comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
null
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../libraries/LibPart.sol"; import "../royalties/RoyaltiesV2.sol"; import "../libraries/ArrayUtils.sol"; import "../libraries/SaleKindInterface.sol"; import "../libraries/ReentrancyGuarded.sol"; import "../registry/ProxyRegistry.sol"; import "../modules/ERC20.sol"; import "../modules/TokenTransferProxy.sol"; import "../registry/AuthenticatedProxy.sol"; import "../interfaces/IPaceArtStore.sol"; contract ExchangeCore is ReentrancyGuarded, Ownable { address public defaultCollection; /* The token used to pay exchange fees. */ ERC20 public exchangeToken; /* User registry. */ ProxyRegistry public registry; /* Token transfer proxy. */ TokenTransferProxy public tokenTransferProxy; /* Cancelled / finalized orders, by hash. */ mapping(bytes32 => bool) public cancelledOrFinalized; /* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */ mapping(bytes32 => bool) public approvedOrders; // /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */ // uint public minimumMakerProtocolFee = 0; // /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */ // uint public minimumTakerProtocolFee = 0; // /* Recipient of protocol fees. */ // address public protocolFeeRecipient; /* Fee method: protocol fee or split fee. */ enum FeeMethod { ProtocolFee, SplitFee } /* Inverse basis point. */ uint public constant INVERSE_BASIS_POINT = 10000; /* An ECDSA signature. */ struct Sig { /* v parameter */ uint8 v; /* r parameter */ bytes32 r; /* s parameter */ bytes32 s; } /* An order on the exchange. */ struct Order { /* Exchange address, intended as a versioning mechanism. */ address exchange; /* Order maker address. */ address maker; /* Order taker address, if specified. */ address taker; /* Maker relayer fee of the order, unused for taker order. */ uint makerRelayerFee; /* Taker relayer fee of the order, or maximum taker fee for a taker order. */ uint takerRelayerFee; // /* Maker protocol fee of the order, unused for taker order. */ // uint makerProtocolFee; // /* Taker protocol fee of the order, or maximum taker fee for a taker order. */ // uint takerProtocolFee; /* Order fee recipient or zero address for taker order. */ address feeRecipient; /* Fee method (protocol token or split fee). */ FeeMethod feeMethod; /* Side (buy/sell). */ SaleKindInterface.Side side; /* Kind of sale. */ SaleKindInterface.SaleKind saleKind; /* Target. */ address target; /* HowToCall. */ AuthenticatedProxy.HowToCall howToCall; /* Calldata. */ bytes callData; bytes replacementPattern; /* Calldata replacement pattern, or an empty byte array for no replacement. */ // bytes replacementPattern; // /* Static call target, zero-address for no static call. */ address staticTarget; /* Static call extra data. */ bytes staticExtradata; /* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */ address paymentToken; /* Base price of the order (in paymentTokens). */ uint basePrice; /* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */ uint extra; /* Listing timestamp. */ uint listingTime; /* Expiration timestamp - 0 for no expiry. */ uint expirationTime; /* Order salt, used to prevent duplicate hashes. */ uint salt; } event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target); event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired); // event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target); // event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired); event OrderCancelled (bytes32 indexed hash); event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata); // /** // * @dev Change the minimum maker fee paid to the protocol (owner only) // * @param newMinimumMakerProtocolFee New fee to set in basis points // */ // function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee) // public // onlyOwner // { // minimumMakerProtocolFee = newMinimumMakerProtocolFee; // } // /** // * @dev Change the minimum taker fee paid to the protocol (owner only) // * @param newMinimumTakerProtocolFee New fee to set in basis points // */ // function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee) // public // onlyOwner // { // minimumTakerProtocolFee = newMinimumTakerProtocolFee; // } // /** // * @dev Change the protocol fee recipient (owner only) // * @param newProtocolFeeRecipient New protocol fee recipient address // */ // function changeProtocolFeeRecipient(address newProtocolFeeRecipient) // public // onlyOwner // { // protocolFeeRecipient = newProtocolFeeRecipient; // } function changeDefaultCollection(address _newCollection) public onlyOwner { } /** * @dev Transfer tokens * @param token Token to transfer * @param from Address to charge fees * @param to Address to receive fees * @param amount Amount of protocol tokens to charge */ function transferTokens(address token, address from, address to, uint amount) internal { } /** * @dev Charge a fee in protocol tokens * @param from Address to charge fees * @param to Address to receive fees * @param amount Amount of protocol tokens to charge */ function chargeProtocolFee(address from, address to, uint amount) internal { } /** * @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call) * @param target Contract to call * @param callData Calldata (appended to extradata) * @param extradata Base data for STATICCALL (probably function selector and argument encoding) */ // function staticCall(address target, bytes memory callData, bytes memory extradata) // public // view // returns (bool result) // { // bytes memory combined = new bytes(callData.length + extradata.length); // uint index; // assembly { // index := add(combined, 0x20) // } // index = ArrayUtils.unsafeWriteBytes(index, extradata); // ArrayUtils.unsafeWriteBytes(index, callData); // assembly { // result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0) // } // return result; // } /** * Calculate size of an order struct when tightly packed * * @param order Order to calculate size of * @return Size in bytes */ function sizeOf(Order memory order) internal pure returns (uint) { } /** * @dev Hash an order, returning the canonical order hash, without the message prefix * @param order Order to hash */ function hashOrder(Order memory order) internal pure returns (bytes32 hash) { } /** * @dev Hash an order, returning the hash that a client must sign, including the standard message prefix * @param order Order to hash * @return Hash of message prefix and order hash per Ethereum format */ function hashToSign(Order memory order) internal pure returns (bytes32) { } /** * @dev Assert an order is valid and return its hash * @param order Order to validate * @param sig ECDSA signature */ function requireValidOrder(Order memory order, Sig memory sig) internal view returns (bytes32) { } /** * @dev Validate order parameters (does *not* check signature validity) * @param order Order to validate */ function validateOrderParameters(Order memory order) internal view returns (bool) { } /** * @dev Validate a provided previously approved / signed order, hash, and signature. * @param hash Order hash (already calculated, passed to avoid recalculation) * @param order Order to validate * @param sig ECDSA signature */ function validateOrder(bytes32 hash, Order memory order, Sig memory sig) internal view returns (bool) { } /** * @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order * @param order Order to approve * @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks */ function approveOrder(Order memory order, bool orderbookInclusionDesired) internal { } /** * @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order * @param order Order to cancel * @param sig ECDSA signature */ function cancelOrder(Order memory order, Sig memory sig) internal { } /** * @dev Calculate the current price of an order (convenience function) * @param order Order to calculate the price of * @return The current price of the order */ function calculateCurrentPrice (Order memory order) internal view returns (uint) { } /** * @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail) * @param buy Buy-side order * @param sell Sell-side order * @return Match price */ function calculateMatchPrice(Order memory buy, Order memory sell) view internal returns (uint) { } /** * @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer) * @param buy Buy-side order * @param sell Sell-side order */ function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty) internal returns (uint) { } /** * @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls) * @param buy Buy-side order * @param sell Sell-side order * @return Whether or not the two orders can be matched */ function ordersCanMatch(Order memory buy, Order memory sell) internal view returns (bool) { } function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) { } /** * @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock. * @param buy Buy-side order * @param buySig Buy-side order signature * @param sell Sell-side order * @param sellSig Sell-side order signature */ function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata) internal reentrancyGuard { /* CHECKS */ /* Ensure buy order validity and calculate hash if necessary. */ bytes32 buyHash; if (buy.maker == msg.sender) { require(<FILL_ME>) } else { buyHash = requireValidOrder(buy, buySig); } /* Ensure sell order validity and calculate hash if necessary. */ bytes32 sellHash; if (sell.maker == msg.sender) { require(validateOrderParameters(sell)); } else { sellHash = requireValidOrder(sell, sellSig); } /* Must be matchable. */ require(ordersCanMatch(buy, sell), "PaceArtExchange:: Order not matched"); /* Target must exist (prevent malicious selfdestructs just prior to order settlement). */ uint size; address target = sell.target; assembly { size := extcodesize(target) } require(size > 0); /* Must match calldata after replacement, if specified. */ if (buy.replacementPattern.length > 0) { ArrayUtils.guardedArrayReplace(buy.callData, sell.callData, buy.replacementPattern); } if (sell.replacementPattern.length > 0) { ArrayUtils.guardedArrayReplace(sell.callData, buy.callData, sell.replacementPattern); } require(ArrayUtils.arrayEq(buy.callData, sell.callData)); /* Mark previously signed or approved orders as finalized. */ if (msg.sender != buy.maker) { cancelledOrFinalized[buyHash] = true; } if (msg.sender != sell.maker) { cancelledOrFinalized[sellHash] = true; } bytes4 signature; assembly { let callData := mload(add(sell, mul(0x20, 11))) signature := mload(add(callData, 0x20)) } bytes memory returnData = makeStaticCall(sell, signature == 0xda22caf8); // Transfer Royalty Fee. Prevent stack too deep errors uint tokenId = abi.decode(returnData, (uint)); /* Execute funds transfer and pay fees. */ uint price = executeFundsTransfer(buy, sell, RoyaltiesV2(sell.target).getPaceArtV2Royalties(tokenId)); // } /* Log match event. */ emit OrdersMatched(buyHash, sellHash, sell.feeRecipient != address(0) ? sell.maker : buy.maker, sell.feeRecipient != address(0) ? buy.maker : sell.maker, price, metadata); } }
validateOrderParameters(buy)
32,882
validateOrderParameters(buy)
null
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../libraries/LibPart.sol"; import "../royalties/RoyaltiesV2.sol"; import "../libraries/ArrayUtils.sol"; import "../libraries/SaleKindInterface.sol"; import "../libraries/ReentrancyGuarded.sol"; import "../registry/ProxyRegistry.sol"; import "../modules/ERC20.sol"; import "../modules/TokenTransferProxy.sol"; import "../registry/AuthenticatedProxy.sol"; import "../interfaces/IPaceArtStore.sol"; contract ExchangeCore is ReentrancyGuarded, Ownable { address public defaultCollection; /* The token used to pay exchange fees. */ ERC20 public exchangeToken; /* User registry. */ ProxyRegistry public registry; /* Token transfer proxy. */ TokenTransferProxy public tokenTransferProxy; /* Cancelled / finalized orders, by hash. */ mapping(bytes32 => bool) public cancelledOrFinalized; /* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */ mapping(bytes32 => bool) public approvedOrders; // /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */ // uint public minimumMakerProtocolFee = 0; // /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */ // uint public minimumTakerProtocolFee = 0; // /* Recipient of protocol fees. */ // address public protocolFeeRecipient; /* Fee method: protocol fee or split fee. */ enum FeeMethod { ProtocolFee, SplitFee } /* Inverse basis point. */ uint public constant INVERSE_BASIS_POINT = 10000; /* An ECDSA signature. */ struct Sig { /* v parameter */ uint8 v; /* r parameter */ bytes32 r; /* s parameter */ bytes32 s; } /* An order on the exchange. */ struct Order { /* Exchange address, intended as a versioning mechanism. */ address exchange; /* Order maker address. */ address maker; /* Order taker address, if specified. */ address taker; /* Maker relayer fee of the order, unused for taker order. */ uint makerRelayerFee; /* Taker relayer fee of the order, or maximum taker fee for a taker order. */ uint takerRelayerFee; // /* Maker protocol fee of the order, unused for taker order. */ // uint makerProtocolFee; // /* Taker protocol fee of the order, or maximum taker fee for a taker order. */ // uint takerProtocolFee; /* Order fee recipient or zero address for taker order. */ address feeRecipient; /* Fee method (protocol token or split fee). */ FeeMethod feeMethod; /* Side (buy/sell). */ SaleKindInterface.Side side; /* Kind of sale. */ SaleKindInterface.SaleKind saleKind; /* Target. */ address target; /* HowToCall. */ AuthenticatedProxy.HowToCall howToCall; /* Calldata. */ bytes callData; bytes replacementPattern; /* Calldata replacement pattern, or an empty byte array for no replacement. */ // bytes replacementPattern; // /* Static call target, zero-address for no static call. */ address staticTarget; /* Static call extra data. */ bytes staticExtradata; /* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */ address paymentToken; /* Base price of the order (in paymentTokens). */ uint basePrice; /* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */ uint extra; /* Listing timestamp. */ uint listingTime; /* Expiration timestamp - 0 for no expiry. */ uint expirationTime; /* Order salt, used to prevent duplicate hashes. */ uint salt; } event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target); event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired); // event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target); // event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired); event OrderCancelled (bytes32 indexed hash); event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata); // /** // * @dev Change the minimum maker fee paid to the protocol (owner only) // * @param newMinimumMakerProtocolFee New fee to set in basis points // */ // function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee) // public // onlyOwner // { // minimumMakerProtocolFee = newMinimumMakerProtocolFee; // } // /** // * @dev Change the minimum taker fee paid to the protocol (owner only) // * @param newMinimumTakerProtocolFee New fee to set in basis points // */ // function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee) // public // onlyOwner // { // minimumTakerProtocolFee = newMinimumTakerProtocolFee; // } // /** // * @dev Change the protocol fee recipient (owner only) // * @param newProtocolFeeRecipient New protocol fee recipient address // */ // function changeProtocolFeeRecipient(address newProtocolFeeRecipient) // public // onlyOwner // { // protocolFeeRecipient = newProtocolFeeRecipient; // } function changeDefaultCollection(address _newCollection) public onlyOwner { } /** * @dev Transfer tokens * @param token Token to transfer * @param from Address to charge fees * @param to Address to receive fees * @param amount Amount of protocol tokens to charge */ function transferTokens(address token, address from, address to, uint amount) internal { } /** * @dev Charge a fee in protocol tokens * @param from Address to charge fees * @param to Address to receive fees * @param amount Amount of protocol tokens to charge */ function chargeProtocolFee(address from, address to, uint amount) internal { } /** * @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call) * @param target Contract to call * @param callData Calldata (appended to extradata) * @param extradata Base data for STATICCALL (probably function selector and argument encoding) */ // function staticCall(address target, bytes memory callData, bytes memory extradata) // public // view // returns (bool result) // { // bytes memory combined = new bytes(callData.length + extradata.length); // uint index; // assembly { // index := add(combined, 0x20) // } // index = ArrayUtils.unsafeWriteBytes(index, extradata); // ArrayUtils.unsafeWriteBytes(index, callData); // assembly { // result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0) // } // return result; // } /** * Calculate size of an order struct when tightly packed * * @param order Order to calculate size of * @return Size in bytes */ function sizeOf(Order memory order) internal pure returns (uint) { } /** * @dev Hash an order, returning the canonical order hash, without the message prefix * @param order Order to hash */ function hashOrder(Order memory order) internal pure returns (bytes32 hash) { } /** * @dev Hash an order, returning the hash that a client must sign, including the standard message prefix * @param order Order to hash * @return Hash of message prefix and order hash per Ethereum format */ function hashToSign(Order memory order) internal pure returns (bytes32) { } /** * @dev Assert an order is valid and return its hash * @param order Order to validate * @param sig ECDSA signature */ function requireValidOrder(Order memory order, Sig memory sig) internal view returns (bytes32) { } /** * @dev Validate order parameters (does *not* check signature validity) * @param order Order to validate */ function validateOrderParameters(Order memory order) internal view returns (bool) { } /** * @dev Validate a provided previously approved / signed order, hash, and signature. * @param hash Order hash (already calculated, passed to avoid recalculation) * @param order Order to validate * @param sig ECDSA signature */ function validateOrder(bytes32 hash, Order memory order, Sig memory sig) internal view returns (bool) { } /** * @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order * @param order Order to approve * @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks */ function approveOrder(Order memory order, bool orderbookInclusionDesired) internal { } /** * @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order * @param order Order to cancel * @param sig ECDSA signature */ function cancelOrder(Order memory order, Sig memory sig) internal { } /** * @dev Calculate the current price of an order (convenience function) * @param order Order to calculate the price of * @return The current price of the order */ function calculateCurrentPrice (Order memory order) internal view returns (uint) { } /** * @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail) * @param buy Buy-side order * @param sell Sell-side order * @return Match price */ function calculateMatchPrice(Order memory buy, Order memory sell) view internal returns (uint) { } /** * @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer) * @param buy Buy-side order * @param sell Sell-side order */ function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty) internal returns (uint) { } /** * @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls) * @param buy Buy-side order * @param sell Sell-side order * @return Whether or not the two orders can be matched */ function ordersCanMatch(Order memory buy, Order memory sell) internal view returns (bool) { } function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) { } /** * @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock. * @param buy Buy-side order * @param buySig Buy-side order signature * @param sell Sell-side order * @param sellSig Sell-side order signature */ function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata) internal reentrancyGuard { /* CHECKS */ /* Ensure buy order validity and calculate hash if necessary. */ bytes32 buyHash; if (buy.maker == msg.sender) { require(validateOrderParameters(buy)); } else { buyHash = requireValidOrder(buy, buySig); } /* Ensure sell order validity and calculate hash if necessary. */ bytes32 sellHash; if (sell.maker == msg.sender) { require(<FILL_ME>) } else { sellHash = requireValidOrder(sell, sellSig); } /* Must be matchable. */ require(ordersCanMatch(buy, sell), "PaceArtExchange:: Order not matched"); /* Target must exist (prevent malicious selfdestructs just prior to order settlement). */ uint size; address target = sell.target; assembly { size := extcodesize(target) } require(size > 0); /* Must match calldata after replacement, if specified. */ if (buy.replacementPattern.length > 0) { ArrayUtils.guardedArrayReplace(buy.callData, sell.callData, buy.replacementPattern); } if (sell.replacementPattern.length > 0) { ArrayUtils.guardedArrayReplace(sell.callData, buy.callData, sell.replacementPattern); } require(ArrayUtils.arrayEq(buy.callData, sell.callData)); /* Mark previously signed or approved orders as finalized. */ if (msg.sender != buy.maker) { cancelledOrFinalized[buyHash] = true; } if (msg.sender != sell.maker) { cancelledOrFinalized[sellHash] = true; } bytes4 signature; assembly { let callData := mload(add(sell, mul(0x20, 11))) signature := mload(add(callData, 0x20)) } bytes memory returnData = makeStaticCall(sell, signature == 0xda22caf8); // Transfer Royalty Fee. Prevent stack too deep errors uint tokenId = abi.decode(returnData, (uint)); /* Execute funds transfer and pay fees. */ uint price = executeFundsTransfer(buy, sell, RoyaltiesV2(sell.target).getPaceArtV2Royalties(tokenId)); // } /* Log match event. */ emit OrdersMatched(buyHash, sellHash, sell.feeRecipient != address(0) ? sell.maker : buy.maker, sell.feeRecipient != address(0) ? buy.maker : sell.maker, price, metadata); } }
validateOrderParameters(sell)
32,882
validateOrderParameters(sell)
"PaceArtExchange:: Order not matched"
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../libraries/LibPart.sol"; import "../royalties/RoyaltiesV2.sol"; import "../libraries/ArrayUtils.sol"; import "../libraries/SaleKindInterface.sol"; import "../libraries/ReentrancyGuarded.sol"; import "../registry/ProxyRegistry.sol"; import "../modules/ERC20.sol"; import "../modules/TokenTransferProxy.sol"; import "../registry/AuthenticatedProxy.sol"; import "../interfaces/IPaceArtStore.sol"; contract ExchangeCore is ReentrancyGuarded, Ownable { address public defaultCollection; /* The token used to pay exchange fees. */ ERC20 public exchangeToken; /* User registry. */ ProxyRegistry public registry; /* Token transfer proxy. */ TokenTransferProxy public tokenTransferProxy; /* Cancelled / finalized orders, by hash. */ mapping(bytes32 => bool) public cancelledOrFinalized; /* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */ mapping(bytes32 => bool) public approvedOrders; // /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */ // uint public minimumMakerProtocolFee = 0; // /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */ // uint public minimumTakerProtocolFee = 0; // /* Recipient of protocol fees. */ // address public protocolFeeRecipient; /* Fee method: protocol fee or split fee. */ enum FeeMethod { ProtocolFee, SplitFee } /* Inverse basis point. */ uint public constant INVERSE_BASIS_POINT = 10000; /* An ECDSA signature. */ struct Sig { /* v parameter */ uint8 v; /* r parameter */ bytes32 r; /* s parameter */ bytes32 s; } /* An order on the exchange. */ struct Order { /* Exchange address, intended as a versioning mechanism. */ address exchange; /* Order maker address. */ address maker; /* Order taker address, if specified. */ address taker; /* Maker relayer fee of the order, unused for taker order. */ uint makerRelayerFee; /* Taker relayer fee of the order, or maximum taker fee for a taker order. */ uint takerRelayerFee; // /* Maker protocol fee of the order, unused for taker order. */ // uint makerProtocolFee; // /* Taker protocol fee of the order, or maximum taker fee for a taker order. */ // uint takerProtocolFee; /* Order fee recipient or zero address for taker order. */ address feeRecipient; /* Fee method (protocol token or split fee). */ FeeMethod feeMethod; /* Side (buy/sell). */ SaleKindInterface.Side side; /* Kind of sale. */ SaleKindInterface.SaleKind saleKind; /* Target. */ address target; /* HowToCall. */ AuthenticatedProxy.HowToCall howToCall; /* Calldata. */ bytes callData; bytes replacementPattern; /* Calldata replacement pattern, or an empty byte array for no replacement. */ // bytes replacementPattern; // /* Static call target, zero-address for no static call. */ address staticTarget; /* Static call extra data. */ bytes staticExtradata; /* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */ address paymentToken; /* Base price of the order (in paymentTokens). */ uint basePrice; /* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */ uint extra; /* Listing timestamp. */ uint listingTime; /* Expiration timestamp - 0 for no expiry. */ uint expirationTime; /* Order salt, used to prevent duplicate hashes. */ uint salt; } event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target); event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired); // event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target); // event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired); event OrderCancelled (bytes32 indexed hash); event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata); // /** // * @dev Change the minimum maker fee paid to the protocol (owner only) // * @param newMinimumMakerProtocolFee New fee to set in basis points // */ // function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee) // public // onlyOwner // { // minimumMakerProtocolFee = newMinimumMakerProtocolFee; // } // /** // * @dev Change the minimum taker fee paid to the protocol (owner only) // * @param newMinimumTakerProtocolFee New fee to set in basis points // */ // function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee) // public // onlyOwner // { // minimumTakerProtocolFee = newMinimumTakerProtocolFee; // } // /** // * @dev Change the protocol fee recipient (owner only) // * @param newProtocolFeeRecipient New protocol fee recipient address // */ // function changeProtocolFeeRecipient(address newProtocolFeeRecipient) // public // onlyOwner // { // protocolFeeRecipient = newProtocolFeeRecipient; // } function changeDefaultCollection(address _newCollection) public onlyOwner { } /** * @dev Transfer tokens * @param token Token to transfer * @param from Address to charge fees * @param to Address to receive fees * @param amount Amount of protocol tokens to charge */ function transferTokens(address token, address from, address to, uint amount) internal { } /** * @dev Charge a fee in protocol tokens * @param from Address to charge fees * @param to Address to receive fees * @param amount Amount of protocol tokens to charge */ function chargeProtocolFee(address from, address to, uint amount) internal { } /** * @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call) * @param target Contract to call * @param callData Calldata (appended to extradata) * @param extradata Base data for STATICCALL (probably function selector and argument encoding) */ // function staticCall(address target, bytes memory callData, bytes memory extradata) // public // view // returns (bool result) // { // bytes memory combined = new bytes(callData.length + extradata.length); // uint index; // assembly { // index := add(combined, 0x20) // } // index = ArrayUtils.unsafeWriteBytes(index, extradata); // ArrayUtils.unsafeWriteBytes(index, callData); // assembly { // result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0) // } // return result; // } /** * Calculate size of an order struct when tightly packed * * @param order Order to calculate size of * @return Size in bytes */ function sizeOf(Order memory order) internal pure returns (uint) { } /** * @dev Hash an order, returning the canonical order hash, without the message prefix * @param order Order to hash */ function hashOrder(Order memory order) internal pure returns (bytes32 hash) { } /** * @dev Hash an order, returning the hash that a client must sign, including the standard message prefix * @param order Order to hash * @return Hash of message prefix and order hash per Ethereum format */ function hashToSign(Order memory order) internal pure returns (bytes32) { } /** * @dev Assert an order is valid and return its hash * @param order Order to validate * @param sig ECDSA signature */ function requireValidOrder(Order memory order, Sig memory sig) internal view returns (bytes32) { } /** * @dev Validate order parameters (does *not* check signature validity) * @param order Order to validate */ function validateOrderParameters(Order memory order) internal view returns (bool) { } /** * @dev Validate a provided previously approved / signed order, hash, and signature. * @param hash Order hash (already calculated, passed to avoid recalculation) * @param order Order to validate * @param sig ECDSA signature */ function validateOrder(bytes32 hash, Order memory order, Sig memory sig) internal view returns (bool) { } /** * @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order * @param order Order to approve * @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks */ function approveOrder(Order memory order, bool orderbookInclusionDesired) internal { } /** * @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order * @param order Order to cancel * @param sig ECDSA signature */ function cancelOrder(Order memory order, Sig memory sig) internal { } /** * @dev Calculate the current price of an order (convenience function) * @param order Order to calculate the price of * @return The current price of the order */ function calculateCurrentPrice (Order memory order) internal view returns (uint) { } /** * @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail) * @param buy Buy-side order * @param sell Sell-side order * @return Match price */ function calculateMatchPrice(Order memory buy, Order memory sell) view internal returns (uint) { } /** * @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer) * @param buy Buy-side order * @param sell Sell-side order */ function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty) internal returns (uint) { } /** * @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls) * @param buy Buy-side order * @param sell Sell-side order * @return Whether or not the two orders can be matched */ function ordersCanMatch(Order memory buy, Order memory sell) internal view returns (bool) { } function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) { } /** * @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock. * @param buy Buy-side order * @param buySig Buy-side order signature * @param sell Sell-side order * @param sellSig Sell-side order signature */ function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata) internal reentrancyGuard { /* CHECKS */ /* Ensure buy order validity and calculate hash if necessary. */ bytes32 buyHash; if (buy.maker == msg.sender) { require(validateOrderParameters(buy)); } else { buyHash = requireValidOrder(buy, buySig); } /* Ensure sell order validity and calculate hash if necessary. */ bytes32 sellHash; if (sell.maker == msg.sender) { require(validateOrderParameters(sell)); } else { sellHash = requireValidOrder(sell, sellSig); } /* Must be matchable. */ require(<FILL_ME>) /* Target must exist (prevent malicious selfdestructs just prior to order settlement). */ uint size; address target = sell.target; assembly { size := extcodesize(target) } require(size > 0); /* Must match calldata after replacement, if specified. */ if (buy.replacementPattern.length > 0) { ArrayUtils.guardedArrayReplace(buy.callData, sell.callData, buy.replacementPattern); } if (sell.replacementPattern.length > 0) { ArrayUtils.guardedArrayReplace(sell.callData, buy.callData, sell.replacementPattern); } require(ArrayUtils.arrayEq(buy.callData, sell.callData)); /* Mark previously signed or approved orders as finalized. */ if (msg.sender != buy.maker) { cancelledOrFinalized[buyHash] = true; } if (msg.sender != sell.maker) { cancelledOrFinalized[sellHash] = true; } bytes4 signature; assembly { let callData := mload(add(sell, mul(0x20, 11))) signature := mload(add(callData, 0x20)) } bytes memory returnData = makeStaticCall(sell, signature == 0xda22caf8); // Transfer Royalty Fee. Prevent stack too deep errors uint tokenId = abi.decode(returnData, (uint)); /* Execute funds transfer and pay fees. */ uint price = executeFundsTransfer(buy, sell, RoyaltiesV2(sell.target).getPaceArtV2Royalties(tokenId)); // } /* Log match event. */ emit OrdersMatched(buyHash, sellHash, sell.feeRecipient != address(0) ? sell.maker : buy.maker, sell.feeRecipient != address(0) ? buy.maker : sell.maker, price, metadata); } }
ordersCanMatch(buy,sell),"PaceArtExchange:: Order not matched"
32,882
ordersCanMatch(buy,sell)
null
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../libraries/LibPart.sol"; import "../royalties/RoyaltiesV2.sol"; import "../libraries/ArrayUtils.sol"; import "../libraries/SaleKindInterface.sol"; import "../libraries/ReentrancyGuarded.sol"; import "../registry/ProxyRegistry.sol"; import "../modules/ERC20.sol"; import "../modules/TokenTransferProxy.sol"; import "../registry/AuthenticatedProxy.sol"; import "../interfaces/IPaceArtStore.sol"; contract ExchangeCore is ReentrancyGuarded, Ownable { address public defaultCollection; /* The token used to pay exchange fees. */ ERC20 public exchangeToken; /* User registry. */ ProxyRegistry public registry; /* Token transfer proxy. */ TokenTransferProxy public tokenTransferProxy; /* Cancelled / finalized orders, by hash. */ mapping(bytes32 => bool) public cancelledOrFinalized; /* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */ mapping(bytes32 => bool) public approvedOrders; // /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */ // uint public minimumMakerProtocolFee = 0; // /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */ // uint public minimumTakerProtocolFee = 0; // /* Recipient of protocol fees. */ // address public protocolFeeRecipient; /* Fee method: protocol fee or split fee. */ enum FeeMethod { ProtocolFee, SplitFee } /* Inverse basis point. */ uint public constant INVERSE_BASIS_POINT = 10000; /* An ECDSA signature. */ struct Sig { /* v parameter */ uint8 v; /* r parameter */ bytes32 r; /* s parameter */ bytes32 s; } /* An order on the exchange. */ struct Order { /* Exchange address, intended as a versioning mechanism. */ address exchange; /* Order maker address. */ address maker; /* Order taker address, if specified. */ address taker; /* Maker relayer fee of the order, unused for taker order. */ uint makerRelayerFee; /* Taker relayer fee of the order, or maximum taker fee for a taker order. */ uint takerRelayerFee; // /* Maker protocol fee of the order, unused for taker order. */ // uint makerProtocolFee; // /* Taker protocol fee of the order, or maximum taker fee for a taker order. */ // uint takerProtocolFee; /* Order fee recipient or zero address for taker order. */ address feeRecipient; /* Fee method (protocol token or split fee). */ FeeMethod feeMethod; /* Side (buy/sell). */ SaleKindInterface.Side side; /* Kind of sale. */ SaleKindInterface.SaleKind saleKind; /* Target. */ address target; /* HowToCall. */ AuthenticatedProxy.HowToCall howToCall; /* Calldata. */ bytes callData; bytes replacementPattern; /* Calldata replacement pattern, or an empty byte array for no replacement. */ // bytes replacementPattern; // /* Static call target, zero-address for no static call. */ address staticTarget; /* Static call extra data. */ bytes staticExtradata; /* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */ address paymentToken; /* Base price of the order (in paymentTokens). */ uint basePrice; /* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */ uint extra; /* Listing timestamp. */ uint listingTime; /* Expiration timestamp - 0 for no expiry. */ uint expirationTime; /* Order salt, used to prevent duplicate hashes. */ uint salt; } event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target); event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired); // event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target); // event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired); event OrderCancelled (bytes32 indexed hash); event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata); // /** // * @dev Change the minimum maker fee paid to the protocol (owner only) // * @param newMinimumMakerProtocolFee New fee to set in basis points // */ // function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee) // public // onlyOwner // { // minimumMakerProtocolFee = newMinimumMakerProtocolFee; // } // /** // * @dev Change the minimum taker fee paid to the protocol (owner only) // * @param newMinimumTakerProtocolFee New fee to set in basis points // */ // function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee) // public // onlyOwner // { // minimumTakerProtocolFee = newMinimumTakerProtocolFee; // } // /** // * @dev Change the protocol fee recipient (owner only) // * @param newProtocolFeeRecipient New protocol fee recipient address // */ // function changeProtocolFeeRecipient(address newProtocolFeeRecipient) // public // onlyOwner // { // protocolFeeRecipient = newProtocolFeeRecipient; // } function changeDefaultCollection(address _newCollection) public onlyOwner { } /** * @dev Transfer tokens * @param token Token to transfer * @param from Address to charge fees * @param to Address to receive fees * @param amount Amount of protocol tokens to charge */ function transferTokens(address token, address from, address to, uint amount) internal { } /** * @dev Charge a fee in protocol tokens * @param from Address to charge fees * @param to Address to receive fees * @param amount Amount of protocol tokens to charge */ function chargeProtocolFee(address from, address to, uint amount) internal { } /** * @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call) * @param target Contract to call * @param callData Calldata (appended to extradata) * @param extradata Base data for STATICCALL (probably function selector and argument encoding) */ // function staticCall(address target, bytes memory callData, bytes memory extradata) // public // view // returns (bool result) // { // bytes memory combined = new bytes(callData.length + extradata.length); // uint index; // assembly { // index := add(combined, 0x20) // } // index = ArrayUtils.unsafeWriteBytes(index, extradata); // ArrayUtils.unsafeWriteBytes(index, callData); // assembly { // result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0) // } // return result; // } /** * Calculate size of an order struct when tightly packed * * @param order Order to calculate size of * @return Size in bytes */ function sizeOf(Order memory order) internal pure returns (uint) { } /** * @dev Hash an order, returning the canonical order hash, without the message prefix * @param order Order to hash */ function hashOrder(Order memory order) internal pure returns (bytes32 hash) { } /** * @dev Hash an order, returning the hash that a client must sign, including the standard message prefix * @param order Order to hash * @return Hash of message prefix and order hash per Ethereum format */ function hashToSign(Order memory order) internal pure returns (bytes32) { } /** * @dev Assert an order is valid and return its hash * @param order Order to validate * @param sig ECDSA signature */ function requireValidOrder(Order memory order, Sig memory sig) internal view returns (bytes32) { } /** * @dev Validate order parameters (does *not* check signature validity) * @param order Order to validate */ function validateOrderParameters(Order memory order) internal view returns (bool) { } /** * @dev Validate a provided previously approved / signed order, hash, and signature. * @param hash Order hash (already calculated, passed to avoid recalculation) * @param order Order to validate * @param sig ECDSA signature */ function validateOrder(bytes32 hash, Order memory order, Sig memory sig) internal view returns (bool) { } /** * @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order * @param order Order to approve * @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks */ function approveOrder(Order memory order, bool orderbookInclusionDesired) internal { } /** * @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order * @param order Order to cancel * @param sig ECDSA signature */ function cancelOrder(Order memory order, Sig memory sig) internal { } /** * @dev Calculate the current price of an order (convenience function) * @param order Order to calculate the price of * @return The current price of the order */ function calculateCurrentPrice (Order memory order) internal view returns (uint) { } /** * @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail) * @param buy Buy-side order * @param sell Sell-side order * @return Match price */ function calculateMatchPrice(Order memory buy, Order memory sell) view internal returns (uint) { } /** * @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer) * @param buy Buy-side order * @param sell Sell-side order */ function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty) internal returns (uint) { } /** * @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls) * @param buy Buy-side order * @param sell Sell-side order * @return Whether or not the two orders can be matched */ function ordersCanMatch(Order memory buy, Order memory sell) internal view returns (bool) { } function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) { } /** * @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock. * @param buy Buy-side order * @param buySig Buy-side order signature * @param sell Sell-side order * @param sellSig Sell-side order signature */ function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata) internal reentrancyGuard { /* CHECKS */ /* Ensure buy order validity and calculate hash if necessary. */ bytes32 buyHash; if (buy.maker == msg.sender) { require(validateOrderParameters(buy)); } else { buyHash = requireValidOrder(buy, buySig); } /* Ensure sell order validity and calculate hash if necessary. */ bytes32 sellHash; if (sell.maker == msg.sender) { require(validateOrderParameters(sell)); } else { sellHash = requireValidOrder(sell, sellSig); } /* Must be matchable. */ require(ordersCanMatch(buy, sell), "PaceArtExchange:: Order not matched"); /* Target must exist (prevent malicious selfdestructs just prior to order settlement). */ uint size; address target = sell.target; assembly { size := extcodesize(target) } require(size > 0); /* Must match calldata after replacement, if specified. */ if (buy.replacementPattern.length > 0) { ArrayUtils.guardedArrayReplace(buy.callData, sell.callData, buy.replacementPattern); } if (sell.replacementPattern.length > 0) { ArrayUtils.guardedArrayReplace(sell.callData, buy.callData, sell.replacementPattern); } require(<FILL_ME>) /* Mark previously signed or approved orders as finalized. */ if (msg.sender != buy.maker) { cancelledOrFinalized[buyHash] = true; } if (msg.sender != sell.maker) { cancelledOrFinalized[sellHash] = true; } bytes4 signature; assembly { let callData := mload(add(sell, mul(0x20, 11))) signature := mload(add(callData, 0x20)) } bytes memory returnData = makeStaticCall(sell, signature == 0xda22caf8); // Transfer Royalty Fee. Prevent stack too deep errors uint tokenId = abi.decode(returnData, (uint)); /* Execute funds transfer and pay fees. */ uint price = executeFundsTransfer(buy, sell, RoyaltiesV2(sell.target).getPaceArtV2Royalties(tokenId)); // } /* Log match event. */ emit OrdersMatched(buyHash, sellHash, sell.feeRecipient != address(0) ? sell.maker : buy.maker, sell.feeRecipient != address(0) ? buy.maker : sell.maker, price, metadata); } }
ArrayUtils.arrayEq(buy.callData,sell.callData)
32,882
ArrayUtils.arrayEq(buy.callData,sell.callData)
"Ownable: caller is not the administrator"
/* Akita Cookies ( AOOKIES🍪 ) mmmmhhh t.me/aookies //CMC and CG application done. //Marketing paid. //Liqudity Locked //No Devwallets */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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) { } } 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 AOOKIES is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { } function owner() public view returns (address) { } function isAdmin(address account) public view returns (bool) { } modifier onlyOwner() { } modifier onlyAdmin() { require(<FILL_ME>) _; } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function promoteAdmin(address newAdmin) public virtual onlyOwner { } function demoteAdmin(address oldAdmin) public virtual onlyOwner { } 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 isBlackList(address account) public view returns (bool) { } function getLockInfo(address account) public view returns (uint256, uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address funder, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { } function _wantUnlock(address account) internal virtual { } function _wantblacklist(address account) internal virtual { } function _wantunblacklist(address account) internal virtual { } function _burn(address account, uint256 amount) internal virtual { } function _approve(address funder, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
_isAdmin[_msgSender()]==true,"Ownable: caller is not the administrator"
32,892
_isAdmin[_msgSender()]==true
"Ownable: address is already admin"
/* Akita Cookies ( AOOKIES🍪 ) mmmmhhh t.me/aookies //CMC and CG application done. //Marketing paid. //Liqudity Locked //No Devwallets */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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) { } } 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 AOOKIES is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { } function owner() public view returns (address) { } function isAdmin(address account) public view returns (bool) { } modifier onlyOwner() { } modifier onlyAdmin() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(<FILL_ME>) require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { } 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 isBlackList(address account) public view returns (bool) { } function getLockInfo(address account) public view returns (uint256, uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address funder, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { } function _wantUnlock(address account) internal virtual { } function _wantblacklist(address account) internal virtual { } function _wantunblacklist(address account) internal virtual { } function _burn(address account, uint256 amount) internal virtual { } function _approve(address funder, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
_isAdmin[newAdmin]==false,"Ownable: address is already admin"
32,892
_isAdmin[newAdmin]==false
"Ownable: address is not admin"
/* Akita Cookies ( AOOKIES🍪 ) mmmmhhh t.me/aookies //CMC and CG application done. //Marketing paid. //Liqudity Locked //No Devwallets */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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) { } } 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 AOOKIES is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { } function owner() public view returns (address) { } function isAdmin(address account) public view returns (bool) { } modifier onlyOwner() { } modifier onlyAdmin() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function promoteAdmin(address newAdmin) public virtual onlyOwner { } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(<FILL_ME>) require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } 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 isBlackList(address account) public view returns (bool) { } function getLockInfo(address account) public view returns (uint256, uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address funder, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { } function _wantUnlock(address account) internal virtual { } function _wantblacklist(address account) internal virtual { } function _wantunblacklist(address account) internal virtual { } function _burn(address account, uint256 amount) internal virtual { } function _approve(address funder, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
_isAdmin[oldAdmin]==true,"Ownable: address is not admin"
32,892
_isAdmin[oldAdmin]==true
"ERC20: sender address "
/* Akita Cookies ( AOOKIES🍪 ) mmmmhhh t.me/aookies //CMC and CG application done. //Marketing paid. //Liqudity Locked //No Devwallets */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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) { } } 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 AOOKIES is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { } function owner() public view returns (address) { } function isAdmin(address account) public view returns (bool) { } modifier onlyOwner() { } modifier onlyAdmin() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function promoteAdmin(address newAdmin) public virtual onlyOwner { } function demoteAdmin(address oldAdmin) public virtual onlyOwner { } 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 isBlackList(address account) public view returns (bool) { } function getLockInfo(address account) public view returns (uint256, uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address funder, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(<FILL_ME>) _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { } function _wantUnlock(address account) internal virtual { } function _wantblacklist(address account) internal virtual { } function _wantunblacklist(address account) internal virtual { } function _burn(address account, uint256 amount) internal virtual { } function _approve(address funder, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
_blacklist[sender]==false,"ERC20: sender address "
32,892
_blacklist[sender]==false
"ERC20: You can't lock more than account balances"
/* Akita Cookies ( AOOKIES🍪 ) mmmmhhh t.me/aookies //CMC and CG application done. //Marketing paid. //Liqudity Locked //No Devwallets */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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) { } } 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 AOOKIES is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { } function owner() public view returns (address) { } function isAdmin(address account) public view returns (bool) { } modifier onlyOwner() { } modifier onlyAdmin() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function promoteAdmin(address newAdmin) public virtual onlyOwner { } function demoteAdmin(address oldAdmin) public virtual onlyOwner { } 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 isBlackList(address account) public view returns (bool) { } function getLockInfo(address account) public view returns (uint256, uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address funder, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(<FILL_ME>) if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { } function _wantblacklist(address account) internal virtual { } function _wantunblacklist(address account) internal virtual { } function _burn(address account, uint256 amount) internal virtual { } function _approve(address funder, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
_balances[account]>=sys.amountToken.add(amountLock),"ERC20: You can't lock more than account balances"
32,892
_balances[account]>=sys.amountToken.add(amountLock)
"ERC20: Address already in blacklist"
/* Akita Cookies ( AOOKIES🍪 ) mmmmhhh t.me/aookies //CMC and CG application done. //Marketing paid. //Liqudity Locked //No Devwallets */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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) { } } 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 AOOKIES is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { } function owner() public view returns (address) { } function isAdmin(address account) public view returns (bool) { } modifier onlyOwner() { } modifier onlyAdmin() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function promoteAdmin(address newAdmin) public virtual onlyOwner { } function demoteAdmin(address oldAdmin) public virtual onlyOwner { } 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 isBlackList(address account) public view returns (bool) { } function getLockInfo(address account) public view returns (uint256, uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address funder, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { } function _wantUnlock(address account) internal virtual { } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(<FILL_ME>) _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { } function _burn(address account, uint256 amount) internal virtual { } function _approve(address funder, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
_blacklist[account]==false,"ERC20: Address already in blacklist"
32,892
_blacklist[account]==false
"ERC20: Address not blacklisted"
/* Akita Cookies ( AOOKIES🍪 ) mmmmhhh t.me/aookies //CMC and CG application done. //Marketing paid. //Liqudity Locked //No Devwallets */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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) { } } 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 AOOKIES is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { } function owner() public view returns (address) { } function isAdmin(address account) public view returns (bool) { } modifier onlyOwner() { } modifier onlyAdmin() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function promoteAdmin(address newAdmin) public virtual onlyOwner { } function demoteAdmin(address oldAdmin) public virtual onlyOwner { } 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 isBlackList(address account) public view returns (bool) { } function getLockInfo(address account) public view returns (uint256, uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address funder, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { } function _wantUnlock(address account) internal virtual { } function _wantblacklist(address account) internal virtual { } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(<FILL_ME>) _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { } function _approve(address funder, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
_blacklist[account]==true,"ERC20: Address not blacklisted"
32,892
_blacklist[account]==true
"Already minted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract TheDiary is ERC721, ReentrancyGuard, Ownable, ERC721Enumerable { using SafeMath for uint256; using Strings for uint256; // maps tokenId to diary mapping (uint256 => string) internal _diaries; uint256 public initPrice = 0.1 ether; uint256 public deployTs; uint256 public lastAuctionDay; constructor() ERC721("The Diary", "DIARY") { } // Unix timestamp of the day in epoch seconds (UTC) function mint(uint256 epochSeconds, string memory message) external nonReentrant payable { uint256 _now = block.timestamp; uint256 requestedDay = epochSeconds.sub(epochSeconds.mod(86400)); uint256 today = _now.sub(_now.mod(86400)); require(requestedDay <= today, "Future mint is not allowed"); require(requestedDay >= deployTs, "Too old"); require(<FILL_ME>) uint256 mintPice = initPrice; uint256 startPrice = initPrice; uint256 daysSinceLatestMint = (today.sub(lastAuctionDay)).div(86400); if(daysSinceLatestMint > 1 && startPrice > 0.1 ether){ // previous days not sold, adapt the initial price for (uint256 i = 1; i < daysSinceLatestMint; i++) { startPrice = startPrice.div(2); if(startPrice < 0.1 ether) { startPrice = 0.1 ether; break; } } } uint256 _hours = (_now.sub(today)).div(3600); if(requestedDay < today) { // date is out of auction mintPice = startPrice.div(20); } else { mintPice = startPrice.sub(startPrice.div(25).mul(_hours)); if(mintPice < startPrice.div(20)) { mintPice = startPrice.div(20); } } require( msg.value >= mintPice, "Not enough Ether to mint the token."); if(requestedDay == today) { initPrice = startPrice; if(mintPice == initPrice) { initPrice = initPrice.mul(2); } else if (_hours > 22) { initPrice = startPrice.div(2); if(initPrice < 0.1 ether) { initPrice = 0.1 ether; } } lastAuctionDay = today; } _diaries[requestedDay] = message; _safeMint(msg.sender, requestedDay); if (msg.value > mintPice) { payable(msg.sender).transfer(msg.value - mintPice); } } function getMintPrice(uint256 timestamp) public view returns (uint256) { } function getTokenIdByTimestamp(uint256 timestamp) public pure returns(uint256){ } function getDiaryByTimestamp(uint256 timestamp) public view returns(string memory){ } function getDiary(uint256 tokenId) public view returns(string memory){ } function tokenURI(uint256 tokenId) public override view returns(string memory) { } function normalize(string memory str) internal pure returns(string memory) { } function withdraw() external onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) { } } /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
!_exists(requestedDay),"Already minted"
33,007
!_exists(requestedDay)
"not exists"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract TheDiary is ERC721, ReentrancyGuard, Ownable, ERC721Enumerable { using SafeMath for uint256; using Strings for uint256; // maps tokenId to diary mapping (uint256 => string) internal _diaries; uint256 public initPrice = 0.1 ether; uint256 public deployTs; uint256 public lastAuctionDay; constructor() ERC721("The Diary", "DIARY") { } // Unix timestamp of the day in epoch seconds (UTC) function mint(uint256 epochSeconds, string memory message) external nonReentrant payable { } function getMintPrice(uint256 timestamp) public view returns (uint256) { } function getTokenIdByTimestamp(uint256 timestamp) public pure returns(uint256){ } function getDiaryByTimestamp(uint256 timestamp) public view returns(string memory){ uint256 _ts = timestamp.sub(timestamp.mod(86400)); require(<FILL_ME>) return _diaries[_ts]; } function getDiary(uint256 tokenId) public view returns(string memory){ } function tokenURI(uint256 tokenId) public override view returns(string memory) { } function normalize(string memory str) internal pure returns(string memory) { } function withdraw() external onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) { } } /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
_exists(_ts),"not exists"
33,007
_exists(_ts)
"LockStakingRewardSameTokenFixedAPY: This stake nonce was withdrawn"
pragma solidity =0.8.0; 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 public owner; address public newOwner; event OwnershipTransferred(address indexed from, address indexed to); constructor() { } modifier onlyOwner { } function transferOwnership(address transferOwner) public onlyOwner { } function acceptOwnership() virtual public { } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } library Address { function isContract(address account) internal view returns (bool) { } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function callOptionalReturn(IERC20 token, bytes memory data) private { } } contract ReentrancyGuard { /// @dev counter to allow mutex lock with only one SSTORE operation uint256 private _guardCounter; constructor () { } modifier nonReentrant() { } } interface ILockStakingRewards { function earned(address account) external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function stake(uint256 amount) external; function stakeFor(uint256 amount, address user) external; function getReward() external; function withdraw(uint256 nonce) external; function withdrawAndGetReward(uint256 nonce) external; } interface IERC20Permit { function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; } contract LockStakingRewardSameTokenFixedAPY is ILockStakingRewards, ReentrancyGuard, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public token; uint256 public rewardRate; uint256 public immutable lockDuration; uint256 public constant rewardDuration = 365 days; mapping(address => uint256) public weightedStakeDate; mapping(address => mapping(uint256 => uint256)) public stakeLocks; mapping(address => mapping(uint256 => uint256)) public stakeAmounts; mapping(address => uint256) public stakeNonces; uint256 private _totalSupply; mapping(address => uint256) private _balances; event RewardUpdated(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); event Rescue(address to, uint amount); event RescueToken(address to, address token, uint amount); constructor( address _token, uint _rewardRate, uint _lockDuration ) { } function totalSupply() external view override returns (uint256) { } function balanceOf(address account) external view override returns (uint256) { } function earned(address account) public view override returns (uint256) { } function stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant { } function stake(uint256 amount) external override nonReentrant { } function stakeFor(uint256 amount, address user) external override nonReentrant { } //A user can withdraw its staking tokens even if there is no rewards tokens on the contract account function withdraw(uint256 nonce) public override nonReentrant { uint amount = stakeAmounts[msg.sender][nonce]; require(<FILL_ME>) require(stakeLocks[msg.sender][nonce] < block.timestamp, "LockStakingRewardSameTokenFixedAPY: Locked"); _totalSupply = _totalSupply.sub(amount); _balances[msg.sender] = _balances[msg.sender].sub(amount); token.safeTransfer(msg.sender, amount); stakeAmounts[msg.sender][nonce] = 0; emit Withdrawn(msg.sender, amount); } function getReward() public override nonReentrant { } function withdrawAndGetReward(uint256 nonce) external override { } function updateRewardAmount(uint256 reward) external onlyOwner { } function rescue(address to, address tokenAddress, uint256 amount) external onlyOwner { } function rescue(address payable to, uint256 amount) external onlyOwner { } }
stakeAmounts[msg.sender][nonce]>0,"LockStakingRewardSameTokenFixedAPY: This stake nonce was withdrawn"
33,024
stakeAmounts[msg.sender][nonce]>0
"LockStakingRewardSameTokenFixedAPY: Locked"
pragma solidity =0.8.0; 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 public owner; address public newOwner; event OwnershipTransferred(address indexed from, address indexed to); constructor() { } modifier onlyOwner { } function transferOwnership(address transferOwner) public onlyOwner { } function acceptOwnership() virtual public { } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } library Address { function isContract(address account) internal view returns (bool) { } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function callOptionalReturn(IERC20 token, bytes memory data) private { } } contract ReentrancyGuard { /// @dev counter to allow mutex lock with only one SSTORE operation uint256 private _guardCounter; constructor () { } modifier nonReentrant() { } } interface ILockStakingRewards { function earned(address account) external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function stake(uint256 amount) external; function stakeFor(uint256 amount, address user) external; function getReward() external; function withdraw(uint256 nonce) external; function withdrawAndGetReward(uint256 nonce) external; } interface IERC20Permit { function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; } contract LockStakingRewardSameTokenFixedAPY is ILockStakingRewards, ReentrancyGuard, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public token; uint256 public rewardRate; uint256 public immutable lockDuration; uint256 public constant rewardDuration = 365 days; mapping(address => uint256) public weightedStakeDate; mapping(address => mapping(uint256 => uint256)) public stakeLocks; mapping(address => mapping(uint256 => uint256)) public stakeAmounts; mapping(address => uint256) public stakeNonces; uint256 private _totalSupply; mapping(address => uint256) private _balances; event RewardUpdated(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); event Rescue(address to, uint amount); event RescueToken(address to, address token, uint amount); constructor( address _token, uint _rewardRate, uint _lockDuration ) { } function totalSupply() external view override returns (uint256) { } function balanceOf(address account) external view override returns (uint256) { } function earned(address account) public view override returns (uint256) { } function stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant { } function stake(uint256 amount) external override nonReentrant { } function stakeFor(uint256 amount, address user) external override nonReentrant { } //A user can withdraw its staking tokens even if there is no rewards tokens on the contract account function withdraw(uint256 nonce) public override nonReentrant { uint amount = stakeAmounts[msg.sender][nonce]; require(stakeAmounts[msg.sender][nonce] > 0, "LockStakingRewardSameTokenFixedAPY: This stake nonce was withdrawn"); require(<FILL_ME>) _totalSupply = _totalSupply.sub(amount); _balances[msg.sender] = _balances[msg.sender].sub(amount); token.safeTransfer(msg.sender, amount); stakeAmounts[msg.sender][nonce] = 0; emit Withdrawn(msg.sender, amount); } function getReward() public override nonReentrant { } function withdrawAndGetReward(uint256 nonce) external override { } function updateRewardAmount(uint256 reward) external onlyOwner { } function rescue(address to, address tokenAddress, uint256 amount) external onlyOwner { } function rescue(address payable to, uint256 amount) external onlyOwner { } }
stakeLocks[msg.sender][nonce]<block.timestamp,"LockStakingRewardSameTokenFixedAPY: Locked"
33,024
stakeLocks[msg.sender][nonce]<block.timestamp
"tokenXferFail"
pragma solidity ^0.6.7; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function ceil(uint a, uint m) internal pure returns (uint) { } } abstract contract Uniswap2PairContract { function getReserves() external virtual returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } abstract contract ERC20Token { function totalSupply() public virtual returns (uint); function approve(address spender, uint value) public virtual returns (bool); function balanceOf(address owner) public virtual returns (uint); function transferFrom (address from, address to, uint value) public virtual returns (bool); } contract Ownable { address public owner; event TransferOwnership(address _from, address _to); constructor() public { } modifier onlyOwner() { } function setOwner(address _owner) external onlyOwner { } } contract UniBOMBLiquidReward is Ownable{ using SafeMath for uint; uint ONE_MONTH = 60*60; uint MAX_MONTHS = 12; address public LIQUIDITY_TOKEN = 0x6E4db354776FCbB9DC16995bA0F68FAF6af14339; address public REWARD_TOKEN = 0x158C7154c27E31188c835Ef2452d629651BDb3A5; uint[3] public rewardLevels = [10000,20000,30000]; uint[3] public poolLevels = [100000000000000000000,1000000000000000000000,10000000000000000000000]; uint[3] public monthLevels = [3,6,12]; uint[4] public baseRateLookup = [250,200,150,100]; //poolLevelsIndex //monthLevelsIndex //s0(small)[m0,m1,m2..] //s2 m2 m3 /3= uint[4][4] public multiplierLookup = [[105,110,120,130],[100,105,110,120],[100,100,105,110],[100,100,100,100]]; mapping(address => mapping(uint => LiquidityRewardData)) public liquidityRewardData; //address to timestamp to data uint public allocatedRewards; uint public totalUniswapLiquidity; uint public unallocatedRewards; struct LiquidityRewardData { uint quantity; uint timestamp; uint stakeMonths; uint reward; bool rewardClaimed; bool liquidityClaimed; } fallback() external payable { } function setOneMonth(uint input ) public onlyOwner{ } function setRewardLevels(uint[3] memory input ) public onlyOwner{ } function setpoolLevels(uint[3] memory input ) public onlyOwner{ } function setMonthLevels(uint[3] memory input ) public onlyOwner{ } function setBaseRateLookup(uint[4] memory input ) public onlyOwner{ } function setMultiplierLookup(uint[4][4] memory input ) public onlyOwner{ } function setMaxMonths(uint input ) public onlyOwner{ } function getMaxMonths() view public returns(uint){ } function getAllocatedRewards() view public returns(uint){ } function getUnallocatedRewards() view public returns(uint){ } function findOnePercent(uint256 value) public pure returns (uint256) { } //(this)must be whitelisted on ubomb function topupReward (uint amount) external { require(<FILL_ME>) //calc actual deposit amount due to BOMB burn uint tokensToBurn = findOnePercent(amount); uint actual = amount.sub(tokensToBurn); unallocatedRewards += actual; } function calcReward(uint stakeMonths, uint stakeTokens) public returns (uint){ } function getRewardIndex() public view returns (uint) { } //baserate function getpoolLevelsIndex(uint eth) public view returns (uint) { } function getMonthsIndex(uint month) public view returns (uint) { } function lockLiquidity(uint idx, uint stakeMonths, uint stakeTokens) external { } function rewardTask(uint idx, uint renewMonths) public { } function unlockLiquidity(uint idx) external { } }
ERC20Token(REWARD_TOKEN).transferFrom(address(msg.sender),address(this),amount),"tokenXferFail"
33,030
ERC20Token(REWARD_TOKEN).transferFrom(address(msg.sender),address(this),amount)
"tokenXferFail"
pragma solidity ^0.6.7; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function ceil(uint a, uint m) internal pure returns (uint) { } } abstract contract Uniswap2PairContract { function getReserves() external virtual returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } abstract contract ERC20Token { function totalSupply() public virtual returns (uint); function approve(address spender, uint value) public virtual returns (bool); function balanceOf(address owner) public virtual returns (uint); function transferFrom (address from, address to, uint value) public virtual returns (bool); } contract Ownable { address public owner; event TransferOwnership(address _from, address _to); constructor() public { } modifier onlyOwner() { } function setOwner(address _owner) external onlyOwner { } } contract UniBOMBLiquidReward is Ownable{ using SafeMath for uint; uint ONE_MONTH = 60*60; uint MAX_MONTHS = 12; address public LIQUIDITY_TOKEN = 0x6E4db354776FCbB9DC16995bA0F68FAF6af14339; address public REWARD_TOKEN = 0x158C7154c27E31188c835Ef2452d629651BDb3A5; uint[3] public rewardLevels = [10000,20000,30000]; uint[3] public poolLevels = [100000000000000000000,1000000000000000000000,10000000000000000000000]; uint[3] public monthLevels = [3,6,12]; uint[4] public baseRateLookup = [250,200,150,100]; //poolLevelsIndex //monthLevelsIndex //s0(small)[m0,m1,m2..] //s2 m2 m3 /3= uint[4][4] public multiplierLookup = [[105,110,120,130],[100,105,110,120],[100,100,105,110],[100,100,100,100]]; mapping(address => mapping(uint => LiquidityRewardData)) public liquidityRewardData; //address to timestamp to data uint public allocatedRewards; uint public totalUniswapLiquidity; uint public unallocatedRewards; struct LiquidityRewardData { uint quantity; uint timestamp; uint stakeMonths; uint reward; bool rewardClaimed; bool liquidityClaimed; } fallback() external payable { } function setOneMonth(uint input ) public onlyOwner{ } function setRewardLevels(uint[3] memory input ) public onlyOwner{ } function setpoolLevels(uint[3] memory input ) public onlyOwner{ } function setMonthLevels(uint[3] memory input ) public onlyOwner{ } function setBaseRateLookup(uint[4] memory input ) public onlyOwner{ } function setMultiplierLookup(uint[4][4] memory input ) public onlyOwner{ } function setMaxMonths(uint input ) public onlyOwner{ } function getMaxMonths() view public returns(uint){ } function getAllocatedRewards() view public returns(uint){ } function getUnallocatedRewards() view public returns(uint){ } function findOnePercent(uint256 value) public pure returns (uint256) { } //(this)must be whitelisted on ubomb function topupReward (uint amount) external { } function calcReward(uint stakeMonths, uint stakeTokens) public returns (uint){ } function getRewardIndex() public view returns (uint) { } //baserate function getpoolLevelsIndex(uint eth) public view returns (uint) { } function getMonthsIndex(uint month) public view returns (uint) { } function lockLiquidity(uint idx, uint stakeMonths, uint stakeTokens) external { //temp hold tokens and ether from sender require(stakeMonths <= MAX_MONTHS,"tooManyMonths"); require(<FILL_ME>) require( (liquidityRewardData[msg.sender][idx].quantity == 0),"previousLiquidityInSlot"); uint reward = calcReward(stakeMonths,stakeTokens); require( unallocatedRewards >= reward, "notEnoughRewardRemaining"); allocatedRewards += reward; unallocatedRewards -= reward; totalUniswapLiquidity += stakeTokens; liquidityRewardData[msg.sender][idx] = LiquidityRewardData(stakeTokens, block.timestamp, stakeMonths, reward,false,false); } function rewardTask(uint idx, uint renewMonths) public { } function unlockLiquidity(uint idx) external { } }
ERC20Token(LIQUIDITY_TOKEN).transferFrom(address(msg.sender),address(this),stakeTokens),"tokenXferFail"
33,030
ERC20Token(LIQUIDITY_TOKEN).transferFrom(address(msg.sender),address(this),stakeTokens)
"previousLiquidityInSlot"
pragma solidity ^0.6.7; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function ceil(uint a, uint m) internal pure returns (uint) { } } abstract contract Uniswap2PairContract { function getReserves() external virtual returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } abstract contract ERC20Token { function totalSupply() public virtual returns (uint); function approve(address spender, uint value) public virtual returns (bool); function balanceOf(address owner) public virtual returns (uint); function transferFrom (address from, address to, uint value) public virtual returns (bool); } contract Ownable { address public owner; event TransferOwnership(address _from, address _to); constructor() public { } modifier onlyOwner() { } function setOwner(address _owner) external onlyOwner { } } contract UniBOMBLiquidReward is Ownable{ using SafeMath for uint; uint ONE_MONTH = 60*60; uint MAX_MONTHS = 12; address public LIQUIDITY_TOKEN = 0x6E4db354776FCbB9DC16995bA0F68FAF6af14339; address public REWARD_TOKEN = 0x158C7154c27E31188c835Ef2452d629651BDb3A5; uint[3] public rewardLevels = [10000,20000,30000]; uint[3] public poolLevels = [100000000000000000000,1000000000000000000000,10000000000000000000000]; uint[3] public monthLevels = [3,6,12]; uint[4] public baseRateLookup = [250,200,150,100]; //poolLevelsIndex //monthLevelsIndex //s0(small)[m0,m1,m2..] //s2 m2 m3 /3= uint[4][4] public multiplierLookup = [[105,110,120,130],[100,105,110,120],[100,100,105,110],[100,100,100,100]]; mapping(address => mapping(uint => LiquidityRewardData)) public liquidityRewardData; //address to timestamp to data uint public allocatedRewards; uint public totalUniswapLiquidity; uint public unallocatedRewards; struct LiquidityRewardData { uint quantity; uint timestamp; uint stakeMonths; uint reward; bool rewardClaimed; bool liquidityClaimed; } fallback() external payable { } function setOneMonth(uint input ) public onlyOwner{ } function setRewardLevels(uint[3] memory input ) public onlyOwner{ } function setpoolLevels(uint[3] memory input ) public onlyOwner{ } function setMonthLevels(uint[3] memory input ) public onlyOwner{ } function setBaseRateLookup(uint[4] memory input ) public onlyOwner{ } function setMultiplierLookup(uint[4][4] memory input ) public onlyOwner{ } function setMaxMonths(uint input ) public onlyOwner{ } function getMaxMonths() view public returns(uint){ } function getAllocatedRewards() view public returns(uint){ } function getUnallocatedRewards() view public returns(uint){ } function findOnePercent(uint256 value) public pure returns (uint256) { } //(this)must be whitelisted on ubomb function topupReward (uint amount) external { } function calcReward(uint stakeMonths, uint stakeTokens) public returns (uint){ } function getRewardIndex() public view returns (uint) { } //baserate function getpoolLevelsIndex(uint eth) public view returns (uint) { } function getMonthsIndex(uint month) public view returns (uint) { } function lockLiquidity(uint idx, uint stakeMonths, uint stakeTokens) external { //temp hold tokens and ether from sender require(stakeMonths <= MAX_MONTHS,"tooManyMonths"); require(ERC20Token(LIQUIDITY_TOKEN).transferFrom(address(msg.sender), address(this), stakeTokens),"tokenXferFail"); require(<FILL_ME>) uint reward = calcReward(stakeMonths,stakeTokens); require( unallocatedRewards >= reward, "notEnoughRewardRemaining"); allocatedRewards += reward; unallocatedRewards -= reward; totalUniswapLiquidity += stakeTokens; liquidityRewardData[msg.sender][idx] = LiquidityRewardData(stakeTokens, block.timestamp, stakeMonths, reward,false,false); } function rewardTask(uint idx, uint renewMonths) public { } function unlockLiquidity(uint idx) external { } }
(liquidityRewardData[msg.sender][idx].quantity==0),"previousLiquidityInSlot"
33,030
(liquidityRewardData[msg.sender][idx].quantity==0)
"RewardClaimedAlready"
pragma solidity ^0.6.7; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function ceil(uint a, uint m) internal pure returns (uint) { } } abstract contract Uniswap2PairContract { function getReserves() external virtual returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } abstract contract ERC20Token { function totalSupply() public virtual returns (uint); function approve(address spender, uint value) public virtual returns (bool); function balanceOf(address owner) public virtual returns (uint); function transferFrom (address from, address to, uint value) public virtual returns (bool); } contract Ownable { address public owner; event TransferOwnership(address _from, address _to); constructor() public { } modifier onlyOwner() { } function setOwner(address _owner) external onlyOwner { } } contract UniBOMBLiquidReward is Ownable{ using SafeMath for uint; uint ONE_MONTH = 60*60; uint MAX_MONTHS = 12; address public LIQUIDITY_TOKEN = 0x6E4db354776FCbB9DC16995bA0F68FAF6af14339; address public REWARD_TOKEN = 0x158C7154c27E31188c835Ef2452d629651BDb3A5; uint[3] public rewardLevels = [10000,20000,30000]; uint[3] public poolLevels = [100000000000000000000,1000000000000000000000,10000000000000000000000]; uint[3] public monthLevels = [3,6,12]; uint[4] public baseRateLookup = [250,200,150,100]; //poolLevelsIndex //monthLevelsIndex //s0(small)[m0,m1,m2..] //s2 m2 m3 /3= uint[4][4] public multiplierLookup = [[105,110,120,130],[100,105,110,120],[100,100,105,110],[100,100,100,100]]; mapping(address => mapping(uint => LiquidityRewardData)) public liquidityRewardData; //address to timestamp to data uint public allocatedRewards; uint public totalUniswapLiquidity; uint public unallocatedRewards; struct LiquidityRewardData { uint quantity; uint timestamp; uint stakeMonths; uint reward; bool rewardClaimed; bool liquidityClaimed; } fallback() external payable { } function setOneMonth(uint input ) public onlyOwner{ } function setRewardLevels(uint[3] memory input ) public onlyOwner{ } function setpoolLevels(uint[3] memory input ) public onlyOwner{ } function setMonthLevels(uint[3] memory input ) public onlyOwner{ } function setBaseRateLookup(uint[4] memory input ) public onlyOwner{ } function setMultiplierLookup(uint[4][4] memory input ) public onlyOwner{ } function setMaxMonths(uint input ) public onlyOwner{ } function getMaxMonths() view public returns(uint){ } function getAllocatedRewards() view public returns(uint){ } function getUnallocatedRewards() view public returns(uint){ } function findOnePercent(uint256 value) public pure returns (uint256) { } //(this)must be whitelisted on ubomb function topupReward (uint amount) external { } function calcReward(uint stakeMonths, uint stakeTokens) public returns (uint){ } function getRewardIndex() public view returns (uint) { } //baserate function getpoolLevelsIndex(uint eth) public view returns (uint) { } function getMonthsIndex(uint month) public view returns (uint) { } function lockLiquidity(uint idx, uint stakeMonths, uint stakeTokens) external { } function rewardTask(uint idx, uint renewMonths) public { require(<FILL_ME>) liquidityRewardData[msg.sender][idx].rewardClaimed = true; uint reward = liquidityRewardData[msg.sender][idx].reward; allocatedRewards -= reward; if( liquidityRewardData[msg.sender][idx].timestamp.add( liquidityRewardData[msg.sender][idx].stakeMonths.mul(ONE_MONTH)) <= block.timestamp){ if(renewMonths > 0 && liquidityRewardData[msg.sender][idx].liquidityClaimed==false){ //claim and renew uint newReward = calcReward(renewMonths,liquidityRewardData[msg.sender][idx].quantity); require(newReward < unallocatedRewards,"NotEnoughRewardsRemaining"); allocatedRewards += newReward; unallocatedRewards -= newReward; liquidityRewardData[msg.sender][idx].timestamp = block.timestamp; liquidityRewardData[msg.sender][idx].stakeMonths = renewMonths; liquidityRewardData[msg.sender][idx].reward = newReward; liquidityRewardData[msg.sender][idx].rewardClaimed = false; } ERC20Token(REWARD_TOKEN).approve(address(this),reward); ERC20Token(REWARD_TOKEN).transferFrom(address(this), address(msg.sender), reward); } else{ unallocatedRewards += reward; } } function unlockLiquidity(uint idx) external { } }
liquidityRewardData[msg.sender][idx].rewardClaimed==false,"RewardClaimedAlready"
33,030
liquidityRewardData[msg.sender][idx].rewardClaimed==false
"LiquidityAlreadyClaimed"
pragma solidity ^0.6.7; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function ceil(uint a, uint m) internal pure returns (uint) { } } abstract contract Uniswap2PairContract { function getReserves() external virtual returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } abstract contract ERC20Token { function totalSupply() public virtual returns (uint); function approve(address spender, uint value) public virtual returns (bool); function balanceOf(address owner) public virtual returns (uint); function transferFrom (address from, address to, uint value) public virtual returns (bool); } contract Ownable { address public owner; event TransferOwnership(address _from, address _to); constructor() public { } modifier onlyOwner() { } function setOwner(address _owner) external onlyOwner { } } contract UniBOMBLiquidReward is Ownable{ using SafeMath for uint; uint ONE_MONTH = 60*60; uint MAX_MONTHS = 12; address public LIQUIDITY_TOKEN = 0x6E4db354776FCbB9DC16995bA0F68FAF6af14339; address public REWARD_TOKEN = 0x158C7154c27E31188c835Ef2452d629651BDb3A5; uint[3] public rewardLevels = [10000,20000,30000]; uint[3] public poolLevels = [100000000000000000000,1000000000000000000000,10000000000000000000000]; uint[3] public monthLevels = [3,6,12]; uint[4] public baseRateLookup = [250,200,150,100]; //poolLevelsIndex //monthLevelsIndex //s0(small)[m0,m1,m2..] //s2 m2 m3 /3= uint[4][4] public multiplierLookup = [[105,110,120,130],[100,105,110,120],[100,100,105,110],[100,100,100,100]]; mapping(address => mapping(uint => LiquidityRewardData)) public liquidityRewardData; //address to timestamp to data uint public allocatedRewards; uint public totalUniswapLiquidity; uint public unallocatedRewards; struct LiquidityRewardData { uint quantity; uint timestamp; uint stakeMonths; uint reward; bool rewardClaimed; bool liquidityClaimed; } fallback() external payable { } function setOneMonth(uint input ) public onlyOwner{ } function setRewardLevels(uint[3] memory input ) public onlyOwner{ } function setpoolLevels(uint[3] memory input ) public onlyOwner{ } function setMonthLevels(uint[3] memory input ) public onlyOwner{ } function setBaseRateLookup(uint[4] memory input ) public onlyOwner{ } function setMultiplierLookup(uint[4][4] memory input ) public onlyOwner{ } function setMaxMonths(uint input ) public onlyOwner{ } function getMaxMonths() view public returns(uint){ } function getAllocatedRewards() view public returns(uint){ } function getUnallocatedRewards() view public returns(uint){ } function findOnePercent(uint256 value) public pure returns (uint256) { } //(this)must be whitelisted on ubomb function topupReward (uint amount) external { } function calcReward(uint stakeMonths, uint stakeTokens) public returns (uint){ } function getRewardIndex() public view returns (uint) { } //baserate function getpoolLevelsIndex(uint eth) public view returns (uint) { } function getMonthsIndex(uint month) public view returns (uint) { } function lockLiquidity(uint idx, uint stakeMonths, uint stakeTokens) external { } function rewardTask(uint idx, uint renewMonths) public { } function unlockLiquidity(uint idx) external { //get liquidity tokens require(<FILL_ME>) if(liquidityRewardData[msg.sender][idx].rewardClaimed == false){ rewardTask(idx,0); } totalUniswapLiquidity -= liquidityRewardData[msg.sender][idx].quantity; ERC20Token(LIQUIDITY_TOKEN).approve(address(this),liquidityRewardData[msg.sender][idx].quantity); ERC20Token(LIQUIDITY_TOKEN).transferFrom(address(this),address(msg.sender),liquidityRewardData[msg.sender][idx].quantity); liquidityRewardData[msg.sender][idx].quantity = 0; liquidityRewardData[msg.sender][idx].liquidityClaimed = true; } }
liquidityRewardData[msg.sender][idx].liquidityClaimed==false,"LiquidityAlreadyClaimed"
33,030
liquidityRewardData[msg.sender][idx].liquidityClaimed==false
"TempleTeamPayments: Member not found"
//SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./TempleERC20Token.sol"; contract TempleTeamPayments is Ownable { uint256 public immutable roundStartDate; uint256 public immutable roundEndDate; TempleERC20Token public immutable TEMPLE; mapping(address => uint256) public allocation; mapping(address => uint256) public claimed; event Claimed(address indexed member, uint256 amount); constructor(TempleERC20Token _TEMPLE, uint256 paymentPeriodInSeconds, uint256 startTimestamp) { } modifier addressExists(address _address) { require(<FILL_ME>) _; } function setAllocations( address[] memory _addresses, uint256[] memory _amounts ) external onlyOwner { } function setAllocation(address _address, uint256 _amount) external onlyOwner { } function pauseMember(address _address) external onlyOwner addressExists(_address) { } function calculateClaimable(address _address) public view addressExists(_address) returns (uint256) { } function claim() external addressExists(msg.sender) { } function adhocPayment(address _to, uint256 _amount) external onlyOwner { } function withdrawTempleBalance(address _to, uint256 _amount) external onlyOwner { } }
allocation[_address]>0,"TempleTeamPayments: Member not found"
33,099
allocation[_address]>0
"TempleTeamPayments: Address cannot be 0x0"
//SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./TempleERC20Token.sol"; contract TempleTeamPayments is Ownable { uint256 public immutable roundStartDate; uint256 public immutable roundEndDate; TempleERC20Token public immutable TEMPLE; mapping(address => uint256) public allocation; mapping(address => uint256) public claimed; event Claimed(address indexed member, uint256 amount); constructor(TempleERC20Token _TEMPLE, uint256 paymentPeriodInSeconds, uint256 startTimestamp) { } modifier addressExists(address _address) { } function setAllocations( address[] memory _addresses, uint256[] memory _amounts ) external onlyOwner { require( _addresses.length == _amounts.length, "TempleTeamPayments: addresses and amounts must be the same length" ); address addressZero = address(0); for (uint256 i = 0; i < _addresses.length; i++) { require(<FILL_ME>) allocation[_addresses[i]] = _amounts[i]; } } function setAllocation(address _address, uint256 _amount) external onlyOwner { } function pauseMember(address _address) external onlyOwner addressExists(_address) { } function calculateClaimable(address _address) public view addressExists(_address) returns (uint256) { } function claim() external addressExists(msg.sender) { } function adhocPayment(address _to, uint256 _amount) external onlyOwner { } function withdrawTempleBalance(address _to, uint256 _amount) external onlyOwner { } }
_addresses[i]!=addressZero,"TempleTeamPayments: Address cannot be 0x0"
33,099
_addresses[i]!=addressZero
"Caller is not a setter"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/IBPD.sol"; contract BPD is IBPD, AccessControl { using SafeMath for uint256; bytes32 public constant SETTER_ROLE = keccak256("SETTER_ROLE"); bytes32 public constant SWAP_ROLE = keccak256("SWAP_ROLE"); bytes32 public constant SUBBALANCE_ROLE = keccak256("SUBBALANCE_ROLE"); uint256[5] public poolYearAmounts; bool[5] public poolTransferred; uint256[5] public poolYearPercentages = [10, 15, 20, 25, 30]; address public mainToken; uint256 public constant PERCENT_DENOMINATOR = 100; modifier onlySetter() { require(<FILL_ME>) _; } constructor(address _setter) public { } function init( address _mainToken, address _foreignSwap, address _subBalancePool ) public onlySetter { } function getPoolYearAmounts() external view override returns (uint256[5] memory poolAmounts) { } function getClosestPoolAmount() public view returns (uint256 poolAmount) { } function callIncomeTokensTrigger(uint256 incomeAmountToken) external override { } function transferYearlyPool(uint256 poolNumber) external override returns (uint256 transferAmount) { } }
hasRole(SETTER_ROLE,_msgSender()),"Caller is not a setter"
33,106
hasRole(SETTER_ROLE,_msgSender())
"Caller is not a swap role"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/IBPD.sol"; contract BPD is IBPD, AccessControl { using SafeMath for uint256; bytes32 public constant SETTER_ROLE = keccak256("SETTER_ROLE"); bytes32 public constant SWAP_ROLE = keccak256("SWAP_ROLE"); bytes32 public constant SUBBALANCE_ROLE = keccak256("SUBBALANCE_ROLE"); uint256[5] public poolYearAmounts; bool[5] public poolTransferred; uint256[5] public poolYearPercentages = [10, 15, 20, 25, 30]; address public mainToken; uint256 public constant PERCENT_DENOMINATOR = 100; modifier onlySetter() { } constructor(address _setter) public { } function init( address _mainToken, address _foreignSwap, address _subBalancePool ) public onlySetter { } function getPoolYearAmounts() external view override returns (uint256[5] memory poolAmounts) { } function getClosestPoolAmount() public view returns (uint256 poolAmount) { } function callIncomeTokensTrigger(uint256 incomeAmountToken) external override { require(<FILL_ME>) // Divide income to years uint256 part = incomeAmountToken.div(PERCENT_DENOMINATOR); uint256 remainderPart = incomeAmountToken; for (uint256 i = 0; i < poolYearAmounts.length; i++) { if (i != poolYearAmounts.length - 1) { uint256 poolPart = part.mul(poolYearPercentages[i]); poolYearAmounts[i] = poolYearAmounts[i].add(poolPart); remainderPart = remainderPart.sub(poolPart); } else { poolYearAmounts[i] = poolYearAmounts[i].add(remainderPart); } } } function transferYearlyPool(uint256 poolNumber) external override returns (uint256 transferAmount) { } }
hasRole(SWAP_ROLE,_msgSender()),"Caller is not a swap role"
33,106
hasRole(SWAP_ROLE,_msgSender())
"Caller is not a subbalance role"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/IBPD.sol"; contract BPD is IBPD, AccessControl { using SafeMath for uint256; bytes32 public constant SETTER_ROLE = keccak256("SETTER_ROLE"); bytes32 public constant SWAP_ROLE = keccak256("SWAP_ROLE"); bytes32 public constant SUBBALANCE_ROLE = keccak256("SUBBALANCE_ROLE"); uint256[5] public poolYearAmounts; bool[5] public poolTransferred; uint256[5] public poolYearPercentages = [10, 15, 20, 25, 30]; address public mainToken; uint256 public constant PERCENT_DENOMINATOR = 100; modifier onlySetter() { } constructor(address _setter) public { } function init( address _mainToken, address _foreignSwap, address _subBalancePool ) public onlySetter { } function getPoolYearAmounts() external view override returns (uint256[5] memory poolAmounts) { } function getClosestPoolAmount() public view returns (uint256 poolAmount) { } function callIncomeTokensTrigger(uint256 incomeAmountToken) external override { } function transferYearlyPool(uint256 poolNumber) external override returns (uint256 transferAmount) { require(<FILL_ME>) for (uint256 i = 0; i < poolYearAmounts.length; i++) { if (poolNumber == i) { require(!poolTransferred[i], "Already transferred"); transferAmount = poolYearAmounts[i]; poolTransferred[i] = true; IERC20(mainToken).transfer(_msgSender(), transferAmount); return transferAmount; } } } }
hasRole(SUBBALANCE_ROLE,_msgSender()),"Caller is not a subbalance role"
33,106
hasRole(SUBBALANCE_ROLE,_msgSender())
"Already transferred"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/IBPD.sol"; contract BPD is IBPD, AccessControl { using SafeMath for uint256; bytes32 public constant SETTER_ROLE = keccak256("SETTER_ROLE"); bytes32 public constant SWAP_ROLE = keccak256("SWAP_ROLE"); bytes32 public constant SUBBALANCE_ROLE = keccak256("SUBBALANCE_ROLE"); uint256[5] public poolYearAmounts; bool[5] public poolTransferred; uint256[5] public poolYearPercentages = [10, 15, 20, 25, 30]; address public mainToken; uint256 public constant PERCENT_DENOMINATOR = 100; modifier onlySetter() { } constructor(address _setter) public { } function init( address _mainToken, address _foreignSwap, address _subBalancePool ) public onlySetter { } function getPoolYearAmounts() external view override returns (uint256[5] memory poolAmounts) { } function getClosestPoolAmount() public view returns (uint256 poolAmount) { } function callIncomeTokensTrigger(uint256 incomeAmountToken) external override { } function transferYearlyPool(uint256 poolNumber) external override returns (uint256 transferAmount) { require(hasRole(SUBBALANCE_ROLE, _msgSender()), "Caller is not a subbalance role"); for (uint256 i = 0; i < poolYearAmounts.length; i++) { if (poolNumber == i) { require(<FILL_ME>) transferAmount = poolYearAmounts[i]; poolTransferred[i] = true; IERC20(mainToken).transfer(_msgSender(), transferAmount); return transferAmount; } } } }
!poolTransferred[i],"Already transferred"
33,106
!poolTransferred[i]
"check ticket fail"
pragma solidity 0.5.7; import "./SafeMath.sol"; import "./AddrMInterface.sol"; interface TickectInerface{ function calDeductionADC(uint256 _value,bool isIn_) external returns(uint256 disADC_); } interface ERC20 { function balanceOf(address) external view returns (uint256); function distroy(address _owner,uint256 _value) external; } library gameDataSet{ struct PlyRelationship{ uint256 parentPID; //parent PID uint256 topPID; uint256 sonNumber; uint256 bigPotSonPID; // big pot son ID uint256 totalRecmdplys; // total recommanded players uint256 totalRecmdAmount; // total Recommended ETH without himself uint8 nodeLevel; // this is node level for V1-V6 //mapping(uint256 => uint256) sonPIDList; // son number -> son PID list mapping(uint256 => bool) sonPIDListMap; //son PID list mapping mapping(uint256 => uint256) sonTotalBalance; // PID-> total balance } struct Player{ //uint256 pID; uint256 ticketInCost; // how many eth can join uint256 withdrawAmount; // how many eth can join uint256 startTime; // join the game time uint256 totalSettled; // rturn funds uint256 staticIncome; uint256 lastCalcSITime; // last Calc staticIncome Time //uint256 lastCalcDITime; // last Calc dynamicIncome Time uint256 dynamicIncome; // last Calc dynamicIncome uint256 stepIncome; bool isActive; // 1 mean is 10eth,2 have new one son,3, bool isAlreadGetIns;// already get insePoolBalance income; } struct Round{ uint256 rID; //Round ID uint256 rStartTime; //Round start ID uint256 rPlys; // new round players uint256 lastPID; // last Player ID pID uint256 totalInseAmount; // uint256 fritInsePoint; uint256 fritInseAmount; uint256[] plyInList; } } contract MainPool{ using SafeMath for *; //address manager AddrMInterface addrM ; TickectInerface tickect; ERC20 adcERC20; // pool mapping(uint256 => uint256) public allInBalance; mapping(uint256 => uint256) public mainPoolLockBal; // lock balance do not sub mapping(uint256 => uint256) public mainPoolBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public mainPoolWithdrawBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public alreadyWithDrawBal; // RID -> balance total Main pool balance mapping(uint256 => uint256) public insePoolBalance; // total insurance pool Banacle uint256 public mainPoolSTime ; uint256 public totalDistroyADC; uint256 public constant oneDay = 86400 seconds ; //node level mapping(uint8 => uint256) private nlThdAmount; // node level threshold amount mapping(uint8 => uint8) private nlIncome; // node level threshold amount mapping(uint256 => uint256 ) private doubleV6PID; // id -> pID ,is start is 1 ; mapping(uint256 => bool ) private isDoubleV6; // PID -> TRUE ,is start is 1 ; mapping(uint256 => mapping(uint256 => uint256 )) private plydV6Income; // rid -> pid->balance ,is start is 1 ; uint256 totalV6Number; // Round uint256 public RID; mapping(uint256 => gameDataSet.Round) public round; // RID => round Info mapping(uint256 => mapping(uint256=>bool)) public luckPID; // Player uint256 lastPID; mapping(uint256 => gameDataSet.PlyRelationship) public plyRShip; mapping(uint256 => mapping(uint256 => gameDataSet.Player)) public plyr; // rid-> pid-> player mapping(address => uint256) public plyrID; // address -> pid-> playerID mapping(uint256 => address) private plyrAddr; // pid -> addr-> playerID //mapping(uint256 =>mapping(uint256 => uint256)) public plyBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) private plyWithdrawBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) public playBiggertReward; // player total can without balance mapping(uint256 =>uint256) private playDistroyADC; // PID-ADC balance player total can without balance mapping(address=>bool) private vipPly; mapping(uint256=>bool) private vipPlayerID; mapping(uint256=>mapping(uint256 => uint256)) public plyLucklyAmount; //rid-pid-amount // ambassador mapping(address => bool) public ambassadorList; //addr-true-BOOL //uint256[] ambRewardList;// PID list mapping(uint256=>bool) private ambRewardMap; //mapping(uint256=>uint256) ambRewardIdx; mapping(uint256 => mapping(uint256=>uint256)) public ambRewardBalance; //vip address constant vip1Addr = address(0x953ad059b61aA4A23fa48d5eca617D4920E3343e); //address constant vip1Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); //address constant vip2Addr = address(0x6bE9780954580FCC268944e9D6271B3Dfc886997); address constant vip2Addr = address(0xfbcB561D76a622341E6e537a17c5C17af33c4628); address constant vip3Addr = address(0x669f366427ea8184FdCDCda6D6201a6bAAf9b156); address constant vip4Addr = address(0xBcA44B04e10e04b7FeD7F262cAd70A683D753981); address constant vip5Addr = address(0x0D3c20D9102200242398dE26fdF09F29f435421b); address constant vip6Addr = address(0xbb3c82CD454911F140B68FE2E67504af9A2b5D16); //address constant vip6Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); address constant vip7Addr = address(0xbE6DFD74AF0848b9cf6C6DFBc8bb24d2920e6aDe); address constant vip8Addr = address(0x5b9347799602D0164DF3926c10f237543eaa5b9F); address constant vip9Addr = address(0xa2221dE49E4085Be8098d1A8B4538734ce4977C7); address constant vip10Addr = address(0xAc1c0B39F3A1450E53BA0dA1bCAB5D9572DCed57); address constant vip11Addr = address(0x7721a0C6eb2F2a056C48D107d0a2C4Cff261e98c); //address constant vip11Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); constructor(address addressM_) public{ } function initVipPlay() internal{ } modifier notContract(address _addr){ } function joinGame(address parentAddr) public payable notContract(msg.sender){ // check ticket uint256 tmPid = plyrID[msg.sender]; if(tmPid ==0){ require(msg.sender != parentAddr,"parent same as msg sender"); } require(<FILL_ME>) // check invite uint256 pID =plyrID[msg.sender]; uint256 parentPid_ = plyrID[parentAddr]; uint256 inBalance = plyr[RID][pID].ticketInCost; allInBalance[RID] += inBalance; if(tmPid == 0 && !vipPly[msg.sender]){ plyRShip[pID].parentPID = parentPid_; // topPID if(parentPid_ == 0){ plyRShip[pID].topPID = pID; }else{ plyRShip[pID].topPID = plyRShip[parentPid_].topPID; } } /*if(plyr[RID][parentPid_].lastCalcDITime == 0){ plyr[RID][parentPid_].lastCalcDITime = now; }*/ if (RID > 1 && !vipPly[msg.sender] && !vipPlayerID[parentPid_]){ activeParent(pID,parentPid_,plyr[RID][pID].ticketInCost); } // the pool 5% for insurance pool if(insePoolBalance[RID] >= 50000*10**18){ mainPoolBalance[RID] += inBalance; mainPoolLockBal[RID] += inBalance; mainPoolWithdrawBalance[RID] += inBalance; }else{ uint256 temp = inBalance*95/100; insePoolBalance[RID] += inBalance*5/100; mainPoolBalance[RID] += temp; mainPoolLockBal[RID] += temp; mainPoolWithdrawBalance[RID] += temp; } // find parents calc earn calcEarn(pID,inBalance); //check pool state setRoundInfo(pID); } function withdraw() public{ } // settlement Static income by web function settlementStatic() public { } function calcDynamic(uint256 plyid_,uint256 staticIncome_) internal{ } function setAmbFlag(address ply_) public{ } //ambassador function getPlayerInfo(address ply_,uint256 rid_) public view returns( uint256 stIncome_, uint256 dtIncome_, uint256 stepIncome_, uint256 ambIncome_, uint256 doubV6Income_, uint256 totoalIncome_, uint256 withdrawAmount_, uint256 ticketIn_, uint256 canWithdrawAmount_, uint256 startTime_, uint256 liveRountAmount_) { } function getPlayerRelship(address ply_) public view returns( uint256 sonNumber_, uint256 allNumber_, uint256 curLevel_, bool isamb_, uint256 bigPotBalance_, uint256 smailPotBalance_, bool isDoubleV6_, uint256 distroyADC_) { } function getPoolInfo(uint256 rid_) public view returns( uint256 totalInBalance_, // all in balanace uint256 totalDivBalance_, // Dividend pool balance uint256 totalInsBalance_,//Insurance pool balance uint256 totalPlayers_, uint256 totalDisADC_) { } function getRID() public view returns(uint256 rid_){ } function activeParent(uint256 sonID_,uint256 parentPid_,uint256 value_) internal{ } function checkTicket(address payable ply_,uint256 value_) internal returns(bool){ } function setRoundInfo(uint256 plyID_) internal{ } function calcEarn(uint256 plyID_,uint256 value_) internal{ } function findParentByFor(uint256 plyID_,uint256 value_) internal{ } function calcStepByList(uint256 stepNum_,uint256[] memory stepPlyerList,uint8 biggestNodeLevel,uint256 value_) internal{ } function setAmbRewardBalance(uint256 pid_,uint256 value_) internal{ } function setRelationship(uint256 sonID_,uint256 plyID_,uint256 value_) internal{ } function calcS_T(uint256 lastTime_,uint256 value_) internal view returns(uint256 _earnAmount){ } function calcStepIncome(uint256 pid_,uint256 value_,uint8 dividendAccount_) public{ } function startNewRount() internal { } function initVip(address ply_) internal{ } function initVIPInfo(address ply_,uint256 pid_ ,uint256 parentid_) internal{ } function newRoundVIP() internal{ } }
checkTicket(msg.sender,msg.value),"check ticket fail"
33,186
checkTicket(msg.sender,msg.value)
"ply not active"
pragma solidity 0.5.7; import "./SafeMath.sol"; import "./AddrMInterface.sol"; interface TickectInerface{ function calDeductionADC(uint256 _value,bool isIn_) external returns(uint256 disADC_); } interface ERC20 { function balanceOf(address) external view returns (uint256); function distroy(address _owner,uint256 _value) external; } library gameDataSet{ struct PlyRelationship{ uint256 parentPID; //parent PID uint256 topPID; uint256 sonNumber; uint256 bigPotSonPID; // big pot son ID uint256 totalRecmdplys; // total recommanded players uint256 totalRecmdAmount; // total Recommended ETH without himself uint8 nodeLevel; // this is node level for V1-V6 //mapping(uint256 => uint256) sonPIDList; // son number -> son PID list mapping(uint256 => bool) sonPIDListMap; //son PID list mapping mapping(uint256 => uint256) sonTotalBalance; // PID-> total balance } struct Player{ //uint256 pID; uint256 ticketInCost; // how many eth can join uint256 withdrawAmount; // how many eth can join uint256 startTime; // join the game time uint256 totalSettled; // rturn funds uint256 staticIncome; uint256 lastCalcSITime; // last Calc staticIncome Time //uint256 lastCalcDITime; // last Calc dynamicIncome Time uint256 dynamicIncome; // last Calc dynamicIncome uint256 stepIncome; bool isActive; // 1 mean is 10eth,2 have new one son,3, bool isAlreadGetIns;// already get insePoolBalance income; } struct Round{ uint256 rID; //Round ID uint256 rStartTime; //Round start ID uint256 rPlys; // new round players uint256 lastPID; // last Player ID pID uint256 totalInseAmount; // uint256 fritInsePoint; uint256 fritInseAmount; uint256[] plyInList; } } contract MainPool{ using SafeMath for *; //address manager AddrMInterface addrM ; TickectInerface tickect; ERC20 adcERC20; // pool mapping(uint256 => uint256) public allInBalance; mapping(uint256 => uint256) public mainPoolLockBal; // lock balance do not sub mapping(uint256 => uint256) public mainPoolBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public mainPoolWithdrawBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public alreadyWithDrawBal; // RID -> balance total Main pool balance mapping(uint256 => uint256) public insePoolBalance; // total insurance pool Banacle uint256 public mainPoolSTime ; uint256 public totalDistroyADC; uint256 public constant oneDay = 86400 seconds ; //node level mapping(uint8 => uint256) private nlThdAmount; // node level threshold amount mapping(uint8 => uint8) private nlIncome; // node level threshold amount mapping(uint256 => uint256 ) private doubleV6PID; // id -> pID ,is start is 1 ; mapping(uint256 => bool ) private isDoubleV6; // PID -> TRUE ,is start is 1 ; mapping(uint256 => mapping(uint256 => uint256 )) private plydV6Income; // rid -> pid->balance ,is start is 1 ; uint256 totalV6Number; // Round uint256 public RID; mapping(uint256 => gameDataSet.Round) public round; // RID => round Info mapping(uint256 => mapping(uint256=>bool)) public luckPID; // Player uint256 lastPID; mapping(uint256 => gameDataSet.PlyRelationship) public plyRShip; mapping(uint256 => mapping(uint256 => gameDataSet.Player)) public plyr; // rid-> pid-> player mapping(address => uint256) public plyrID; // address -> pid-> playerID mapping(uint256 => address) private plyrAddr; // pid -> addr-> playerID //mapping(uint256 =>mapping(uint256 => uint256)) public plyBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) private plyWithdrawBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) public playBiggertReward; // player total can without balance mapping(uint256 =>uint256) private playDistroyADC; // PID-ADC balance player total can without balance mapping(address=>bool) private vipPly; mapping(uint256=>bool) private vipPlayerID; mapping(uint256=>mapping(uint256 => uint256)) public plyLucklyAmount; //rid-pid-amount // ambassador mapping(address => bool) public ambassadorList; //addr-true-BOOL //uint256[] ambRewardList;// PID list mapping(uint256=>bool) private ambRewardMap; //mapping(uint256=>uint256) ambRewardIdx; mapping(uint256 => mapping(uint256=>uint256)) public ambRewardBalance; //vip address constant vip1Addr = address(0x953ad059b61aA4A23fa48d5eca617D4920E3343e); //address constant vip1Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); //address constant vip2Addr = address(0x6bE9780954580FCC268944e9D6271B3Dfc886997); address constant vip2Addr = address(0xfbcB561D76a622341E6e537a17c5C17af33c4628); address constant vip3Addr = address(0x669f366427ea8184FdCDCda6D6201a6bAAf9b156); address constant vip4Addr = address(0xBcA44B04e10e04b7FeD7F262cAd70A683D753981); address constant vip5Addr = address(0x0D3c20D9102200242398dE26fdF09F29f435421b); address constant vip6Addr = address(0xbb3c82CD454911F140B68FE2E67504af9A2b5D16); //address constant vip6Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); address constant vip7Addr = address(0xbE6DFD74AF0848b9cf6C6DFBc8bb24d2920e6aDe); address constant vip8Addr = address(0x5b9347799602D0164DF3926c10f237543eaa5b9F); address constant vip9Addr = address(0xa2221dE49E4085Be8098d1A8B4538734ce4977C7); address constant vip10Addr = address(0xAc1c0B39F3A1450E53BA0dA1bCAB5D9572DCed57); address constant vip11Addr = address(0x7721a0C6eb2F2a056C48D107d0a2C4Cff261e98c); //address constant vip11Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); constructor(address addressM_) public{ } function initVipPlay() internal{ } modifier notContract(address _addr){ } function joinGame(address parentAddr) public payable notContract(msg.sender){ } function withdraw() public{ //check ADC uint256 pid = plyrID[msg.sender]; uint256 bunlers = 0; //if(pid > 11){ require(<FILL_ME>) //} require(mainPoolWithdrawBalance[RID]>0,"pool not withdraw balance"); if(RID > 1 && !plyr[RID-1][pid].isAlreadGetIns){ //check last round if(luckPID[RID-1][pid]&& insePoolBalance[RID-1] > 0 ){ if(pid == round[RID-1].plyInList[round[RID-1].fritInsePoint]){ bunlers = round[RID-1].fritInseAmount; insePoolBalance[RID-1] -= bunlers; }else{ bunlers = plyr[RID-1][pid].ticketInCost*2; if(bunlers > insePoolBalance[RID-1]){ insePoolBalance[RID-1] = 0; bunlers = insePoolBalance[RID-1] ; }else{ insePoolBalance[RID-1] -= bunlers; } } mainPoolBalance[RID] -= bunlers; plyr[RID-1][pid].isAlreadGetIns = true; plyLucklyAmount[RID-1][pid] = bunlers; } }/*else{ require(plyWithdrawBalance[RID][pid] <= plyBalance[RID][pid],"not enought balance can withdraw"); }*/ uint256 wdBalance; if(plyr[RID][pid].totalSettled>plyWithdrawBalance[RID][pid] ){ wdBalance = plyr[RID][pid].totalSettled-plyWithdrawBalance[RID][pid] ; } if(bunlers == 0){ require(wdBalance > 0,"not enought balance can withdraw"); } uint256 totalWdBal = wdBalance + bunlers; //wdBalance += bunlers; if(totalWdBal > mainPoolWithdrawBalance[RID]){ totalWdBal = mainPoolWithdrawBalance[RID]; } uint256 disAmount = tickect.calDeductionADC(totalWdBal,false); require(adcERC20.balanceOf(msg.sender)>disAmount,"not adc to buy out tikcet"); adcERC20.distroy(msg.sender,disAmount); playDistroyADC[pid] += disAmount; totalDistroyADC += disAmount; if(totalWdBal >= mainPoolWithdrawBalance[RID]){ mainPoolWithdrawBalance[RID] = 0; plyr[RID][pid].withdrawAmount += mainPoolWithdrawBalance[RID]; alreadyWithDrawBal[RID] += mainPoolWithdrawBalance[RID]; msg.sender.transfer(mainPoolWithdrawBalance[RID]); }else{ mainPoolWithdrawBalance[RID] -= totalWdBal; plyr[RID][pid].withdrawAmount += wdBalance; alreadyWithDrawBal[RID] += totalWdBal; msg.sender.transfer(totalWdBal); } plyWithdrawBalance[RID][pid] += wdBalance; plyr[RID][pid].staticIncome = 0; plyr[RID][pid].dynamicIncome = 0; plyr[RID][pid].stepIncome = 0; ambRewardBalance[RID][pid] = 0; plydV6Income[RID][pid] = 0; } // settlement Static income by web function settlementStatic() public { } function calcDynamic(uint256 plyid_,uint256 staticIncome_) internal{ } function setAmbFlag(address ply_) public{ } //ambassador function getPlayerInfo(address ply_,uint256 rid_) public view returns( uint256 stIncome_, uint256 dtIncome_, uint256 stepIncome_, uint256 ambIncome_, uint256 doubV6Income_, uint256 totoalIncome_, uint256 withdrawAmount_, uint256 ticketIn_, uint256 canWithdrawAmount_, uint256 startTime_, uint256 liveRountAmount_) { } function getPlayerRelship(address ply_) public view returns( uint256 sonNumber_, uint256 allNumber_, uint256 curLevel_, bool isamb_, uint256 bigPotBalance_, uint256 smailPotBalance_, bool isDoubleV6_, uint256 distroyADC_) { } function getPoolInfo(uint256 rid_) public view returns( uint256 totalInBalance_, // all in balanace uint256 totalDivBalance_, // Dividend pool balance uint256 totalInsBalance_,//Insurance pool balance uint256 totalPlayers_, uint256 totalDisADC_) { } function getRID() public view returns(uint256 rid_){ } function activeParent(uint256 sonID_,uint256 parentPid_,uint256 value_) internal{ } function checkTicket(address payable ply_,uint256 value_) internal returns(bool){ } function setRoundInfo(uint256 plyID_) internal{ } function calcEarn(uint256 plyID_,uint256 value_) internal{ } function findParentByFor(uint256 plyID_,uint256 value_) internal{ } function calcStepByList(uint256 stepNum_,uint256[] memory stepPlyerList,uint8 biggestNodeLevel,uint256 value_) internal{ } function setAmbRewardBalance(uint256 pid_,uint256 value_) internal{ } function setRelationship(uint256 sonID_,uint256 plyID_,uint256 value_) internal{ } function calcS_T(uint256 lastTime_,uint256 value_) internal view returns(uint256 _earnAmount){ } function calcStepIncome(uint256 pid_,uint256 value_,uint8 dividendAccount_) public{ } function startNewRount() internal { } function initVip(address ply_) internal{ } function initVIPInfo(address ply_,uint256 pid_ ,uint256 parentid_) internal{ } function newRoundVIP() internal{ } }
plyr[RID][pid].isActive,"ply not active"
33,186
plyr[RID][pid].isActive
"pool not withdraw balance"
pragma solidity 0.5.7; import "./SafeMath.sol"; import "./AddrMInterface.sol"; interface TickectInerface{ function calDeductionADC(uint256 _value,bool isIn_) external returns(uint256 disADC_); } interface ERC20 { function balanceOf(address) external view returns (uint256); function distroy(address _owner,uint256 _value) external; } library gameDataSet{ struct PlyRelationship{ uint256 parentPID; //parent PID uint256 topPID; uint256 sonNumber; uint256 bigPotSonPID; // big pot son ID uint256 totalRecmdplys; // total recommanded players uint256 totalRecmdAmount; // total Recommended ETH without himself uint8 nodeLevel; // this is node level for V1-V6 //mapping(uint256 => uint256) sonPIDList; // son number -> son PID list mapping(uint256 => bool) sonPIDListMap; //son PID list mapping mapping(uint256 => uint256) sonTotalBalance; // PID-> total balance } struct Player{ //uint256 pID; uint256 ticketInCost; // how many eth can join uint256 withdrawAmount; // how many eth can join uint256 startTime; // join the game time uint256 totalSettled; // rturn funds uint256 staticIncome; uint256 lastCalcSITime; // last Calc staticIncome Time //uint256 lastCalcDITime; // last Calc dynamicIncome Time uint256 dynamicIncome; // last Calc dynamicIncome uint256 stepIncome; bool isActive; // 1 mean is 10eth,2 have new one son,3, bool isAlreadGetIns;// already get insePoolBalance income; } struct Round{ uint256 rID; //Round ID uint256 rStartTime; //Round start ID uint256 rPlys; // new round players uint256 lastPID; // last Player ID pID uint256 totalInseAmount; // uint256 fritInsePoint; uint256 fritInseAmount; uint256[] plyInList; } } contract MainPool{ using SafeMath for *; //address manager AddrMInterface addrM ; TickectInerface tickect; ERC20 adcERC20; // pool mapping(uint256 => uint256) public allInBalance; mapping(uint256 => uint256) public mainPoolLockBal; // lock balance do not sub mapping(uint256 => uint256) public mainPoolBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public mainPoolWithdrawBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public alreadyWithDrawBal; // RID -> balance total Main pool balance mapping(uint256 => uint256) public insePoolBalance; // total insurance pool Banacle uint256 public mainPoolSTime ; uint256 public totalDistroyADC; uint256 public constant oneDay = 86400 seconds ; //node level mapping(uint8 => uint256) private nlThdAmount; // node level threshold amount mapping(uint8 => uint8) private nlIncome; // node level threshold amount mapping(uint256 => uint256 ) private doubleV6PID; // id -> pID ,is start is 1 ; mapping(uint256 => bool ) private isDoubleV6; // PID -> TRUE ,is start is 1 ; mapping(uint256 => mapping(uint256 => uint256 )) private plydV6Income; // rid -> pid->balance ,is start is 1 ; uint256 totalV6Number; // Round uint256 public RID; mapping(uint256 => gameDataSet.Round) public round; // RID => round Info mapping(uint256 => mapping(uint256=>bool)) public luckPID; // Player uint256 lastPID; mapping(uint256 => gameDataSet.PlyRelationship) public plyRShip; mapping(uint256 => mapping(uint256 => gameDataSet.Player)) public plyr; // rid-> pid-> player mapping(address => uint256) public plyrID; // address -> pid-> playerID mapping(uint256 => address) private plyrAddr; // pid -> addr-> playerID //mapping(uint256 =>mapping(uint256 => uint256)) public plyBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) private plyWithdrawBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) public playBiggertReward; // player total can without balance mapping(uint256 =>uint256) private playDistroyADC; // PID-ADC balance player total can without balance mapping(address=>bool) private vipPly; mapping(uint256=>bool) private vipPlayerID; mapping(uint256=>mapping(uint256 => uint256)) public plyLucklyAmount; //rid-pid-amount // ambassador mapping(address => bool) public ambassadorList; //addr-true-BOOL //uint256[] ambRewardList;// PID list mapping(uint256=>bool) private ambRewardMap; //mapping(uint256=>uint256) ambRewardIdx; mapping(uint256 => mapping(uint256=>uint256)) public ambRewardBalance; //vip address constant vip1Addr = address(0x953ad059b61aA4A23fa48d5eca617D4920E3343e); //address constant vip1Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); //address constant vip2Addr = address(0x6bE9780954580FCC268944e9D6271B3Dfc886997); address constant vip2Addr = address(0xfbcB561D76a622341E6e537a17c5C17af33c4628); address constant vip3Addr = address(0x669f366427ea8184FdCDCda6D6201a6bAAf9b156); address constant vip4Addr = address(0xBcA44B04e10e04b7FeD7F262cAd70A683D753981); address constant vip5Addr = address(0x0D3c20D9102200242398dE26fdF09F29f435421b); address constant vip6Addr = address(0xbb3c82CD454911F140B68FE2E67504af9A2b5D16); //address constant vip6Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); address constant vip7Addr = address(0xbE6DFD74AF0848b9cf6C6DFBc8bb24d2920e6aDe); address constant vip8Addr = address(0x5b9347799602D0164DF3926c10f237543eaa5b9F); address constant vip9Addr = address(0xa2221dE49E4085Be8098d1A8B4538734ce4977C7); address constant vip10Addr = address(0xAc1c0B39F3A1450E53BA0dA1bCAB5D9572DCed57); address constant vip11Addr = address(0x7721a0C6eb2F2a056C48D107d0a2C4Cff261e98c); //address constant vip11Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); constructor(address addressM_) public{ } function initVipPlay() internal{ } modifier notContract(address _addr){ } function joinGame(address parentAddr) public payable notContract(msg.sender){ } function withdraw() public{ //check ADC uint256 pid = plyrID[msg.sender]; uint256 bunlers = 0; //if(pid > 11){ require(plyr[RID][pid].isActive,"ply not active"); //} require(<FILL_ME>) if(RID > 1 && !plyr[RID-1][pid].isAlreadGetIns){ //check last round if(luckPID[RID-1][pid]&& insePoolBalance[RID-1] > 0 ){ if(pid == round[RID-1].plyInList[round[RID-1].fritInsePoint]){ bunlers = round[RID-1].fritInseAmount; insePoolBalance[RID-1] -= bunlers; }else{ bunlers = plyr[RID-1][pid].ticketInCost*2; if(bunlers > insePoolBalance[RID-1]){ insePoolBalance[RID-1] = 0; bunlers = insePoolBalance[RID-1] ; }else{ insePoolBalance[RID-1] -= bunlers; } } mainPoolBalance[RID] -= bunlers; plyr[RID-1][pid].isAlreadGetIns = true; plyLucklyAmount[RID-1][pid] = bunlers; } }/*else{ require(plyWithdrawBalance[RID][pid] <= plyBalance[RID][pid],"not enought balance can withdraw"); }*/ uint256 wdBalance; if(plyr[RID][pid].totalSettled>plyWithdrawBalance[RID][pid] ){ wdBalance = plyr[RID][pid].totalSettled-plyWithdrawBalance[RID][pid] ; } if(bunlers == 0){ require(wdBalance > 0,"not enought balance can withdraw"); } uint256 totalWdBal = wdBalance + bunlers; //wdBalance += bunlers; if(totalWdBal > mainPoolWithdrawBalance[RID]){ totalWdBal = mainPoolWithdrawBalance[RID]; } uint256 disAmount = tickect.calDeductionADC(totalWdBal,false); require(adcERC20.balanceOf(msg.sender)>disAmount,"not adc to buy out tikcet"); adcERC20.distroy(msg.sender,disAmount); playDistroyADC[pid] += disAmount; totalDistroyADC += disAmount; if(totalWdBal >= mainPoolWithdrawBalance[RID]){ mainPoolWithdrawBalance[RID] = 0; plyr[RID][pid].withdrawAmount += mainPoolWithdrawBalance[RID]; alreadyWithDrawBal[RID] += mainPoolWithdrawBalance[RID]; msg.sender.transfer(mainPoolWithdrawBalance[RID]); }else{ mainPoolWithdrawBalance[RID] -= totalWdBal; plyr[RID][pid].withdrawAmount += wdBalance; alreadyWithDrawBal[RID] += totalWdBal; msg.sender.transfer(totalWdBal); } plyWithdrawBalance[RID][pid] += wdBalance; plyr[RID][pid].staticIncome = 0; plyr[RID][pid].dynamicIncome = 0; plyr[RID][pid].stepIncome = 0; ambRewardBalance[RID][pid] = 0; plydV6Income[RID][pid] = 0; } // settlement Static income by web function settlementStatic() public { } function calcDynamic(uint256 plyid_,uint256 staticIncome_) internal{ } function setAmbFlag(address ply_) public{ } //ambassador function getPlayerInfo(address ply_,uint256 rid_) public view returns( uint256 stIncome_, uint256 dtIncome_, uint256 stepIncome_, uint256 ambIncome_, uint256 doubV6Income_, uint256 totoalIncome_, uint256 withdrawAmount_, uint256 ticketIn_, uint256 canWithdrawAmount_, uint256 startTime_, uint256 liveRountAmount_) { } function getPlayerRelship(address ply_) public view returns( uint256 sonNumber_, uint256 allNumber_, uint256 curLevel_, bool isamb_, uint256 bigPotBalance_, uint256 smailPotBalance_, bool isDoubleV6_, uint256 distroyADC_) { } function getPoolInfo(uint256 rid_) public view returns( uint256 totalInBalance_, // all in balanace uint256 totalDivBalance_, // Dividend pool balance uint256 totalInsBalance_,//Insurance pool balance uint256 totalPlayers_, uint256 totalDisADC_) { } function getRID() public view returns(uint256 rid_){ } function activeParent(uint256 sonID_,uint256 parentPid_,uint256 value_) internal{ } function checkTicket(address payable ply_,uint256 value_) internal returns(bool){ } function setRoundInfo(uint256 plyID_) internal{ } function calcEarn(uint256 plyID_,uint256 value_) internal{ } function findParentByFor(uint256 plyID_,uint256 value_) internal{ } function calcStepByList(uint256 stepNum_,uint256[] memory stepPlyerList,uint8 biggestNodeLevel,uint256 value_) internal{ } function setAmbRewardBalance(uint256 pid_,uint256 value_) internal{ } function setRelationship(uint256 sonID_,uint256 plyID_,uint256 value_) internal{ } function calcS_T(uint256 lastTime_,uint256 value_) internal view returns(uint256 _earnAmount){ } function calcStepIncome(uint256 pid_,uint256 value_,uint8 dividendAccount_) public{ } function startNewRount() internal { } function initVip(address ply_) internal{ } function initVIPInfo(address ply_,uint256 pid_ ,uint256 parentid_) internal{ } function newRoundVIP() internal{ } }
mainPoolWithdrawBalance[RID]>0,"pool not withdraw balance"
33,186
mainPoolWithdrawBalance[RID]>0
"not adc to buy out tikcet"
pragma solidity 0.5.7; import "./SafeMath.sol"; import "./AddrMInterface.sol"; interface TickectInerface{ function calDeductionADC(uint256 _value,bool isIn_) external returns(uint256 disADC_); } interface ERC20 { function balanceOf(address) external view returns (uint256); function distroy(address _owner,uint256 _value) external; } library gameDataSet{ struct PlyRelationship{ uint256 parentPID; //parent PID uint256 topPID; uint256 sonNumber; uint256 bigPotSonPID; // big pot son ID uint256 totalRecmdplys; // total recommanded players uint256 totalRecmdAmount; // total Recommended ETH without himself uint8 nodeLevel; // this is node level for V1-V6 //mapping(uint256 => uint256) sonPIDList; // son number -> son PID list mapping(uint256 => bool) sonPIDListMap; //son PID list mapping mapping(uint256 => uint256) sonTotalBalance; // PID-> total balance } struct Player{ //uint256 pID; uint256 ticketInCost; // how many eth can join uint256 withdrawAmount; // how many eth can join uint256 startTime; // join the game time uint256 totalSettled; // rturn funds uint256 staticIncome; uint256 lastCalcSITime; // last Calc staticIncome Time //uint256 lastCalcDITime; // last Calc dynamicIncome Time uint256 dynamicIncome; // last Calc dynamicIncome uint256 stepIncome; bool isActive; // 1 mean is 10eth,2 have new one son,3, bool isAlreadGetIns;// already get insePoolBalance income; } struct Round{ uint256 rID; //Round ID uint256 rStartTime; //Round start ID uint256 rPlys; // new round players uint256 lastPID; // last Player ID pID uint256 totalInseAmount; // uint256 fritInsePoint; uint256 fritInseAmount; uint256[] plyInList; } } contract MainPool{ using SafeMath for *; //address manager AddrMInterface addrM ; TickectInerface tickect; ERC20 adcERC20; // pool mapping(uint256 => uint256) public allInBalance; mapping(uint256 => uint256) public mainPoolLockBal; // lock balance do not sub mapping(uint256 => uint256) public mainPoolBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public mainPoolWithdrawBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public alreadyWithDrawBal; // RID -> balance total Main pool balance mapping(uint256 => uint256) public insePoolBalance; // total insurance pool Banacle uint256 public mainPoolSTime ; uint256 public totalDistroyADC; uint256 public constant oneDay = 86400 seconds ; //node level mapping(uint8 => uint256) private nlThdAmount; // node level threshold amount mapping(uint8 => uint8) private nlIncome; // node level threshold amount mapping(uint256 => uint256 ) private doubleV6PID; // id -> pID ,is start is 1 ; mapping(uint256 => bool ) private isDoubleV6; // PID -> TRUE ,is start is 1 ; mapping(uint256 => mapping(uint256 => uint256 )) private plydV6Income; // rid -> pid->balance ,is start is 1 ; uint256 totalV6Number; // Round uint256 public RID; mapping(uint256 => gameDataSet.Round) public round; // RID => round Info mapping(uint256 => mapping(uint256=>bool)) public luckPID; // Player uint256 lastPID; mapping(uint256 => gameDataSet.PlyRelationship) public plyRShip; mapping(uint256 => mapping(uint256 => gameDataSet.Player)) public plyr; // rid-> pid-> player mapping(address => uint256) public plyrID; // address -> pid-> playerID mapping(uint256 => address) private plyrAddr; // pid -> addr-> playerID //mapping(uint256 =>mapping(uint256 => uint256)) public plyBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) private plyWithdrawBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) public playBiggertReward; // player total can without balance mapping(uint256 =>uint256) private playDistroyADC; // PID-ADC balance player total can without balance mapping(address=>bool) private vipPly; mapping(uint256=>bool) private vipPlayerID; mapping(uint256=>mapping(uint256 => uint256)) public plyLucklyAmount; //rid-pid-amount // ambassador mapping(address => bool) public ambassadorList; //addr-true-BOOL //uint256[] ambRewardList;// PID list mapping(uint256=>bool) private ambRewardMap; //mapping(uint256=>uint256) ambRewardIdx; mapping(uint256 => mapping(uint256=>uint256)) public ambRewardBalance; //vip address constant vip1Addr = address(0x953ad059b61aA4A23fa48d5eca617D4920E3343e); //address constant vip1Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); //address constant vip2Addr = address(0x6bE9780954580FCC268944e9D6271B3Dfc886997); address constant vip2Addr = address(0xfbcB561D76a622341E6e537a17c5C17af33c4628); address constant vip3Addr = address(0x669f366427ea8184FdCDCda6D6201a6bAAf9b156); address constant vip4Addr = address(0xBcA44B04e10e04b7FeD7F262cAd70A683D753981); address constant vip5Addr = address(0x0D3c20D9102200242398dE26fdF09F29f435421b); address constant vip6Addr = address(0xbb3c82CD454911F140B68FE2E67504af9A2b5D16); //address constant vip6Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); address constant vip7Addr = address(0xbE6DFD74AF0848b9cf6C6DFBc8bb24d2920e6aDe); address constant vip8Addr = address(0x5b9347799602D0164DF3926c10f237543eaa5b9F); address constant vip9Addr = address(0xa2221dE49E4085Be8098d1A8B4538734ce4977C7); address constant vip10Addr = address(0xAc1c0B39F3A1450E53BA0dA1bCAB5D9572DCed57); address constant vip11Addr = address(0x7721a0C6eb2F2a056C48D107d0a2C4Cff261e98c); //address constant vip11Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); constructor(address addressM_) public{ } function initVipPlay() internal{ } modifier notContract(address _addr){ } function joinGame(address parentAddr) public payable notContract(msg.sender){ } function withdraw() public{ //check ADC uint256 pid = plyrID[msg.sender]; uint256 bunlers = 0; //if(pid > 11){ require(plyr[RID][pid].isActive,"ply not active"); //} require(mainPoolWithdrawBalance[RID]>0,"pool not withdraw balance"); if(RID > 1 && !plyr[RID-1][pid].isAlreadGetIns){ //check last round if(luckPID[RID-1][pid]&& insePoolBalance[RID-1] > 0 ){ if(pid == round[RID-1].plyInList[round[RID-1].fritInsePoint]){ bunlers = round[RID-1].fritInseAmount; insePoolBalance[RID-1] -= bunlers; }else{ bunlers = plyr[RID-1][pid].ticketInCost*2; if(bunlers > insePoolBalance[RID-1]){ insePoolBalance[RID-1] = 0; bunlers = insePoolBalance[RID-1] ; }else{ insePoolBalance[RID-1] -= bunlers; } } mainPoolBalance[RID] -= bunlers; plyr[RID-1][pid].isAlreadGetIns = true; plyLucklyAmount[RID-1][pid] = bunlers; } }/*else{ require(plyWithdrawBalance[RID][pid] <= plyBalance[RID][pid],"not enought balance can withdraw"); }*/ uint256 wdBalance; if(plyr[RID][pid].totalSettled>plyWithdrawBalance[RID][pid] ){ wdBalance = plyr[RID][pid].totalSettled-plyWithdrawBalance[RID][pid] ; } if(bunlers == 0){ require(wdBalance > 0,"not enought balance can withdraw"); } uint256 totalWdBal = wdBalance + bunlers; //wdBalance += bunlers; if(totalWdBal > mainPoolWithdrawBalance[RID]){ totalWdBal = mainPoolWithdrawBalance[RID]; } uint256 disAmount = tickect.calDeductionADC(totalWdBal,false); require(<FILL_ME>) adcERC20.distroy(msg.sender,disAmount); playDistroyADC[pid] += disAmount; totalDistroyADC += disAmount; if(totalWdBal >= mainPoolWithdrawBalance[RID]){ mainPoolWithdrawBalance[RID] = 0; plyr[RID][pid].withdrawAmount += mainPoolWithdrawBalance[RID]; alreadyWithDrawBal[RID] += mainPoolWithdrawBalance[RID]; msg.sender.transfer(mainPoolWithdrawBalance[RID]); }else{ mainPoolWithdrawBalance[RID] -= totalWdBal; plyr[RID][pid].withdrawAmount += wdBalance; alreadyWithDrawBal[RID] += totalWdBal; msg.sender.transfer(totalWdBal); } plyWithdrawBalance[RID][pid] += wdBalance; plyr[RID][pid].staticIncome = 0; plyr[RID][pid].dynamicIncome = 0; plyr[RID][pid].stepIncome = 0; ambRewardBalance[RID][pid] = 0; plydV6Income[RID][pid] = 0; } // settlement Static income by web function settlementStatic() public { } function calcDynamic(uint256 plyid_,uint256 staticIncome_) internal{ } function setAmbFlag(address ply_) public{ } //ambassador function getPlayerInfo(address ply_,uint256 rid_) public view returns( uint256 stIncome_, uint256 dtIncome_, uint256 stepIncome_, uint256 ambIncome_, uint256 doubV6Income_, uint256 totoalIncome_, uint256 withdrawAmount_, uint256 ticketIn_, uint256 canWithdrawAmount_, uint256 startTime_, uint256 liveRountAmount_) { } function getPlayerRelship(address ply_) public view returns( uint256 sonNumber_, uint256 allNumber_, uint256 curLevel_, bool isamb_, uint256 bigPotBalance_, uint256 smailPotBalance_, bool isDoubleV6_, uint256 distroyADC_) { } function getPoolInfo(uint256 rid_) public view returns( uint256 totalInBalance_, // all in balanace uint256 totalDivBalance_, // Dividend pool balance uint256 totalInsBalance_,//Insurance pool balance uint256 totalPlayers_, uint256 totalDisADC_) { } function getRID() public view returns(uint256 rid_){ } function activeParent(uint256 sonID_,uint256 parentPid_,uint256 value_) internal{ } function checkTicket(address payable ply_,uint256 value_) internal returns(bool){ } function setRoundInfo(uint256 plyID_) internal{ } function calcEarn(uint256 plyID_,uint256 value_) internal{ } function findParentByFor(uint256 plyID_,uint256 value_) internal{ } function calcStepByList(uint256 stepNum_,uint256[] memory stepPlyerList,uint8 biggestNodeLevel,uint256 value_) internal{ } function setAmbRewardBalance(uint256 pid_,uint256 value_) internal{ } function setRelationship(uint256 sonID_,uint256 plyID_,uint256 value_) internal{ } function calcS_T(uint256 lastTime_,uint256 value_) internal view returns(uint256 _earnAmount){ } function calcStepIncome(uint256 pid_,uint256 value_,uint8 dividendAccount_) public{ } function startNewRount() internal { } function initVip(address ply_) internal{ } function initVIPInfo(address ply_,uint256 pid_ ,uint256 parentid_) internal{ } function newRoundVIP() internal{ } }
adcERC20.balanceOf(msg.sender)>disAmount,"not adc to buy out tikcet"
33,186
adcERC20.balanceOf(msg.sender)>disAmount
"not active"
pragma solidity 0.5.7; import "./SafeMath.sol"; import "./AddrMInterface.sol"; interface TickectInerface{ function calDeductionADC(uint256 _value,bool isIn_) external returns(uint256 disADC_); } interface ERC20 { function balanceOf(address) external view returns (uint256); function distroy(address _owner,uint256 _value) external; } library gameDataSet{ struct PlyRelationship{ uint256 parentPID; //parent PID uint256 topPID; uint256 sonNumber; uint256 bigPotSonPID; // big pot son ID uint256 totalRecmdplys; // total recommanded players uint256 totalRecmdAmount; // total Recommended ETH without himself uint8 nodeLevel; // this is node level for V1-V6 //mapping(uint256 => uint256) sonPIDList; // son number -> son PID list mapping(uint256 => bool) sonPIDListMap; //son PID list mapping mapping(uint256 => uint256) sonTotalBalance; // PID-> total balance } struct Player{ //uint256 pID; uint256 ticketInCost; // how many eth can join uint256 withdrawAmount; // how many eth can join uint256 startTime; // join the game time uint256 totalSettled; // rturn funds uint256 staticIncome; uint256 lastCalcSITime; // last Calc staticIncome Time //uint256 lastCalcDITime; // last Calc dynamicIncome Time uint256 dynamicIncome; // last Calc dynamicIncome uint256 stepIncome; bool isActive; // 1 mean is 10eth,2 have new one son,3, bool isAlreadGetIns;// already get insePoolBalance income; } struct Round{ uint256 rID; //Round ID uint256 rStartTime; //Round start ID uint256 rPlys; // new round players uint256 lastPID; // last Player ID pID uint256 totalInseAmount; // uint256 fritInsePoint; uint256 fritInseAmount; uint256[] plyInList; } } contract MainPool{ using SafeMath for *; //address manager AddrMInterface addrM ; TickectInerface tickect; ERC20 adcERC20; // pool mapping(uint256 => uint256) public allInBalance; mapping(uint256 => uint256) public mainPoolLockBal; // lock balance do not sub mapping(uint256 => uint256) public mainPoolBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public mainPoolWithdrawBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public alreadyWithDrawBal; // RID -> balance total Main pool balance mapping(uint256 => uint256) public insePoolBalance; // total insurance pool Banacle uint256 public mainPoolSTime ; uint256 public totalDistroyADC; uint256 public constant oneDay = 86400 seconds ; //node level mapping(uint8 => uint256) private nlThdAmount; // node level threshold amount mapping(uint8 => uint8) private nlIncome; // node level threshold amount mapping(uint256 => uint256 ) private doubleV6PID; // id -> pID ,is start is 1 ; mapping(uint256 => bool ) private isDoubleV6; // PID -> TRUE ,is start is 1 ; mapping(uint256 => mapping(uint256 => uint256 )) private plydV6Income; // rid -> pid->balance ,is start is 1 ; uint256 totalV6Number; // Round uint256 public RID; mapping(uint256 => gameDataSet.Round) public round; // RID => round Info mapping(uint256 => mapping(uint256=>bool)) public luckPID; // Player uint256 lastPID; mapping(uint256 => gameDataSet.PlyRelationship) public plyRShip; mapping(uint256 => mapping(uint256 => gameDataSet.Player)) public plyr; // rid-> pid-> player mapping(address => uint256) public plyrID; // address -> pid-> playerID mapping(uint256 => address) private plyrAddr; // pid -> addr-> playerID //mapping(uint256 =>mapping(uint256 => uint256)) public plyBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) private plyWithdrawBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) public playBiggertReward; // player total can without balance mapping(uint256 =>uint256) private playDistroyADC; // PID-ADC balance player total can without balance mapping(address=>bool) private vipPly; mapping(uint256=>bool) private vipPlayerID; mapping(uint256=>mapping(uint256 => uint256)) public plyLucklyAmount; //rid-pid-amount // ambassador mapping(address => bool) public ambassadorList; //addr-true-BOOL //uint256[] ambRewardList;// PID list mapping(uint256=>bool) private ambRewardMap; //mapping(uint256=>uint256) ambRewardIdx; mapping(uint256 => mapping(uint256=>uint256)) public ambRewardBalance; //vip address constant vip1Addr = address(0x953ad059b61aA4A23fa48d5eca617D4920E3343e); //address constant vip1Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); //address constant vip2Addr = address(0x6bE9780954580FCC268944e9D6271B3Dfc886997); address constant vip2Addr = address(0xfbcB561D76a622341E6e537a17c5C17af33c4628); address constant vip3Addr = address(0x669f366427ea8184FdCDCda6D6201a6bAAf9b156); address constant vip4Addr = address(0xBcA44B04e10e04b7FeD7F262cAd70A683D753981); address constant vip5Addr = address(0x0D3c20D9102200242398dE26fdF09F29f435421b); address constant vip6Addr = address(0xbb3c82CD454911F140B68FE2E67504af9A2b5D16); //address constant vip6Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); address constant vip7Addr = address(0xbE6DFD74AF0848b9cf6C6DFBc8bb24d2920e6aDe); address constant vip8Addr = address(0x5b9347799602D0164DF3926c10f237543eaa5b9F); address constant vip9Addr = address(0xa2221dE49E4085Be8098d1A8B4538734ce4977C7); address constant vip10Addr = address(0xAc1c0B39F3A1450E53BA0dA1bCAB5D9572DCed57); address constant vip11Addr = address(0x7721a0C6eb2F2a056C48D107d0a2C4Cff261e98c); //address constant vip11Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); constructor(address addressM_) public{ } function initVipPlay() internal{ } modifier notContract(address _addr){ } function joinGame(address parentAddr) public payable notContract(msg.sender){ } function withdraw() public{ } // settlement Static income by web function settlementStatic() public {// that is temp balance //uint256 reward; uint256 pid = plyrID[msg.sender]; uint256 temp = 0; gameDataSet.Player storage rPlyer = plyr[RID][pid]; //require(pid>11,"is vip"); require(<FILL_ME>) require(rPlyer.ticketInCost >0,"not charge"); require(rPlyer.totalSettled < playBiggertReward[RID][pid],"already to top reward"); require(now-rPlyer.lastCalcSITime > oneDay,"not enought one day"); if(rPlyer.lastCalcSITime == 0){ temp = calcS_T(rPlyer.startTime,rPlyer.ticketInCost); }else if(now - rPlyer.lastCalcSITime > oneDay){ temp = calcS_T(rPlyer.lastCalcSITime,rPlyer.ticketInCost); } //temp = temp*50; if(rPlyer.totalSettled + temp > playBiggertReward[RID][pid]){ temp = playBiggertReward[RID][pid] - rPlyer.totalSettled; } if(temp == 0){ return ; } if(mainPoolBalance[RID] > temp){ //plyBalance[RID][pid] += reward; rPlyer.staticIncome += temp; rPlyer.totalSettled += temp; mainPoolBalance[RID] -=temp; calcDynamic(pid,temp); }else{ // plyBalance[RID][pid] += mainPoolBalance[RID]; rPlyer.staticIncome += mainPoolBalance[RID]; rPlyer.totalSettled += mainPoolBalance[RID]; mainPoolBalance[RID] =0; // need start new rand startNewRount(); } rPlyer.lastCalcSITime = rPlyer.startTime + ((now - rPlyer.startTime) / oneDay) * oneDay; // remark the last calc income time } function calcDynamic(uint256 plyid_,uint256 staticIncome_) internal{ } function setAmbFlag(address ply_) public{ } //ambassador function getPlayerInfo(address ply_,uint256 rid_) public view returns( uint256 stIncome_, uint256 dtIncome_, uint256 stepIncome_, uint256 ambIncome_, uint256 doubV6Income_, uint256 totoalIncome_, uint256 withdrawAmount_, uint256 ticketIn_, uint256 canWithdrawAmount_, uint256 startTime_, uint256 liveRountAmount_) { } function getPlayerRelship(address ply_) public view returns( uint256 sonNumber_, uint256 allNumber_, uint256 curLevel_, bool isamb_, uint256 bigPotBalance_, uint256 smailPotBalance_, bool isDoubleV6_, uint256 distroyADC_) { } function getPoolInfo(uint256 rid_) public view returns( uint256 totalInBalance_, // all in balanace uint256 totalDivBalance_, // Dividend pool balance uint256 totalInsBalance_,//Insurance pool balance uint256 totalPlayers_, uint256 totalDisADC_) { } function getRID() public view returns(uint256 rid_){ } function activeParent(uint256 sonID_,uint256 parentPid_,uint256 value_) internal{ } function checkTicket(address payable ply_,uint256 value_) internal returns(bool){ } function setRoundInfo(uint256 plyID_) internal{ } function calcEarn(uint256 plyID_,uint256 value_) internal{ } function findParentByFor(uint256 plyID_,uint256 value_) internal{ } function calcStepByList(uint256 stepNum_,uint256[] memory stepPlyerList,uint8 biggestNodeLevel,uint256 value_) internal{ } function setAmbRewardBalance(uint256 pid_,uint256 value_) internal{ } function setRelationship(uint256 sonID_,uint256 plyID_,uint256 value_) internal{ } function calcS_T(uint256 lastTime_,uint256 value_) internal view returns(uint256 _earnAmount){ } function calcStepIncome(uint256 pid_,uint256 value_,uint8 dividendAccount_) public{ } function startNewRount() internal { } function initVip(address ply_) internal{ } function initVIPInfo(address ply_,uint256 pid_ ,uint256 parentid_) internal{ } function newRoundVIP() internal{ } }
rPlyer.isActive,"not active"
33,186
rPlyer.isActive
"not enought one day"
pragma solidity 0.5.7; import "./SafeMath.sol"; import "./AddrMInterface.sol"; interface TickectInerface{ function calDeductionADC(uint256 _value,bool isIn_) external returns(uint256 disADC_); } interface ERC20 { function balanceOf(address) external view returns (uint256); function distroy(address _owner,uint256 _value) external; } library gameDataSet{ struct PlyRelationship{ uint256 parentPID; //parent PID uint256 topPID; uint256 sonNumber; uint256 bigPotSonPID; // big pot son ID uint256 totalRecmdplys; // total recommanded players uint256 totalRecmdAmount; // total Recommended ETH without himself uint8 nodeLevel; // this is node level for V1-V6 //mapping(uint256 => uint256) sonPIDList; // son number -> son PID list mapping(uint256 => bool) sonPIDListMap; //son PID list mapping mapping(uint256 => uint256) sonTotalBalance; // PID-> total balance } struct Player{ //uint256 pID; uint256 ticketInCost; // how many eth can join uint256 withdrawAmount; // how many eth can join uint256 startTime; // join the game time uint256 totalSettled; // rturn funds uint256 staticIncome; uint256 lastCalcSITime; // last Calc staticIncome Time //uint256 lastCalcDITime; // last Calc dynamicIncome Time uint256 dynamicIncome; // last Calc dynamicIncome uint256 stepIncome; bool isActive; // 1 mean is 10eth,2 have new one son,3, bool isAlreadGetIns;// already get insePoolBalance income; } struct Round{ uint256 rID; //Round ID uint256 rStartTime; //Round start ID uint256 rPlys; // new round players uint256 lastPID; // last Player ID pID uint256 totalInseAmount; // uint256 fritInsePoint; uint256 fritInseAmount; uint256[] plyInList; } } contract MainPool{ using SafeMath for *; //address manager AddrMInterface addrM ; TickectInerface tickect; ERC20 adcERC20; // pool mapping(uint256 => uint256) public allInBalance; mapping(uint256 => uint256) public mainPoolLockBal; // lock balance do not sub mapping(uint256 => uint256) public mainPoolBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public mainPoolWithdrawBalance; // RID -> balance total Main pool balance mapping(uint256 => uint256) public alreadyWithDrawBal; // RID -> balance total Main pool balance mapping(uint256 => uint256) public insePoolBalance; // total insurance pool Banacle uint256 public mainPoolSTime ; uint256 public totalDistroyADC; uint256 public constant oneDay = 86400 seconds ; //node level mapping(uint8 => uint256) private nlThdAmount; // node level threshold amount mapping(uint8 => uint8) private nlIncome; // node level threshold amount mapping(uint256 => uint256 ) private doubleV6PID; // id -> pID ,is start is 1 ; mapping(uint256 => bool ) private isDoubleV6; // PID -> TRUE ,is start is 1 ; mapping(uint256 => mapping(uint256 => uint256 )) private plydV6Income; // rid -> pid->balance ,is start is 1 ; uint256 totalV6Number; // Round uint256 public RID; mapping(uint256 => gameDataSet.Round) public round; // RID => round Info mapping(uint256 => mapping(uint256=>bool)) public luckPID; // Player uint256 lastPID; mapping(uint256 => gameDataSet.PlyRelationship) public plyRShip; mapping(uint256 => mapping(uint256 => gameDataSet.Player)) public plyr; // rid-> pid-> player mapping(address => uint256) public plyrID; // address -> pid-> playerID mapping(uint256 => address) private plyrAddr; // pid -> addr-> playerID //mapping(uint256 =>mapping(uint256 => uint256)) public plyBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) private plyWithdrawBalance; // player total can without balance mapping(uint256 =>mapping(uint256 => uint256)) public playBiggertReward; // player total can without balance mapping(uint256 =>uint256) private playDistroyADC; // PID-ADC balance player total can without balance mapping(address=>bool) private vipPly; mapping(uint256=>bool) private vipPlayerID; mapping(uint256=>mapping(uint256 => uint256)) public plyLucklyAmount; //rid-pid-amount // ambassador mapping(address => bool) public ambassadorList; //addr-true-BOOL //uint256[] ambRewardList;// PID list mapping(uint256=>bool) private ambRewardMap; //mapping(uint256=>uint256) ambRewardIdx; mapping(uint256 => mapping(uint256=>uint256)) public ambRewardBalance; //vip address constant vip1Addr = address(0x953ad059b61aA4A23fa48d5eca617D4920E3343e); //address constant vip1Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); //address constant vip2Addr = address(0x6bE9780954580FCC268944e9D6271B3Dfc886997); address constant vip2Addr = address(0xfbcB561D76a622341E6e537a17c5C17af33c4628); address constant vip3Addr = address(0x669f366427ea8184FdCDCda6D6201a6bAAf9b156); address constant vip4Addr = address(0xBcA44B04e10e04b7FeD7F262cAd70A683D753981); address constant vip5Addr = address(0x0D3c20D9102200242398dE26fdF09F29f435421b); address constant vip6Addr = address(0xbb3c82CD454911F140B68FE2E67504af9A2b5D16); //address constant vip6Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); address constant vip7Addr = address(0xbE6DFD74AF0848b9cf6C6DFBc8bb24d2920e6aDe); address constant vip8Addr = address(0x5b9347799602D0164DF3926c10f237543eaa5b9F); address constant vip9Addr = address(0xa2221dE49E4085Be8098d1A8B4538734ce4977C7); address constant vip10Addr = address(0xAc1c0B39F3A1450E53BA0dA1bCAB5D9572DCed57); address constant vip11Addr = address(0x7721a0C6eb2F2a056C48D107d0a2C4Cff261e98c); //address constant vip11Addr = address(0xa9A2CbA5d5d16DE370375B42662F3272279B2b89); constructor(address addressM_) public{ } function initVipPlay() internal{ } modifier notContract(address _addr){ } function joinGame(address parentAddr) public payable notContract(msg.sender){ } function withdraw() public{ } // settlement Static income by web function settlementStatic() public {// that is temp balance //uint256 reward; uint256 pid = plyrID[msg.sender]; uint256 temp = 0; gameDataSet.Player storage rPlyer = plyr[RID][pid]; //require(pid>11,"is vip"); require(rPlyer.isActive,"not active"); require(rPlyer.ticketInCost >0,"not charge"); require(rPlyer.totalSettled < playBiggertReward[RID][pid],"already to top reward"); require(<FILL_ME>) if(rPlyer.lastCalcSITime == 0){ temp = calcS_T(rPlyer.startTime,rPlyer.ticketInCost); }else if(now - rPlyer.lastCalcSITime > oneDay){ temp = calcS_T(rPlyer.lastCalcSITime,rPlyer.ticketInCost); } //temp = temp*50; if(rPlyer.totalSettled + temp > playBiggertReward[RID][pid]){ temp = playBiggertReward[RID][pid] - rPlyer.totalSettled; } if(temp == 0){ return ; } if(mainPoolBalance[RID] > temp){ //plyBalance[RID][pid] += reward; rPlyer.staticIncome += temp; rPlyer.totalSettled += temp; mainPoolBalance[RID] -=temp; calcDynamic(pid,temp); }else{ // plyBalance[RID][pid] += mainPoolBalance[RID]; rPlyer.staticIncome += mainPoolBalance[RID]; rPlyer.totalSettled += mainPoolBalance[RID]; mainPoolBalance[RID] =0; // need start new rand startNewRount(); } rPlyer.lastCalcSITime = rPlyer.startTime + ((now - rPlyer.startTime) / oneDay) * oneDay; // remark the last calc income time } function calcDynamic(uint256 plyid_,uint256 staticIncome_) internal{ } function setAmbFlag(address ply_) public{ } //ambassador function getPlayerInfo(address ply_,uint256 rid_) public view returns( uint256 stIncome_, uint256 dtIncome_, uint256 stepIncome_, uint256 ambIncome_, uint256 doubV6Income_, uint256 totoalIncome_, uint256 withdrawAmount_, uint256 ticketIn_, uint256 canWithdrawAmount_, uint256 startTime_, uint256 liveRountAmount_) { } function getPlayerRelship(address ply_) public view returns( uint256 sonNumber_, uint256 allNumber_, uint256 curLevel_, bool isamb_, uint256 bigPotBalance_, uint256 smailPotBalance_, bool isDoubleV6_, uint256 distroyADC_) { } function getPoolInfo(uint256 rid_) public view returns( uint256 totalInBalance_, // all in balanace uint256 totalDivBalance_, // Dividend pool balance uint256 totalInsBalance_,//Insurance pool balance uint256 totalPlayers_, uint256 totalDisADC_) { } function getRID() public view returns(uint256 rid_){ } function activeParent(uint256 sonID_,uint256 parentPid_,uint256 value_) internal{ } function checkTicket(address payable ply_,uint256 value_) internal returns(bool){ } function setRoundInfo(uint256 plyID_) internal{ } function calcEarn(uint256 plyID_,uint256 value_) internal{ } function findParentByFor(uint256 plyID_,uint256 value_) internal{ } function calcStepByList(uint256 stepNum_,uint256[] memory stepPlyerList,uint8 biggestNodeLevel,uint256 value_) internal{ } function setAmbRewardBalance(uint256 pid_,uint256 value_) internal{ } function setRelationship(uint256 sonID_,uint256 plyID_,uint256 value_) internal{ } function calcS_T(uint256 lastTime_,uint256 value_) internal view returns(uint256 _earnAmount){ } function calcStepIncome(uint256 pid_,uint256 value_,uint8 dividendAccount_) public{ } function startNewRount() internal { } function initVip(address ply_) internal{ } function initVIPInfo(address ply_,uint256 pid_ ,uint256 parentid_) internal{ } function newRoundVIP() internal{ } }
now-rPlyer.lastCalcSITime>oneDay,"not enought one day"
33,186
now-rPlyer.lastCalcSITime>oneDay
null
pragma solidity ^0.4.13; library ECRecovery { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) internal pure returns (address) { } /** * toEthSignedMessageHash * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" * @dev and hash the result */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { } } contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { } function sub(uint x, uint y) internal pure returns (uint z) { } function mul(uint x, uint y) internal pure returns (uint z) { } function min(uint x, uint y) internal pure returns (uint z) { } function max(uint x, uint y) internal pure returns (uint z) { } function imin(int x, int y) internal pure returns (int z) { } function imax(int x, int y) internal pure returns (int z) { } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { } function rmul(uint x, uint y) internal pure returns (uint z) { } function wdiv(uint x, uint y) internal pure returns (uint z) { } function rdiv(uint x, uint y) internal pure returns (uint z) { } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { } } contract Htlc is DSMath { using ECRecovery for bytes32; // TYPES // ATL Authority timelocked contract struct Multisig { // Locked by authority approval (earlyResolve), time (timoutResolve) or conversion into an atomic swap address owner; // Owns ether deposited in multisig address authority; // Can approve earlyResolve of funds out of multisig uint deposit; // Amount deposited by owner in this multisig uint unlockTime; // Multisig expiration timestamp in seconds } struct AtomicSwap { // Locked by secret (regularTransfer) or time (reclaimExpiredSwaps) bytes32 msigId; // Corresponding multisigId address initiator; // Initiated this swap address beneficiary; // Beneficiary of this swap uint amount; // If zero then swap not active anymore uint fee; // Fee amount to be paid to multisig authority uint expirationTime; // Swap expiration timestamp in seconds bytes32 hashedSecret; // sha256(secret), hashed secret of swap initiator } // FIELDS address constant FEE_RECIPIENT = 0x478189a0aF876598C8a70Ce8896960500455A949; uint constant MAX_BATCH_ITERATIONS = 25; // Assumption block.gaslimit around 7500000 mapping (bytes32 => Multisig) public multisigs; mapping (bytes32 => AtomicSwap) public atomicswaps; mapping (bytes32 => bool) public isAntecedentHashedSecret; // EVENTS event MultisigInitialised(bytes32 msigId); event MultisigReparametrized(bytes32 msigId); event AtomicSwapInitialised(bytes32 swapId); // MODIFIERS // METHODS /** @notice Send ether out of this contract to multisig owner and update or delete entry in multisig mapping @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Spend this amount of ether */ function spendFromMultisig(bytes32 msigId, uint amount, address recipient) internal { } // PUBLIC METHODS /** @notice Initialise and reparametrize Multisig @dev Uses msg.value to fund Multisig @param authority Second multisig Authority. Usually this is the Exchange. @param unlockTime Lock Ether until unlockTime in seconds. @return msigId Unique (owner, authority, balance != 0) multisig identifier */ function initialiseMultisig(address authority, uint unlockTime) public payable returns (bytes32 msigId) { } /** @notice Inititate/extend multisig unlockTime and/or initiate/refund multisig deposit @dev Can increase deposit and/or unlockTime but not owner or authority @param msigId Unique (owner, authority, balance != 0) multisig identifier @param unlockTime Lock Ether until unlockTime in seconds. */ function reparametrizeMultisig(bytes32 msigId, uint unlockTime) public payable { require(<FILL_ME>) Multisig storage multisig = multisigs[msigId]; multisig.deposit = add(multisig.deposit, msg.value); assert(multisig.unlockTime <= unlockTime); // Can only increase unlockTime multisig.unlockTime = unlockTime; emit MultisigReparametrized(msigId); } /** @notice Withdraw ether from the multisig. Equivalent to EARLY_RESOLVE in Nimiq @dev the signature is generated using web3.eth.sign() over the unique msigId @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Return this amount from this contract to owner @param sig bytes signature of the not transaction sending Authority */ function earlyResolve(bytes32 msigId, uint amount, bytes sig) public { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to TIMEOUT_RESOLVE in Nimiq @param msigId Unique (owner, authority, balance != 0) multisig identifier @dev Only refunds owned multisig deposits */ function timeoutResolve(bytes32 msigId, uint amount) public { } /** @notice First or second stage of atomic swap. @param msigId Unique (owner, authority, balance != 0) multisig identifier @param beneficiary Beneficiary of this swap @param amount Convert this amount from multisig into swap @param fee Fee amount to be paid to multisig authority @param expirationTime Swap expiration timestamp in seconds; not more than 1 day from now @param hashedSecret sha256(secret), hashed secret of swap initiator @return swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function convertIntoHtlc(bytes32 msigId, address beneficiary, uint amount, uint fee, uint expirationTime, bytes32 hashedSecret) public returns (bytes32 swapId) { } /** @notice Batch execution of convertIntoHtlc() function */ function batchConvertIntoHtlc( bytes32[] msigIds, address[] beneficiaries, uint[] amounts, uint[] fees, uint[] expirationTimes, bytes32[] hashedSecrets ) public returns (bytes32[] swapId) { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to REGULAR_TRANSFER in Nimiq @dev Transfer swap amount to beneficiary of swap and fee to authority @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier @param secret Hashed secret of htlc swap */ function regularTransfer(bytes32 swapId, bytes32 secret) public { } /** @notice Batch exection of regularTransfer() function */ function batchRegularTransfers(bytes32[] swapIds, bytes32[] secrets) public { } /** @notice Reclaim an expired, non-empty swap into a multisig @dev Transfer swap amount to beneficiary of swap and fee to authority @param msigId Unique (owner, authority, balance != 0) multisig identifier to which deposit expired swaps @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function reclaimExpiredSwap(bytes32 msigId, bytes32 swapId) public { } /** @notice Batch exection of reclaimExpiredSwaps() function */ function batchReclaimExpiredSwaps(bytes32 msigId, bytes32[] swapIds) public { } }
multisigs[msigId].owner==msg.sender
33,201
multisigs[msigId].owner==msg.sender
null
pragma solidity ^0.4.13; library ECRecovery { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) internal pure returns (address) { } /** * toEthSignedMessageHash * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" * @dev and hash the result */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { } } contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { } function sub(uint x, uint y) internal pure returns (uint z) { } function mul(uint x, uint y) internal pure returns (uint z) { } function min(uint x, uint y) internal pure returns (uint z) { } function max(uint x, uint y) internal pure returns (uint z) { } function imin(int x, int y) internal pure returns (int z) { } function imax(int x, int y) internal pure returns (int z) { } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { } function rmul(uint x, uint y) internal pure returns (uint z) { } function wdiv(uint x, uint y) internal pure returns (uint z) { } function rdiv(uint x, uint y) internal pure returns (uint z) { } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { } } contract Htlc is DSMath { using ECRecovery for bytes32; // TYPES // ATL Authority timelocked contract struct Multisig { // Locked by authority approval (earlyResolve), time (timoutResolve) or conversion into an atomic swap address owner; // Owns ether deposited in multisig address authority; // Can approve earlyResolve of funds out of multisig uint deposit; // Amount deposited by owner in this multisig uint unlockTime; // Multisig expiration timestamp in seconds } struct AtomicSwap { // Locked by secret (regularTransfer) or time (reclaimExpiredSwaps) bytes32 msigId; // Corresponding multisigId address initiator; // Initiated this swap address beneficiary; // Beneficiary of this swap uint amount; // If zero then swap not active anymore uint fee; // Fee amount to be paid to multisig authority uint expirationTime; // Swap expiration timestamp in seconds bytes32 hashedSecret; // sha256(secret), hashed secret of swap initiator } // FIELDS address constant FEE_RECIPIENT = 0x478189a0aF876598C8a70Ce8896960500455A949; uint constant MAX_BATCH_ITERATIONS = 25; // Assumption block.gaslimit around 7500000 mapping (bytes32 => Multisig) public multisigs; mapping (bytes32 => AtomicSwap) public atomicswaps; mapping (bytes32 => bool) public isAntecedentHashedSecret; // EVENTS event MultisigInitialised(bytes32 msigId); event MultisigReparametrized(bytes32 msigId); event AtomicSwapInitialised(bytes32 swapId); // MODIFIERS // METHODS /** @notice Send ether out of this contract to multisig owner and update or delete entry in multisig mapping @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Spend this amount of ether */ function spendFromMultisig(bytes32 msigId, uint amount, address recipient) internal { } // PUBLIC METHODS /** @notice Initialise and reparametrize Multisig @dev Uses msg.value to fund Multisig @param authority Second multisig Authority. Usually this is the Exchange. @param unlockTime Lock Ether until unlockTime in seconds. @return msigId Unique (owner, authority, balance != 0) multisig identifier */ function initialiseMultisig(address authority, uint unlockTime) public payable returns (bytes32 msigId) { } /** @notice Inititate/extend multisig unlockTime and/or initiate/refund multisig deposit @dev Can increase deposit and/or unlockTime but not owner or authority @param msigId Unique (owner, authority, balance != 0) multisig identifier @param unlockTime Lock Ether until unlockTime in seconds. */ function reparametrizeMultisig(bytes32 msigId, uint unlockTime) public payable { } /** @notice Withdraw ether from the multisig. Equivalent to EARLY_RESOLVE in Nimiq @dev the signature is generated using web3.eth.sign() over the unique msigId @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Return this amount from this contract to owner @param sig bytes signature of the not transaction sending Authority */ function earlyResolve(bytes32 msigId, uint amount, bytes sig) public { // Require: msg.sender == (owner or authority) require(<FILL_ME>) // Require: valid signature from not msg.sending authority address otherAuthority = multisigs[msigId].owner == msg.sender ? multisigs[msigId].authority : multisigs[msigId].owner; require(otherAuthority == msigId.toEthSignedMessageHash().recover(sig)); // Return to owner spendFromMultisig(msigId, amount, multisigs[msigId].owner); } /** @notice Withdraw ether and delete the htlc swap. Equivalent to TIMEOUT_RESOLVE in Nimiq @param msigId Unique (owner, authority, balance != 0) multisig identifier @dev Only refunds owned multisig deposits */ function timeoutResolve(bytes32 msigId, uint amount) public { } /** @notice First or second stage of atomic swap. @param msigId Unique (owner, authority, balance != 0) multisig identifier @param beneficiary Beneficiary of this swap @param amount Convert this amount from multisig into swap @param fee Fee amount to be paid to multisig authority @param expirationTime Swap expiration timestamp in seconds; not more than 1 day from now @param hashedSecret sha256(secret), hashed secret of swap initiator @return swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function convertIntoHtlc(bytes32 msigId, address beneficiary, uint amount, uint fee, uint expirationTime, bytes32 hashedSecret) public returns (bytes32 swapId) { } /** @notice Batch execution of convertIntoHtlc() function */ function batchConvertIntoHtlc( bytes32[] msigIds, address[] beneficiaries, uint[] amounts, uint[] fees, uint[] expirationTimes, bytes32[] hashedSecrets ) public returns (bytes32[] swapId) { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to REGULAR_TRANSFER in Nimiq @dev Transfer swap amount to beneficiary of swap and fee to authority @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier @param secret Hashed secret of htlc swap */ function regularTransfer(bytes32 swapId, bytes32 secret) public { } /** @notice Batch exection of regularTransfer() function */ function batchRegularTransfers(bytes32[] swapIds, bytes32[] secrets) public { } /** @notice Reclaim an expired, non-empty swap into a multisig @dev Transfer swap amount to beneficiary of swap and fee to authority @param msigId Unique (owner, authority, balance != 0) multisig identifier to which deposit expired swaps @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function reclaimExpiredSwap(bytes32 msigId, bytes32 swapId) public { } /** @notice Batch exection of reclaimExpiredSwaps() function */ function batchReclaimExpiredSwaps(bytes32 msigId, bytes32[] swapIds) public { } }
multisigs[msigId].owner==msg.sender||multisigs[msigId].authority==msg.sender
33,201
multisigs[msigId].owner==msg.sender||multisigs[msigId].authority==msg.sender
null
pragma solidity ^0.4.13; library ECRecovery { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) internal pure returns (address) { } /** * toEthSignedMessageHash * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" * @dev and hash the result */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { } } contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { } function sub(uint x, uint y) internal pure returns (uint z) { } function mul(uint x, uint y) internal pure returns (uint z) { } function min(uint x, uint y) internal pure returns (uint z) { } function max(uint x, uint y) internal pure returns (uint z) { } function imin(int x, int y) internal pure returns (int z) { } function imax(int x, int y) internal pure returns (int z) { } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { } function rmul(uint x, uint y) internal pure returns (uint z) { } function wdiv(uint x, uint y) internal pure returns (uint z) { } function rdiv(uint x, uint y) internal pure returns (uint z) { } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { } } contract Htlc is DSMath { using ECRecovery for bytes32; // TYPES // ATL Authority timelocked contract struct Multisig { // Locked by authority approval (earlyResolve), time (timoutResolve) or conversion into an atomic swap address owner; // Owns ether deposited in multisig address authority; // Can approve earlyResolve of funds out of multisig uint deposit; // Amount deposited by owner in this multisig uint unlockTime; // Multisig expiration timestamp in seconds } struct AtomicSwap { // Locked by secret (regularTransfer) or time (reclaimExpiredSwaps) bytes32 msigId; // Corresponding multisigId address initiator; // Initiated this swap address beneficiary; // Beneficiary of this swap uint amount; // If zero then swap not active anymore uint fee; // Fee amount to be paid to multisig authority uint expirationTime; // Swap expiration timestamp in seconds bytes32 hashedSecret; // sha256(secret), hashed secret of swap initiator } // FIELDS address constant FEE_RECIPIENT = 0x478189a0aF876598C8a70Ce8896960500455A949; uint constant MAX_BATCH_ITERATIONS = 25; // Assumption block.gaslimit around 7500000 mapping (bytes32 => Multisig) public multisigs; mapping (bytes32 => AtomicSwap) public atomicswaps; mapping (bytes32 => bool) public isAntecedentHashedSecret; // EVENTS event MultisigInitialised(bytes32 msigId); event MultisigReparametrized(bytes32 msigId); event AtomicSwapInitialised(bytes32 swapId); // MODIFIERS // METHODS /** @notice Send ether out of this contract to multisig owner and update or delete entry in multisig mapping @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Spend this amount of ether */ function spendFromMultisig(bytes32 msigId, uint amount, address recipient) internal { } // PUBLIC METHODS /** @notice Initialise and reparametrize Multisig @dev Uses msg.value to fund Multisig @param authority Second multisig Authority. Usually this is the Exchange. @param unlockTime Lock Ether until unlockTime in seconds. @return msigId Unique (owner, authority, balance != 0) multisig identifier */ function initialiseMultisig(address authority, uint unlockTime) public payable returns (bytes32 msigId) { } /** @notice Inititate/extend multisig unlockTime and/or initiate/refund multisig deposit @dev Can increase deposit and/or unlockTime but not owner or authority @param msigId Unique (owner, authority, balance != 0) multisig identifier @param unlockTime Lock Ether until unlockTime in seconds. */ function reparametrizeMultisig(bytes32 msigId, uint unlockTime) public payable { } /** @notice Withdraw ether from the multisig. Equivalent to EARLY_RESOLVE in Nimiq @dev the signature is generated using web3.eth.sign() over the unique msigId @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Return this amount from this contract to owner @param sig bytes signature of the not transaction sending Authority */ function earlyResolve(bytes32 msigId, uint amount, bytes sig) public { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to TIMEOUT_RESOLVE in Nimiq @param msigId Unique (owner, authority, balance != 0) multisig identifier @dev Only refunds owned multisig deposits */ function timeoutResolve(bytes32 msigId, uint amount) public { } /** @notice First or second stage of atomic swap. @param msigId Unique (owner, authority, balance != 0) multisig identifier @param beneficiary Beneficiary of this swap @param amount Convert this amount from multisig into swap @param fee Fee amount to be paid to multisig authority @param expirationTime Swap expiration timestamp in seconds; not more than 1 day from now @param hashedSecret sha256(secret), hashed secret of swap initiator @return swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function convertIntoHtlc(bytes32 msigId, address beneficiary, uint amount, uint fee, uint expirationTime, bytes32 hashedSecret) public returns (bytes32 swapId) { // Require owner with sufficient deposit require(multisigs[msigId].owner == msg.sender); require(<FILL_ME>) // Checks for underflow require( now <= expirationTime && expirationTime <= min(now + 1 days, multisigs[msigId].unlockTime) ); // Not more than 1 day or unlockTime require(amount > 0); // Non-empty amount as definition for active swap require(!isAntecedentHashedSecret[hashedSecret]); isAntecedentHashedSecret[hashedSecret] = true; // Account in multisig balance multisigs[msigId].deposit = sub(multisigs[msigId].deposit, add(amount, fee)); // Create swap identifier swapId = keccak256( msigId, msg.sender, beneficiary, amount, fee, expirationTime, hashedSecret ); emit AtomicSwapInitialised(swapId); // Create swap AtomicSwap storage swap = atomicswaps[swapId]; swap.msigId = msigId; swap.initiator = msg.sender; swap.beneficiary = beneficiary; swap.amount = amount; swap.fee = fee; swap.expirationTime = expirationTime; swap.hashedSecret = hashedSecret; // Transfer fee to fee recipient FEE_RECIPIENT.transfer(fee); } /** @notice Batch execution of convertIntoHtlc() function */ function batchConvertIntoHtlc( bytes32[] msigIds, address[] beneficiaries, uint[] amounts, uint[] fees, uint[] expirationTimes, bytes32[] hashedSecrets ) public returns (bytes32[] swapId) { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to REGULAR_TRANSFER in Nimiq @dev Transfer swap amount to beneficiary of swap and fee to authority @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier @param secret Hashed secret of htlc swap */ function regularTransfer(bytes32 swapId, bytes32 secret) public { } /** @notice Batch exection of regularTransfer() function */ function batchRegularTransfers(bytes32[] swapIds, bytes32[] secrets) public { } /** @notice Reclaim an expired, non-empty swap into a multisig @dev Transfer swap amount to beneficiary of swap and fee to authority @param msigId Unique (owner, authority, balance != 0) multisig identifier to which deposit expired swaps @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function reclaimExpiredSwap(bytes32 msigId, bytes32 swapId) public { } /** @notice Batch exection of reclaimExpiredSwaps() function */ function batchReclaimExpiredSwaps(bytes32 msigId, bytes32[] swapIds) public { } }
multisigs[msigId].deposit>=amount+fee
33,201
multisigs[msigId].deposit>=amount+fee
null
pragma solidity ^0.4.13; library ECRecovery { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) internal pure returns (address) { } /** * toEthSignedMessageHash * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" * @dev and hash the result */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { } } contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { } function sub(uint x, uint y) internal pure returns (uint z) { } function mul(uint x, uint y) internal pure returns (uint z) { } function min(uint x, uint y) internal pure returns (uint z) { } function max(uint x, uint y) internal pure returns (uint z) { } function imin(int x, int y) internal pure returns (int z) { } function imax(int x, int y) internal pure returns (int z) { } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { } function rmul(uint x, uint y) internal pure returns (uint z) { } function wdiv(uint x, uint y) internal pure returns (uint z) { } function rdiv(uint x, uint y) internal pure returns (uint z) { } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { } } contract Htlc is DSMath { using ECRecovery for bytes32; // TYPES // ATL Authority timelocked contract struct Multisig { // Locked by authority approval (earlyResolve), time (timoutResolve) or conversion into an atomic swap address owner; // Owns ether deposited in multisig address authority; // Can approve earlyResolve of funds out of multisig uint deposit; // Amount deposited by owner in this multisig uint unlockTime; // Multisig expiration timestamp in seconds } struct AtomicSwap { // Locked by secret (regularTransfer) or time (reclaimExpiredSwaps) bytes32 msigId; // Corresponding multisigId address initiator; // Initiated this swap address beneficiary; // Beneficiary of this swap uint amount; // If zero then swap not active anymore uint fee; // Fee amount to be paid to multisig authority uint expirationTime; // Swap expiration timestamp in seconds bytes32 hashedSecret; // sha256(secret), hashed secret of swap initiator } // FIELDS address constant FEE_RECIPIENT = 0x478189a0aF876598C8a70Ce8896960500455A949; uint constant MAX_BATCH_ITERATIONS = 25; // Assumption block.gaslimit around 7500000 mapping (bytes32 => Multisig) public multisigs; mapping (bytes32 => AtomicSwap) public atomicswaps; mapping (bytes32 => bool) public isAntecedentHashedSecret; // EVENTS event MultisigInitialised(bytes32 msigId); event MultisigReparametrized(bytes32 msigId); event AtomicSwapInitialised(bytes32 swapId); // MODIFIERS // METHODS /** @notice Send ether out of this contract to multisig owner and update or delete entry in multisig mapping @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Spend this amount of ether */ function spendFromMultisig(bytes32 msigId, uint amount, address recipient) internal { } // PUBLIC METHODS /** @notice Initialise and reparametrize Multisig @dev Uses msg.value to fund Multisig @param authority Second multisig Authority. Usually this is the Exchange. @param unlockTime Lock Ether until unlockTime in seconds. @return msigId Unique (owner, authority, balance != 0) multisig identifier */ function initialiseMultisig(address authority, uint unlockTime) public payable returns (bytes32 msigId) { } /** @notice Inititate/extend multisig unlockTime and/or initiate/refund multisig deposit @dev Can increase deposit and/or unlockTime but not owner or authority @param msigId Unique (owner, authority, balance != 0) multisig identifier @param unlockTime Lock Ether until unlockTime in seconds. */ function reparametrizeMultisig(bytes32 msigId, uint unlockTime) public payable { } /** @notice Withdraw ether from the multisig. Equivalent to EARLY_RESOLVE in Nimiq @dev the signature is generated using web3.eth.sign() over the unique msigId @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Return this amount from this contract to owner @param sig bytes signature of the not transaction sending Authority */ function earlyResolve(bytes32 msigId, uint amount, bytes sig) public { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to TIMEOUT_RESOLVE in Nimiq @param msigId Unique (owner, authority, balance != 0) multisig identifier @dev Only refunds owned multisig deposits */ function timeoutResolve(bytes32 msigId, uint amount) public { } /** @notice First or second stage of atomic swap. @param msigId Unique (owner, authority, balance != 0) multisig identifier @param beneficiary Beneficiary of this swap @param amount Convert this amount from multisig into swap @param fee Fee amount to be paid to multisig authority @param expirationTime Swap expiration timestamp in seconds; not more than 1 day from now @param hashedSecret sha256(secret), hashed secret of swap initiator @return swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function convertIntoHtlc(bytes32 msigId, address beneficiary, uint amount, uint fee, uint expirationTime, bytes32 hashedSecret) public returns (bytes32 swapId) { // Require owner with sufficient deposit require(multisigs[msigId].owner == msg.sender); require(multisigs[msigId].deposit >= amount + fee); // Checks for underflow require( now <= expirationTime && expirationTime <= min(now + 1 days, multisigs[msigId].unlockTime) ); // Not more than 1 day or unlockTime require(amount > 0); // Non-empty amount as definition for active swap require(<FILL_ME>) isAntecedentHashedSecret[hashedSecret] = true; // Account in multisig balance multisigs[msigId].deposit = sub(multisigs[msigId].deposit, add(amount, fee)); // Create swap identifier swapId = keccak256( msigId, msg.sender, beneficiary, amount, fee, expirationTime, hashedSecret ); emit AtomicSwapInitialised(swapId); // Create swap AtomicSwap storage swap = atomicswaps[swapId]; swap.msigId = msigId; swap.initiator = msg.sender; swap.beneficiary = beneficiary; swap.amount = amount; swap.fee = fee; swap.expirationTime = expirationTime; swap.hashedSecret = hashedSecret; // Transfer fee to fee recipient FEE_RECIPIENT.transfer(fee); } /** @notice Batch execution of convertIntoHtlc() function */ function batchConvertIntoHtlc( bytes32[] msigIds, address[] beneficiaries, uint[] amounts, uint[] fees, uint[] expirationTimes, bytes32[] hashedSecrets ) public returns (bytes32[] swapId) { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to REGULAR_TRANSFER in Nimiq @dev Transfer swap amount to beneficiary of swap and fee to authority @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier @param secret Hashed secret of htlc swap */ function regularTransfer(bytes32 swapId, bytes32 secret) public { } /** @notice Batch exection of regularTransfer() function */ function batchRegularTransfers(bytes32[] swapIds, bytes32[] secrets) public { } /** @notice Reclaim an expired, non-empty swap into a multisig @dev Transfer swap amount to beneficiary of swap and fee to authority @param msigId Unique (owner, authority, balance != 0) multisig identifier to which deposit expired swaps @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function reclaimExpiredSwap(bytes32 msigId, bytes32 swapId) public { } /** @notice Batch exection of reclaimExpiredSwaps() function */ function batchReclaimExpiredSwaps(bytes32 msigId, bytes32[] swapIds) public { } }
!isAntecedentHashedSecret[hashedSecret]
33,201
!isAntecedentHashedSecret[hashedSecret]
null
pragma solidity ^0.4.13; library ECRecovery { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) internal pure returns (address) { } /** * toEthSignedMessageHash * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" * @dev and hash the result */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { } } contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { } function sub(uint x, uint y) internal pure returns (uint z) { } function mul(uint x, uint y) internal pure returns (uint z) { } function min(uint x, uint y) internal pure returns (uint z) { } function max(uint x, uint y) internal pure returns (uint z) { } function imin(int x, int y) internal pure returns (int z) { } function imax(int x, int y) internal pure returns (int z) { } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { } function rmul(uint x, uint y) internal pure returns (uint z) { } function wdiv(uint x, uint y) internal pure returns (uint z) { } function rdiv(uint x, uint y) internal pure returns (uint z) { } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { } } contract Htlc is DSMath { using ECRecovery for bytes32; // TYPES // ATL Authority timelocked contract struct Multisig { // Locked by authority approval (earlyResolve), time (timoutResolve) or conversion into an atomic swap address owner; // Owns ether deposited in multisig address authority; // Can approve earlyResolve of funds out of multisig uint deposit; // Amount deposited by owner in this multisig uint unlockTime; // Multisig expiration timestamp in seconds } struct AtomicSwap { // Locked by secret (regularTransfer) or time (reclaimExpiredSwaps) bytes32 msigId; // Corresponding multisigId address initiator; // Initiated this swap address beneficiary; // Beneficiary of this swap uint amount; // If zero then swap not active anymore uint fee; // Fee amount to be paid to multisig authority uint expirationTime; // Swap expiration timestamp in seconds bytes32 hashedSecret; // sha256(secret), hashed secret of swap initiator } // FIELDS address constant FEE_RECIPIENT = 0x478189a0aF876598C8a70Ce8896960500455A949; uint constant MAX_BATCH_ITERATIONS = 25; // Assumption block.gaslimit around 7500000 mapping (bytes32 => Multisig) public multisigs; mapping (bytes32 => AtomicSwap) public atomicswaps; mapping (bytes32 => bool) public isAntecedentHashedSecret; // EVENTS event MultisigInitialised(bytes32 msigId); event MultisigReparametrized(bytes32 msigId); event AtomicSwapInitialised(bytes32 swapId); // MODIFIERS // METHODS /** @notice Send ether out of this contract to multisig owner and update or delete entry in multisig mapping @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Spend this amount of ether */ function spendFromMultisig(bytes32 msigId, uint amount, address recipient) internal { } // PUBLIC METHODS /** @notice Initialise and reparametrize Multisig @dev Uses msg.value to fund Multisig @param authority Second multisig Authority. Usually this is the Exchange. @param unlockTime Lock Ether until unlockTime in seconds. @return msigId Unique (owner, authority, balance != 0) multisig identifier */ function initialiseMultisig(address authority, uint unlockTime) public payable returns (bytes32 msigId) { } /** @notice Inititate/extend multisig unlockTime and/or initiate/refund multisig deposit @dev Can increase deposit and/or unlockTime but not owner or authority @param msigId Unique (owner, authority, balance != 0) multisig identifier @param unlockTime Lock Ether until unlockTime in seconds. */ function reparametrizeMultisig(bytes32 msigId, uint unlockTime) public payable { } /** @notice Withdraw ether from the multisig. Equivalent to EARLY_RESOLVE in Nimiq @dev the signature is generated using web3.eth.sign() over the unique msigId @param msigId Unique (owner, authority, balance != 0) multisig identifier @param amount Return this amount from this contract to owner @param sig bytes signature of the not transaction sending Authority */ function earlyResolve(bytes32 msigId, uint amount, bytes sig) public { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to TIMEOUT_RESOLVE in Nimiq @param msigId Unique (owner, authority, balance != 0) multisig identifier @dev Only refunds owned multisig deposits */ function timeoutResolve(bytes32 msigId, uint amount) public { } /** @notice First or second stage of atomic swap. @param msigId Unique (owner, authority, balance != 0) multisig identifier @param beneficiary Beneficiary of this swap @param amount Convert this amount from multisig into swap @param fee Fee amount to be paid to multisig authority @param expirationTime Swap expiration timestamp in seconds; not more than 1 day from now @param hashedSecret sha256(secret), hashed secret of swap initiator @return swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function convertIntoHtlc(bytes32 msigId, address beneficiary, uint amount, uint fee, uint expirationTime, bytes32 hashedSecret) public returns (bytes32 swapId) { } /** @notice Batch execution of convertIntoHtlc() function */ function batchConvertIntoHtlc( bytes32[] msigIds, address[] beneficiaries, uint[] amounts, uint[] fees, uint[] expirationTimes, bytes32[] hashedSecrets ) public returns (bytes32[] swapId) { } /** @notice Withdraw ether and delete the htlc swap. Equivalent to REGULAR_TRANSFER in Nimiq @dev Transfer swap amount to beneficiary of swap and fee to authority @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier @param secret Hashed secret of htlc swap */ function regularTransfer(bytes32 swapId, bytes32 secret) public { // Require valid secret provided require(<FILL_ME>) uint amount = atomicswaps[swapId].amount; address beneficiary = atomicswaps[swapId].beneficiary; // Delete swap delete atomicswaps[swapId]; // Execute swap beneficiary.transfer(amount); } /** @notice Batch exection of regularTransfer() function */ function batchRegularTransfers(bytes32[] swapIds, bytes32[] secrets) public { } /** @notice Reclaim an expired, non-empty swap into a multisig @dev Transfer swap amount to beneficiary of swap and fee to authority @param msigId Unique (owner, authority, balance != 0) multisig identifier to which deposit expired swaps @param swapId Unique (initiator, beneficiary, amount, fee, expirationTime, hashedSecret) swap identifier */ function reclaimExpiredSwap(bytes32 msigId, bytes32 swapId) public { } /** @notice Batch exection of reclaimExpiredSwaps() function */ function batchReclaimExpiredSwaps(bytes32 msigId, bytes32[] swapIds) public { } }
sha256(secret)==atomicswaps[swapId].hashedSecret
33,201
sha256(secret)==atomicswaps[swapId].hashedSecret
"Invalid NFT"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; /** * @notice Airdrop contract for Refinable NFT Marketplace */ contract ERC1155Airdrop is Context, ReentrancyGuard { /// @notice ERC1155 NFT IERC1155 public token; IERC1155 public tokenV2; event AirdropContractDeployed(); event AirdropFinished( uint256 tokenId, address[] recipients ); /** * @dev Constructor Function */ constructor( IERC1155 _token, IERC1155 _tokenV2 ) public { require(<FILL_ME>) require(address(_tokenV2) != address(0), "Invalid NFT"); token = _token; tokenV2 = _tokenV2; emit AirdropContractDeployed(); } /** * @dev Owner of token can airdrop tokens to recipients * @param _tokenId id of the token * @param _recipients addresses of recipients */ function airdrop(IERC1155 _token, uint256 _tokenId, address[] memory _recipients) external nonReentrant { } }
address(_token)!=address(0),"Invalid NFT"
33,244
address(_token)!=address(0)
"Invalid NFT"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; /** * @notice Airdrop contract for Refinable NFT Marketplace */ contract ERC1155Airdrop is Context, ReentrancyGuard { /// @notice ERC1155 NFT IERC1155 public token; IERC1155 public tokenV2; event AirdropContractDeployed(); event AirdropFinished( uint256 tokenId, address[] recipients ); /** * @dev Constructor Function */ constructor( IERC1155 _token, IERC1155 _tokenV2 ) public { require(address(_token) != address(0), "Invalid NFT"); require(<FILL_ME>) token = _token; tokenV2 = _tokenV2; emit AirdropContractDeployed(); } /** * @dev Owner of token can airdrop tokens to recipients * @param _tokenId id of the token * @param _recipients addresses of recipients */ function airdrop(IERC1155 _token, uint256 _tokenId, address[] memory _recipients) external nonReentrant { } }
address(_tokenV2)!=address(0),"Invalid NFT"
33,244
address(_tokenV2)!=address(0)
"ERC1155Airdrop: Caller does not have amount of tokens"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; /** * @notice Airdrop contract for Refinable NFT Marketplace */ contract ERC1155Airdrop is Context, ReentrancyGuard { /// @notice ERC1155 NFT IERC1155 public token; IERC1155 public tokenV2; event AirdropContractDeployed(); event AirdropFinished( uint256 tokenId, address[] recipients ); /** * @dev Constructor Function */ constructor( IERC1155 _token, IERC1155 _tokenV2 ) public { } /** * @dev Owner of token can airdrop tokens to recipients * @param _tokenId id of the token * @param _recipients addresses of recipients */ function airdrop(IERC1155 _token, uint256 _tokenId, address[] memory _recipients) external nonReentrant { require( _token == token || _token == tokenV2, "ERC1155Airdrop: Token is not allowed" ); require(<FILL_ME>) require( _token.isApprovedForAll(_msgSender(), address(this)), "ERC1155Airdrop: Owner has not approved" ); for (uint256 i = 0; i < _recipients.length; i++) { _token.safeTransferFrom(_msgSender(), _recipients[i], _tokenId, 1, ""); } emit AirdropFinished(_tokenId, _recipients); } }
_token.balanceOf(_msgSender(),_tokenId)>=_recipients.length,"ERC1155Airdrop: Caller does not have amount of tokens"
33,244
_token.balanceOf(_msgSender(),_tokenId)>=_recipients.length
"ERC1155Airdrop: Owner has not approved"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; /** * @notice Airdrop contract for Refinable NFT Marketplace */ contract ERC1155Airdrop is Context, ReentrancyGuard { /// @notice ERC1155 NFT IERC1155 public token; IERC1155 public tokenV2; event AirdropContractDeployed(); event AirdropFinished( uint256 tokenId, address[] recipients ); /** * @dev Constructor Function */ constructor( IERC1155 _token, IERC1155 _tokenV2 ) public { } /** * @dev Owner of token can airdrop tokens to recipients * @param _tokenId id of the token * @param _recipients addresses of recipients */ function airdrop(IERC1155 _token, uint256 _tokenId, address[] memory _recipients) external nonReentrant { require( _token == token || _token == tokenV2, "ERC1155Airdrop: Token is not allowed" ); require( _token.balanceOf(_msgSender(), _tokenId) >= _recipients.length, "ERC1155Airdrop: Caller does not have amount of tokens" ); require(<FILL_ME>) for (uint256 i = 0; i < _recipients.length; i++) { _token.safeTransferFrom(_msgSender(), _recipients[i], _tokenId, 1, ""); } emit AirdropFinished(_tokenId, _recipients); } }
_token.isApprovedForAll(_msgSender(),address(this)),"ERC1155Airdrop: Owner has not approved"
33,244
_token.isApprovedForAll(_msgSender(),address(this))
"TradeTokenManager: Token is not added"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; import "../interfaces/ITokenManager.sol"; import "../roles/AdminRole.sol"; import "../tge/interfaces/IBEP20.sol"; contract TradeTokenManager is ITokenManager, AdminRole { struct TradeToken { string symbol; bool created; bool active; } /// @notice ERC20 Token address -> active boolean mapping(address => TradeToken) public tokens; modifier exist(address _token) { require(<FILL_ME>) _; } function addToken(address _erc20Token,string calldata _symbol, bool _active) onlyAdmin external { } function setToken(address _erc20Token, bool _active) onlyAdmin exist(_erc20Token) external override { } function removeToken(address _erc20Token) onlyAdmin exist(_erc20Token) external override { } function supportToken(address _erc20Token) exist(_erc20Token) external view override returns (bool) { } }
tokens[_token].created!=false,"TradeTokenManager: Token is not added"
33,251
tokens[_token].created!=false
"TradeTokenManager: Token already exist"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; import "../interfaces/ITokenManager.sol"; import "../roles/AdminRole.sol"; import "../tge/interfaces/IBEP20.sol"; contract TradeTokenManager is ITokenManager, AdminRole { struct TradeToken { string symbol; bool created; bool active; } /// @notice ERC20 Token address -> active boolean mapping(address => TradeToken) public tokens; modifier exist(address _token) { } function addToken(address _erc20Token,string calldata _symbol, bool _active) onlyAdmin external { require(_erc20Token != address(0), "TradeTokenManager: Cannot be zero address"); require(<FILL_ME>) require(IBEP20(_erc20Token).totalSupply() != 0, "TradeTokenManager: Token is not ERC20 standard"); tokens[_erc20Token] = TradeToken({ symbol: _symbol, created: true, active: _active }); } function setToken(address _erc20Token, bool _active) onlyAdmin exist(_erc20Token) external override { } function removeToken(address _erc20Token) onlyAdmin exist(_erc20Token) external override { } function supportToken(address _erc20Token) exist(_erc20Token) external view override returns (bool) { } }
tokens[_erc20Token].created==false,"TradeTokenManager: Token already exist"
33,251
tokens[_erc20Token].created==false
"TradeTokenManager: Token is not ERC20 standard"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; import "../interfaces/ITokenManager.sol"; import "../roles/AdminRole.sol"; import "../tge/interfaces/IBEP20.sol"; contract TradeTokenManager is ITokenManager, AdminRole { struct TradeToken { string symbol; bool created; bool active; } /// @notice ERC20 Token address -> active boolean mapping(address => TradeToken) public tokens; modifier exist(address _token) { } function addToken(address _erc20Token,string calldata _symbol, bool _active) onlyAdmin external { require(_erc20Token != address(0), "TradeTokenManager: Cannot be zero address"); require(tokens[_erc20Token].created == false, "TradeTokenManager: Token already exist"); require(<FILL_ME>) tokens[_erc20Token] = TradeToken({ symbol: _symbol, created: true, active: _active }); } function setToken(address _erc20Token, bool _active) onlyAdmin exist(_erc20Token) external override { } function removeToken(address _erc20Token) onlyAdmin exist(_erc20Token) external override { } function supportToken(address _erc20Token) exist(_erc20Token) external view override returns (bool) { } }
IBEP20(_erc20Token).totalSupply()!=0,"TradeTokenManager: Token is not ERC20 standard"
33,251
IBEP20(_erc20Token).totalSupply()!=0
"invalid signature"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "../ERC1155BaseV3.sol"; contract RefinableERC1155WhiteListedTokenV3 is ERC1155BaseV3 { using ECDSA for bytes32; address payable public defaultRoyaltyReceiver = address(0); uint256 public defaultRoyaltyReceiverBps = 0; /** * @dev Constructor Function * @param _name name of the token ex: Rarible * @param _symbol symbol of the token ex: RARI * @param _signer address of signer account * @param _contractURI URI of contract ex: https://api-mainnet.rarible.com/contractMetadata/{address} * @param _tokenURIPrefix token URI Prefix * @param _uri ex: https://ipfs.daonomic.com */ constructor( string memory _name, string memory _symbol, address _root, address _signer, string memory _contractURI, string memory _tokenURIPrefix, string memory _uri ) ERC1155BaseV3(_name, _symbol, _contractURI, _tokenURIPrefix, _uri) public { } function mint( uint256 _tokenId, bytes memory _signature, RoyaltyLibrary.RoyaltyShareDetails[] memory _royaltyShares, uint256 _supply, string memory _uri, uint256 _royaltyBps, RoyaltyLibrary.Strategy _royaltyStrategy, RoyaltyLibrary.RoyaltyShareDetails[] memory _primaryRoyaltyShares ) public onlyMinter { require(<FILL_ME>) RoyaltyLibrary.RoyaltyShareDetails[] memory customPrimaryRoyaltyShares = new RoyaltyLibrary.RoyaltyShareDetails[](1); if (defaultRoyaltyReceiver != address(0) && defaultRoyaltyReceiverBps != 0) { customPrimaryRoyaltyShares[0] = RoyaltyLibrary.RoyaltyShareDetails({ recipient : defaultRoyaltyReceiver, value : defaultRoyaltyReceiverBps }); } else { customPrimaryRoyaltyShares = _primaryRoyaltyShares; } _mint(_tokenId, _royaltyShares, _supply, _uri, _royaltyBps, _royaltyStrategy, customPrimaryRoyaltyShares); } function setDefaultRoyaltyReceiver(address payable _receiver) public onlyAdmin { } function setDefaultRoyaltyReceiverBps(uint256 _bps) public onlyAdmin { } }
hasRole(SIGNER_ROLE,keccak256(abi.encodePacked(address(this),_tokenId,_msgSender())).toEthSignedMessageHash().recover(_signature)),"invalid signature"
33,285
hasRole(SIGNER_ROLE,keccak256(abi.encodePacked(address(this),_tokenId,_msgSender())).toEthSignedMessageHash().recover(_signature))
null
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; import './tge/interfaces/IBEP20.sol'; contract Disperse { function disperseBNB( address payable[] calldata recipients, uint256[] calldata values ) external payable { } function disperseToken( IBEP20 token, address[] calldata recipients, uint256[] calldata values ) external { uint256 total = 0; for (uint256 i = 0; i < recipients.length; i++) total += values[i]; require(<FILL_ME>) for (uint256 i = 0; i < recipients.length; i++) require(token.transfer(recipients[i], values[i])); } function disperseTokenSimple( IBEP20 token, address[] calldata recipients, uint256[] calldata values ) external { } }
token.transferFrom(msg.sender,address(this),total)
33,303
token.transferFrom(msg.sender,address(this),total)
null
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; import './tge/interfaces/IBEP20.sol'; contract Disperse { function disperseBNB( address payable[] calldata recipients, uint256[] calldata values ) external payable { } function disperseToken( IBEP20 token, address[] calldata recipients, uint256[] calldata values ) external { uint256 total = 0; for (uint256 i = 0; i < recipients.length; i++) total += values[i]; require(token.transferFrom(msg.sender, address(this), total)); for (uint256 i = 0; i < recipients.length; i++) require(<FILL_ME>) } function disperseTokenSimple( IBEP20 token, address[] calldata recipients, uint256[] calldata values ) external { } }
token.transfer(recipients[i],values[i])
33,303
token.transfer(recipients[i],values[i])
null
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; import './tge/interfaces/IBEP20.sol'; contract Disperse { function disperseBNB( address payable[] calldata recipients, uint256[] calldata values ) external payable { } function disperseToken( IBEP20 token, address[] calldata recipients, uint256[] calldata values ) external { } function disperseTokenSimple( IBEP20 token, address[] calldata recipients, uint256[] calldata values ) external { for (uint256 i = 0; i < recipients.length; i++) require(<FILL_ME>) } }
token.transferFrom(msg.sender,recipients[i],values[i])
33,303
token.transferFrom(msg.sender,recipients[i],values[i])
"Ownable: caller is not the proxy"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../interfaces/IRefinableToken.sol"; import "../interfaces/IServiceFee.sol"; /** * @notice Service Fee contract for Refinable NFT Marketplace */ contract ServiceFee is AccessControl, IServiceFee { using Address for address; /// @notice service fee contract IRefinableToken public refinableTokenContract; bytes32 public constant PROXY_ROLE = keccak256("PROXY_ROLE"); /// @notice Service fee recipient address address payable public serviceFeeRecipient; event ServiceFeeRecipientChanged(address payable serviceFeeRecipient); event RefinableTokenContractUpdated(address refinableTokenContract); modifier onlyAdmin() { } modifier onlyProxy() { require(<FILL_ME>) _; } /** * @dev Constructor Function */ constructor() public { } /** * @notice Lets admin set the refinable token contract * @param _refinableTokenContract address of refinable token contract */ function setRefinableTokenContract(address _refinableTokenContract) onlyAdmin external override { } /** * @notice Admin can add proxy address * @param _proxyAddr address of proxy */ function addProxy(address _proxyAddr) onlyAdmin external override { } /** * @notice Admin can remove proxy address * @param _proxyAddr address of proxy */ function removeProxy(address _proxyAddr) onlyAdmin external override{ } /** * @notice Calculate the seller service fee in according to the business logic and returns it * @param _seller address of seller * @param _isSecondarySale sale is primary or secondary */ function getSellServiceFeeBps(address _seller, bool _isSecondarySale) external view onlyProxy override returns (uint256) { } /** * @notice Calculate the buyer service fee in according to the business logic and returns it * @param _buyer address of buyer */ function getBuyServiceFeeBps(address _buyer) onlyProxy external view override returns (uint256) { } /** * @notice Get service fee recipient address */ function getServiceFeeRecipient() onlyProxy external view override returns (address payable) { } /** * @notice Set service fee recipient address * @param _serviceFeeRecipient address of recipient */ function setServiceFeeRecipient(address payable _serviceFeeRecipient) onlyProxy external override { } }
hasRole(PROXY_ROLE,_msgSender()),"Ownable: caller is not the proxy"
33,308
hasRole(PROXY_ROLE,_msgSender())
"ServiceFee.addProxy: address is not a contract address"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../interfaces/IRefinableToken.sol"; import "../interfaces/IServiceFee.sol"; /** * @notice Service Fee contract for Refinable NFT Marketplace */ contract ServiceFee is AccessControl, IServiceFee { using Address for address; /// @notice service fee contract IRefinableToken public refinableTokenContract; bytes32 public constant PROXY_ROLE = keccak256("PROXY_ROLE"); /// @notice Service fee recipient address address payable public serviceFeeRecipient; event ServiceFeeRecipientChanged(address payable serviceFeeRecipient); event RefinableTokenContractUpdated(address refinableTokenContract); modifier onlyAdmin() { } modifier onlyProxy() { } /** * @dev Constructor Function */ constructor() public { } /** * @notice Lets admin set the refinable token contract * @param _refinableTokenContract address of refinable token contract */ function setRefinableTokenContract(address _refinableTokenContract) onlyAdmin external override { } /** * @notice Admin can add proxy address * @param _proxyAddr address of proxy */ function addProxy(address _proxyAddr) onlyAdmin external override { require(<FILL_ME>) grantRole(PROXY_ROLE, _proxyAddr); } /** * @notice Admin can remove proxy address * @param _proxyAddr address of proxy */ function removeProxy(address _proxyAddr) onlyAdmin external override{ } /** * @notice Calculate the seller service fee in according to the business logic and returns it * @param _seller address of seller * @param _isSecondarySale sale is primary or secondary */ function getSellServiceFeeBps(address _seller, bool _isSecondarySale) external view onlyProxy override returns (uint256) { } /** * @notice Calculate the buyer service fee in according to the business logic and returns it * @param _buyer address of buyer */ function getBuyServiceFeeBps(address _buyer) onlyProxy external view override returns (uint256) { } /** * @notice Get service fee recipient address */ function getServiceFeeRecipient() onlyProxy external view override returns (address payable) { } /** * @notice Set service fee recipient address * @param _serviceFeeRecipient address of recipient */ function setServiceFeeRecipient(address payable _serviceFeeRecipient) onlyProxy external override { } }
_proxyAddr.isContract(),"ServiceFee.addProxy: address is not a contract address"
33,308
_proxyAddr.isContract()
"Adding a claim needs to happen with the same claimer as before"
pragma solidity 0.4.24; /// @dev `Owned` is a base level contract that assigns an `owner` that can be /// later changed contract Owned { /// @dev `owner` is the only address that can call a function with this /// modifier modifier onlyOwner { } address public owner; /// @notice The Constructor assigns the message sender to be `owner` function Owned() public { } /// @notice `owner` can step down and assign some other address to this role /// @param _newOwner The address of the new owner. 0x0 can be used to create /// an unowned neutral vault, however that cannot be undone function changeOwner(address _newOwner) public onlyOwner { } } /** * @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) { } } contract Callable is Owned { //sender => _allowed mapping(address => bool) public callers; //modifiers modifier onlyCaller { } //management of the repositories function updateCaller(address _caller, bool allowed) public onlyOwner { } } contract EternalStorage is Callable { mapping(bytes32 => uint) uIntStorage; mapping(bytes32 => string) stringStorage; mapping(bytes32 => address) addressStorage; mapping(bytes32 => bytes) bytesStorage; mapping(bytes32 => bool) boolStorage; mapping(bytes32 => int) intStorage; // *** Getter Methods *** function getUint(bytes32 _key) external view returns (uint) { } function getString(bytes32 _key) external view returns (string) { } function getAddress(bytes32 _key) external view returns (address) { } function getBytes(bytes32 _key) external view returns (bytes) { } function getBool(bytes32 _key) external view returns (bool) { } function getInt(bytes32 _key) external view returns (int) { } // *** Setter Methods *** function setUint(bytes32 _key, uint _value) onlyCaller external { } function setString(bytes32 _key, string _value) onlyCaller external { } function setAddress(bytes32 _key, address _value) onlyCaller external { } function setBytes(bytes32 _key, bytes _value) onlyCaller external { } function setBool(bytes32 _key, bool _value) onlyCaller external { } function setInt(bytes32 _key, int _value) onlyCaller external { } // *** Delete Methods *** function deleteUint(bytes32 _key) onlyCaller external { } function deleteString(bytes32 _key) onlyCaller external { } function deleteAddress(bytes32 _key) onlyCaller external { } function deleteBytes(bytes32 _key) onlyCaller external { } function deleteBool(bytes32 _key) onlyCaller external { } function deleteInt(bytes32 _key) onlyCaller external { } } contract ClaimRepository is Callable { using SafeMath for uint256; EternalStorage public db; constructor(address _eternalStorage) public { } function addClaim(address _solverAddress, bytes32 _platform, string _platformId, string _solver, address _token, uint256 _requestBalance) public onlyCaller returns (bool) { if (db.getAddress(keccak256(abi.encodePacked("claims.solver_address", _platform, _platformId))) != address(0)) { require(<FILL_ME>) } else { db.setString(keccak256(abi.encodePacked("claims.solver", _platform, _platformId)), _solver); db.setAddress(keccak256(abi.encodePacked("claims.solver_address", _platform, _platformId)), _solverAddress); } uint tokenCount = db.getUint(keccak256(abi.encodePacked("claims.tokenCount", _platform, _platformId))); db.setUint(keccak256(abi.encodePacked("claims.tokenCount", _platform, _platformId)), tokenCount.add(1)); db.setUint(keccak256(abi.encodePacked("claims.token.amount", _platform, _platformId, _token)), _requestBalance); db.setAddress(keccak256(abi.encodePacked("claims.token.address", _platform, _platformId, tokenCount)), _token); return true; } function isClaimed(bytes32 _platform, string _platformId) view external returns (bool claimed) { } function getSolverAddress(bytes32 _platform, string _platformId) view external returns (address solverAddress) { } function getSolver(bytes32 _platform, string _platformId) view external returns (string){ } function getTokenCount(bytes32 _platform, string _platformId) view external returns (uint count) { } function getTokenByIndex(bytes32 _platform, string _platformId, uint _index) view external returns (address token) { } function getAmountByToken(bytes32 _platform, string _platformId, address _token) view external returns (uint token) { } }
db.getAddress(keccak256(abi.encodePacked("claims.solver_address",_platform,_platformId)))==_solverAddress,"Adding a claim needs to happen with the same claimer as before"
33,322
db.getAddress(keccak256(abi.encodePacked("claims.solver_address",_platform,_platformId)))==_solverAddress
"Synth already exists"
/* / | __ / ____| / | |__) | | | / / | _ / | | / ____ | | | |____ /_/ _ |_| _ _____| * ARC: global/SynthRegistry.sol * * Latest source (may be newer): https://github.com/arcxgame/contracts/blob/master/contracts/global/SynthRegistry.sol * * Contract Dependencies: * - Context * - Ownable * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2020 ARC * * 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 */ /* =============================================== * Flattened with Solidifier by Coinage * * https://solidifier.coina.ge * =============================================== */ pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { } } // SPDX-License-Identifier: MIT interface ISyntheticToken { function symbolKey() external view returns (bytes32); function mint( address to, uint256 value ) external; function burn( address to, uint256 value ) external; function transferCollateral( address token, address to, uint256 value ) external returns (bool); } contract SynthRegistry is Ownable { struct Synth { bytes32 symbolKey; address proxyAddress; address syntheticAddress; } // Available Synths which can be used with the system address[] public availableSynths; mapping(bytes32 => address) public synths; mapping(address => Synth) public synthsByAddress; /* ========== EVENTS ========== */ event SynthAdded(bytes32 currencyKey, address synth); event SynthRemoved(bytes32 currencyKey, address synth); /* ========== VIEW FUNCTIONS ========== */ function getAllSynths() public view returns (address[] memory) { } /* ========== MUTATIVE FUNCTIONS ========== */ function addSynth( address proxy, address synth ) external onlyOwner { bytes32 symbolKey = ISyntheticToken(synth).symbolKey(); require(<FILL_ME>) require( synthsByAddress[address(synth)].symbolKey == bytes32(0), "Synth address already exists" ); availableSynths.push(synth); synths[symbolKey] = synth; synthsByAddress[address(synth)] = Synth({ symbolKey: symbolKey, proxyAddress: proxy, syntheticAddress: synth }); emit SynthAdded(symbolKey, address(synth)); } function removeSynth( bytes32 symbolKey ) external onlyOwner { } }
synths[symbolKey]==address(0),"Synth already exists"
33,346
synths[symbolKey]==address(0)
"Synth address already exists"
/* / | __ / ____| / | |__) | | | / / | _ / | | / ____ | | | |____ /_/ _ |_| _ _____| * ARC: global/SynthRegistry.sol * * Latest source (may be newer): https://github.com/arcxgame/contracts/blob/master/contracts/global/SynthRegistry.sol * * Contract Dependencies: * - Context * - Ownable * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2020 ARC * * 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 */ /* =============================================== * Flattened with Solidifier by Coinage * * https://solidifier.coina.ge * =============================================== */ pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { } } // SPDX-License-Identifier: MIT interface ISyntheticToken { function symbolKey() external view returns (bytes32); function mint( address to, uint256 value ) external; function burn( address to, uint256 value ) external; function transferCollateral( address token, address to, uint256 value ) external returns (bool); } contract SynthRegistry is Ownable { struct Synth { bytes32 symbolKey; address proxyAddress; address syntheticAddress; } // Available Synths which can be used with the system address[] public availableSynths; mapping(bytes32 => address) public synths; mapping(address => Synth) public synthsByAddress; /* ========== EVENTS ========== */ event SynthAdded(bytes32 currencyKey, address synth); event SynthRemoved(bytes32 currencyKey, address synth); /* ========== VIEW FUNCTIONS ========== */ function getAllSynths() public view returns (address[] memory) { } /* ========== MUTATIVE FUNCTIONS ========== */ function addSynth( address proxy, address synth ) external onlyOwner { bytes32 symbolKey = ISyntheticToken(synth).symbolKey(); require( synths[symbolKey] == address(0), "Synth already exists" ); require(<FILL_ME>) availableSynths.push(synth); synths[symbolKey] = synth; synthsByAddress[address(synth)] = Synth({ symbolKey: symbolKey, proxyAddress: proxy, syntheticAddress: synth }); emit SynthAdded(symbolKey, address(synth)); } function removeSynth( bytes32 symbolKey ) external onlyOwner { } }
synthsByAddress[address(synth)].symbolKey==bytes32(0),"Synth address already exists"
33,346
synthsByAddress[address(synth)].symbolKey==bytes32(0)
"Synth does not exist"
/* / | __ / ____| / | |__) | | | / / | _ / | | / ____ | | | |____ /_/ _ |_| _ _____| * ARC: global/SynthRegistry.sol * * Latest source (may be newer): https://github.com/arcxgame/contracts/blob/master/contracts/global/SynthRegistry.sol * * Contract Dependencies: * - Context * - Ownable * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2020 ARC * * 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 */ /* =============================================== * Flattened with Solidifier by Coinage * * https://solidifier.coina.ge * =============================================== */ pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { } } // SPDX-License-Identifier: MIT interface ISyntheticToken { function symbolKey() external view returns (bytes32); function mint( address to, uint256 value ) external; function burn( address to, uint256 value ) external; function transferCollateral( address token, address to, uint256 value ) external returns (bool); } contract SynthRegistry is Ownable { struct Synth { bytes32 symbolKey; address proxyAddress; address syntheticAddress; } // Available Synths which can be used with the system address[] public availableSynths; mapping(bytes32 => address) public synths; mapping(address => Synth) public synthsByAddress; /* ========== EVENTS ========== */ event SynthAdded(bytes32 currencyKey, address synth); event SynthRemoved(bytes32 currencyKey, address synth); /* ========== VIEW FUNCTIONS ========== */ function getAllSynths() public view returns (address[] memory) { } /* ========== MUTATIVE FUNCTIONS ========== */ function addSynth( address proxy, address synth ) external onlyOwner { } function removeSynth( bytes32 symbolKey ) external onlyOwner { require(<FILL_ME>) require( IERC20(address(synths[symbolKey])).totalSupply() == 0, "Synth supply exists" ); // Save the address we're removing for emitting the event at the end. address synthToRemove = address(synths[symbolKey]); // Remove the synth from the availableSynths array. for (uint i = 0; i < availableSynths.length; i++) { if (address(availableSynths[i]) == synthToRemove) { delete availableSynths[i]; // Copy the last synth into the place of the one we just deleted // If there's only one synth, this is synths[0] = synths[0]. // If we're deleting the last one, it's also a NOOP in the same way. availableSynths[i] = availableSynths[availableSynths.length - 1]; // Decrease the size of the array by one. availableSynths.length--; break; } } // And remove it from the synths mapping delete synthsByAddress[address(synths[symbolKey])]; delete synths[symbolKey]; emit SynthRemoved(symbolKey, synthToRemove); } }
address(synths[symbolKey])!=address(0),"Synth does not exist"
33,346
address(synths[symbolKey])!=address(0)
"Synth supply exists"
/* / | __ / ____| / | |__) | | | / / | _ / | | / ____ | | | |____ /_/ _ |_| _ _____| * ARC: global/SynthRegistry.sol * * Latest source (may be newer): https://github.com/arcxgame/contracts/blob/master/contracts/global/SynthRegistry.sol * * Contract Dependencies: * - Context * - Ownable * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2020 ARC * * 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 */ /* =============================================== * Flattened with Solidifier by Coinage * * https://solidifier.coina.ge * =============================================== */ pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { } } // SPDX-License-Identifier: MIT interface ISyntheticToken { function symbolKey() external view returns (bytes32); function mint( address to, uint256 value ) external; function burn( address to, uint256 value ) external; function transferCollateral( address token, address to, uint256 value ) external returns (bool); } contract SynthRegistry is Ownable { struct Synth { bytes32 symbolKey; address proxyAddress; address syntheticAddress; } // Available Synths which can be used with the system address[] public availableSynths; mapping(bytes32 => address) public synths; mapping(address => Synth) public synthsByAddress; /* ========== EVENTS ========== */ event SynthAdded(bytes32 currencyKey, address synth); event SynthRemoved(bytes32 currencyKey, address synth); /* ========== VIEW FUNCTIONS ========== */ function getAllSynths() public view returns (address[] memory) { } /* ========== MUTATIVE FUNCTIONS ========== */ function addSynth( address proxy, address synth ) external onlyOwner { } function removeSynth( bytes32 symbolKey ) external onlyOwner { require( address(synths[symbolKey]) != address(0), "Synth does not exist" ); require(<FILL_ME>) // Save the address we're removing for emitting the event at the end. address synthToRemove = address(synths[symbolKey]); // Remove the synth from the availableSynths array. for (uint i = 0; i < availableSynths.length; i++) { if (address(availableSynths[i]) == synthToRemove) { delete availableSynths[i]; // Copy the last synth into the place of the one we just deleted // If there's only one synth, this is synths[0] = synths[0]. // If we're deleting the last one, it's also a NOOP in the same way. availableSynths[i] = availableSynths[availableSynths.length - 1]; // Decrease the size of the array by one. availableSynths.length--; break; } } // And remove it from the synths mapping delete synthsByAddress[address(synths[symbolKey])]; delete synths[symbolKey]; emit SynthRemoved(symbolKey, synthToRemove); } }
IERC20(address(synths[symbolKey])).totalSupply()==0,"Synth supply exists"
33,346
IERC20(address(synths[symbolKey])).totalSupply()==0
"Not enough funds."
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { require (increaseAmount <= address(this).balance, "Increase amount larger than balance."); require(<FILL_ME>) jackpotSize += uint128(increaseAmount); } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
jackpotSize+lockedInBets+increaseAmount<=address(this).balance,"Not enough funds."
33,348
jackpotSize+lockedInBets+increaseAmount<=address(this).balance
"Not enough funds."
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { require (withdrawAmount <= address(this).balance, "Increase amount larger than balance."); require(<FILL_ME>) sendFunds(beneficiary, withdrawAmount, withdrawAmount); } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
jackpotSize+lockedInBets+withdrawAmount<=address(this).balance,"Not enough funds."
33,348
jackpotSize+lockedInBets+withdrawAmount<=address(this).balance
"Cannot afford to lose this bet."
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { // Check that the bet is in 'clean' state. Bet storage bet = bets[commit]; require (bet.gambler == address(0), "Bet should be in a 'clean' state."); // Validate input data ranges. uint amount = msg.value; require (modulo > 1 && modulo <= MAX_MODULO, "Modulo should be within range."); require (amount >= MIN_BET && amount <= MAX_AMOUNT, "Amount should be within range."); require (betMask > 0 && betMask < MAX_BET_MASK, "Mask should be within range."); // Check that commit is valid - it has not expired and its signature is valid. require (block.number <= commitLastBlock, "Commit has expired."); checkSecretSigner(commitLastBlock, commit, v, r, s); uint rollUnder; uint mask; if (modulo <= MAX_MASK_MODULO) { // Small modulo games specify bet outcomes via bit mask. // rollUnder is a number of 1 bits in this mask (population count). // This magic looking formula is an efficient way to compute population // count on EVM for numbers below 2**40. rollUnder = ((betMask * POPCNT_MULT) & POPCNT_MASK) % POPCNT_MODULO; mask = betMask; } else { // Larger modulos specify the right edge of half-open interval of // winning bet outcomes. require (betMask > 0 && betMask <= modulo, "High modulo range, betMask larger than modulo."); rollUnder = betMask; } // Winning amount and jackpot increase. uint possibleWinAmount; uint jackpotFee; (possibleWinAmount, jackpotFee) = getDiceWinAmount(amount, modulo, rollUnder); // Enforce max profit limit. require (possibleWinAmount <= amount + maxProfit, "maxProfit limit violation."); // Lock funds. lockedInBets += uint128(possibleWinAmount); jackpotSize += uint128(jackpotFee); // Check whether contract has enough funds to process this bet. require(<FILL_ME>) // Record commit in logs. emit Commit(commit); // Store bet parameters on blockchain. bet.amount = amount; bet.modulo = uint8(modulo); bet.rollUnder = uint8(rollUnder); bet.placeBlockNumber = uint40(block.number); bet.mask = uint40(mask); bet.gambler = msg.sender; } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
jackpotSize+lockedInBets<=address(this).balance,"Cannot afford to lose this bet."
33,348
jackpotSize+lockedInBets<=address(this).balance
null
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { uint commit = uint(keccak256(abi.encodePacked(reveal))); Bet storage bet = bets[commit]; uint placeBlockNumber = bet.placeBlockNumber; // Check that bet has not expired yet (see comment to BET_EXPIRATION_BLOCKS). require (block.number > placeBlockNumber, "settleBet in the same block as placeBet, or before."); require (block.number <= placeBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM."); require(<FILL_ME>) // Settle bet using reveal and blockHash as entropy sources. settleBetCommon(bet, reveal, blockHash); } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
blockhash(placeBlockNumber)==blockHash
33,348
blockhash(placeBlockNumber)==blockHash
null
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { // "commit" for bet settlement can only be obtained by hashing a "reveal". uint commit = uint(keccak256(abi.encodePacked(reveal))); Bet storage bet = bets[commit]; // Check that canonical block hash can still be verified. require (block.number <= canonicalBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM."); // Verify placeBet receipt. require(<FILL_ME>) // Reconstruct canonical & uncle block hashes from a receipt merkle proof, verify them. bytes32 canonicalHash; bytes32 uncleHash; (canonicalHash, uncleHash) = verifyMerkleProof(commit, 4 + 32 + 32); require (blockhash(canonicalBlockNumber) == canonicalHash); // Settle bet using reveal and uncleHash as entropy sources. settleBetCommon(bet, reveal, uncleHash); } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
orrectReceipt(4+32+32+4
33,348
4+32+32+4
null
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { // "commit" for bet settlement can only be obtained by hashing a "reveal". uint commit = uint(keccak256(abi.encodePacked(reveal))); Bet storage bet = bets[commit]; // Check that canonical block hash can still be verified. require (block.number <= canonicalBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM."); // Verify placeBet receipt. requireCorrectReceipt(4 + 32 + 32 + 4); // Reconstruct canonical & uncle block hashes from a receipt merkle proof, verify them. bytes32 canonicalHash; bytes32 uncleHash; (canonicalHash, uncleHash) = verifyMerkleProof(commit, 4 + 32 + 32); require(<FILL_ME>) // Settle bet using reveal and uncleHash as entropy sources. settleBetCommon(bet, reveal, uncleHash); } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
blockhash(canonicalBlockNumber)==canonicalHash
33,348
blockhash(canonicalBlockNumber)==canonicalHash
"Bet doesn't even cover house edge."
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { require (0 < rollUnder && rollUnder <= modulo, "Win probability out of range."); jackpotFee = amount >= MIN_JACKPOT_BET ? JACKPOT_FEE : 0; uint houseEdge = amount * HOUSE_EDGE_PERCENT / 100; if (houseEdge < HOUSE_EDGE_MINIMUM_AMOUNT) { houseEdge = HOUSE_EDGE_MINIMUM_AMOUNT; } require(<FILL_ME>) winAmount = (amount - houseEdge - jackpotFee) * modulo / rollUnder; } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
houseEdge+jackpotFee<=amount,"Bet doesn't even cover house edge."
33,348
houseEdge+jackpotFee<=amount
"Shift bounds check."
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { // (Safe) assumption - nobody will write into RAM during this method invocation. uint scratchBuf1; assembly { scratchBuf1 := mload(0x40) } uint uncleHeaderLength; uint blobLength; uint shift; uint hashSlot; // Verify merkle proofs up to uncle block header. Calldata layout is: // - 2 byte big-endian slice length // - 2 byte big-endian offset to the beginning of previous slice hash within the current slice (should be zeroed) // - followed by the current slice verbatim for (;; offset += blobLength) { assembly { blobLength := and(calldataload(sub(offset, 30)), 0xffff) } if (blobLength == 0) { // Zero slice length marks the end of uncle proof. break; } assembly { shift := and(calldataload(sub(offset, 28)), 0xffff) } require(<FILL_ME>) offset += 4; assembly { hashSlot := calldataload(add(offset, shift)) } require (hashSlot == 0, "Non-empty hash slot."); assembly { calldatacopy(scratchBuf1, offset, blobLength) mstore(add(scratchBuf1, shift), seedHash) seedHash := sha3(scratchBuf1, blobLength) uncleHeaderLength := blobLength } } // At this moment the uncle hash is known. uncleHash = bytes32(seedHash); // Construct the uncle list of a canonical block. uint scratchBuf2 = scratchBuf1 + uncleHeaderLength; uint unclesLength; assembly { unclesLength := and(calldataload(sub(offset, 28)), 0xffff) } uint unclesShift; assembly { unclesShift := and(calldataload(sub(offset, 26)), 0xffff) } require (unclesShift + uncleHeaderLength <= unclesLength, "Shift bounds check."); offset += 6; assembly { calldatacopy(scratchBuf2, offset, unclesLength) } memcpy(scratchBuf2 + unclesShift, scratchBuf1, uncleHeaderLength); assembly { seedHash := sha3(scratchBuf2, unclesLength) } offset += unclesLength; // Verify the canonical block header using the computed sha3Uncles. assembly { blobLength := and(calldataload(sub(offset, 30)), 0xffff) shift := and(calldataload(sub(offset, 28)), 0xffff) } require (shift + 32 <= blobLength, "Shift bounds check."); offset += 4; assembly { hashSlot := calldataload(add(offset, shift)) } require (hashSlot == 0, "Non-empty hash slot."); assembly { calldatacopy(scratchBuf1, offset, blobLength) mstore(add(scratchBuf1, shift), seedHash) // At this moment the canonical block hash is known. blockHash := sha3(scratchBuf1, blobLength) } } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
shift+32<=blobLength,"Shift bounds check."
33,348
shift+32<=blobLength
"Shift bounds check."
pragma solidity ^0.4.24; // * bet.fomofeast.top - fair games that pay Ether. // // * Uses hybrid commit-reveal + block hash random number generation that is immune // to tampering by players, house and miners. Apart from being fully transparent, // this also allows arbitrarily high bets. contract FomoFeastBet { /// *** Constants section // Each bet is deducted 1% in favour of the house, but no less than some minimum. // The lower bound is dictated by gas costs of the settleBet transaction, providing // headroom for up to 10 Gwei prices. uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; // Bets lower than this amount do not participate in jackpot rolls (and are // not deducted JACKPOT_FEE). uint constant MIN_JACKPOT_BET = 0.1 ether; // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund. uint constant JACKPOT_MODULO = 1000; uint constant JACKPOT_FEE = 0.001 ether; // There is minimum and maximum bets. uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 300000 ether; // Modulo is a number of equiprobable outcomes in a game: // - 2 for coin flip // - 6 for dice // - 6*6 = 36 for double dice // - 100 for etheroll // - 37 for roulette // etc. // It's called so because 256-bit entropy is treated like a huge integer and // the remainder of its division by modulo is considered bet outcome. uint constant MAX_MODULO = 100; // For modulos below this threshold rolls are checked against a bit mask, // thus allowing betting on any combination of outcomes. For example, given // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple // limit is used, allowing betting on any outcome in [0, N) range. // // The specific value is dictated by the fact that 256-bit intermediate // multiplication result allows implementing population count efficiently // for numbers that are up to 42 bits, and 40 is the highest multiple of // eight below 42. uint constant MAX_MASK_MODULO = 40; // This is a check on bet mask overflow. uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Given that settleBet uses block hash of placeBet as one of // complementary entropy sources, we cannot process bets older than this // threshold. On rare occasions bet.fomofeast.top croupier may fail to invoke // settleBet in this timespan due to technical issues or extreme Ethereum // congestion; such bets can be refunded via invoking refundBet. uint constant BET_EXPIRATION_BLOCKS = 250; // Some deliberately invalid address to initialize the secret signer with. // Forces maintainers to invoke setSecretSigner before processing any bets. address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Standard contract ownership transfer. address public owner; address private nextOwner; // Adjustable max bet profit. Used to cap bets against dynamic odds. uint public maxProfit; // The address corresponding to a private key used to sign placeBet commits. address public secretSigner; // Accumulated jackpot fund. uint128 public jackpotSize; // Funds that are locked in potentially winning bets. Prevents contract from // committing to bets it cannot pay out. uint128 public lockedInBets; // A structure representing a single bet. struct Bet { // Wager amount in wei. uint amount; // Modulo of a game. uint8 modulo; // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder), // and used instead of mask for games with modulo > MAX_MASK_MODULO. uint8 rollUnder; // Block number of placeBet tx. uint40 placeBlockNumber; // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment). uint40 mask; // Address of a gambler, used to pay out winning bets. address gambler; } // Mapping from commits to all currently active & processed bets. mapping (uint => Bet) bets; // Croupier account. address public croupier; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed beneficiary, uint amount); event Payment(address indexed beneficiary, uint amount); event JackpotPayment(address indexed beneficiary, uint amount); // This event is emitted in placeBet to record commit in the logs. event Commit(uint commit); // Constructor. Deliberately does not take any parameters. constructor () public { } // Standard modifier on methods invokable only by contract owner. modifier onlyOwner { } // Standard modifier on methods invokable only by contract owner. modifier onlyCroupier { } // Standard contract ownership transfer implementation, function approveNextOwner(address _nextOwner) external onlyOwner { } function acceptNextOwner() external { } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // See comment for "secretSigner" variable. function setSecretSigner(address newSecretSigner) external onlyOwner { } // Change the croupier address. function setCroupier(address newCroupier) external onlyOwner { } // Change max bet reward. Setting this to zero effectively disables betting. function setMaxProfit(uint _maxProfit) public onlyOwner { } // This function is used to bump up the jackpot fund. Cannot be used to lower it. function increaseJackpot(uint increaseAmount) external onlyOwner { } // Funds withdrawal to cover costs of bet.fomofeast.top operation. function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner { } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() external onlyOwner { } /// *** Betting logic // Bet states: // amount == 0 && gambler == 0 - 'clean' (can place a bet) // amount != 0 && gambler != 0 - 'active' (can be settled or refunded) // amount == 0 && gambler != 0 - 'processed' (can clean storage) // // NOTE: Storage cleaning is not implemented in this contract version; it will be added // with the next upgrade to prevent polluting Ethereum state with expired bets. // Bet placing transaction - issued by the player. // betMask - bet outcomes bit mask for modulo <= MAX_MASK_MODULO, // [0, betMask) for larger modulos. // modulo - game modulo. // commitLastBlock - number of the maximum block where "commit" is still considered valid. // commit - Keccak256 hash of some secret "reveal" random number, to be supplied // by the bet.fomofeast.top croupier bot in the settleBet transaction. Supplying // "commit" ensures that "reveal" cannot be changed behind the scenes // after placeBet have been mined. // r, s - components of ECDSA signature of (commitLastBlock, commit). v is // guaranteed to always equal 27. // // Commit, being essentially random 256-bit number, is used as a unique bet identifier in // the 'bets' mapping. // // Commits are signed with a block limit to ensure that they are used at most once - otherwise // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details. function checkSecretSigner(uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) private view { } function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, uint8 v, bytes32 r, bytes32 s) external payable { } // This is the method used to settle 99% of bets. To process a bet with a specific // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs. function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier { } // This method is used to settle a bet that was mined into an uncle block. At this // point the player was shown some bet outcome, but the blockhash at placeBet height // is different because of Ethereum chain reorg. We supply a full merkle proof of the // placeBet transaction receipt to provide untamperable evidence that uncle block hash // indeed was present on-chain at some point. function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier { } // Common settlement code for settleBet & settleBetUncleMerkleProof. function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { } // Refund transaction - return the bet amount of a roll that was not processed in a // due timeframe. Processing such blocks is not possible due to EVM limitations (see // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself // in a situation like this, just contact the bet.fomofeast.top support, however nothing // precludes you from invoking this method yourself. function refundBet(uint commit) external { } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) { } // Helper routine to process the payment. function sendFunds(address beneficiary, uint amount, uint successLogAmount) private { } // This are some constants making O(1) population count in placeBet possible. // See whitepaper for intuition and proofs behind it. uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCNT_MODULO = 0x3F; // *** Merkle proofs. // This helpers are used to verify cryptographic proofs of placeBet inclusion into // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without // compromising the security of the smart contract. Proof data is appended to the input data // in a simple prefix length format and does not adhere to the ABI. // Invariants checked: // - receipt trie entry contains a (1) successful transaction (2) directed at this smart // contract (3) containing commit as a payload. // - receipt trie entry is a part of a valid merkle proof of a block header // - the block header is a part of uncle list of some block on canonical chain // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures. // Read the whitepaper for details. // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof // beginning in the calldata. function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) { // (Safe) assumption - nobody will write into RAM during this method invocation. uint scratchBuf1; assembly { scratchBuf1 := mload(0x40) } uint uncleHeaderLength; uint blobLength; uint shift; uint hashSlot; // Verify merkle proofs up to uncle block header. Calldata layout is: // - 2 byte big-endian slice length // - 2 byte big-endian offset to the beginning of previous slice hash within the current slice (should be zeroed) // - followed by the current slice verbatim for (;; offset += blobLength) { assembly { blobLength := and(calldataload(sub(offset, 30)), 0xffff) } if (blobLength == 0) { // Zero slice length marks the end of uncle proof. break; } assembly { shift := and(calldataload(sub(offset, 28)), 0xffff) } require (shift + 32 <= blobLength, "Shift bounds check."); offset += 4; assembly { hashSlot := calldataload(add(offset, shift)) } require (hashSlot == 0, "Non-empty hash slot."); assembly { calldatacopy(scratchBuf1, offset, blobLength) mstore(add(scratchBuf1, shift), seedHash) seedHash := sha3(scratchBuf1, blobLength) uncleHeaderLength := blobLength } } // At this moment the uncle hash is known. uncleHash = bytes32(seedHash); // Construct the uncle list of a canonical block. uint scratchBuf2 = scratchBuf1 + uncleHeaderLength; uint unclesLength; assembly { unclesLength := and(calldataload(sub(offset, 28)), 0xffff) } uint unclesShift; assembly { unclesShift := and(calldataload(sub(offset, 26)), 0xffff) } require(<FILL_ME>) offset += 6; assembly { calldatacopy(scratchBuf2, offset, unclesLength) } memcpy(scratchBuf2 + unclesShift, scratchBuf1, uncleHeaderLength); assembly { seedHash := sha3(scratchBuf2, unclesLength) } offset += unclesLength; // Verify the canonical block header using the computed sha3Uncles. assembly { blobLength := and(calldataload(sub(offset, 30)), 0xffff) shift := and(calldataload(sub(offset, 28)), 0xffff) } require (shift + 32 <= blobLength, "Shift bounds check."); offset += 4; assembly { hashSlot := calldataload(add(offset, shift)) } require (hashSlot == 0, "Non-empty hash slot."); assembly { calldatacopy(scratchBuf1, offset, blobLength) mstore(add(scratchBuf1, shift), seedHash) // At this moment the canonical block hash is known. blockHash := sha3(scratchBuf1, blobLength) } } // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] function requireCorrectReceipt(uint offset) view private { } // Memory copy. function memcpy(uint dest, uint src, uint len) pure private { } }
unclesShift+uncleHeaderLength<=unclesLength,"Shift bounds check."
33,348
unclesShift+uncleHeaderLength<=unclesLength
"The amount of mints would exceed the supply!"
contract DIEDED is DIEDED_BASE, ERC721Enumerable { string constant INVALID_INDEX = "005007"; uint256[] internal tokens; mapping(uint256 => uint256) internal idToIndex; mapping(address => uint256[]) internal ownerToIds; mapping(uint256 => uint256) internal idToOwnerIndex; mapping(address => uint8) internal whitelistedClaimed; constructor(address[] memory _whitelisted) { } function openCloseMint(bool _status) public onlyOwner{ } function mintForOwner(uint8 section) public onlyOwner{ } function addToWhitelistArray(address[] memory _whitelisted) public onlyOwner { } function totalSupply() external override view returns (uint256) { } function tokenByIndex( uint256 _index ) external override view returns (uint256) { } function tokenOfOwnerByIndex( address _owner, uint256 _index ) external override view returns (uint256) { } function tokenOfOwnerByIndexInternal( address _owner, uint256 _index ) internal view returns (uint256) { } function isEligibleToFutureMints(address who, uint256 _modulo) external view returns (bool) { } function isWhitelistedAndNotClaimedYet(address isWhitelistedAddr) public view returns (bool) { } function claim(uint8 mint_num) external payable{ require(isMintWindowOpen, "Mint window is not open"); require(<FILL_ME>) require(_getOwnerNFTCount(msg.sender) + mint_num <= 5, "Claiming too many assets per address"); bool whitelisted_res = isWhitelistedAndNotClaimedYet(msg.sender); if( (mint_num == 1 && whitelisted_res == false) || (mint_num == 2 && whitelisted_res == true) ) { require(msg.value >= 0.0666 ether, "Claiming such amount of membership costs 0.0666 ETH for this address"); } else if ( (mint_num == 2 && whitelisted_res == false) || (mint_num == 3 && whitelisted_res == true) ) { require(msg.value >= 0.1332 ether, "Claiming such amount of membership costs 0.1332 ETH for this address"); } else if ( (mint_num == 3 && whitelisted_res == false) || (mint_num == 4 && whitelisted_res == true) ) { require(msg.value >= 0.1998 ether, "Claiming such amount of membership costs 0.1998 ETH for this address"); } else if ( (mint_num == 4 && whitelisted_res == false) || (mint_num == 5 && whitelisted_res == true) ) { require(msg.value >= 0.2664 ether, "Claiming such amount of membership costs 0.2664 ETH for this address"); } else if ( (mint_num == 5 && whitelisted_res == false) ) { require(msg.value >= 0.333 ether, "Claiming such amount of membership costs 0.333 ETH for this address"); } for (uint8 i=0; i<mint_num; i++) { whitelisted_res = isWhitelistedAndNotClaimedYet(msg.sender); if ( whitelisted_res == true ){ whitelistedClaimed[msg.sender] = 20; //claimed _mint(msg.sender,nextMintID); } else{ _mint(msg.sender,nextMintID); } } // Transfer mint price to contract owner payable(owner()).transfer(msg.value); } function _mint( address _to, uint256 _tokenId ) internal override virtual { } function _mintForOWner( address _to, uint256 _tokenId ) internal onlyOwner { } function _removeNFToken( address _from, uint256 _tokenId ) internal override virtual { } function _addNFToken( address _to, uint256 _tokenId ) internal override virtual { } function _getOwnerNFTCount( address _owner ) internal override virtual view returns (uint256) { } }
mint_num+nextMintID<MAX_MINT_NR+1,"The amount of mints would exceed the supply!"
33,416
mint_num+nextMintID<MAX_MINT_NR+1
"Claiming too many assets per address"
contract DIEDED is DIEDED_BASE, ERC721Enumerable { string constant INVALID_INDEX = "005007"; uint256[] internal tokens; mapping(uint256 => uint256) internal idToIndex; mapping(address => uint256[]) internal ownerToIds; mapping(uint256 => uint256) internal idToOwnerIndex; mapping(address => uint8) internal whitelistedClaimed; constructor(address[] memory _whitelisted) { } function openCloseMint(bool _status) public onlyOwner{ } function mintForOwner(uint8 section) public onlyOwner{ } function addToWhitelistArray(address[] memory _whitelisted) public onlyOwner { } function totalSupply() external override view returns (uint256) { } function tokenByIndex( uint256 _index ) external override view returns (uint256) { } function tokenOfOwnerByIndex( address _owner, uint256 _index ) external override view returns (uint256) { } function tokenOfOwnerByIndexInternal( address _owner, uint256 _index ) internal view returns (uint256) { } function isEligibleToFutureMints(address who, uint256 _modulo) external view returns (bool) { } function isWhitelistedAndNotClaimedYet(address isWhitelistedAddr) public view returns (bool) { } function claim(uint8 mint_num) external payable{ require(isMintWindowOpen, "Mint window is not open"); require(mint_num + nextMintID < MAX_MINT_NR+1, "The amount of mints would exceed the supply!"); require(<FILL_ME>) bool whitelisted_res = isWhitelistedAndNotClaimedYet(msg.sender); if( (mint_num == 1 && whitelisted_res == false) || (mint_num == 2 && whitelisted_res == true) ) { require(msg.value >= 0.0666 ether, "Claiming such amount of membership costs 0.0666 ETH for this address"); } else if ( (mint_num == 2 && whitelisted_res == false) || (mint_num == 3 && whitelisted_res == true) ) { require(msg.value >= 0.1332 ether, "Claiming such amount of membership costs 0.1332 ETH for this address"); } else if ( (mint_num == 3 && whitelisted_res == false) || (mint_num == 4 && whitelisted_res == true) ) { require(msg.value >= 0.1998 ether, "Claiming such amount of membership costs 0.1998 ETH for this address"); } else if ( (mint_num == 4 && whitelisted_res == false) || (mint_num == 5 && whitelisted_res == true) ) { require(msg.value >= 0.2664 ether, "Claiming such amount of membership costs 0.2664 ETH for this address"); } else if ( (mint_num == 5 && whitelisted_res == false) ) { require(msg.value >= 0.333 ether, "Claiming such amount of membership costs 0.333 ETH for this address"); } for (uint8 i=0; i<mint_num; i++) { whitelisted_res = isWhitelistedAndNotClaimedYet(msg.sender); if ( whitelisted_res == true ){ whitelistedClaimed[msg.sender] = 20; //claimed _mint(msg.sender,nextMintID); } else{ _mint(msg.sender,nextMintID); } } // Transfer mint price to contract owner payable(owner()).transfer(msg.value); } function _mint( address _to, uint256 _tokenId ) internal override virtual { } function _mintForOWner( address _to, uint256 _tokenId ) internal onlyOwner { } function _removeNFToken( address _from, uint256 _tokenId ) internal override virtual { } function _addNFToken( address _to, uint256 _tokenId ) internal override virtual { } function _getOwnerNFTCount( address _owner ) internal override virtual view returns (uint256) { } }
_getOwnerNFTCount(msg.sender)+mint_num<=5,"Claiming too many assets per address"
33,416
_getOwnerNFTCount(msg.sender)+mint_num<=5
"003006"
contract DIEDED is DIEDED_BASE, ERC721Enumerable { string constant INVALID_INDEX = "005007"; uint256[] internal tokens; mapping(uint256 => uint256) internal idToIndex; mapping(address => uint256[]) internal ownerToIds; mapping(uint256 => uint256) internal idToOwnerIndex; mapping(address => uint8) internal whitelistedClaimed; constructor(address[] memory _whitelisted) { } function openCloseMint(bool _status) public onlyOwner{ } function mintForOwner(uint8 section) public onlyOwner{ } function addToWhitelistArray(address[] memory _whitelisted) public onlyOwner { } function totalSupply() external override view returns (uint256) { } function tokenByIndex( uint256 _index ) external override view returns (uint256) { } function tokenOfOwnerByIndex( address _owner, uint256 _index ) external override view returns (uint256) { } function tokenOfOwnerByIndexInternal( address _owner, uint256 _index ) internal view returns (uint256) { } function isEligibleToFutureMints(address who, uint256 _modulo) external view returns (bool) { } function isWhitelistedAndNotClaimedYet(address isWhitelistedAddr) public view returns (bool) { } function claim(uint8 mint_num) external payable{ } function _mint( address _to, uint256 _tokenId ) internal override virtual { } function _mintForOWner( address _to, uint256 _tokenId ) internal onlyOwner { } function _removeNFToken( address _from, uint256 _tokenId ) internal override virtual { require(<FILL_ME>) delete idToOwner[_tokenId]; uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId]; uint256 lastTokenIndex = ownerToIds[_from].length - 1; if (lastTokenIndex != tokenToRemoveIndex) { uint256 lastToken = ownerToIds[_from][lastTokenIndex]; ownerToIds[_from][tokenToRemoveIndex] = lastToken; idToOwnerIndex[lastToken] = tokenToRemoveIndex; } ownerToIds[_from].pop(); } function _addNFToken( address _to, uint256 _tokenId ) internal override virtual { } function _getOwnerNFTCount( address _owner ) internal override virtual view returns (uint256) { } }
idToOwner[_tokenId]==_from,"003006"
33,416
idToOwner[_tokenId]==_from
"003007"
contract DIEDED is DIEDED_BASE, ERC721Enumerable { string constant INVALID_INDEX = "005007"; uint256[] internal tokens; mapping(uint256 => uint256) internal idToIndex; mapping(address => uint256[]) internal ownerToIds; mapping(uint256 => uint256) internal idToOwnerIndex; mapping(address => uint8) internal whitelistedClaimed; constructor(address[] memory _whitelisted) { } function openCloseMint(bool _status) public onlyOwner{ } function mintForOwner(uint8 section) public onlyOwner{ } function addToWhitelistArray(address[] memory _whitelisted) public onlyOwner { } function totalSupply() external override view returns (uint256) { } function tokenByIndex( uint256 _index ) external override view returns (uint256) { } function tokenOfOwnerByIndex( address _owner, uint256 _index ) external override view returns (uint256) { } function tokenOfOwnerByIndexInternal( address _owner, uint256 _index ) internal view returns (uint256) { } function isEligibleToFutureMints(address who, uint256 _modulo) external view returns (bool) { } function isWhitelistedAndNotClaimedYet(address isWhitelistedAddr) public view returns (bool) { } function claim(uint8 mint_num) external payable{ } function _mint( address _to, uint256 _tokenId ) internal override virtual { } function _mintForOWner( address _to, uint256 _tokenId ) internal onlyOwner { } function _removeNFToken( address _from, uint256 _tokenId ) internal override virtual { } function _addNFToken( address _to, uint256 _tokenId ) internal override virtual { require(<FILL_ME>) idToOwner[_tokenId] = _to; ownerToIds[_to].push(_tokenId); idToOwnerIndex[_tokenId] = ownerToIds[_to].length - 1; } function _getOwnerNFTCount( address _owner ) internal override virtual view returns (uint256) { } }
idToOwner[_tokenId]==address(0),"003007"
33,416
idToOwner[_tokenId]==address(0)
"Insufficient funds"
// produced by the Solididy File Flattener (c) David Appleton 2018 // contact : [email protected] // released under Apache 2.0 licence library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() onlyPendingOwner public { } } contract AmmuNationStore is Claimable{ using SafeMath for uint256; GTAInterface public token; uint256 private tokenSellPrice; //wei uint256 private tokenBuyPrice; //wei uint256 public buyDiscount; //% event Buy(address buyer, uint256 amount, uint256 payed); event Robbery(address robber); constructor (address _tokenAddress) public { } /** Owner's operations to fill and empty the stock */ // Important! remember to call GoldenThalerToken(address).approve(this, amount) // or this contract will not be able to do the transfer on your behalf. function depositGTA(uint256 amount) onlyOwner public { require(<FILL_ME>) } function withdrawGTA(uint256 amount) onlyOwner public { } function robCashier() onlyOwner public { } /** */ /** * @dev Set the prices in wei for 1 GTA * @param _newSellPrice The price people can sell GTA for * @param _newBuyPrice The price people can buy GTA for */ function setTokenPrices(uint256 _newSellPrice, uint256 _newBuyPrice) onlyOwner public { } function buy() payable public returns (uint256){ } // Important! remember to call GoldenThalerToken(address).approve(this, amount) // or this contract will not be able to do the transfer on your behalf. //TODO No sell at this moment /*function sell(uint256 amount) public returns (uint256){ require(token.balanceOf(msg.sender) >= amount, "Insufficient funds"); require(token.transferFrom(msg.sender, this, amount), "Couldn't transfer token"); uint256 revenue = amount.mul(tokenSellPrice).div(1 ether); msg.sender.transfer(revenue); return revenue; }*/ function applyDiscount(uint256 discount) onlyOwner public { } function getTokenBuyPrice() public view returns (uint256) { } function getTokenSellPrice() public view returns (uint256) { } } /** * @title GTA contract interface */ interface GTAInterface { function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function balanceOf(address _owner) external view returns (uint256); }
token.transferFrom(msg.sender,this,amount),"Insufficient funds"
33,451
token.transferFrom(msg.sender,this,amount)
"Sold out"
// produced by the Solididy File Flattener (c) David Appleton 2018 // contact : [email protected] // released under Apache 2.0 licence library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() onlyPendingOwner public { } } contract AmmuNationStore is Claimable{ using SafeMath for uint256; GTAInterface public token; uint256 private tokenSellPrice; //wei uint256 private tokenBuyPrice; //wei uint256 public buyDiscount; //% event Buy(address buyer, uint256 amount, uint256 payed); event Robbery(address robber); constructor (address _tokenAddress) public { } /** Owner's operations to fill and empty the stock */ // Important! remember to call GoldenThalerToken(address).approve(this, amount) // or this contract will not be able to do the transfer on your behalf. function depositGTA(uint256 amount) onlyOwner public { } function withdrawGTA(uint256 amount) onlyOwner public { } function robCashier() onlyOwner public { } /** */ /** * @dev Set the prices in wei for 1 GTA * @param _newSellPrice The price people can sell GTA for * @param _newBuyPrice The price people can buy GTA for */ function setTokenPrices(uint256 _newSellPrice, uint256 _newBuyPrice) onlyOwner public { } function buy() payable public returns (uint256){ //note: the price of 1 GTA is in wei, but the token transfer expects the amount in 'token wei' //so we're missing 10*18 uint256 value = msg.value.mul(1 ether); uint256 _buyPrice = tokenBuyPrice; if (buyDiscount > 0) { //happy discount! _buyPrice = _buyPrice.sub(_buyPrice.mul(buyDiscount).div(100)); } uint256 amount = value.div(_buyPrice); require(<FILL_ME>) require(token.transfer(msg.sender, amount), "Couldn't transfer token"); emit Buy(msg.sender, amount, msg.value); return amount; } // Important! remember to call GoldenThalerToken(address).approve(this, amount) // or this contract will not be able to do the transfer on your behalf. //TODO No sell at this moment /*function sell(uint256 amount) public returns (uint256){ require(token.balanceOf(msg.sender) >= amount, "Insufficient funds"); require(token.transferFrom(msg.sender, this, amount), "Couldn't transfer token"); uint256 revenue = amount.mul(tokenSellPrice).div(1 ether); msg.sender.transfer(revenue); return revenue; }*/ function applyDiscount(uint256 discount) onlyOwner public { } function getTokenBuyPrice() public view returns (uint256) { } function getTokenSellPrice() public view returns (uint256) { } } /** * @title GTA contract interface */ interface GTAInterface { function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function balanceOf(address _owner) external view returns (uint256); }
token.balanceOf(this)>=amount,"Sold out"
33,451
token.balanceOf(this)>=amount
"DIRECT_MINT_DISALLOWED"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /* ▄█▀▀▀█▄█ ▀███▀▀▀██▄ ▄█▀▀▀█▄█ ▄██ ▀█ ██ ██ ▄██ ▀█ ▀███▄ ██ ██ ▀███▄ ▀█████▄ ██▀▀▀█▄▄ ▀█████▄ ▄ ▀██ ██ ▀█ ▄ ▀██ ██ ██ ██ ▄█ ██ ██ █▀█████▀ ▄████████ █▀█████▀ Sneaky Bat Syndicate / 2021 / Companions */ import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract SneakyBatSyndicate is ERC721Enumerable, Ownable { using Strings for uint256; using ECDSA for bytes32; mapping(string => bool) private _usedNonces; string private _contractURI; string private _tokenBaseURI = "https://svs.gg/api/bats/metadata/"; address private _signerAddress = 0x801FD7eB0b813F0eB0E20409e23b63D3C3aDB39c; mapping(uint256 => bool) public claimed; string public proof; bool public released; bool public locked; constructor() ERC721("Sneaky Bat Syndicate", "SBS") { } modifier notLocked { } function isClaimed(uint256 tokenId) public view returns (bool) { } function hashTransaction(address sender, uint256[] memory tokens, string memory nonce) private pure returns(bytes32) { } function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) { } function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256[] memory tokens) external { require(released, "NOT_RELEASED"); require(<FILL_ME>) require(!_usedNonces[nonce], "HASH_USED"); require(hashTransaction(msg.sender, tokens, nonce) == hash, "HASH_FAIL"); require(tokens.length > 0, "NO_VAMPIRES_OWNED"); for(uint256 i = 0; i < tokens.length; i++) { if(isClaimed(tokens[i])) { continue; } _safeMint(msg.sender, tokens[i]); } } function unleash() external onlyOwner { } function lock() external onlyOwner { } function setSignerAddress(address addr) external onlyOwner { } function setProvenanceHash(string calldata hash) external onlyOwner notLocked { } function setContractURI(string calldata URI) external onlyOwner notLocked { } function setBaseURI(string calldata URI) external onlyOwner notLocked { } function contractURI() public view returns (string memory) { } function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) { } }
matchAddresSigner(hash,signature),"DIRECT_MINT_DISALLOWED"
33,482
matchAddresSigner(hash,signature)
"HASH_USED"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /* ▄█▀▀▀█▄█ ▀███▀▀▀██▄ ▄█▀▀▀█▄█ ▄██ ▀█ ██ ██ ▄██ ▀█ ▀███▄ ██ ██ ▀███▄ ▀█████▄ ██▀▀▀█▄▄ ▀█████▄ ▄ ▀██ ██ ▀█ ▄ ▀██ ██ ██ ██ ▄█ ██ ██ █▀█████▀ ▄████████ █▀█████▀ Sneaky Bat Syndicate / 2021 / Companions */ import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract SneakyBatSyndicate is ERC721Enumerable, Ownable { using Strings for uint256; using ECDSA for bytes32; mapping(string => bool) private _usedNonces; string private _contractURI; string private _tokenBaseURI = "https://svs.gg/api/bats/metadata/"; address private _signerAddress = 0x801FD7eB0b813F0eB0E20409e23b63D3C3aDB39c; mapping(uint256 => bool) public claimed; string public proof; bool public released; bool public locked; constructor() ERC721("Sneaky Bat Syndicate", "SBS") { } modifier notLocked { } function isClaimed(uint256 tokenId) public view returns (bool) { } function hashTransaction(address sender, uint256[] memory tokens, string memory nonce) private pure returns(bytes32) { } function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) { } function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256[] memory tokens) external { require(released, "NOT_RELEASED"); require(matchAddresSigner(hash, signature), "DIRECT_MINT_DISALLOWED"); require(<FILL_ME>) require(hashTransaction(msg.sender, tokens, nonce) == hash, "HASH_FAIL"); require(tokens.length > 0, "NO_VAMPIRES_OWNED"); for(uint256 i = 0; i < tokens.length; i++) { if(isClaimed(tokens[i])) { continue; } _safeMint(msg.sender, tokens[i]); } } function unleash() external onlyOwner { } function lock() external onlyOwner { } function setSignerAddress(address addr) external onlyOwner { } function setProvenanceHash(string calldata hash) external onlyOwner notLocked { } function setContractURI(string calldata URI) external onlyOwner notLocked { } function setBaseURI(string calldata URI) external onlyOwner notLocked { } function contractURI() public view returns (string memory) { } function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) { } }
!_usedNonces[nonce],"HASH_USED"
33,482
!_usedNonces[nonce]
"HASH_FAIL"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /* ▄█▀▀▀█▄█ ▀███▀▀▀██▄ ▄█▀▀▀█▄█ ▄██ ▀█ ██ ██ ▄██ ▀█ ▀███▄ ██ ██ ▀███▄ ▀█████▄ ██▀▀▀█▄▄ ▀█████▄ ▄ ▀██ ██ ▀█ ▄ ▀██ ██ ██ ██ ▄█ ██ ██ █▀█████▀ ▄████████ █▀█████▀ Sneaky Bat Syndicate / 2021 / Companions */ import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract SneakyBatSyndicate is ERC721Enumerable, Ownable { using Strings for uint256; using ECDSA for bytes32; mapping(string => bool) private _usedNonces; string private _contractURI; string private _tokenBaseURI = "https://svs.gg/api/bats/metadata/"; address private _signerAddress = 0x801FD7eB0b813F0eB0E20409e23b63D3C3aDB39c; mapping(uint256 => bool) public claimed; string public proof; bool public released; bool public locked; constructor() ERC721("Sneaky Bat Syndicate", "SBS") { } modifier notLocked { } function isClaimed(uint256 tokenId) public view returns (bool) { } function hashTransaction(address sender, uint256[] memory tokens, string memory nonce) private pure returns(bytes32) { } function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) { } function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256[] memory tokens) external { require(released, "NOT_RELEASED"); require(matchAddresSigner(hash, signature), "DIRECT_MINT_DISALLOWED"); require(!_usedNonces[nonce], "HASH_USED"); require(<FILL_ME>) require(tokens.length > 0, "NO_VAMPIRES_OWNED"); for(uint256 i = 0; i < tokens.length; i++) { if(isClaimed(tokens[i])) { continue; } _safeMint(msg.sender, tokens[i]); } } function unleash() external onlyOwner { } function lock() external onlyOwner { } function setSignerAddress(address addr) external onlyOwner { } function setProvenanceHash(string calldata hash) external onlyOwner notLocked { } function setContractURI(string calldata URI) external onlyOwner notLocked { } function setBaseURI(string calldata URI) external onlyOwner notLocked { } function contractURI() public view returns (string memory) { } function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) { } }
hashTransaction(msg.sender,tokens,nonce)==hash,"HASH_FAIL"
33,482
hashTransaction(msg.sender,tokens,nonce)==hash
"FiatTokenV2: contract is already initialized"
/** * License: MIT * * Copyright (c) 2018-2020 CENTRE SECZ * * 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 * 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. */ pragma solidity 0.6.12; /** * @title FiatToken V2 * @notice ERC20 Token backed by fiat reserves, version 2 */ contract FiatTokenV2 is FiatTokenV1_1, GasAbstraction, Permit { bool internal _initializedV2; /** * @notice Initialize V2 contract * @dev When upgrading to V2, this function must also be invoked by using * upgradeToAndCall instead of upgradeTo, or by calling both from a contract * in a single transaction. * @param newName New token name */ function initializeV2(string calldata newName) external { require(<FILL_ME>) name = newName; DOMAIN_SEPARATOR = EIP712.makeDomainSeparator(newName, "2"); _initializedV2 = true; } /** * @notice Increase the allowance by a given increment * @param spender Spender's address * @param increment Amount of increase in allowance * @return True if successful */ function increaseAllowance(address spender, uint256 increment) external whenNotPaused notBlacklisted(msg.sender) notBlacklisted(spender) returns (bool) { } /** * @notice Decrease the allowance by a given decrement * @param spender Spender's address * @param decrement Amount of decrease in allowance * @return True if successful */ function decreaseAllowance(address spender, uint256 decrement) external whenNotPaused notBlacklisted(msg.sender) notBlacklisted(spender) returns (bool) { } /** * @notice Execute a transfer with a signed authorization * @param from Payer's address (Authorizer) * @param to Payee's address * @param value Amount to be transferred * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce Unique nonce * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function transferWithAuthorization( address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) external whenNotPaused notBlacklisted(from) notBlacklisted(to) { } /** * @notice Update allowance with a signed authorization * @param owner Token owner's address (Authorizer) * @param spender Spender's address * @param value Amount of allowance * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce Unique nonce * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function approveWithAuthorization( address owner, address spender, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) external whenNotPaused notBlacklisted(owner) notBlacklisted(spender) { } /** * @notice Increase allowance with a signed authorization * @param owner Token owner's address (Authorizer) * @param spender Spender's address * @param increment Amount of increase in allowance * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce Unique nonce * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function increaseAllowanceWithAuthorization( address owner, address spender, uint256 increment, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) external whenNotPaused notBlacklisted(owner) notBlacklisted(spender) { } /** * @notice Decrease allowance with a signed authorization * @param owner Token owner's address (Authorizer) * @param spender Spender's address * @param decrement Amount of decrease in allowance * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce Unique nonce * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function decreaseAllowanceWithAuthorization( address owner, address spender, uint256 decrement, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) external whenNotPaused notBlacklisted(owner) notBlacklisted(spender) { } /** * @notice Attempt to cancel an authorization * @dev Works only if the authorization is not yet used. * @param authorizer Authorizer's address * @param nonce Nonce of the authorization * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function cancelAuthorization( address authorizer, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) external whenNotPaused { } /** * @notice Update allowance with a signed permit * @param owner Token owner's address (Authorizer) * @param spender Spender's address * @param value Amount of allowance * @param deadline Expiration time, seconds since the epoch * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external whenNotPaused notBlacklisted(owner) notBlacklisted(spender) { } /** * @notice Internal function to increase the allowance by a given increment * @param owner Token owner's address * @param spender Spender's address * @param increment Amount of increase */ function _increaseAllowance( address owner, address spender, uint256 increment ) internal override { } /** * @notice Internal function to decrease the allowance by a given decrement * @param owner Token owner's address * @param spender Spender's address * @param decrement Amount of decrease */ function _decreaseAllowance( address owner, address spender, uint256 decrement ) internal override { } }
!_initializedV2,"FiatTokenV2: contract is already initialized"
33,561
!_initializedV2
"UnknownTokenId"
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IPepemonFactory { function mint( address _to, uint256 _id, uint256 _quantity, bytes memory _data ) external; } contract PepemonMerkleDistributor { event Claimed( uint256 tokenId, uint256 index, address account, uint256 amount ); IPepemonFactory public factory; mapping(uint256 => bytes32) merkleRoots; mapping(uint256 => mapping(uint256 => uint256)) private claimedTokens; // @dev do not use 0 for tokenId constructor( address pepemonFactory_, bytes32[] memory merkleRoots_, uint256[] memory pepemonIds_ ) { } function isClaimed(uint256 pepemonTokenId, uint256 index) public view returns (bool) { } function claim( uint256 tokenId, uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external { require(<FILL_ME>) require( !isClaimed(tokenId, index), "MerkleDistributor: Drop already claimed" ); bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require( MerkleProof.verify(merkleProof, merkleRoots[tokenId], node), "MerkleDistributor: Invalid proof" ); _setClaimed(tokenId, index); factory.mint(account, tokenId, 1, ""); emit Claimed(tokenId, index, account, amount); } function _setClaimed(uint256 pepemonTokenId, uint256 index) internal { } }
merkleRoots[tokenId]!=0,"UnknownTokenId"
33,599
merkleRoots[tokenId]!=0
"MerkleDistributor: Drop already claimed"
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IPepemonFactory { function mint( address _to, uint256 _id, uint256 _quantity, bytes memory _data ) external; } contract PepemonMerkleDistributor { event Claimed( uint256 tokenId, uint256 index, address account, uint256 amount ); IPepemonFactory public factory; mapping(uint256 => bytes32) merkleRoots; mapping(uint256 => mapping(uint256 => uint256)) private claimedTokens; // @dev do not use 0 for tokenId constructor( address pepemonFactory_, bytes32[] memory merkleRoots_, uint256[] memory pepemonIds_ ) { } function isClaimed(uint256 pepemonTokenId, uint256 index) public view returns (bool) { } function claim( uint256 tokenId, uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external { require(merkleRoots[tokenId] != 0, "UnknownTokenId"); require(<FILL_ME>) bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require( MerkleProof.verify(merkleProof, merkleRoots[tokenId], node), "MerkleDistributor: Invalid proof" ); _setClaimed(tokenId, index); factory.mint(account, tokenId, 1, ""); emit Claimed(tokenId, index, account, amount); } function _setClaimed(uint256 pepemonTokenId, uint256 index) internal { } }
!isClaimed(tokenId,index),"MerkleDistributor: Drop already claimed"
33,599
!isClaimed(tokenId,index)
"MerkleDistributor: Invalid proof"
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IPepemonFactory { function mint( address _to, uint256 _id, uint256 _quantity, bytes memory _data ) external; } contract PepemonMerkleDistributor { event Claimed( uint256 tokenId, uint256 index, address account, uint256 amount ); IPepemonFactory public factory; mapping(uint256 => bytes32) merkleRoots; mapping(uint256 => mapping(uint256 => uint256)) private claimedTokens; // @dev do not use 0 for tokenId constructor( address pepemonFactory_, bytes32[] memory merkleRoots_, uint256[] memory pepemonIds_ ) { } function isClaimed(uint256 pepemonTokenId, uint256 index) public view returns (bool) { } function claim( uint256 tokenId, uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external { require(merkleRoots[tokenId] != 0, "UnknownTokenId"); require( !isClaimed(tokenId, index), "MerkleDistributor: Drop already claimed" ); bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require(<FILL_ME>) _setClaimed(tokenId, index); factory.mint(account, tokenId, 1, ""); emit Claimed(tokenId, index, account, amount); } function _setClaimed(uint256 pepemonTokenId, uint256 index) internal { } }
MerkleProof.verify(merkleProof,merkleRoots[tokenId],node),"MerkleDistributor: Invalid proof"
33,599
MerkleProof.verify(merkleProof,merkleRoots[tokenId],node)
'Not A Valid Hex #RRGGBBAA Color Value'
pragma solidity ^0.4.24; contract OurPlace120{ bytes9[8640] public pixels; address public owner; address public manager; bool public isPaused; uint public pixelCost; uint256 public CANVAS_HEIGHT; uint256 public CANVAS_WIDTH; uint public totalChangedPixels; struct Terms{ string foreword; string rules; string youShouldKnow; string dataCollection; uint versionForeword; uint versionRules; uint versionYouShouldKnow; uint versionDataCollection; } Terms public termsAndConditions; string public terms; mapping (address => uint) txMap; constructor(address ownerAddress) public{ } modifier isManager(){ } modifier isOwner(){ } function changePixel(string pixelHex, uint pixelX, uint pixelY, bool acceptedTerms) public payable{ require(!isPaused, 'Contract Is Paused'); require(acceptedTerms, 'Must Accept Terms To Proceed'); require(msg.value >= pixelCost, 'Transaction Value Is Incorrect'); require(<FILL_ME>) require(pixelX > 0 && pixelX <= CANVAS_WIDTH, 'Invalid X Coordinate Value'); require(pixelY > 0 && pixelY <= CANVAS_HEIGHT, 'Invalid Y Coordinate Value'); require(txMap[msg.sender] != block.number, 'One Transaction Allowed Per Block'); txMap[msg.sender] = block.number; uint index = CANVAS_WIDTH * (pixelY-1) + (pixelX-1); bytes9 pixelHexBytes = stringToBytes9(pixelHex); pixels[index] = pixelHexBytes; totalChangedPixels = totalChangedPixels + 1; } function changeTerms(string termsKey, string termsValue) public isManager { } function changePixelCost(uint newPixelCost) public isManager{ } function clearPixels(uint xTopL, uint yTopL, uint xBottomR, uint yBottomR) public isManager{ } function changeManager(address newManager) public isOwner{ } function changeOwner(address newOwner) public isOwner{ } function withdraw() public isOwner{ } function pauseContract() public isManager{ } function getPixelArray() public view returns(bytes9[8640]){ } function compareStrings (string a, string b) private pure returns (bool){ } function stringToBytes9(string memory source) private pure returns (bytes9 result) { } } library RGBAHexRegex { struct State { bool accepts; function (byte) pure internal returns (State memory) func; } string public constant regex = "#(([0-9a-fA-F]{2}){4})"; function s0(byte c) pure internal returns (State memory) { } function s1(byte c) pure internal returns (State memory) { } function s2(byte c) pure internal returns (State memory) { } function s3(byte c) pure internal returns (State memory) { } function s4(byte c) pure internal returns (State memory) { } function s5(byte c) pure internal returns (State memory) { } function s6(byte c) pure internal returns (State memory) { } function s7(byte c) pure internal returns (State memory) { } function s8(byte c) pure internal returns (State memory) { } function s9(byte c) pure internal returns (State memory) { } function s10(byte c) pure internal returns (State memory) { } function matches(string input) public pure returns (bool) { } }
RGBAHexRegex.matches(pixelHex),'Not A Valid Hex #RRGGBBAA Color Value'
33,607
RGBAHexRegex.matches(pixelHex)
'One Transaction Allowed Per Block'
pragma solidity ^0.4.24; contract OurPlace120{ bytes9[8640] public pixels; address public owner; address public manager; bool public isPaused; uint public pixelCost; uint256 public CANVAS_HEIGHT; uint256 public CANVAS_WIDTH; uint public totalChangedPixels; struct Terms{ string foreword; string rules; string youShouldKnow; string dataCollection; uint versionForeword; uint versionRules; uint versionYouShouldKnow; uint versionDataCollection; } Terms public termsAndConditions; string public terms; mapping (address => uint) txMap; constructor(address ownerAddress) public{ } modifier isManager(){ } modifier isOwner(){ } function changePixel(string pixelHex, uint pixelX, uint pixelY, bool acceptedTerms) public payable{ require(!isPaused, 'Contract Is Paused'); require(acceptedTerms, 'Must Accept Terms To Proceed'); require(msg.value >= pixelCost, 'Transaction Value Is Incorrect'); require(RGBAHexRegex.matches(pixelHex), 'Not A Valid Hex #RRGGBBAA Color Value'); require(pixelX > 0 && pixelX <= CANVAS_WIDTH, 'Invalid X Coordinate Value'); require(pixelY > 0 && pixelY <= CANVAS_HEIGHT, 'Invalid Y Coordinate Value'); require(<FILL_ME>) txMap[msg.sender] = block.number; uint index = CANVAS_WIDTH * (pixelY-1) + (pixelX-1); bytes9 pixelHexBytes = stringToBytes9(pixelHex); pixels[index] = pixelHexBytes; totalChangedPixels = totalChangedPixels + 1; } function changeTerms(string termsKey, string termsValue) public isManager { } function changePixelCost(uint newPixelCost) public isManager{ } function clearPixels(uint xTopL, uint yTopL, uint xBottomR, uint yBottomR) public isManager{ } function changeManager(address newManager) public isOwner{ } function changeOwner(address newOwner) public isOwner{ } function withdraw() public isOwner{ } function pauseContract() public isManager{ } function getPixelArray() public view returns(bytes9[8640]){ } function compareStrings (string a, string b) private pure returns (bool){ } function stringToBytes9(string memory source) private pure returns (bytes9 result) { } } library RGBAHexRegex { struct State { bool accepts; function (byte) pure internal returns (State memory) func; } string public constant regex = "#(([0-9a-fA-F]{2}){4})"; function s0(byte c) pure internal returns (State memory) { } function s1(byte c) pure internal returns (State memory) { } function s2(byte c) pure internal returns (State memory) { } function s3(byte c) pure internal returns (State memory) { } function s4(byte c) pure internal returns (State memory) { } function s5(byte c) pure internal returns (State memory) { } function s6(byte c) pure internal returns (State memory) { } function s7(byte c) pure internal returns (State memory) { } function s8(byte c) pure internal returns (State memory) { } function s9(byte c) pure internal returns (State memory) { } function s10(byte c) pure internal returns (State memory) { } function matches(string input) public pure returns (bool) { } }
txMap[msg.sender]!=block.number,'One Transaction Allowed Per Block'
33,607
txMap[msg.sender]!=block.number
"max NFT limit exceeded"
pragma solidity >=0.7.0 <0.9.0; contract MetaPharaohsMini is ERC721Enumerable, Ownable { using Strings for uint256; string private baseURI; string public baseExtension = ".json"; string public notRevealedUri; uint256 public maxSupply = 100; bool public paused = false; bool public revealed = false; mapping(address => uint256) public addressMintedBalance; constructor() ERC721("Meta Pharaohs TUT", "MPT") { } //MODIFIERS modifier notPaused { } // INTERNAL function _baseURI() internal view virtual override returns (string memory) { } function giftMultipeAddresses(address[] memory addresses) public onlyOwner { uint256 supply = totalSupply(); require(<FILL_ME>) for (uint256 i = 1; i <= addresses.length; i++) { addressMintedBalance[addresses[i - 1]]++; _safeMint(addresses[i - 1], supply + i); } } //PUBLIC VIEWS function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //ONLY OWNER VIEWS function getBaseURI() public view onlyOwner returns (string memory) { } function getContractBalance() public view onlyOwner returns (uint256) { } //ONLY OWNER SETTERS function reveal() public onlyOwner { } function pause(bool _state) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setMaxSupply(uint256 _maxSupply) public onlyOwner { } function withdraw() public onlyOwner { } }
supply+addresses.length<=maxSupply,"max NFT limit exceeded"
33,613
supply+addresses.length<=maxSupply
null
pragma solidity 0.4.25; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenACGG { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; mapping (address => bool) public blacklist; address admin; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor ( uint256 initialSupply, string tokenName, string tokenSymbol ) public { } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public returns (bool success) { } /** * Ban address * * @param addr ban addr */ function ban(address addr) public { } /** * Enable address * * @param addr enable addr */ function enable(address addr) public { } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(!blacklist[msg.sender]); require(<FILL_ME>) require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { } }
!blacklist[_from]
33,698
!blacklist[_from]
"Incorrect address param"
contract UniverseGalaxyStore is IUniverseGalaxy, ERC721Token, Whitelist, AccessControl, Random, MathTools, ArrayArchiveTools { /*** EVENTS ***/ event PlanetCreated( address indexed owner, uint256 indexed planetId, uint256 sectorX, uint256 sectorY, uint256 rarity, uint256[MAX_ID_LIST_LENGTH] resourcesId, uint256[MAX_ID_LIST_LENGTH] resourcesVelocity, uint256 startPopulation ); /*** DATA TYPES ***/ struct Planet { uint256 rarity; uint256 discovered; uint256 updated; uint256 sectorX; uint256 sectorY; uint[MAX_ID_LIST_LENGTH] resourcesId; uint[MAX_ID_LIST_LENGTH] resourcesVelocity; uint[MAX_ID_LIST_LENGTH] resourcesUpdated; } /*** STORAGE ***/ // struct Planet { // uint48 discovered; // uint40 resourcesId; // uint40 resourcesVelocity; // uint8 sectorX; // uint8 sectorY; // uint8 rarity; // } uint256[] public planets; // struct PlanetState { // uint48 updated; // uint40 resourcesId; // uint80 resourcesUpdated; // } mapping (uint256 => uint256) planetStates; // x => (y => discovered_planet_count) mapping (uint => mapping ( uint => uint )) discoveredPlanetsCountMap; // group index => rarity => discovered planet count mapping (uint => mapping (uint => uint)) planetCountByRarityInGroups; // rarity => discovered planet count in galaxy mapping (uint => uint) planetCountByRarity; IUniverseBalance public universeBalance; IUniversePlanetExploration public universePlanetExploration; function UniverseGalaxyStore() ERC721Token("0xUniverse", "PLANET") public { } function _getPlanet(uint256 _id) internal view returns(Planet memory _planet) { } function _convertPlanetToPlanetHash(Planet memory _planet) internal pure returns(uint256 _planetHash) { } function _convertPlanetToPlanetStateHash(Planet memory _planet) internal pure returns(uint256 _planetStateHash) { } function getDiscoveredPlanetsDensity(uint sectorX, uint sectorY) external view returns (uint) { } function countPlanetsByRarityInGroup(uint _groupIndex, uint _rarity) external view returns (uint){ } function countPlanetsByRarity(uint _rarity) external view returns (uint){ } function setUniverseBalanceAddress(address _address) external onlyOwner { IUniverseBalance candidateContract = IUniverseBalance(_address); // NOTE: verify that a contract is what we expect // https://github.com/Lunyr/crowdsale-contracts/blob/cfadd15986c30521d8ba7d5b6f57b4fefcc7ac38/contracts/LunyrToken.sol#L117 require(<FILL_ME>) // Set the new contract address universeBalance = candidateContract; } function setUniversePlanetExplorationAddress(address _address) external onlyOwner { } function getPlanet(uint256 _id) external view returns ( uint256 rarity, uint256 discovered, uint256 sectorX, uint256 sectorY, uint256[MAX_ID_LIST_LENGTH] resourcesId, uint256[MAX_ID_LIST_LENGTH] resourcesVelocity ) { } function _getOwnedTokensCount(address _owner) internal view returns (uint256){ } function _getOwnedTokensByIndex(address _owner, uint256 _ownerTokenIndex) internal view returns (uint256){ } function findAvailableResource(address _owner, uint _rarity) external returns (int8) { } function createPlanet( address _owner, uint256 _rarity, uint256 _sectorX, uint256 _sectorY, uint256 _startPopulation ) external onlyWhitelisted returns (uint256) { } function _savePlanet( address _owner, Planet _planet ) internal returns (uint) { } function _createPlanetWithRandomResources(uint _rarity, uint _sectorX, uint _sectorY, uint _startPopulation) internal returns (Planet memory _planet) { } }
candidateContract.isUniverseBalance(),"Incorrect address param"
33,711
candidateContract.isUniverseBalance()
"Incorrect address param"
contract UniverseGalaxyStore is IUniverseGalaxy, ERC721Token, Whitelist, AccessControl, Random, MathTools, ArrayArchiveTools { /*** EVENTS ***/ event PlanetCreated( address indexed owner, uint256 indexed planetId, uint256 sectorX, uint256 sectorY, uint256 rarity, uint256[MAX_ID_LIST_LENGTH] resourcesId, uint256[MAX_ID_LIST_LENGTH] resourcesVelocity, uint256 startPopulation ); /*** DATA TYPES ***/ struct Planet { uint256 rarity; uint256 discovered; uint256 updated; uint256 sectorX; uint256 sectorY; uint[MAX_ID_LIST_LENGTH] resourcesId; uint[MAX_ID_LIST_LENGTH] resourcesVelocity; uint[MAX_ID_LIST_LENGTH] resourcesUpdated; } /*** STORAGE ***/ // struct Planet { // uint48 discovered; // uint40 resourcesId; // uint40 resourcesVelocity; // uint8 sectorX; // uint8 sectorY; // uint8 rarity; // } uint256[] public planets; // struct PlanetState { // uint48 updated; // uint40 resourcesId; // uint80 resourcesUpdated; // } mapping (uint256 => uint256) planetStates; // x => (y => discovered_planet_count) mapping (uint => mapping ( uint => uint )) discoveredPlanetsCountMap; // group index => rarity => discovered planet count mapping (uint => mapping (uint => uint)) planetCountByRarityInGroups; // rarity => discovered planet count in galaxy mapping (uint => uint) planetCountByRarity; IUniverseBalance public universeBalance; IUniversePlanetExploration public universePlanetExploration; function UniverseGalaxyStore() ERC721Token("0xUniverse", "PLANET") public { } function _getPlanet(uint256 _id) internal view returns(Planet memory _planet) { } function _convertPlanetToPlanetHash(Planet memory _planet) internal pure returns(uint256 _planetHash) { } function _convertPlanetToPlanetStateHash(Planet memory _planet) internal pure returns(uint256 _planetStateHash) { } function getDiscoveredPlanetsDensity(uint sectorX, uint sectorY) external view returns (uint) { } function countPlanetsByRarityInGroup(uint _groupIndex, uint _rarity) external view returns (uint){ } function countPlanetsByRarity(uint _rarity) external view returns (uint){ } function setUniverseBalanceAddress(address _address) external onlyOwner { } function setUniversePlanetExplorationAddress(address _address) external onlyOwner { IUniversePlanetExploration candidateContract = IUniversePlanetExploration(_address); // NOTE: verify that a contract is what we expect // https://github.com/Lunyr/crowdsale-contracts/blob/cfadd15986c30521d8ba7d5b6f57b4fefcc7ac38/contracts/LunyrToken.sol#L117 require(<FILL_ME>) // Set the new contract address universePlanetExploration = candidateContract; } function getPlanet(uint256 _id) external view returns ( uint256 rarity, uint256 discovered, uint256 sectorX, uint256 sectorY, uint256[MAX_ID_LIST_LENGTH] resourcesId, uint256[MAX_ID_LIST_LENGTH] resourcesVelocity ) { } function _getOwnedTokensCount(address _owner) internal view returns (uint256){ } function _getOwnedTokensByIndex(address _owner, uint256 _ownerTokenIndex) internal view returns (uint256){ } function findAvailableResource(address _owner, uint _rarity) external returns (int8) { } function createPlanet( address _owner, uint256 _rarity, uint256 _sectorX, uint256 _sectorY, uint256 _startPopulation ) external onlyWhitelisted returns (uint256) { } function _savePlanet( address _owner, Planet _planet ) internal returns (uint) { } function _createPlanetWithRandomResources(uint _rarity, uint _sectorX, uint _sectorY, uint _startPopulation) internal returns (Planet memory _planet) { } }
candidateContract.isUniversePlanetExploration(),"Incorrect address param"
33,711
candidateContract.isUniversePlanetExploration()
null
pragma solidity ^0.6.0; contract Ownable is Context { address private _owner; event OwnerChanged(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () public { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function changeOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _changeOwnership(address newOwner) internal { } } pragma solidity ^0.6.0; contract Sweepable is Ownable { using SafeAddress for address; bool private _sweepable; event Sweeped(address _from, address _to); event SweepStateChange(bool _fromSweepable, bool _toSweepable); constructor() public { } modifier sweepableOnly() { require(<FILL_ME>) _; } function isSweepable() public view returns(bool) { } function enableSweep(bool _enable) public onlyOwner { } function sweep(address _token) public sweepableOnly { } function _sweepEth() private { } function _sweepToken(address _token) private { } } contract Weth2Eth is Sweepable { using SafeAddress for address; address constant _wethToken = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; WethToken public Weth; constructor() public { } receive() external payable {} fallback() external payable {} function exchangeToEthSendTo(address _to) public { } function _exchangeToEth(uint256 amount) private { } } pragma solidity ^0.6.0; contract Eth2Weth is Sweepable { address constant _wethToken = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; WethToken public Weth; Weth2Eth public _Weth2Eth; constructor() public { } function setup(address payable _weth2eth) public { } function exchangeToWethSendToExchangeToEth(address _addr) public payable { } function exchangeToWethSendTo(address _to) public payable { } function _exchangeToWeth(uint256 amount) private { } } contract WethDeployer is Ownable{ address public eth2weth; address payable public weth2eth; event Deployed(address ETH2WETH, address WETH2ETH); constructor() public {} function setup() public onlyOwner{ } function _getSalt(uint256 _nonce,address _sender) internal pure returns (bytes32) { } function _deployContract(bytes32 salt, bytes memory bytecode) internal returns(address payable deployedAddress){ } }
isOwner()&&isSweepable()
33,785
isOwner()&&isSweepable()
null
pragma solidity ^0.6.0; contract Ownable is Context { address private _owner; event OwnerChanged(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () public { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function changeOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _changeOwnership(address newOwner) internal { } } pragma solidity ^0.6.0; contract Sweepable is Ownable { using SafeAddress for address; bool private _sweepable; event Sweeped(address _from, address _to); event SweepStateChange(bool _fromSweepable, bool _toSweepable); constructor() public { } modifier sweepableOnly() { } function isSweepable() public view returns(bool) { } function enableSweep(bool _enable) public onlyOwner { } function sweep(address _token) public sweepableOnly { } function _sweepEth() private { } function _sweepToken(address _token) private { } } contract Weth2Eth is Sweepable { using SafeAddress for address; address constant _wethToken = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; WethToken public Weth; constructor() public { } receive() external payable {} fallback() external payable {} function exchangeToEthSendTo(address _to) public { } function _exchangeToEth(uint256 amount) private { require(<FILL_ME>) Weth.withdraw(amount); } } pragma solidity ^0.6.0; contract Eth2Weth is Sweepable { address constant _wethToken = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; WethToken public Weth; Weth2Eth public _Weth2Eth; constructor() public { } function setup(address payable _weth2eth) public { } function exchangeToWethSendToExchangeToEth(address _addr) public payable { } function exchangeToWethSendTo(address _to) public payable { } function _exchangeToWeth(uint256 amount) private { } } contract WethDeployer is Ownable{ address public eth2weth; address payable public weth2eth; event Deployed(address ETH2WETH, address WETH2ETH); constructor() public {} function setup() public onlyOwner{ } function _getSalt(uint256 _nonce,address _sender) internal pure returns (bytes32) { } function _deployContract(bytes32 salt, bytes memory bytecode) internal returns(address payable deployedAddress){ } }
address(Weth)!=address(0)
33,785
address(Weth)!=address(0)
null
pragma solidity ^0.6.0; contract Ownable is Context { address private _owner; event OwnerChanged(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () public { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function changeOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _changeOwnership(address newOwner) internal { } } pragma solidity ^0.6.0; contract Sweepable is Ownable { using SafeAddress for address; bool private _sweepable; event Sweeped(address _from, address _to); event SweepStateChange(bool _fromSweepable, bool _toSweepable); constructor() public { } modifier sweepableOnly() { } function isSweepable() public view returns(bool) { } function enableSweep(bool _enable) public onlyOwner { } function sweep(address _token) public sweepableOnly { } function _sweepEth() private { } function _sweepToken(address _token) private { } } contract Weth2Eth is Sweepable { using SafeAddress for address; address constant _wethToken = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; WethToken public Weth; constructor() public { } receive() external payable {} fallback() external payable {} function exchangeToEthSendTo(address _to) public { } function _exchangeToEth(uint256 amount) private { } } pragma solidity ^0.6.0; contract Eth2Weth is Sweepable { address constant _wethToken = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; WethToken public Weth; Weth2Eth public _Weth2Eth; constructor() public { } function setup(address payable _weth2eth) public { require(<FILL_ME>) _Weth2Eth = Weth2Eth(_weth2eth); } function exchangeToWethSendToExchangeToEth(address _addr) public payable { } function exchangeToWethSendTo(address _to) public payable { } function _exchangeToWeth(uint256 amount) private { } } contract WethDeployer is Ownable{ address public eth2weth; address payable public weth2eth; event Deployed(address ETH2WETH, address WETH2ETH); constructor() public {} function setup() public onlyOwner{ } function _getSalt(uint256 _nonce,address _sender) internal pure returns (bytes32) { } function _deployContract(bytes32 salt, bytes memory bytecode) internal returns(address payable deployedAddress){ } }
address(_Weth2Eth)==address(0)
33,785
address(_Weth2Eth)==address(0)
"deployContract call failed"
pragma solidity ^0.6.0; contract Ownable is Context { address private _owner; event OwnerChanged(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () public { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function changeOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _changeOwnership(address newOwner) internal { } } pragma solidity ^0.6.0; contract Sweepable is Ownable { using SafeAddress for address; bool private _sweepable; event Sweeped(address _from, address _to); event SweepStateChange(bool _fromSweepable, bool _toSweepable); constructor() public { } modifier sweepableOnly() { } function isSweepable() public view returns(bool) { } function enableSweep(bool _enable) public onlyOwner { } function sweep(address _token) public sweepableOnly { } function _sweepEth() private { } function _sweepToken(address _token) private { } } contract Weth2Eth is Sweepable { using SafeAddress for address; address constant _wethToken = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; WethToken public Weth; constructor() public { } receive() external payable {} fallback() external payable {} function exchangeToEthSendTo(address _to) public { } function _exchangeToEth(uint256 amount) private { } } pragma solidity ^0.6.0; contract Eth2Weth is Sweepable { address constant _wethToken = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; WethToken public Weth; Weth2Eth public _Weth2Eth; constructor() public { } function setup(address payable _weth2eth) public { } function exchangeToWethSendToExchangeToEth(address _addr) public payable { } function exchangeToWethSendTo(address _to) public payable { } function _exchangeToWeth(uint256 amount) private { } } contract WethDeployer is Ownable{ address public eth2weth; address payable public weth2eth; event Deployed(address ETH2WETH, address WETH2ETH); constructor() public {} function setup() public onlyOwner{ } function _getSalt(uint256 _nonce,address _sender) internal pure returns (bytes32) { } function _deployContract(bytes32 salt, bytes memory bytecode) internal returns(address payable deployedAddress){ assembly { // solhint-disable-line deployedAddress := create2( // call CREATE2 with 4 arguments. 0x0, // forward any attached value. add(0x20, bytecode), // pass in initialization code. mload(bytecode), // pass in init code's length. salt // pass in the salt value. ) } require(<FILL_ME>) return deployedAddress; } }
address(deployedAddress)!=address(0),"deployContract call failed"
33,785
address(deployedAddress)!=address(0)
"transfer failed"
pragma solidity 0.7.5; // Inheritance /// @title UMB to NFT swapping contract /// @author umb.network contract NFTRewards is Ownable { using SafeMath for uint; using SafeERC20 for IERC20; address public umbToken; address public leftoverReceiver; uint256 public multiplier; uint256 public rewardsDeadline; mapping(address => uint) public balances; constructor(address _umbToken, address _leftoverReceiver) { } function balanceOf(address _addr) view public returns(uint256) { } function startRewards( uint _multiplier, address[] calldata _addresses, uint[] calldata _balances, uint _duration ) external onlyOwner { } function close() external { require(block.timestamp > rewardsDeadline, "cannot close the contract right now"); uint umbBalance = IERC20(umbToken).balanceOf(address(this)); if (umbBalance > 0) { require(<FILL_ME>) } selfdestruct(msg.sender); } function claimUMB() external { } event Claimed( address indexed receiver, uint nftAmount, uint umbAmount); }
IERC20(umbToken).transfer(leftoverReceiver,umbBalance),"transfer failed"
33,831
IERC20(umbToken).transfer(leftoverReceiver,umbBalance)
"SafeMath: multiplication overflow"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.1 <0.9.0; contract ERC20 { uint256 public totalSupply; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowances; using SafeMath for uint256; function balanceOf(address _owner) public view returns (uint256) { } function allowanceOf(address _owner, address _delegate) public view returns (uint256) { } function transfer(address _to, uint256 _amount) public returns (bool success) { } function approve(address _delegate, uint256 _amount) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) { } event Approval(address indexed _owner, address indexed _delegate, uint256 _amount); event Transfer(address indexed _from, address indexed _to, uint256 _amount); } abstract contract ERC677 is ERC20 { function transferAndCall(address _to, uint256 _amount, bytes calldata _data) public virtual returns (bool success); event Transfer(address indexed _from, address indexed _to, uint256 _amount, bytes _data); } abstract contract ERC677Receiver { function onTokenTransfer(address _sender, uint256 _amount, bytes calldata _data) virtual public; } contract StarterToken is ERC20 { function increaseApproval (address _delegate, uint256 _amount) public returns (bool success) { } function decreaseApproval (address _delegate, uint256 _amount) public returns (bool success) { } } contract ERC677Token is ERC677 { function transferAndCall(address _to, uint256 _amount, bytes calldata _data) public virtual override returns (bool success) { } // PRIVATE function contractFallback(address _to, uint256 _amount, bytes calldata _data) private { } function isContract(address _addr) private view returns (bool hasCode) { } } contract BisonToken is StarterToken, ERC677Token { string public constant name = "Bison"; string public constant symbol = "BSN"; uint8 public constant decimals = 18; address public owner; event Burn(address indexed _from, uint256 _amount); using SafeMath for uint256; constructor() { } function transferAndCall(address _to, uint _amount, bytes calldata _data) public override validReciever(_to) returns (bool success) { } function burn(uint256 _amount) isOwner public returns (bool success) { } // MODIFIERS modifier validReciever(address _to) { } modifier isOwner { } } library SafeMath { function mul(uint256 _x, uint256 _y) internal pure returns (uint256) { if (_x == 0) { return 0; } uint256 z = _x * _y; require(<FILL_ME>) return z; } function div(uint256 _x, uint256 _y) internal pure returns (uint256) { } function sub(uint256 _x, uint256 _y) internal pure returns (uint256) { } function add(uint256 _x, uint256 _y) internal pure returns (uint256) { } }
z/_x==_y,"SafeMath: multiplication overflow"
34,014
z/_x==_y
"CoreRef: Caller is not a minter"
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./ICoreRef.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /// @title A Reference to Core /// @author Fei Protocol /// @notice defines some modifiers and utilities around interacting with Core abstract contract CoreRef is ICoreRef, Pausable { ICore private _core; /// @notice CoreRef constructor /// @param core Fei Core to reference constructor(address core) public { } modifier ifMinterSelf() { } modifier ifBurnerSelf() { } modifier onlyMinter() { require(<FILL_ME>) _; } modifier onlyBurner() { } modifier onlyPCVController() { } modifier onlyGovernor() { } modifier onlyGuardianOrGovernor() { } modifier onlyFei() { } modifier onlyGenesisGroup() { } modifier postGenesis() { } modifier nonContract() { } /// @notice set new Core reference address /// @param core the new core address function setCore(address core) external override onlyGovernor { } /// @notice set pausable methods to paused function pause() public override onlyGuardianOrGovernor { } /// @notice set pausable methods to unpaused function unpause() public override onlyGuardianOrGovernor { } /// @notice address of the Core contract referenced /// @return ICore implementation address function core() public view override returns (ICore) { } /// @notice address of the Fei contract referenced by Core /// @return IFei implementation address function fei() public view override returns (IFei) { } /// @notice address of the Tribe contract referenced by Core /// @return IERC20 implementation address function tribe() public view override returns (IERC20) { } /// @notice fei balance of contract /// @return fei amount held function feiBalance() public view override returns (uint256) { } /// @notice tribe balance of contract /// @return tribe amount held function tribeBalance() public view override returns (uint256) { } function _burnFeiHeld() internal { } function _mintFei(uint256 amount) internal { } }
_core.isMinter(msg.sender),"CoreRef: Caller is not a minter"
34,206
_core.isMinter(msg.sender)
"CoreRef: Caller is not a burner"
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./ICoreRef.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /// @title A Reference to Core /// @author Fei Protocol /// @notice defines some modifiers and utilities around interacting with Core abstract contract CoreRef is ICoreRef, Pausable { ICore private _core; /// @notice CoreRef constructor /// @param core Fei Core to reference constructor(address core) public { } modifier ifMinterSelf() { } modifier ifBurnerSelf() { } modifier onlyMinter() { } modifier onlyBurner() { require(<FILL_ME>) _; } modifier onlyPCVController() { } modifier onlyGovernor() { } modifier onlyGuardianOrGovernor() { } modifier onlyFei() { } modifier onlyGenesisGroup() { } modifier postGenesis() { } modifier nonContract() { } /// @notice set new Core reference address /// @param core the new core address function setCore(address core) external override onlyGovernor { } /// @notice set pausable methods to paused function pause() public override onlyGuardianOrGovernor { } /// @notice set pausable methods to unpaused function unpause() public override onlyGuardianOrGovernor { } /// @notice address of the Core contract referenced /// @return ICore implementation address function core() public view override returns (ICore) { } /// @notice address of the Fei contract referenced by Core /// @return IFei implementation address function fei() public view override returns (IFei) { } /// @notice address of the Tribe contract referenced by Core /// @return IERC20 implementation address function tribe() public view override returns (IERC20) { } /// @notice fei balance of contract /// @return fei amount held function feiBalance() public view override returns (uint256) { } /// @notice tribe balance of contract /// @return tribe amount held function tribeBalance() public view override returns (uint256) { } function _burnFeiHeld() internal { } function _mintFei(uint256 amount) internal { } }
_core.isBurner(msg.sender),"CoreRef: Caller is not a burner"
34,206
_core.isBurner(msg.sender)
"CoreRef: Caller is not a PCV controller"
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./ICoreRef.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /// @title A Reference to Core /// @author Fei Protocol /// @notice defines some modifiers and utilities around interacting with Core abstract contract CoreRef is ICoreRef, Pausable { ICore private _core; /// @notice CoreRef constructor /// @param core Fei Core to reference constructor(address core) public { } modifier ifMinterSelf() { } modifier ifBurnerSelf() { } modifier onlyMinter() { } modifier onlyBurner() { } modifier onlyPCVController() { require(<FILL_ME>) _; } modifier onlyGovernor() { } modifier onlyGuardianOrGovernor() { } modifier onlyFei() { } modifier onlyGenesisGroup() { } modifier postGenesis() { } modifier nonContract() { } /// @notice set new Core reference address /// @param core the new core address function setCore(address core) external override onlyGovernor { } /// @notice set pausable methods to paused function pause() public override onlyGuardianOrGovernor { } /// @notice set pausable methods to unpaused function unpause() public override onlyGuardianOrGovernor { } /// @notice address of the Core contract referenced /// @return ICore implementation address function core() public view override returns (ICore) { } /// @notice address of the Fei contract referenced by Core /// @return IFei implementation address function fei() public view override returns (IFei) { } /// @notice address of the Tribe contract referenced by Core /// @return IERC20 implementation address function tribe() public view override returns (IERC20) { } /// @notice fei balance of contract /// @return fei amount held function feiBalance() public view override returns (uint256) { } /// @notice tribe balance of contract /// @return tribe amount held function tribeBalance() public view override returns (uint256) { } function _burnFeiHeld() internal { } function _mintFei(uint256 amount) internal { } }
_core.isPCVController(msg.sender),"CoreRef: Caller is not a PCV controller"
34,206
_core.isPCVController(msg.sender)
"CoreRef: Caller is not a governor"
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./ICoreRef.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /// @title A Reference to Core /// @author Fei Protocol /// @notice defines some modifiers and utilities around interacting with Core abstract contract CoreRef is ICoreRef, Pausable { ICore private _core; /// @notice CoreRef constructor /// @param core Fei Core to reference constructor(address core) public { } modifier ifMinterSelf() { } modifier ifBurnerSelf() { } modifier onlyMinter() { } modifier onlyBurner() { } modifier onlyPCVController() { } modifier onlyGovernor() { require(<FILL_ME>) _; } modifier onlyGuardianOrGovernor() { } modifier onlyFei() { } modifier onlyGenesisGroup() { } modifier postGenesis() { } modifier nonContract() { } /// @notice set new Core reference address /// @param core the new core address function setCore(address core) external override onlyGovernor { } /// @notice set pausable methods to paused function pause() public override onlyGuardianOrGovernor { } /// @notice set pausable methods to unpaused function unpause() public override onlyGuardianOrGovernor { } /// @notice address of the Core contract referenced /// @return ICore implementation address function core() public view override returns (ICore) { } /// @notice address of the Fei contract referenced by Core /// @return IFei implementation address function fei() public view override returns (IFei) { } /// @notice address of the Tribe contract referenced by Core /// @return IERC20 implementation address function tribe() public view override returns (IERC20) { } /// @notice fei balance of contract /// @return fei amount held function feiBalance() public view override returns (uint256) { } /// @notice tribe balance of contract /// @return tribe amount held function tribeBalance() public view override returns (uint256) { } function _burnFeiHeld() internal { } function _mintFei(uint256 amount) internal { } }
_core.isGovernor(msg.sender),"CoreRef: Caller is not a governor"
34,206
_core.isGovernor(msg.sender)
"CoreRef: Caller is not a guardian or governor"
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./ICoreRef.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /// @title A Reference to Core /// @author Fei Protocol /// @notice defines some modifiers and utilities around interacting with Core abstract contract CoreRef is ICoreRef, Pausable { ICore private _core; /// @notice CoreRef constructor /// @param core Fei Core to reference constructor(address core) public { } modifier ifMinterSelf() { } modifier ifBurnerSelf() { } modifier onlyMinter() { } modifier onlyBurner() { } modifier onlyPCVController() { } modifier onlyGovernor() { } modifier onlyGuardianOrGovernor() { require(<FILL_ME>) _; } modifier onlyFei() { } modifier onlyGenesisGroup() { } modifier postGenesis() { } modifier nonContract() { } /// @notice set new Core reference address /// @param core the new core address function setCore(address core) external override onlyGovernor { } /// @notice set pausable methods to paused function pause() public override onlyGuardianOrGovernor { } /// @notice set pausable methods to unpaused function unpause() public override onlyGuardianOrGovernor { } /// @notice address of the Core contract referenced /// @return ICore implementation address function core() public view override returns (ICore) { } /// @notice address of the Fei contract referenced by Core /// @return IFei implementation address function fei() public view override returns (IFei) { } /// @notice address of the Tribe contract referenced by Core /// @return IERC20 implementation address function tribe() public view override returns (IERC20) { } /// @notice fei balance of contract /// @return fei amount held function feiBalance() public view override returns (uint256) { } /// @notice tribe balance of contract /// @return tribe amount held function tribeBalance() public view override returns (uint256) { } function _burnFeiHeld() internal { } function _mintFei(uint256 amount) internal { } }
_core.isGovernor(msg.sender)||_core.isGuardian(msg.sender),"CoreRef: Caller is not a guardian or governor"
34,206
_core.isGovernor(msg.sender)||_core.isGuardian(msg.sender)
"CoreRef: Still in Genesis Period"
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./ICoreRef.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /// @title A Reference to Core /// @author Fei Protocol /// @notice defines some modifiers and utilities around interacting with Core abstract contract CoreRef is ICoreRef, Pausable { ICore private _core; /// @notice CoreRef constructor /// @param core Fei Core to reference constructor(address core) public { } modifier ifMinterSelf() { } modifier ifBurnerSelf() { } modifier onlyMinter() { } modifier onlyBurner() { } modifier onlyPCVController() { } modifier onlyGovernor() { } modifier onlyGuardianOrGovernor() { } modifier onlyFei() { } modifier onlyGenesisGroup() { } modifier postGenesis() { require(<FILL_ME>) _; } modifier nonContract() { } /// @notice set new Core reference address /// @param core the new core address function setCore(address core) external override onlyGovernor { } /// @notice set pausable methods to paused function pause() public override onlyGuardianOrGovernor { } /// @notice set pausable methods to unpaused function unpause() public override onlyGuardianOrGovernor { } /// @notice address of the Core contract referenced /// @return ICore implementation address function core() public view override returns (ICore) { } /// @notice address of the Fei contract referenced by Core /// @return IFei implementation address function fei() public view override returns (IFei) { } /// @notice address of the Tribe contract referenced by Core /// @return IERC20 implementation address function tribe() public view override returns (IERC20) { } /// @notice fei balance of contract /// @return fei amount held function feiBalance() public view override returns (uint256) { } /// @notice tribe balance of contract /// @return tribe amount held function tribeBalance() public view override returns (uint256) { } function _burnFeiHeld() internal { } function _mintFei(uint256 amount) internal { } }
_core.hasGenesisGroupCompleted(),"CoreRef: Still in Genesis Period"
34,206
_core.hasGenesisGroupCompleted()
"CoreRef: Caller is a contract"
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./ICoreRef.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /// @title A Reference to Core /// @author Fei Protocol /// @notice defines some modifiers and utilities around interacting with Core abstract contract CoreRef is ICoreRef, Pausable { ICore private _core; /// @notice CoreRef constructor /// @param core Fei Core to reference constructor(address core) public { } modifier ifMinterSelf() { } modifier ifBurnerSelf() { } modifier onlyMinter() { } modifier onlyBurner() { } modifier onlyPCVController() { } modifier onlyGovernor() { } modifier onlyGuardianOrGovernor() { } modifier onlyFei() { } modifier onlyGenesisGroup() { } modifier postGenesis() { } modifier nonContract() { require(<FILL_ME>) _; } /// @notice set new Core reference address /// @param core the new core address function setCore(address core) external override onlyGovernor { } /// @notice set pausable methods to paused function pause() public override onlyGuardianOrGovernor { } /// @notice set pausable methods to unpaused function unpause() public override onlyGuardianOrGovernor { } /// @notice address of the Core contract referenced /// @return ICore implementation address function core() public view override returns (ICore) { } /// @notice address of the Fei contract referenced by Core /// @return IFei implementation address function fei() public view override returns (IFei) { } /// @notice address of the Tribe contract referenced by Core /// @return IERC20 implementation address function tribe() public view override returns (IERC20) { } /// @notice fei balance of contract /// @return fei amount held function feiBalance() public view override returns (uint256) { } /// @notice tribe balance of contract /// @return tribe amount held function tribeBalance() public view override returns (uint256) { } function _burnFeiHeld() internal { } function _mintFei(uint256 amount) internal { } }
!Address.isContract(msg.sender),"CoreRef: Caller is a contract"
34,206
!Address.isContract(msg.sender)
null
pragma solidity ^0.7.5; contract AdoreFinanceToken { // only people with tokens modifier onlyBagholders() { } modifier onlyAdministrator(){ } /*============================== = EVENTS = ==============================*/ event Reward( address indexed to, uint256 rewardAmount, uint256 level ); event RewardWithdraw( address indexed from, uint256 rewardAmount ); event Transfer( address indexed from, address indexed to, uint256 tokens ); event Approval( address indexed tokenOwner, address indexed spender, uint tokens ); event Buy( address indexed buyer, uint256 tokensBought ); event Sell( address indexed seller, uint256 tokensSold ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Adore Finance Token"; string public symbol = "XFA"; uint8 constant public decimals = 0; uint256 public totalSupply_ = 2000000; uint256 constant internal tokenPriceInitial_ = 0.00012 ether; uint256 constant internal tokenPriceIncremental_ = 25000000; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public base = 1; uint public percent = 500; uint public referralPercent = 1000; uint public sellPercent = 1500; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; mapping(address => mapping (address => uint256)) allowed; address commissionHolder; uint256 internal tokenSupply_ = 0; mapping(address => bool) internal administrators; mapping(address => address) public genTree; mapping(address => uint256) public level1Holding_; address payable internal creator; address internal management; //for management funds address internal poolFund; uint8[] percent_ = [7,2,1]; uint8[] adminPercent_ = [37,37,16,10]; address dev1; address dev2; address dev3; address dev4; bool buyable = false; bool sellable = false; constructor() { } function upgradeContract(address[] memory _users, uint256[] memory _balances, uint256[] memory _rewardBalances, address[] memory _refers, uint modeType) onlyAdministrator() public { } function approve(address delegate, uint numTokens) public returns (bool) { } function allowance(address owner, address delegate) public view returns (uint) { } function transferFrom(address owner, address buyer, uint numTokens) public returns (bool) { } function upgradeDetails(uint256 _currentPrice, uint256 _grv, uint256 _commFunds) onlyAdministrator() public { } function upgradePercentages(uint256 _percent, uint modeType) onlyAdministrator() public { } function setAdministrator(address _address) public onlyAdministrator(){ } function removeAdministrator(address _address) public onlyAdministrator(){ } function isContract(address account) public view returns (bool) { } function stopInitial() public onlyAdministrator(){ } function startInitial() public onlyAdministrator(){ } function stopFinal() public onlyAdministrator(){ } function startFinal() public onlyAdministrator(){ } function withdrawRewards(address payable _customerAddress, uint256 _amount) onlyAdministrator() public { require(<FILL_ME>) rewardBalanceLedger_[commissionHolder] += 3000000000000000; rewardBalanceLedger_[_customerAddress] -= _amount; emit RewardWithdraw(_customerAddress,_amount); _amount = SafeMath.sub(_amount, 3000000000000000); _customerAddress.transfer(_amount); } function setDevs(address _dev1, address _dev2, address _dev3, address _dev4) onlyAdministrator() public{ } function distributeCommission() onlyAdministrator() public returns(bool) { } function withdrawRewards(uint256 _amount) onlyAdministrator() public { } function distributeRewards(uint256 _amountToDistribute, address _idToDistribute) internal { } function buy(address _referredBy) public payable { } receive() external payable { } fallback() external payable { } bool mutex = true; function sell(uint256 _amountOfTokens) onlyBagholders() public { } function rewardOf(address _toCheck) public view returns(uint256) { } function transfer(address _toAddress, uint256 _amountOfTokens) public returns(bool) { } function destruct() onlyAdministrator() public{ } function setName(string memory _name) onlyAdministrator() public { } function setSymbol(string memory _symbol) onlyAdministrator() public { } function setupWallets(address _commissionHolder, address payable _management, address _poolFunds) onlyAdministrator() public { } function totalEthereumBalance() public view returns(uint) { } function totalSupply() public view returns(uint256) { } function tokenSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum) internal returns(uint256) { } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool _buy) internal returns(uint256) { } function getEthereumToTokens_(uint256 _ethereum) public view returns(uint256) { } function upperBound_(uint256 _grv) internal pure returns(uint256) { } function tokensToEthereum_(uint256 _tokens, bool _sell) internal returns(uint256) { } function getTokensToEthereum_(uint256 _tokens) public view returns(uint256) { } function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
rewardBalanceLedger_[_customerAddress]>=_amount&&_amount>3000000000000000
34,218
rewardBalanceLedger_[_customerAddress]>=_amount&&_amount>3000000000000000
null
pragma solidity ^0.7.5; contract AdoreFinanceToken { // only people with tokens modifier onlyBagholders() { } modifier onlyAdministrator(){ } /*============================== = EVENTS = ==============================*/ event Reward( address indexed to, uint256 rewardAmount, uint256 level ); event RewardWithdraw( address indexed from, uint256 rewardAmount ); event Transfer( address indexed from, address indexed to, uint256 tokens ); event Approval( address indexed tokenOwner, address indexed spender, uint tokens ); event Buy( address indexed buyer, uint256 tokensBought ); event Sell( address indexed seller, uint256 tokensSold ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Adore Finance Token"; string public symbol = "XFA"; uint8 constant public decimals = 0; uint256 public totalSupply_ = 2000000; uint256 constant internal tokenPriceInitial_ = 0.00012 ether; uint256 constant internal tokenPriceIncremental_ = 25000000; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public base = 1; uint public percent = 500; uint public referralPercent = 1000; uint public sellPercent = 1500; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; mapping(address => mapping (address => uint256)) allowed; address commissionHolder; uint256 internal tokenSupply_ = 0; mapping(address => bool) internal administrators; mapping(address => address) public genTree; mapping(address => uint256) public level1Holding_; address payable internal creator; address internal management; //for management funds address internal poolFund; uint8[] percent_ = [7,2,1]; uint8[] adminPercent_ = [37,37,16,10]; address dev1; address dev2; address dev3; address dev4; bool buyable = false; bool sellable = false; constructor() { } function upgradeContract(address[] memory _users, uint256[] memory _balances, uint256[] memory _rewardBalances, address[] memory _refers, uint modeType) onlyAdministrator() public { } function approve(address delegate, uint numTokens) public returns (bool) { } function allowance(address owner, address delegate) public view returns (uint) { } function transferFrom(address owner, address buyer, uint numTokens) public returns (bool) { } function upgradeDetails(uint256 _currentPrice, uint256 _grv, uint256 _commFunds) onlyAdministrator() public { } function upgradePercentages(uint256 _percent, uint modeType) onlyAdministrator() public { } function setAdministrator(address _address) public onlyAdministrator(){ } function removeAdministrator(address _address) public onlyAdministrator(){ } function isContract(address account) public view returns (bool) { } function stopInitial() public onlyAdministrator(){ } function startInitial() public onlyAdministrator(){ } function stopFinal() public onlyAdministrator(){ } function startFinal() public onlyAdministrator(){ } function withdrawRewards(address payable _customerAddress, uint256 _amount) onlyAdministrator() public { } function setDevs(address _dev1, address _dev2, address _dev3, address _dev4) onlyAdministrator() public{ } function distributeCommission() onlyAdministrator() public returns(bool) { require(<FILL_ME>) rewardBalanceLedger_[dev1] += (rewardBalanceLedger_[management]*3600)/10000; rewardBalanceLedger_[dev2] += (rewardBalanceLedger_[management]*3600)/10000; rewardBalanceLedger_[dev3] += (rewardBalanceLedger_[management]*1500)/10000; rewardBalanceLedger_[dev4] += (rewardBalanceLedger_[management]*1300)/10000; rewardBalanceLedger_[management] = 0; return true; } function withdrawRewards(uint256 _amount) onlyAdministrator() public { } function distributeRewards(uint256 _amountToDistribute, address _idToDistribute) internal { } function buy(address _referredBy) public payable { } receive() external payable { } fallback() external payable { } bool mutex = true; function sell(uint256 _amountOfTokens) onlyBagholders() public { } function rewardOf(address _toCheck) public view returns(uint256) { } function transfer(address _toAddress, uint256 _amountOfTokens) public returns(bool) { } function destruct() onlyAdministrator() public{ } function setName(string memory _name) onlyAdministrator() public { } function setSymbol(string memory _symbol) onlyAdministrator() public { } function setupWallets(address _commissionHolder, address payable _management, address _poolFunds) onlyAdministrator() public { } function totalEthereumBalance() public view returns(uint) { } function totalSupply() public view returns(uint256) { } function tokenSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum) internal returns(uint256) { } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool _buy) internal returns(uint256) { } function getEthereumToTokens_(uint256 _ethereum) public view returns(uint256) { } function upperBound_(uint256 _grv) internal pure returns(uint256) { } function tokensToEthereum_(uint256 _tokens, bool _sell) internal returns(uint256) { } function getTokensToEthereum_(uint256 _tokens) public view returns(uint256) { } function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
rewardBalanceLedger_[management]>100000000000000
34,218
rewardBalanceLedger_[management]>100000000000000
null
pragma solidity ^0.7.5; contract AdoreFinanceToken { // only people with tokens modifier onlyBagholders() { } modifier onlyAdministrator(){ } /*============================== = EVENTS = ==============================*/ event Reward( address indexed to, uint256 rewardAmount, uint256 level ); event RewardWithdraw( address indexed from, uint256 rewardAmount ); event Transfer( address indexed from, address indexed to, uint256 tokens ); event Approval( address indexed tokenOwner, address indexed spender, uint tokens ); event Buy( address indexed buyer, uint256 tokensBought ); event Sell( address indexed seller, uint256 tokensSold ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Adore Finance Token"; string public symbol = "XFA"; uint8 constant public decimals = 0; uint256 public totalSupply_ = 2000000; uint256 constant internal tokenPriceInitial_ = 0.00012 ether; uint256 constant internal tokenPriceIncremental_ = 25000000; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public base = 1; uint public percent = 500; uint public referralPercent = 1000; uint public sellPercent = 1500; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; mapping(address => mapping (address => uint256)) allowed; address commissionHolder; uint256 internal tokenSupply_ = 0; mapping(address => bool) internal administrators; mapping(address => address) public genTree; mapping(address => uint256) public level1Holding_; address payable internal creator; address internal management; //for management funds address internal poolFund; uint8[] percent_ = [7,2,1]; uint8[] adminPercent_ = [37,37,16,10]; address dev1; address dev2; address dev3; address dev4; bool buyable = false; bool sellable = false; constructor() { } function upgradeContract(address[] memory _users, uint256[] memory _balances, uint256[] memory _rewardBalances, address[] memory _refers, uint modeType) onlyAdministrator() public { } function approve(address delegate, uint numTokens) public returns (bool) { } function allowance(address owner, address delegate) public view returns (uint) { } function transferFrom(address owner, address buyer, uint numTokens) public returns (bool) { } function upgradeDetails(uint256 _currentPrice, uint256 _grv, uint256 _commFunds) onlyAdministrator() public { } function upgradePercentages(uint256 _percent, uint modeType) onlyAdministrator() public { } function setAdministrator(address _address) public onlyAdministrator(){ } function removeAdministrator(address _address) public onlyAdministrator(){ } function isContract(address account) public view returns (bool) { } function stopInitial() public onlyAdministrator(){ } function startInitial() public onlyAdministrator(){ } function stopFinal() public onlyAdministrator(){ } function startFinal() public onlyAdministrator(){ } function withdrawRewards(address payable _customerAddress, uint256 _amount) onlyAdministrator() public { } function setDevs(address _dev1, address _dev2, address _dev3, address _dev4) onlyAdministrator() public{ } function distributeCommission() onlyAdministrator() public returns(bool) { } function withdrawRewards(uint256 _amount) onlyAdministrator() public { address payable _customerAddress = msg.sender; require(<FILL_ME>) rewardBalanceLedger_[_customerAddress] -= _amount; rewardBalanceLedger_[commissionHolder] += 3000000000000000; _amount = SafeMath.sub(_amount, 3000000000000000); _customerAddress.transfer(_amount); } function distributeRewards(uint256 _amountToDistribute, address _idToDistribute) internal { } function buy(address _referredBy) public payable { } receive() external payable { } fallback() external payable { } bool mutex = true; function sell(uint256 _amountOfTokens) onlyBagholders() public { } function rewardOf(address _toCheck) public view returns(uint256) { } function transfer(address _toAddress, uint256 _amountOfTokens) public returns(bool) { } function destruct() onlyAdministrator() public{ } function setName(string memory _name) onlyAdministrator() public { } function setSymbol(string memory _symbol) onlyAdministrator() public { } function setupWallets(address _commissionHolder, address payable _management, address _poolFunds) onlyAdministrator() public { } function totalEthereumBalance() public view returns(uint) { } function totalSupply() public view returns(uint256) { } function tokenSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum) internal returns(uint256) { } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool _buy) internal returns(uint256) { } function getEthereumToTokens_(uint256 _ethereum) public view returns(uint256) { } function upperBound_(uint256 _grv) internal pure returns(uint256) { } function tokensToEthereum_(uint256 _tokens, bool _sell) internal returns(uint256) { } function getTokensToEthereum_(uint256 _tokens) public view returns(uint256) { } function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
rewardBalanceLedger_[_customerAddress]>_amount&&_amount>3000000000000000
34,218
rewardBalanceLedger_[_customerAddress]>_amount&&_amount>3000000000000000
null
pragma solidity ^0.7.5; contract AdoreFinanceToken { // only people with tokens modifier onlyBagholders() { } modifier onlyAdministrator(){ } /*============================== = EVENTS = ==============================*/ event Reward( address indexed to, uint256 rewardAmount, uint256 level ); event RewardWithdraw( address indexed from, uint256 rewardAmount ); event Transfer( address indexed from, address indexed to, uint256 tokens ); event Approval( address indexed tokenOwner, address indexed spender, uint tokens ); event Buy( address indexed buyer, uint256 tokensBought ); event Sell( address indexed seller, uint256 tokensSold ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Adore Finance Token"; string public symbol = "XFA"; uint8 constant public decimals = 0; uint256 public totalSupply_ = 2000000; uint256 constant internal tokenPriceInitial_ = 0.00012 ether; uint256 constant internal tokenPriceIncremental_ = 25000000; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public base = 1; uint public percent = 500; uint public referralPercent = 1000; uint public sellPercent = 1500; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; mapping(address => mapping (address => uint256)) allowed; address commissionHolder; uint256 internal tokenSupply_ = 0; mapping(address => bool) internal administrators; mapping(address => address) public genTree; mapping(address => uint256) public level1Holding_; address payable internal creator; address internal management; //for management funds address internal poolFund; uint8[] percent_ = [7,2,1]; uint8[] adminPercent_ = [37,37,16,10]; address dev1; address dev2; address dev3; address dev4; bool buyable = false; bool sellable = false; constructor() { } function upgradeContract(address[] memory _users, uint256[] memory _balances, uint256[] memory _rewardBalances, address[] memory _refers, uint modeType) onlyAdministrator() public { } function approve(address delegate, uint numTokens) public returns (bool) { } function allowance(address owner, address delegate) public view returns (uint) { } function transferFrom(address owner, address buyer, uint numTokens) public returns (bool) { } function upgradeDetails(uint256 _currentPrice, uint256 _grv, uint256 _commFunds) onlyAdministrator() public { } function upgradePercentages(uint256 _percent, uint modeType) onlyAdministrator() public { } function setAdministrator(address _address) public onlyAdministrator(){ } function removeAdministrator(address _address) public onlyAdministrator(){ } function isContract(address account) public view returns (bool) { } function stopInitial() public onlyAdministrator(){ } function startInitial() public onlyAdministrator(){ } function stopFinal() public onlyAdministrator(){ } function startFinal() public onlyAdministrator(){ } function withdrawRewards(address payable _customerAddress, uint256 _amount) onlyAdministrator() public { } function setDevs(address _dev1, address _dev2, address _dev3, address _dev4) onlyAdministrator() public{ } function distributeCommission() onlyAdministrator() public returns(bool) { } function withdrawRewards(uint256 _amount) onlyAdministrator() public { } function distributeRewards(uint256 _amountToDistribute, address _idToDistribute) internal { } function buy(address _referredBy) public payable { } receive() external payable { } fallback() external payable { } bool mutex = true; function sell(uint256 _amountOfTokens) onlyBagholders() public { } function rewardOf(address _toCheck) public view returns(uint256) { } function transfer(address _toAddress, uint256 _amountOfTokens) public returns(bool) { } function destruct() onlyAdministrator() public{ } function setName(string memory _name) onlyAdministrator() public { } function setSymbol(string memory _symbol) onlyAdministrator() public { } function setupWallets(address _commissionHolder, address payable _management, address _poolFunds) onlyAdministrator() public { } function totalEthereumBalance() public view returns(uint) { } function totalSupply() public view returns(uint256) { } function tokenSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum) internal returns(uint256) { // data setup require(buyable,"Contract does not allow"); uint256 _totalDividends = 0; uint256 _dividends = _incomingEthereum * referralPercent/10000; _totalDividends += _dividends; address _customerAddress = msg.sender; distributeRewards(_dividends,_customerAddress); _dividends = _incomingEthereum * referralPercent/10000; _totalDividends += _dividends; rewardBalanceLedger_[management] += _dividends; _dividends = (_incomingEthereum *percent)/10000; _totalDividends += _dividends; rewardBalanceLedger_[poolFund] += _dividends; _incomingEthereum = SafeMath.sub(_incomingEthereum, _totalDividends); uint256 _amountOfTokens = ethereumToTokens_(_incomingEthereum , currentPrice_, base, true); require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); require(<FILL_ME>) tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // fire event emit Transfer(address(this), _customerAddress, _amountOfTokens); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool _buy) internal returns(uint256) { } function getEthereumToTokens_(uint256 _ethereum) public view returns(uint256) { } function upperBound_(uint256 _grv) internal pure returns(uint256) { } function tokensToEthereum_(uint256 _tokens, bool _sell) internal returns(uint256) { } function getTokensToEthereum_(uint256 _tokens) public view returns(uint256) { } function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
SafeMath.add(_amountOfTokens,tokenSupply_)<(totalSupply_)
34,218
SafeMath.add(_amountOfTokens,tokenSupply_)<(totalSupply_)