comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | pragma solidity 0.5.12;
// solium-disable no-empty-blocks,error-reason
/**
* @title Registry
* @dev An ERC721 Token see https://eips.ethereum.org/EIPS/eip-721. With
* additional functions so other trusted contracts to interact with the tokens.
*/
contract Registry is IRegistry, ControllerRole, ERC721Burnable {
// Optional mapping for token URIs
mapping(uint256 => string) internal _tokenURIs;
string internal _prefix;
// Mapping from token ID to resolver address
mapping (uint256 => address) internal _tokenResolvers;
// uint256(keccak256(abi.encodePacked(uint256(0x0), keccak256(abi.encodePacked("crypto")))))
uint256 private constant _CRYPTO_HASH =
0x0f4a10a4f46c288cea365fcf45cccf0e9d901b945b9829ccdb54c10dc3cb7a6f;
modifier onlyApprovedOrOwner(uint256 tokenId) {
require(<FILL_ME>)
_;
}
constructor () public {
}
/// ERC721 Metadata extension
function name() external view returns (string memory) {
}
function symbol() external view returns (string memory) {
}
function tokenURI(uint256 tokenId) external view returns (string memory) {
}
function controlledSetTokenURIPrefix(string calldata prefix) external onlyController {
}
/// Ownership
function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool) {
}
/// Registry Constants
function root() public pure returns (uint256) {
}
function childIdOf(uint256 tokenId, string calldata label) external pure returns (uint256) {
}
/// Minting
function mintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledMintChild(address to, uint256 tokenId, string calldata label) external onlyController {
}
function safeMintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function safeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledSafeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyController
{
}
/// Transfering
function setOwner(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function transferFromChild(address from, address to, uint256 tokenId, string calldata label)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledTransferFrom(address from, address to, uint256 tokenId) external onlyController {
}
function safeTransferFromChild(
address from,
address to,
uint256 tokenId,
string memory label,
bytes memory _data
) public onlyApprovedOrOwner(tokenId) {
}
function safeTransferFromChild(address from, address to, uint256 tokenId, string calldata label) external {
}
function controlledSafeTransferFrom(address from, address to, uint256 tokenId, bytes calldata _data)
external
onlyController
{
}
/// Burning
function burnChild(uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledBurn(uint256 tokenId) external onlyController {
}
/// Resolution
function resolverOf(uint256 tokenId) external view returns (address) {
}
function resolveTo(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function controlledResolveTo(address to, uint256 tokenId) external onlyController {
}
function sync(uint256 tokenId, uint256 updateId) external {
}
/// Internal
function _childId(uint256 tokenId, string memory label) internal pure returns (uint256) {
}
function _mintChild(address to, uint256 tokenId, string memory label) internal {
}
function _safeMintChild(address to, uint256 tokenId, string memory label, bytes memory _data) internal {
}
function _transferFrom(address from, address to, uint256 tokenId) internal {
}
function _burn(uint256 tokenId) internal {
}
function _resolveTo(address to, uint256 tokenId) internal {
}
}
| _isApprovedOrOwner(msg.sender,tokenId) | 22,545 | _isApprovedOrOwner(msg.sender,tokenId) |
null | pragma solidity 0.5.12;
// solium-disable no-empty-blocks,error-reason
/**
* @title Registry
* @dev An ERC721 Token see https://eips.ethereum.org/EIPS/eip-721. With
* additional functions so other trusted contracts to interact with the tokens.
*/
contract Registry is IRegistry, ControllerRole, ERC721Burnable {
// Optional mapping for token URIs
mapping(uint256 => string) internal _tokenURIs;
string internal _prefix;
// Mapping from token ID to resolver address
mapping (uint256 => address) internal _tokenResolvers;
// uint256(keccak256(abi.encodePacked(uint256(0x0), keccak256(abi.encodePacked("crypto")))))
uint256 private constant _CRYPTO_HASH =
0x0f4a10a4f46c288cea365fcf45cccf0e9d901b945b9829ccdb54c10dc3cb7a6f;
modifier onlyApprovedOrOwner(uint256 tokenId) {
}
constructor () public {
}
/// ERC721 Metadata extension
function name() external view returns (string memory) {
}
function symbol() external view returns (string memory) {
}
function tokenURI(uint256 tokenId) external view returns (string memory) {
}
function controlledSetTokenURIPrefix(string calldata prefix) external onlyController {
}
/// Ownership
function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool) {
}
/// Registry Constants
function root() public pure returns (uint256) {
}
function childIdOf(uint256 tokenId, string calldata label) external pure returns (uint256) {
}
/// Minting
function mintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledMintChild(address to, uint256 tokenId, string calldata label) external onlyController {
}
function safeMintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function safeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledSafeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyController
{
}
/// Transfering
function setOwner(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function transferFromChild(address from, address to, uint256 tokenId, string calldata label)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledTransferFrom(address from, address to, uint256 tokenId) external onlyController {
}
function safeTransferFromChild(
address from,
address to,
uint256 tokenId,
string memory label,
bytes memory _data
) public onlyApprovedOrOwner(tokenId) {
uint256 childId = _childId(tokenId, label);
_transferFrom(from, to, childId);
require(<FILL_ME>)
}
function safeTransferFromChild(address from, address to, uint256 tokenId, string calldata label) external {
}
function controlledSafeTransferFrom(address from, address to, uint256 tokenId, bytes calldata _data)
external
onlyController
{
}
/// Burning
function burnChild(uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledBurn(uint256 tokenId) external onlyController {
}
/// Resolution
function resolverOf(uint256 tokenId) external view returns (address) {
}
function resolveTo(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function controlledResolveTo(address to, uint256 tokenId) external onlyController {
}
function sync(uint256 tokenId, uint256 updateId) external {
}
/// Internal
function _childId(uint256 tokenId, string memory label) internal pure returns (uint256) {
}
function _mintChild(address to, uint256 tokenId, string memory label) internal {
}
function _safeMintChild(address to, uint256 tokenId, string memory label, bytes memory _data) internal {
}
function _transferFrom(address from, address to, uint256 tokenId) internal {
}
function _burn(uint256 tokenId) internal {
}
function _resolveTo(address to, uint256 tokenId) internal {
}
}
| _checkOnERC721Received(from,to,childId,_data) | 22,545 | _checkOnERC721Received(from,to,childId,_data) |
null | pragma solidity 0.5.12;
// solium-disable no-empty-blocks,error-reason
/**
* @title Registry
* @dev An ERC721 Token see https://eips.ethereum.org/EIPS/eip-721. With
* additional functions so other trusted contracts to interact with the tokens.
*/
contract Registry is IRegistry, ControllerRole, ERC721Burnable {
// Optional mapping for token URIs
mapping(uint256 => string) internal _tokenURIs;
string internal _prefix;
// Mapping from token ID to resolver address
mapping (uint256 => address) internal _tokenResolvers;
// uint256(keccak256(abi.encodePacked(uint256(0x0), keccak256(abi.encodePacked("crypto")))))
uint256 private constant _CRYPTO_HASH =
0x0f4a10a4f46c288cea365fcf45cccf0e9d901b945b9829ccdb54c10dc3cb7a6f;
modifier onlyApprovedOrOwner(uint256 tokenId) {
}
constructor () public {
}
/// ERC721 Metadata extension
function name() external view returns (string memory) {
}
function symbol() external view returns (string memory) {
}
function tokenURI(uint256 tokenId) external view returns (string memory) {
}
function controlledSetTokenURIPrefix(string calldata prefix) external onlyController {
}
/// Ownership
function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool) {
}
/// Registry Constants
function root() public pure returns (uint256) {
}
function childIdOf(uint256 tokenId, string calldata label) external pure returns (uint256) {
}
/// Minting
function mintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledMintChild(address to, uint256 tokenId, string calldata label) external onlyController {
}
function safeMintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function safeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledSafeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyController
{
}
/// Transfering
function setOwner(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function transferFromChild(address from, address to, uint256 tokenId, string calldata label)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledTransferFrom(address from, address to, uint256 tokenId) external onlyController {
}
function safeTransferFromChild(
address from,
address to,
uint256 tokenId,
string memory label,
bytes memory _data
) public onlyApprovedOrOwner(tokenId) {
}
function safeTransferFromChild(address from, address to, uint256 tokenId, string calldata label) external {
}
function controlledSafeTransferFrom(address from, address to, uint256 tokenId, bytes calldata _data)
external
onlyController
{
}
/// Burning
function burnChild(uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledBurn(uint256 tokenId) external onlyController {
}
/// Resolution
function resolverOf(uint256 tokenId) external view returns (address) {
}
function resolveTo(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function controlledResolveTo(address to, uint256 tokenId) external onlyController {
}
function sync(uint256 tokenId, uint256 updateId) external {
require(<FILL_ME>)
emit Sync(msg.sender, updateId, tokenId);
}
/// Internal
function _childId(uint256 tokenId, string memory label) internal pure returns (uint256) {
}
function _mintChild(address to, uint256 tokenId, string memory label) internal {
}
function _safeMintChild(address to, uint256 tokenId, string memory label, bytes memory _data) internal {
}
function _transferFrom(address from, address to, uint256 tokenId) internal {
}
function _burn(uint256 tokenId) internal {
}
function _resolveTo(address to, uint256 tokenId) internal {
}
}
| _tokenResolvers[tokenId]==msg.sender | 22,545 | _tokenResolvers[tokenId]==msg.sender |
null | pragma solidity 0.5.12;
// solium-disable no-empty-blocks,error-reason
/**
* @title Registry
* @dev An ERC721 Token see https://eips.ethereum.org/EIPS/eip-721. With
* additional functions so other trusted contracts to interact with the tokens.
*/
contract Registry is IRegistry, ControllerRole, ERC721Burnable {
// Optional mapping for token URIs
mapping(uint256 => string) internal _tokenURIs;
string internal _prefix;
// Mapping from token ID to resolver address
mapping (uint256 => address) internal _tokenResolvers;
// uint256(keccak256(abi.encodePacked(uint256(0x0), keccak256(abi.encodePacked("crypto")))))
uint256 private constant _CRYPTO_HASH =
0x0f4a10a4f46c288cea365fcf45cccf0e9d901b945b9829ccdb54c10dc3cb7a6f;
modifier onlyApprovedOrOwner(uint256 tokenId) {
}
constructor () public {
}
/// ERC721 Metadata extension
function name() external view returns (string memory) {
}
function symbol() external view returns (string memory) {
}
function tokenURI(uint256 tokenId) external view returns (string memory) {
}
function controlledSetTokenURIPrefix(string calldata prefix) external onlyController {
}
/// Ownership
function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool) {
}
/// Registry Constants
function root() public pure returns (uint256) {
}
function childIdOf(uint256 tokenId, string calldata label) external pure returns (uint256) {
}
/// Minting
function mintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledMintChild(address to, uint256 tokenId, string calldata label) external onlyController {
}
function safeMintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function safeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledSafeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyController
{
}
/// Transfering
function setOwner(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function transferFromChild(address from, address to, uint256 tokenId, string calldata label)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledTransferFrom(address from, address to, uint256 tokenId) external onlyController {
}
function safeTransferFromChild(
address from,
address to,
uint256 tokenId,
string memory label,
bytes memory _data
) public onlyApprovedOrOwner(tokenId) {
}
function safeTransferFromChild(address from, address to, uint256 tokenId, string calldata label) external {
}
function controlledSafeTransferFrom(address from, address to, uint256 tokenId, bytes calldata _data)
external
onlyController
{
}
/// Burning
function burnChild(uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledBurn(uint256 tokenId) external onlyController {
}
/// Resolution
function resolverOf(uint256 tokenId) external view returns (address) {
}
function resolveTo(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function controlledResolveTo(address to, uint256 tokenId) external onlyController {
}
function sync(uint256 tokenId, uint256 updateId) external {
}
/// Internal
function _childId(uint256 tokenId, string memory label) internal pure returns (uint256) {
require(<FILL_ME>)
return uint256(keccak256(abi.encodePacked(tokenId, keccak256(abi.encodePacked(label)))));
}
function _mintChild(address to, uint256 tokenId, string memory label) internal {
}
function _safeMintChild(address to, uint256 tokenId, string memory label, bytes memory _data) internal {
}
function _transferFrom(address from, address to, uint256 tokenId) internal {
}
function _burn(uint256 tokenId) internal {
}
function _resolveTo(address to, uint256 tokenId) internal {
}
}
| bytes(label).length!=0 | 22,545 | bytes(label).length!=0 |
null | pragma solidity 0.5.12;
// solium-disable no-empty-blocks,error-reason
/**
* @title Registry
* @dev An ERC721 Token see https://eips.ethereum.org/EIPS/eip-721. With
* additional functions so other trusted contracts to interact with the tokens.
*/
contract Registry is IRegistry, ControllerRole, ERC721Burnable {
// Optional mapping for token URIs
mapping(uint256 => string) internal _tokenURIs;
string internal _prefix;
// Mapping from token ID to resolver address
mapping (uint256 => address) internal _tokenResolvers;
// uint256(keccak256(abi.encodePacked(uint256(0x0), keccak256(abi.encodePacked("crypto")))))
uint256 private constant _CRYPTO_HASH =
0x0f4a10a4f46c288cea365fcf45cccf0e9d901b945b9829ccdb54c10dc3cb7a6f;
modifier onlyApprovedOrOwner(uint256 tokenId) {
}
constructor () public {
}
/// ERC721 Metadata extension
function name() external view returns (string memory) {
}
function symbol() external view returns (string memory) {
}
function tokenURI(uint256 tokenId) external view returns (string memory) {
}
function controlledSetTokenURIPrefix(string calldata prefix) external onlyController {
}
/// Ownership
function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool) {
}
/// Registry Constants
function root() public pure returns (uint256) {
}
function childIdOf(uint256 tokenId, string calldata label) external pure returns (uint256) {
}
/// Minting
function mintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledMintChild(address to, uint256 tokenId, string calldata label) external onlyController {
}
function safeMintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function safeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledSafeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyController
{
}
/// Transfering
function setOwner(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function transferFromChild(address from, address to, uint256 tokenId, string calldata label)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledTransferFrom(address from, address to, uint256 tokenId) external onlyController {
}
function safeTransferFromChild(
address from,
address to,
uint256 tokenId,
string memory label,
bytes memory _data
) public onlyApprovedOrOwner(tokenId) {
}
function safeTransferFromChild(address from, address to, uint256 tokenId, string calldata label) external {
}
function controlledSafeTransferFrom(address from, address to, uint256 tokenId, bytes calldata _data)
external
onlyController
{
}
/// Burning
function burnChild(uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledBurn(uint256 tokenId) external onlyController {
}
/// Resolution
function resolverOf(uint256 tokenId) external view returns (address) {
}
function resolveTo(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function controlledResolveTo(address to, uint256 tokenId) external onlyController {
}
function sync(uint256 tokenId, uint256 updateId) external {
}
/// Internal
function _childId(uint256 tokenId, string memory label) internal pure returns (uint256) {
}
function _mintChild(address to, uint256 tokenId, string memory label) internal {
uint256 childId = _childId(tokenId, label);
_mint(to, childId);
require(bytes(label).length != 0);
require(<FILL_ME>)
bytes memory domain = abi.encodePacked(label, ".", _tokenURIs[tokenId]);
_tokenURIs[childId] = string(domain);
emit NewURI(childId, string(domain));
}
function _safeMintChild(address to, uint256 tokenId, string memory label, bytes memory _data) internal {
}
function _transferFrom(address from, address to, uint256 tokenId) internal {
}
function _burn(uint256 tokenId) internal {
}
function _resolveTo(address to, uint256 tokenId) internal {
}
}
| _exists(childId) | 22,545 | _exists(childId) |
null | pragma solidity 0.5.12;
// solium-disable no-empty-blocks,error-reason
/**
* @title Registry
* @dev An ERC721 Token see https://eips.ethereum.org/EIPS/eip-721. With
* additional functions so other trusted contracts to interact with the tokens.
*/
contract Registry is IRegistry, ControllerRole, ERC721Burnable {
// Optional mapping for token URIs
mapping(uint256 => string) internal _tokenURIs;
string internal _prefix;
// Mapping from token ID to resolver address
mapping (uint256 => address) internal _tokenResolvers;
// uint256(keccak256(abi.encodePacked(uint256(0x0), keccak256(abi.encodePacked("crypto")))))
uint256 private constant _CRYPTO_HASH =
0x0f4a10a4f46c288cea365fcf45cccf0e9d901b945b9829ccdb54c10dc3cb7a6f;
modifier onlyApprovedOrOwner(uint256 tokenId) {
}
constructor () public {
}
/// ERC721 Metadata extension
function name() external view returns (string memory) {
}
function symbol() external view returns (string memory) {
}
function tokenURI(uint256 tokenId) external view returns (string memory) {
}
function controlledSetTokenURIPrefix(string calldata prefix) external onlyController {
}
/// Ownership
function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool) {
}
/// Registry Constants
function root() public pure returns (uint256) {
}
function childIdOf(uint256 tokenId, string calldata label) external pure returns (uint256) {
}
/// Minting
function mintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledMintChild(address to, uint256 tokenId, string calldata label) external onlyController {
}
function safeMintChild(address to, uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function safeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledSafeMintChild(address to, uint256 tokenId, string calldata label, bytes calldata _data)
external
onlyController
{
}
/// Transfering
function setOwner(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function transferFromChild(address from, address to, uint256 tokenId, string calldata label)
external
onlyApprovedOrOwner(tokenId)
{
}
function controlledTransferFrom(address from, address to, uint256 tokenId) external onlyController {
}
function safeTransferFromChild(
address from,
address to,
uint256 tokenId,
string memory label,
bytes memory _data
) public onlyApprovedOrOwner(tokenId) {
}
function safeTransferFromChild(address from, address to, uint256 tokenId, string calldata label) external {
}
function controlledSafeTransferFrom(address from, address to, uint256 tokenId, bytes calldata _data)
external
onlyController
{
}
/// Burning
function burnChild(uint256 tokenId, string calldata label) external onlyApprovedOrOwner(tokenId) {
}
function controlledBurn(uint256 tokenId) external onlyController {
}
/// Resolution
function resolverOf(uint256 tokenId) external view returns (address) {
}
function resolveTo(address to, uint256 tokenId) external onlyApprovedOrOwner(tokenId) {
}
function controlledResolveTo(address to, uint256 tokenId) external onlyController {
}
function sync(uint256 tokenId, uint256 updateId) external {
}
/// Internal
function _childId(uint256 tokenId, string memory label) internal pure returns (uint256) {
}
function _mintChild(address to, uint256 tokenId, string memory label) internal {
}
function _safeMintChild(address to, uint256 tokenId, string memory label, bytes memory _data) internal {
_mintChild(to, tokenId, label);
require(<FILL_ME>)
}
function _transferFrom(address from, address to, uint256 tokenId) internal {
}
function _burn(uint256 tokenId) internal {
}
function _resolveTo(address to, uint256 tokenId) internal {
}
}
| _checkOnERC721Received(address(0),to,_childId(tokenId,label),_data) | 22,545 | _checkOnERC721Received(address(0),to,_childId(tokenId,label),_data) |
"can't undo blacklisting" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "../reserve/GoodReserveCDai.sol";
import "../Interfaces.sol";
import "../utils/DSMath.sol";
import "../utils/DAOUpgradeableContract.sol";
/**
* @title GoodFundManager contract that transfer interest from the staking contract
* to the reserve contract and transfer the return mintable tokens to the staking
* contract
* cDAI support only
*/
contract GoodFundManager is DAOUpgradeableContract, DSMath {
// timestamp that indicates last time that interests collected
uint256 public lastCollectedInterest;
//just for UI to easily find last event
uint256 public lastCollectedInterestBlock;
// Gas cost for mint ubi+bridge ubi+mint rewards
uint256 public gasCostExceptInterestCollect;
// Gas cost for minting GD for keeper
uint256 public gdMintGasCost;
// how much time since last collectInterest should pass in order to cancel gas cost multiplier requirement for next collectInterest
uint256 public collectInterestTimeThreshold;
// to allow keeper to collect interest, total interest collected should be interestMultiplier*gas costs
uint8 public interestMultiplier;
//min amount of days between interest collection
uint8 public minCollectInterestIntervalDays;
//address of the active staking contracts
address[] public activeContracts;
event GasCostSet(uint256 newGasCost);
event CollectInterestTimeThresholdSet(
uint256 newCollectInterestTimeThreshold
);
event InterestMultiplierSet(uint8 newInterestMultiplier);
event GasCostExceptInterestCollectSet(
uint256 newGasCostExceptInterestCollect
);
event StakingRewardSet(
uint32 _rewardsPerBlock,
address _stakingAddress,
uint32 _blockStart,
uint32 _blockEnd,
bool _isBlackListed
);
//Structure that hold reward information and if its blacklicksted or not for particular staking Contract
struct Reward {
uint32 blockReward; //in G$
uint64 blockStart; // # of the start block to distribute rewards
uint64 blockEnd; // # of the end block to distribute rewards
bool isBlackListed; // If staking contract is blacklisted or not
}
struct InterestInfo {
address contractAddress; // staking contract address which interest will be collected
uint256 interestBalance; // Interest amount that staking contract has
uint256 collectedInterestSoFar; // Collected interest amount so far including this contract
uint256 gasCostSoFar; // Spent gas amount so far including this contract
uint256 maxGasAmountSoFar; // Max gas amount that can spend to collect this interest according to interest amount
bool maxGasLargerOrEqualRequired; // Bool that indicates if max gas amount larger or equal to actual gas needed
}
// Rewards per block for particular Staking contract
mapping(address => Reward) public rewardsForStakingContract;
// Emits when `transferInterest` transfers
// funds to the staking contract and to
// the bridge
event FundsTransferred(
// The caller address
address indexed caller,
// The staking contract address
//address indexed staking,
// The reserve contract address
address reserve,
//addresses of the staking contracts
address[] stakings,
// Amount of cDai that was transferred
// from the staking contract to the
// reserve contract
uint256 cDAIinterestEarned,
// The number of tokens that have been minted
// by the reserve to the staking contract
//uint256 gdInterest,
// The number of tokens that have been minted
// by the reserve to the bridge which in his
// turn should transfer those funds to the
// sidechain
uint256 gdUBI,
// Amount of GD to be minted as reward
//to the keeper which collect interests
uint256 gdReward
);
event StakingRewardMinted(
address stakingContract,
address staker,
uint256 gdReward
);
/**
* @dev Constructor
* @param _ns The address of the name Service
*/
function initialize(INameService _ns) public virtual initializer {
}
/**
* @dev Set gas cost to mint GD rewards for keeper
* @param _gasAmount amount of gas it costs for minting gd reward
*/
function setGasCost(uint256 _gasAmount) public {
}
/**
* @dev Set collectInterestTimeThreshold to determine how much time should pass after collectInterest called
* after which we ignore the interest>=multiplier*gas costs limit
* @param _timeThreshold new threshold in seconds
*/
function setCollectInterestTimeThreshold(uint256 _timeThreshold) public {
}
/**
* @dev Set multiplier to determine how much times larger should be collected interest than spent gas when collectInterestTimeThreshold did not pass
*/
function setInterestMultiplier(uint8 _newMultiplier) public {
}
/**
* @dev Set Gas cost for required transactions after collecting interest in collectInterest function
* we need this to know if caller has enough gas left to keep collecting interest
* @dev _gasAmount The gas amount that needed for transactions
*/
function setGasCostExceptInterestCollect(uint256 _gasAmount) public {
}
/**
* @dev Sets the Reward for particular Staking contract
* @param _rewardsPerBlock reward for per block
* @param _stakingAddress address of the staking contract
* @param _blockStart block number for start reward distrubution
* @param _blockEnd block number for end reward distrubition
* @param _isBlackListed set staking contract blacklisted or not to prevent minting
*/
function setStakingReward(
uint32 _rewardsPerBlock,
address _stakingAddress,
uint32 _blockStart,
uint32 _blockEnd,
bool _isBlackListed
) public {
_onlyAvatar();
//we dont allow to undo blacklisting as it will mess up rewards accounting.
//staking contracts are assumed immutable and thus non fixable
require(<FILL_ME>)
Reward memory reward = Reward(
_rewardsPerBlock,
_blockStart > 0 ? _blockStart : uint32(block.number),
_blockEnd > 0 ? _blockEnd : 0xFFFFFFFF,
_isBlackListed
);
rewardsForStakingContract[_stakingAddress] = reward;
bool exist;
uint8 i;
for (i = 0; i < activeContracts.length; i++) {
if (activeContracts[i] == _stakingAddress) {
exist = true;
break;
}
}
if (exist && (_isBlackListed || _rewardsPerBlock == 0)) {
activeContracts[i] = activeContracts[activeContracts.length - 1];
activeContracts.pop();
} else if (!exist && !(_isBlackListed || _rewardsPerBlock == 0)) {
activeContracts.push(_stakingAddress);
}
emit StakingRewardSet(
_rewardsPerBlock,
_stakingAddress,
_blockStart,
_blockEnd,
_isBlackListed
);
}
/**
* @dev Collects UBI interest in iToken from a given staking contract and transfers
* that interest to the reserve contract. Then transfers the given gd which
* received from the reserve contract back to the staking contract and to the
* bridge, which locks the funds and then the GD tokens are been minted to the
* given address on the sidechain
* @param _stakingContracts from which contracts to collect interest
* @param _forceAndWaiverRewards if set to true, it will collect interest even if not passed thershold, but will not reward caller with gas refund + reward
*/
function collectInterest(
address[] calldata _stakingContracts,
bool _forceAndWaiverRewards
) external {
}
/**
* @dev Function that get interest informations of staking contracts in the sorted array by highest interest to lowest interest amount
* @return array of interestInfo struct
*/
function calcSortedContracts() public view returns (InterestInfo[] memory) {
}
/**
* @dev Mint to users reward tokens which they earned by staking contract
* @param _token reserve token (currently can be just cDAI)
* @param _user user to get rewards
*/
function mintReward(address _token, address _user) public {
}
/// quick sort
function quick(uint256[] memory data, address[] memory addresses)
internal
pure
{
}
/**
@dev quicksort algorithm to sort array
*/
function quickPart(
uint256[] memory data,
address[] memory addresses,
uint256 low,
uint256 high
) internal pure {
}
/**
@dev Helper function to get gasPrice in GWEI then change it to cDAI/DAI
@param _gasAmount gas amount to get its value
@param _inDAI indicates if result should return in DAI
@return Price of the gas in DAI/cDAI
*/
function getGasPriceIncDAIorDAI(uint256 _gasAmount, bool _inDAI)
public
view
returns (uint256)
{
}
/**
@dev Helper function to get gasPrice in G$, used to calculate the rewards for collectInterest KEEPER
@param _gasAmount gas amount to get its value
@return Price of the gas in G$
*/
function getGasPriceInGD(uint256 _gasAmount) public view returns (uint256) {
}
function getActiveContractsCount() public view returns (uint256) {
}
}
| (_isBlackListed||!rewardsForStakingContract[_stakingAddress].isBlackListed),"can't undo blacklisting" | 22,553 | (_isBlackListed||!rewardsForStakingContract[_stakingAddress].isBlackListed) |
"ubi bridge transfer failed" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "../reserve/GoodReserveCDai.sol";
import "../Interfaces.sol";
import "../utils/DSMath.sol";
import "../utils/DAOUpgradeableContract.sol";
/**
* @title GoodFundManager contract that transfer interest from the staking contract
* to the reserve contract and transfer the return mintable tokens to the staking
* contract
* cDAI support only
*/
contract GoodFundManager is DAOUpgradeableContract, DSMath {
// timestamp that indicates last time that interests collected
uint256 public lastCollectedInterest;
//just for UI to easily find last event
uint256 public lastCollectedInterestBlock;
// Gas cost for mint ubi+bridge ubi+mint rewards
uint256 public gasCostExceptInterestCollect;
// Gas cost for minting GD for keeper
uint256 public gdMintGasCost;
// how much time since last collectInterest should pass in order to cancel gas cost multiplier requirement for next collectInterest
uint256 public collectInterestTimeThreshold;
// to allow keeper to collect interest, total interest collected should be interestMultiplier*gas costs
uint8 public interestMultiplier;
//min amount of days between interest collection
uint8 public minCollectInterestIntervalDays;
//address of the active staking contracts
address[] public activeContracts;
event GasCostSet(uint256 newGasCost);
event CollectInterestTimeThresholdSet(
uint256 newCollectInterestTimeThreshold
);
event InterestMultiplierSet(uint8 newInterestMultiplier);
event GasCostExceptInterestCollectSet(
uint256 newGasCostExceptInterestCollect
);
event StakingRewardSet(
uint32 _rewardsPerBlock,
address _stakingAddress,
uint32 _blockStart,
uint32 _blockEnd,
bool _isBlackListed
);
//Structure that hold reward information and if its blacklicksted or not for particular staking Contract
struct Reward {
uint32 blockReward; //in G$
uint64 blockStart; // # of the start block to distribute rewards
uint64 blockEnd; // # of the end block to distribute rewards
bool isBlackListed; // If staking contract is blacklisted or not
}
struct InterestInfo {
address contractAddress; // staking contract address which interest will be collected
uint256 interestBalance; // Interest amount that staking contract has
uint256 collectedInterestSoFar; // Collected interest amount so far including this contract
uint256 gasCostSoFar; // Spent gas amount so far including this contract
uint256 maxGasAmountSoFar; // Max gas amount that can spend to collect this interest according to interest amount
bool maxGasLargerOrEqualRequired; // Bool that indicates if max gas amount larger or equal to actual gas needed
}
// Rewards per block for particular Staking contract
mapping(address => Reward) public rewardsForStakingContract;
// Emits when `transferInterest` transfers
// funds to the staking contract and to
// the bridge
event FundsTransferred(
// The caller address
address indexed caller,
// The staking contract address
//address indexed staking,
// The reserve contract address
address reserve,
//addresses of the staking contracts
address[] stakings,
// Amount of cDai that was transferred
// from the staking contract to the
// reserve contract
uint256 cDAIinterestEarned,
// The number of tokens that have been minted
// by the reserve to the staking contract
//uint256 gdInterest,
// The number of tokens that have been minted
// by the reserve to the bridge which in his
// turn should transfer those funds to the
// sidechain
uint256 gdUBI,
// Amount of GD to be minted as reward
//to the keeper which collect interests
uint256 gdReward
);
event StakingRewardMinted(
address stakingContract,
address staker,
uint256 gdReward
);
/**
* @dev Constructor
* @param _ns The address of the name Service
*/
function initialize(INameService _ns) public virtual initializer {
}
/**
* @dev Set gas cost to mint GD rewards for keeper
* @param _gasAmount amount of gas it costs for minting gd reward
*/
function setGasCost(uint256 _gasAmount) public {
}
/**
* @dev Set collectInterestTimeThreshold to determine how much time should pass after collectInterest called
* after which we ignore the interest>=multiplier*gas costs limit
* @param _timeThreshold new threshold in seconds
*/
function setCollectInterestTimeThreshold(uint256 _timeThreshold) public {
}
/**
* @dev Set multiplier to determine how much times larger should be collected interest than spent gas when collectInterestTimeThreshold did not pass
*/
function setInterestMultiplier(uint8 _newMultiplier) public {
}
/**
* @dev Set Gas cost for required transactions after collecting interest in collectInterest function
* we need this to know if caller has enough gas left to keep collecting interest
* @dev _gasAmount The gas amount that needed for transactions
*/
function setGasCostExceptInterestCollect(uint256 _gasAmount) public {
}
/**
* @dev Sets the Reward for particular Staking contract
* @param _rewardsPerBlock reward for per block
* @param _stakingAddress address of the staking contract
* @param _blockStart block number for start reward distrubution
* @param _blockEnd block number for end reward distrubition
* @param _isBlackListed set staking contract blacklisted or not to prevent minting
*/
function setStakingReward(
uint32 _rewardsPerBlock,
address _stakingAddress,
uint32 _blockStart,
uint32 _blockEnd,
bool _isBlackListed
) public {
}
/**
* @dev Collects UBI interest in iToken from a given staking contract and transfers
* that interest to the reserve contract. Then transfers the given gd which
* received from the reserve contract back to the staking contract and to the
* bridge, which locks the funds and then the GD tokens are been minted to the
* given address on the sidechain
* @param _stakingContracts from which contracts to collect interest
* @param _forceAndWaiverRewards if set to true, it will collect interest even if not passed thershold, but will not reward caller with gas refund + reward
*/
function collectInterest(
address[] calldata _stakingContracts,
bool _forceAndWaiverRewards
) external {
uint256 initialGas = gasleft();
uint256 gdUBI;
uint256 interestInCdai;
address reserveAddress;
{
// require(
// block.timestamp >= lastCollectedInterest + minCollectedInterestIntervalDays * days,
// "collectInterest: collect interval not passed"
// );
//prevent stack too deep
cERC20 iToken = cERC20(nameService.getAddress("CDAI"));
ERC20 daiToken = ERC20(nameService.getAddress("DAI"));
reserveAddress = nameService.getAddress("RESERVE");
// DAI balance of the reserve contract
uint256 currentBalance = daiToken.balanceOf(reserveAddress);
uint256 startingCDAIBalance = iToken.balanceOf(reserveAddress);
for (uint256 i = _stakingContracts.length - 1; i >= 0; i--) {
// elements are sorted by balances from lowest to highest
if (_stakingContracts[i] != address(0x0)) {
IGoodStaking(_stakingContracts[i]).collectUBIInterest(reserveAddress);
}
if (i == 0) break; // when active contracts length is 1 then gives error
}
// Finds the actual transferred DAI
uint256 daiToConvert = daiToken.balanceOf(reserveAddress) -
currentBalance;
// Mints gd while the interest amount is equal to the transferred amount
(gdUBI, interestInCdai) = GoodReserveCDai(reserveAddress).mintUBI(
daiToConvert,
startingCDAIBalance,
iToken
);
IGoodDollar token = IGoodDollar(nameService.getAddress("GOODDOLLAR"));
if (gdUBI > 0) {
//transfer ubi to avatar on sidechain via bridge
require(<FILL_ME>)
}
}
uint256 gdRewardToMint;
if (_forceAndWaiverRewards == false) {
uint256 totalUsedGas = ((initialGas - gasleft() + gdMintGasCost) * 110) /
100; // We will return as reward 1.1x of used gas in GD
gdRewardToMint = getGasPriceInGD(totalUsedGas);
GoodReserveCDai(reserveAddress).mintRewardFromRR(
nameService.getAddress("CDAI"),
msg.sender,
gdRewardToMint
);
uint256 gasPriceIncDAI = getGasPriceIncDAIorDAI(
initialGas - gasleft(),
false
);
if (
block.timestamp >= lastCollectedInterest + collectInterestTimeThreshold
) {
require(
interestInCdai >= gasPriceIncDAI,
"Collected interest value should be larger than spent gas costs"
); // This require is necessary to keeper can not abuse this function
} else {
require(
interestInCdai >= interestMultiplier * gasPriceIncDAI,
"Collected interest value should be interestMultiplier x gas costs"
);
}
}
emit FundsTransferred(
msg.sender,
reserveAddress,
_stakingContracts,
interestInCdai,
gdUBI,
gdRewardToMint
);
lastCollectedInterest = block.timestamp;
lastCollectedInterestBlock = block.number;
}
/**
* @dev Function that get interest informations of staking contracts in the sorted array by highest interest to lowest interest amount
* @return array of interestInfo struct
*/
function calcSortedContracts() public view returns (InterestInfo[] memory) {
}
/**
* @dev Mint to users reward tokens which they earned by staking contract
* @param _token reserve token (currently can be just cDAI)
* @param _user user to get rewards
*/
function mintReward(address _token, address _user) public {
}
/// quick sort
function quick(uint256[] memory data, address[] memory addresses)
internal
pure
{
}
/**
@dev quicksort algorithm to sort array
*/
function quickPart(
uint256[] memory data,
address[] memory addresses,
uint256 low,
uint256 high
) internal pure {
}
/**
@dev Helper function to get gasPrice in GWEI then change it to cDAI/DAI
@param _gasAmount gas amount to get its value
@param _inDAI indicates if result should return in DAI
@return Price of the gas in DAI/cDAI
*/
function getGasPriceIncDAIorDAI(uint256 _gasAmount, bool _inDAI)
public
view
returns (uint256)
{
}
/**
@dev Helper function to get gasPrice in G$, used to calculate the rewards for collectInterest KEEPER
@param _gasAmount gas amount to get its value
@return Price of the gas in G$
*/
function getGasPriceInGD(uint256 _gasAmount) public view returns (uint256) {
}
function getActiveContractsCount() public view returns (uint256) {
}
}
| token.transferAndCall(nameService.getAddress("BRIDGE_CONTRACT"),gdUBI,abi.encodePacked(nameService.getAddress("UBI_RECIPIENT"))),"ubi bridge transfer failed" | 22,553 | token.transferAndCall(nameService.getAddress("BRIDGE_CONTRACT"),gdUBI,abi.encodePacked(nameService.getAddress("UBI_RECIPIENT"))) |
null | pragma solidity ^0.4.25;
/**
* @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 DateTimeEnabled {
/*
* Date and Time utilities for ethereum contracts
*
*/
struct DateTime {
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 weekday;
}
uint constant DAY_IN_SECONDS = 86400;
uint constant YEAR_IN_SECONDS = 31536000;
uint constant LEAP_YEAR_IN_SECONDS = 31622400;
uint constant HOUR_IN_SECONDS = 3600;
uint constant MINUTE_IN_SECONDS = 60;
uint16 constant ORIGIN_YEAR = 1970;
function isLeapYear(uint16 year) internal constant returns (bool) {
}
function leapYearsBefore(uint year) internal constant returns (uint) {
}
function getDaysInMonth(uint8 month, uint16 year) internal constant returns (uint8) {
}
function parseTimestamp(uint timestamp) internal returns (DateTime dt) {
}
function getYear(uint timestamp) internal constant returns (uint16) {
}
function getMonth(uint timestamp) internal constant returns (uint8) {
}
function getDay(uint timestamp) internal constant returns (uint8) {
}
function getHour(uint timestamp) internal constant returns (uint8) {
}
function getMinute(uint timestamp) internal constant returns (uint8) {
}
function getSecond(uint timestamp) internal constant returns (uint8) {
}
function getWeekday(uint timestamp) internal constant returns (uint8) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute, uint8 second) internal constant returns (uint timestamp) {
}
function addDaystoTimeStamp(uint16 _daysToBeAdded) internal returns(uint){
}
function addMinutestoTimeStamp(uint8 _minutesToBeAdded) internal returns(uint){
}
function printDatestamp(uint timestamp) internal returns (uint16,uint8,uint8,uint8,uint8,uint8) {
}
function currentTimeStamp() internal returns (uint) {
}
}
contract ERC20 {
function totalSupply() view public returns (uint _totalSupply);
function balanceOf(address _owner) view public returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint _value) public returns (bool success);
function approve(address _spender, uint _value) public returns (bool success);
function allowance(address _owner, address _spender) view public returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
contract BaseToken is ERC20 {
address public owner;
using SafeMath for uint256;
bool public tokenStatus = false;
modifier ownerOnly(){
}
modifier onlyWhenTokenIsOn(){
}
function onOff () ownerOnly external{
}
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
}
mapping (address => uint256) public balances;
mapping(address => mapping(address => uint256)) allowed;
//Token Details
string public symbol = "BASE";
string public name = "Base Token";
uint8 public decimals = 18;
uint256 public totalSupply; //will be instantiated in the derived Contracts
function totalSupply() view public returns (uint256 ){
}
function balanceOf(address _owner) view public returns (uint balance){
}
function transfer(address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(2 * 32) public returns (bool success){
}
function transferFrom(address _from, address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(3 * 32) public returns (bool success){
}
function approve(address _spender, uint _value) onlyWhenTokenIsOn public returns (bool success){
}
function allowance(address _owner, address _spender) view public returns (uint remaining){
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract ICO is BaseToken,DateTimeEnabled{
uint256 base = 10;
uint256 multiplier;
address ownerMultisig;
struct ICOPhase {
string phaseName;
uint256 tokensStaged;
uint256 tokensAllocated;
uint256 iRate;
uint256 fRate;
uint256 intialTime;
uint256 closingTime;
// uint256 RATE;
bool saleOn;
uint deadline;
}
uint8 public currentICOPhase;
mapping(address=>uint256) public ethContributedBy;
uint256 public totalEthRaised;
uint256 public totalTokensSoldTillNow;
mapping(uint8=>ICOPhase) public icoPhases;
uint8 icoPhasesIndex=1;
function getEthContributedBy(address _address) view public returns(uint256){
}
function getTotalEthRaised() view public returns(uint256){
}
function getTotalTokensSoldTillNow() view public returns(uint256){
}
function addICOPhase(string _phaseName,uint256 _tokensStaged,uint256 _iRate, uint256 _fRate,uint256 _intialTime,uint256 _closingTime) ownerOnly public{
}
function toggleSaleStatus() ownerOnly external{
}
function changefRate(uint256 _fRate) ownerOnly external{
}
function changeCurrentICOPhase(uint8 _newPhase) ownerOnly external{
}
function changeCurrentPhaseDeadline(uint8 _numdays) ownerOnly external{
}
function transferOwnership(address newOwner) ownerOnly external{
}
}
contract MultiRound is ICO{
function newICORound(uint256 _newSupply) ownerOnly public{
}
function destroyUnsoldTokens(uint256 _tokens) ownerOnly public{
}
}
contract ReferralEnabledToken is BaseToken{
struct referral {
address referrer;
uint8 referrerPerc;// this is the percentage referrer will get in ETH.
uint8 refereePerc; // this is the discount Refereee will get
}
struct redeemedReferral {
address referee;
uint timestamp;
uint ethContributed;
uint rewardGained;
}
mapping(address=>referral) public referrals;
uint8 public currentReferralRewardPercentage=10;
uint8 public currentReferralDiscountPercentage=10;
mapping(address=>uint256) public totalEthRewards;
mapping(address=>mapping(uint16=>redeemedReferral)) referrerRewards;
mapping(address=>uint16) referrerRewardIndex;
function totalEthRewards(address _address) view public returns(uint256){
}
function createReferral(address _referrer, address _referree) public returns (bool) {
require(_referrer != _referree);
require(<FILL_ME>)
referrals[_referree].referrer = _referrer;
referrals[_referree].referrerPerc = currentReferralRewardPercentage;
referrals[_referree].refereePerc = currentReferralDiscountPercentage;
return true;
}
function getReferrerRewards(address _referrer, uint16 _index) view public returns(address,uint,uint,uint){
}
function getReferrerIndex(address _referrer) view public returns(uint16) {
}
function getReferrerTotalRewards(address _referrer) view public returns(uint){
}
function getReferral(address _refereeId) constant public returns(address,uint8,uint8) {
}
function changeReferralPerc(uint8 _newPerc) ownerOnly external{
}
function changeRefereePerc(uint8 _newPerc) ownerOnly external{
}
}
contract killable is ICO {
function killContract() ownerOnly external{
}
}
//TODO - ADD Total ETH raised and Record token wise contribution
contract RefineMediumToken is ICO,killable,MultiRound,ReferralEnabledToken {
// uint256 intialTime = 1542043381;
// uint256 closingTime = 1557681781;
uint256 constant alloc1perc=50; //TEAM ALLOCATION
address constant alloc1Acc = 0xF0B50870e5d01FbfE783F6e76994A0BA94d34fe9; //CORETEAM Address (test-TestRPC4)
uint256 constant alloc2perc=50;//in percent -- ADVISORS ALLOCATION
address constant alloc2Acc = 0x3c3daEd0733cDBB26c298443Cec93c48426CC4Bd; //TestRPC5
uint256 constant alloc3perc=50;//in percent -- Bounty Allocation
address constant alloc3Acc = 0xAc5c102B4063615053C29f9B4DC8001D529037Cd; //TestRPC6
uint256 constant alloc4perc=50;//in percent -- Reserved LEAVE IT TO ZERO IF NO MORE ALLOCATIONS ARE THERE
address constant alloc4Acc = 0xf080966E970AC351A9D576846915bBE049Fe98dB; //TestRPC7
address constant ownerMultisig = 0xc4010efafaf53be13498efcffa04df931dc1592a; //Test4
mapping(address=>uint) blockedTill;
constructor() public{
}
function runAllocations() ownerOnly public{
}
function showRate(uint256 _epoch) public view returns (uint256){
}
function currentRate() public view returns (uint256){
}
function () payable public{
}
function createTokens() payable public{
}
function transfer(address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(2 * 32) public returns (bool success){
}
function transferFrom(address _from, address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(3 * 32) public returns (bool success){
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) ownerOnly returns (bool)
{
}
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
}
function mint(address _to, uint256 _amount) ownerOnly canMint public returns (bool) {
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() ownerOnly canMint public returns (bool) {
}
}
| referrals[_referree].referrer==address(0)||referrals[_referree].referrer==msg.sender | 22,582 | referrals[_referree].referrer==address(0)||referrals[_referree].referrer==msg.sender |
null | pragma solidity ^0.4.25;
/**
* @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 DateTimeEnabled {
/*
* Date and Time utilities for ethereum contracts
*
*/
struct DateTime {
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 weekday;
}
uint constant DAY_IN_SECONDS = 86400;
uint constant YEAR_IN_SECONDS = 31536000;
uint constant LEAP_YEAR_IN_SECONDS = 31622400;
uint constant HOUR_IN_SECONDS = 3600;
uint constant MINUTE_IN_SECONDS = 60;
uint16 constant ORIGIN_YEAR = 1970;
function isLeapYear(uint16 year) internal constant returns (bool) {
}
function leapYearsBefore(uint year) internal constant returns (uint) {
}
function getDaysInMonth(uint8 month, uint16 year) internal constant returns (uint8) {
}
function parseTimestamp(uint timestamp) internal returns (DateTime dt) {
}
function getYear(uint timestamp) internal constant returns (uint16) {
}
function getMonth(uint timestamp) internal constant returns (uint8) {
}
function getDay(uint timestamp) internal constant returns (uint8) {
}
function getHour(uint timestamp) internal constant returns (uint8) {
}
function getMinute(uint timestamp) internal constant returns (uint8) {
}
function getSecond(uint timestamp) internal constant returns (uint8) {
}
function getWeekday(uint timestamp) internal constant returns (uint8) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute, uint8 second) internal constant returns (uint timestamp) {
}
function addDaystoTimeStamp(uint16 _daysToBeAdded) internal returns(uint){
}
function addMinutestoTimeStamp(uint8 _minutesToBeAdded) internal returns(uint){
}
function printDatestamp(uint timestamp) internal returns (uint16,uint8,uint8,uint8,uint8,uint8) {
}
function currentTimeStamp() internal returns (uint) {
}
}
contract ERC20 {
function totalSupply() view public returns (uint _totalSupply);
function balanceOf(address _owner) view public returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint _value) public returns (bool success);
function approve(address _spender, uint _value) public returns (bool success);
function allowance(address _owner, address _spender) view public returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
contract BaseToken is ERC20 {
address public owner;
using SafeMath for uint256;
bool public tokenStatus = false;
modifier ownerOnly(){
}
modifier onlyWhenTokenIsOn(){
}
function onOff () ownerOnly external{
}
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
}
mapping (address => uint256) public balances;
mapping(address => mapping(address => uint256)) allowed;
//Token Details
string public symbol = "BASE";
string public name = "Base Token";
uint8 public decimals = 18;
uint256 public totalSupply; //will be instantiated in the derived Contracts
function totalSupply() view public returns (uint256 ){
}
function balanceOf(address _owner) view public returns (uint balance){
}
function transfer(address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(2 * 32) public returns (bool success){
}
function transferFrom(address _from, address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(3 * 32) public returns (bool success){
}
function approve(address _spender, uint _value) onlyWhenTokenIsOn public returns (bool success){
}
function allowance(address _owner, address _spender) view public returns (uint remaining){
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract ICO is BaseToken,DateTimeEnabled{
uint256 base = 10;
uint256 multiplier;
address ownerMultisig;
struct ICOPhase {
string phaseName;
uint256 tokensStaged;
uint256 tokensAllocated;
uint256 iRate;
uint256 fRate;
uint256 intialTime;
uint256 closingTime;
// uint256 RATE;
bool saleOn;
uint deadline;
}
uint8 public currentICOPhase;
mapping(address=>uint256) public ethContributedBy;
uint256 public totalEthRaised;
uint256 public totalTokensSoldTillNow;
mapping(uint8=>ICOPhase) public icoPhases;
uint8 icoPhasesIndex=1;
function getEthContributedBy(address _address) view public returns(uint256){
}
function getTotalEthRaised() view public returns(uint256){
}
function getTotalTokensSoldTillNow() view public returns(uint256){
}
function addICOPhase(string _phaseName,uint256 _tokensStaged,uint256 _iRate, uint256 _fRate,uint256 _intialTime,uint256 _closingTime) ownerOnly public{
}
function toggleSaleStatus() ownerOnly external{
}
function changefRate(uint256 _fRate) ownerOnly external{
}
function changeCurrentICOPhase(uint8 _newPhase) ownerOnly external{
}
function changeCurrentPhaseDeadline(uint8 _numdays) ownerOnly external{
}
function transferOwnership(address newOwner) ownerOnly external{
}
}
contract MultiRound is ICO{
function newICORound(uint256 _newSupply) ownerOnly public{
}
function destroyUnsoldTokens(uint256 _tokens) ownerOnly public{
}
}
contract ReferralEnabledToken is BaseToken{
struct referral {
address referrer;
uint8 referrerPerc;// this is the percentage referrer will get in ETH.
uint8 refereePerc; // this is the discount Refereee will get
}
struct redeemedReferral {
address referee;
uint timestamp;
uint ethContributed;
uint rewardGained;
}
mapping(address=>referral) public referrals;
uint8 public currentReferralRewardPercentage=10;
uint8 public currentReferralDiscountPercentage=10;
mapping(address=>uint256) public totalEthRewards;
mapping(address=>mapping(uint16=>redeemedReferral)) referrerRewards;
mapping(address=>uint16) referrerRewardIndex;
function totalEthRewards(address _address) view public returns(uint256){
}
function createReferral(address _referrer, address _referree) public returns (bool) {
}
function getReferrerRewards(address _referrer, uint16 _index) view public returns(address,uint,uint,uint){
}
function getReferrerIndex(address _referrer) view public returns(uint16) {
}
function getReferrerTotalRewards(address _referrer) view public returns(uint){
}
function getReferral(address _refereeId) constant public returns(address,uint8,uint8) {
}
function changeReferralPerc(uint8 _newPerc) ownerOnly external{
}
function changeRefereePerc(uint8 _newPerc) ownerOnly external{
}
}
contract killable is ICO {
function killContract() ownerOnly external{
}
}
//TODO - ADD Total ETH raised and Record token wise contribution
contract RefineMediumToken is ICO,killable,MultiRound,ReferralEnabledToken {
// uint256 intialTime = 1542043381;
// uint256 closingTime = 1557681781;
uint256 constant alloc1perc=50; //TEAM ALLOCATION
address constant alloc1Acc = 0xF0B50870e5d01FbfE783F6e76994A0BA94d34fe9; //CORETEAM Address (test-TestRPC4)
uint256 constant alloc2perc=50;//in percent -- ADVISORS ALLOCATION
address constant alloc2Acc = 0x3c3daEd0733cDBB26c298443Cec93c48426CC4Bd; //TestRPC5
uint256 constant alloc3perc=50;//in percent -- Bounty Allocation
address constant alloc3Acc = 0xAc5c102B4063615053C29f9B4DC8001D529037Cd; //TestRPC6
uint256 constant alloc4perc=50;//in percent -- Reserved LEAVE IT TO ZERO IF NO MORE ALLOCATIONS ARE THERE
address constant alloc4Acc = 0xf080966E970AC351A9D576846915bBE049Fe98dB; //TestRPC7
address constant ownerMultisig = 0xc4010efafaf53be13498efcffa04df931dc1592a; //Test4
mapping(address=>uint) blockedTill;
constructor() public{
}
function runAllocations() ownerOnly public{
}
function showRate(uint256 _epoch) public view returns (uint256){
}
function currentRate() public view returns (uint256){
}
function () payable public{
}
function createTokens() payable public{
}
function transfer(address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(2 * 32) public returns (bool success){
//_value = _value.mul(1e18);
require(<FILL_ME>)
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender,_to,_value);
return true;
}
function transferFrom(address _from, address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(3 * 32) public returns (bool success){
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) ownerOnly returns (bool)
{
}
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
}
function mint(address _to, uint256 _amount) ownerOnly canMint public returns (bool) {
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() ownerOnly canMint public returns (bool) {
}
}
| balances[msg.sender]>=_value&&_value>0&&now>blockedTill[msg.sender] | 22,582 | balances[msg.sender]>=_value&&_value>0&&now>blockedTill[msg.sender] |
null | pragma solidity ^0.4.25;
/**
* @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 DateTimeEnabled {
/*
* Date and Time utilities for ethereum contracts
*
*/
struct DateTime {
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 weekday;
}
uint constant DAY_IN_SECONDS = 86400;
uint constant YEAR_IN_SECONDS = 31536000;
uint constant LEAP_YEAR_IN_SECONDS = 31622400;
uint constant HOUR_IN_SECONDS = 3600;
uint constant MINUTE_IN_SECONDS = 60;
uint16 constant ORIGIN_YEAR = 1970;
function isLeapYear(uint16 year) internal constant returns (bool) {
}
function leapYearsBefore(uint year) internal constant returns (uint) {
}
function getDaysInMonth(uint8 month, uint16 year) internal constant returns (uint8) {
}
function parseTimestamp(uint timestamp) internal returns (DateTime dt) {
}
function getYear(uint timestamp) internal constant returns (uint16) {
}
function getMonth(uint timestamp) internal constant returns (uint8) {
}
function getDay(uint timestamp) internal constant returns (uint8) {
}
function getHour(uint timestamp) internal constant returns (uint8) {
}
function getMinute(uint timestamp) internal constant returns (uint8) {
}
function getSecond(uint timestamp) internal constant returns (uint8) {
}
function getWeekday(uint timestamp) internal constant returns (uint8) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute) internal constant returns (uint timestamp) {
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute, uint8 second) internal constant returns (uint timestamp) {
}
function addDaystoTimeStamp(uint16 _daysToBeAdded) internal returns(uint){
}
function addMinutestoTimeStamp(uint8 _minutesToBeAdded) internal returns(uint){
}
function printDatestamp(uint timestamp) internal returns (uint16,uint8,uint8,uint8,uint8,uint8) {
}
function currentTimeStamp() internal returns (uint) {
}
}
contract ERC20 {
function totalSupply() view public returns (uint _totalSupply);
function balanceOf(address _owner) view public returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint _value) public returns (bool success);
function approve(address _spender, uint _value) public returns (bool success);
function allowance(address _owner, address _spender) view public returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
contract BaseToken is ERC20 {
address public owner;
using SafeMath for uint256;
bool public tokenStatus = false;
modifier ownerOnly(){
}
modifier onlyWhenTokenIsOn(){
}
function onOff () ownerOnly external{
}
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
}
mapping (address => uint256) public balances;
mapping(address => mapping(address => uint256)) allowed;
//Token Details
string public symbol = "BASE";
string public name = "Base Token";
uint8 public decimals = 18;
uint256 public totalSupply; //will be instantiated in the derived Contracts
function totalSupply() view public returns (uint256 ){
}
function balanceOf(address _owner) view public returns (uint balance){
}
function transfer(address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(2 * 32) public returns (bool success){
}
function transferFrom(address _from, address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(3 * 32) public returns (bool success){
}
function approve(address _spender, uint _value) onlyWhenTokenIsOn public returns (bool success){
}
function allowance(address _owner, address _spender) view public returns (uint remaining){
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract ICO is BaseToken,DateTimeEnabled{
uint256 base = 10;
uint256 multiplier;
address ownerMultisig;
struct ICOPhase {
string phaseName;
uint256 tokensStaged;
uint256 tokensAllocated;
uint256 iRate;
uint256 fRate;
uint256 intialTime;
uint256 closingTime;
// uint256 RATE;
bool saleOn;
uint deadline;
}
uint8 public currentICOPhase;
mapping(address=>uint256) public ethContributedBy;
uint256 public totalEthRaised;
uint256 public totalTokensSoldTillNow;
mapping(uint8=>ICOPhase) public icoPhases;
uint8 icoPhasesIndex=1;
function getEthContributedBy(address _address) view public returns(uint256){
}
function getTotalEthRaised() view public returns(uint256){
}
function getTotalTokensSoldTillNow() view public returns(uint256){
}
function addICOPhase(string _phaseName,uint256 _tokensStaged,uint256 _iRate, uint256 _fRate,uint256 _intialTime,uint256 _closingTime) ownerOnly public{
}
function toggleSaleStatus() ownerOnly external{
}
function changefRate(uint256 _fRate) ownerOnly external{
}
function changeCurrentICOPhase(uint8 _newPhase) ownerOnly external{
}
function changeCurrentPhaseDeadline(uint8 _numdays) ownerOnly external{
}
function transferOwnership(address newOwner) ownerOnly external{
}
}
contract MultiRound is ICO{
function newICORound(uint256 _newSupply) ownerOnly public{
}
function destroyUnsoldTokens(uint256 _tokens) ownerOnly public{
}
}
contract ReferralEnabledToken is BaseToken{
struct referral {
address referrer;
uint8 referrerPerc;// this is the percentage referrer will get in ETH.
uint8 refereePerc; // this is the discount Refereee will get
}
struct redeemedReferral {
address referee;
uint timestamp;
uint ethContributed;
uint rewardGained;
}
mapping(address=>referral) public referrals;
uint8 public currentReferralRewardPercentage=10;
uint8 public currentReferralDiscountPercentage=10;
mapping(address=>uint256) public totalEthRewards;
mapping(address=>mapping(uint16=>redeemedReferral)) referrerRewards;
mapping(address=>uint16) referrerRewardIndex;
function totalEthRewards(address _address) view public returns(uint256){
}
function createReferral(address _referrer, address _referree) public returns (bool) {
}
function getReferrerRewards(address _referrer, uint16 _index) view public returns(address,uint,uint,uint){
}
function getReferrerIndex(address _referrer) view public returns(uint16) {
}
function getReferrerTotalRewards(address _referrer) view public returns(uint){
}
function getReferral(address _refereeId) constant public returns(address,uint8,uint8) {
}
function changeReferralPerc(uint8 _newPerc) ownerOnly external{
}
function changeRefereePerc(uint8 _newPerc) ownerOnly external{
}
}
contract killable is ICO {
function killContract() ownerOnly external{
}
}
//TODO - ADD Total ETH raised and Record token wise contribution
contract RefineMediumToken is ICO,killable,MultiRound,ReferralEnabledToken {
// uint256 intialTime = 1542043381;
// uint256 closingTime = 1557681781;
uint256 constant alloc1perc=50; //TEAM ALLOCATION
address constant alloc1Acc = 0xF0B50870e5d01FbfE783F6e76994A0BA94d34fe9; //CORETEAM Address (test-TestRPC4)
uint256 constant alloc2perc=50;//in percent -- ADVISORS ALLOCATION
address constant alloc2Acc = 0x3c3daEd0733cDBB26c298443Cec93c48426CC4Bd; //TestRPC5
uint256 constant alloc3perc=50;//in percent -- Bounty Allocation
address constant alloc3Acc = 0xAc5c102B4063615053C29f9B4DC8001D529037Cd; //TestRPC6
uint256 constant alloc4perc=50;//in percent -- Reserved LEAVE IT TO ZERO IF NO MORE ALLOCATIONS ARE THERE
address constant alloc4Acc = 0xf080966E970AC351A9D576846915bBE049Fe98dB; //TestRPC7
address constant ownerMultisig = 0xc4010efafaf53be13498efcffa04df931dc1592a; //Test4
mapping(address=>uint) blockedTill;
constructor() public{
}
function runAllocations() ownerOnly public{
}
function showRate(uint256 _epoch) public view returns (uint256){
}
function currentRate() public view returns (uint256){
}
function () payable public{
}
function createTokens() payable public{
}
function transfer(address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(2 * 32) public returns (bool success){
}
function transferFrom(address _from, address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(3 * 32) public returns (bool success){
//_value = _value.mul(10**decimals);
require(<FILL_ME>)
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) ownerOnly returns (bool)
{
}
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
}
function mint(address _to, uint256 _amount) ownerOnly canMint public returns (bool) {
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() ownerOnly canMint public returns (bool) {
}
}
| allowed[_from][msg.sender]>=_value&&balances[_from]>=_value&&_value>0&&now>blockedTill[_from] | 22,582 | allowed[_from][msg.sender]>=_value&&balances[_from]>=_value&&_value>0&&now>blockedTill[_from] |
"New epoch not ready yet" | pragma solidity 0.6.12;
// TROPVault distributes fees equally amongst staked pools
// Have fun reading it. Hopefully it's bug-free. God bless.
contract TimeLockLPTokenStaking {
using SafeMath for uint256;
using Address for address;
// Info of each user.
struct UserInfo {
uint256 amount; // How many tokens the user currently has.
uint256 rewardAllocPoint; //this is used for computing user rewards, depending on the staked amount and locked time
uint256 rewardDebt; // Reward debt. See explanation below.
uint256 rewardLocked;
uint256 releaseTime;
//
// We do some fancy math here. Basically, any point in time, the amount of TROPs
// entitled to a user but is pending to be distributed is:
//
// pending reward = (user.amount * pool.accTROPPerRAP) - user.rewardDebt
//
// Whenever a user deposits or withdraws tokens to a pool. Here's what happens:
// 1. The pool's `accTROPPerRAP` (and `lastRewardBlock`) gets updated.
// 2. User receives the pending reward sent to his/her address.
// 3. User's `amount` gets updated.
// 4. User's `rewardDebt` gets updated.
uint256 lpReleaseTime;
uint256 lockedPeriod;
}
// Info of each pool.
struct PoolInfo {
uint256 allocPoint; // How many allocation points assigned to this pool. TROPs to distribute per block.
uint256 accTROPPerRAP; // Accumulated TROPs per rewardAllocPoint RAP, times 1e18. See below.
uint256 totalRewardAllocPoint;
mapping(address => mapping(address => uint256)) allowance;
bool emergencyWithdrawable;
uint256 rewardsInThisEpoch;
uint256 cumulativeRewardsSinceStart;
uint256 startBlock;
uint256 startTime;
uint256 totalStake;
// For easy graphing historical epoch rewards
mapping(uint256 => uint256) epochRewards;
uint256 epochCalculationStartBlock;
}
// Info of each pool.
PoolInfo public poolInfo;
// Info of each user that stakes tokens.
mapping(address => UserInfo) public userInfo;
// The TROP TOKEN!
IERC20 public trop;
function computeReleasableLP(address _addr) public view returns (uint256) {
}
}
contract TROPStakingFixed is OwnableUpgradeSafe, TimeLockLPTokenStaking {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Dev address.
address public devaddr;
// Total allocation poitns. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint;
//// pending rewards awaiting anyone to massUpdate
uint256 public pendingRewards;
uint256 public epoch;
uint256 public constant REWARD_LOCKED_PERIOD = 14 days;
uint256 public constant REWARD_RELEASE_PERCENTAGE = 40;
uint256 public contractStartBlock;
uint256 private tropBalance;
// Sets the dev fee for this contract
// defaults at 7.24%
// Note contract owner is meant to be a governance contract allowing TROP governance consensus
uint16 DEV_FEE;
uint256 public pending_DEV_rewards;
// Returns fees generated since start of this contract
function averageFeesPerBlockSinceStart()
external
view
returns (uint256 averagePerBlock)
{
}
// Returns averge fees in this epoch
function averageFeesPerBlockEpoch()
external
view
returns (uint256 averagePerBlock)
{
}
function getEpochReward(uint256 _epoch) public view returns (uint256) {
}
//Starts a new calculation epoch
// Because averge since start will not be accurate
function startNewEpoch() public {
require(<FILL_ME>)
// About a week
poolInfo.epochRewards[epoch] = poolInfo.rewardsInThisEpoch;
poolInfo.cumulativeRewardsSinceStart = poolInfo
.cumulativeRewardsSinceStart
.add(poolInfo.rewardsInThisEpoch);
poolInfo.rewardsInThisEpoch = 0;
poolInfo.epochCalculationStartBlock = block.number;
++epoch;
}
event Deposit(address indexed user, uint256 amount);
event Withdraw(address indexed user, uint256 amount);
event EmergencyWithdraw(address indexed user, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function initialize(address _devFundAddress) public initializer {
}
modifier validLockTime(uint256 _time) {
}
//to avoid exploit in time lock
function checkLockTiming(address _user, uint256 _time) internal {
}
function setEmergencyWithdrawable(bool _withdrawable) public onlyOwner {
}
function setDevFee(uint16 _DEV_FEE) public onlyOwner {
}
// View function to see pending TROPs on frontend.
function pendingTROP(address _user) public view returns (uint256) {
}
function getLockedReward(address _user) public view returns (uint256) {
}
// Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public {
}
// ----
// Function that adds pending rewards, called by the TROP token.
// ----
function updatePendingRewards() public {
}
// Update reward variables of the given pool to be up-to-date.
function updatePool() internal returns (uint256 tropRewardWhole) {
}
function withdrawReward() public {
}
// Deposit tokens to TROPVault for TROP allocation.
function deposit(uint256 _amount, uint256 _lockTime)
public
validLockTime(_lockTime)
{
}
function updateRewardAllocPoint(
address _addr,
uint256 _depositAmount,
uint256 _lockTime
) internal {
}
// Test coverage
// [x] Does user get the deposited amounts?
// [x] Does user that its deposited for update correcty?
// [x] Does the depositor get their tokens decreased
function depositFor(
address _depositFor,
uint256 _amount,
uint256 _lockTime
) public validLockTime(_lockTime) {
}
// Test coverage
// [x] Does allowance update correctly?
function setAllowanceForPoolToken(address spender, uint256 value) public {
}
function quitPool() public {
}
// Test coverage
// [x] Does allowance decrease?
// [x] Do oyu need allowance
// [x] Withdraws to correct address
function withdrawFrom(address owner, uint256 _amount) public {
}
// Withdraw tokens from TROPVault.
function withdraw(uint256 _amount) public {
}
// Low level withdraw function
function _withdraw(
uint256 _amount,
address from,
address to
) internal {
}
function updateAndPayOutPending(address from) internal {
}
function emergencyWithdraw() public {
}
function safeTROPTransfer(address _to, uint256 _amount) internal {
}
function transferDevFee() public {
}
function setDevFeeReciever(address _devaddr) public {
}
event Restake(address indexed user, uint256 amount);
function claimAndRestake() public {
}
}
| poolInfo.epochCalculationStartBlock+50000<block.number,"New epoch not ready yet" | 22,684 | poolInfo.epochCalculationStartBlock+50000<block.number |
"stake should not have fee" | pragma solidity 0.6.12;
// TROPVault distributes fees equally amongst staked pools
// Have fun reading it. Hopefully it's bug-free. God bless.
contract TimeLockLPTokenStaking {
using SafeMath for uint256;
using Address for address;
// Info of each user.
struct UserInfo {
uint256 amount; // How many tokens the user currently has.
uint256 rewardAllocPoint; //this is used for computing user rewards, depending on the staked amount and locked time
uint256 rewardDebt; // Reward debt. See explanation below.
uint256 rewardLocked;
uint256 releaseTime;
//
// We do some fancy math here. Basically, any point in time, the amount of TROPs
// entitled to a user but is pending to be distributed is:
//
// pending reward = (user.amount * pool.accTROPPerRAP) - user.rewardDebt
//
// Whenever a user deposits or withdraws tokens to a pool. Here's what happens:
// 1. The pool's `accTROPPerRAP` (and `lastRewardBlock`) gets updated.
// 2. User receives the pending reward sent to his/her address.
// 3. User's `amount` gets updated.
// 4. User's `rewardDebt` gets updated.
uint256 lpReleaseTime;
uint256 lockedPeriod;
}
// Info of each pool.
struct PoolInfo {
uint256 allocPoint; // How many allocation points assigned to this pool. TROPs to distribute per block.
uint256 accTROPPerRAP; // Accumulated TROPs per rewardAllocPoint RAP, times 1e18. See below.
uint256 totalRewardAllocPoint;
mapping(address => mapping(address => uint256)) allowance;
bool emergencyWithdrawable;
uint256 rewardsInThisEpoch;
uint256 cumulativeRewardsSinceStart;
uint256 startBlock;
uint256 startTime;
uint256 totalStake;
// For easy graphing historical epoch rewards
mapping(uint256 => uint256) epochRewards;
uint256 epochCalculationStartBlock;
}
// Info of each pool.
PoolInfo public poolInfo;
// Info of each user that stakes tokens.
mapping(address => UserInfo) public userInfo;
// The TROP TOKEN!
IERC20 public trop;
function computeReleasableLP(address _addr) public view returns (uint256) {
}
}
contract TROPStakingFixed is OwnableUpgradeSafe, TimeLockLPTokenStaking {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Dev address.
address public devaddr;
// Total allocation poitns. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint;
//// pending rewards awaiting anyone to massUpdate
uint256 public pendingRewards;
uint256 public epoch;
uint256 public constant REWARD_LOCKED_PERIOD = 14 days;
uint256 public constant REWARD_RELEASE_PERCENTAGE = 40;
uint256 public contractStartBlock;
uint256 private tropBalance;
// Sets the dev fee for this contract
// defaults at 7.24%
// Note contract owner is meant to be a governance contract allowing TROP governance consensus
uint16 DEV_FEE;
uint256 public pending_DEV_rewards;
// Returns fees generated since start of this contract
function averageFeesPerBlockSinceStart()
external
view
returns (uint256 averagePerBlock)
{
}
// Returns averge fees in this epoch
function averageFeesPerBlockEpoch()
external
view
returns (uint256 averagePerBlock)
{
}
function getEpochReward(uint256 _epoch) public view returns (uint256) {
}
//Starts a new calculation epoch
// Because averge since start will not be accurate
function startNewEpoch() public {
}
event Deposit(address indexed user, uint256 amount);
event Withdraw(address indexed user, uint256 amount);
event EmergencyWithdraw(address indexed user, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function initialize(address _devFundAddress) public initializer {
}
modifier validLockTime(uint256 _time) {
}
//to avoid exploit in time lock
function checkLockTiming(address _user, uint256 _time) internal {
}
function setEmergencyWithdrawable(bool _withdrawable) public onlyOwner {
}
function setDevFee(uint16 _DEV_FEE) public onlyOwner {
}
// View function to see pending TROPs on frontend.
function pendingTROP(address _user) public view returns (uint256) {
}
function getLockedReward(address _user) public view returns (uint256) {
}
// Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public {
}
// ----
// Function that adds pending rewards, called by the TROP token.
// ----
function updatePendingRewards() public {
}
// Update reward variables of the given pool to be up-to-date.
function updatePool() internal returns (uint256 tropRewardWhole) {
}
function withdrawReward() public {
}
// Deposit tokens to TROPVault for TROP allocation.
function deposit(uint256 _amount, uint256 _lockTime)
public
validLockTime(_lockTime)
{
checkLockTiming(msg.sender, _lockTime);
UserInfo storage user = userInfo[msg.sender];
massUpdatePools();
// Transfer pending tokens
// to user
updateAndPayOutPending(msg.sender);
//Transfer in the amounts from user
// save gas
if (_amount > 0) {
uint256 balBefore = trop.balanceOf(address(this));
trop.safeTransferFrom(address(msg.sender), address(this), _amount);
require(<FILL_ME>)
updateRewardAllocPoint(msg.sender, _amount, _lockTime);
user.amount = user.amount.add(_amount);
poolInfo.totalStake += _amount;
}
user.rewardDebt = user.rewardAllocPoint.mul(poolInfo.accTROPPerRAP).div(
1e18
);
emit Deposit(msg.sender, _amount);
}
function updateRewardAllocPoint(
address _addr,
uint256 _depositAmount,
uint256 _lockTime
) internal {
}
// Test coverage
// [x] Does user get the deposited amounts?
// [x] Does user that its deposited for update correcty?
// [x] Does the depositor get their tokens decreased
function depositFor(
address _depositFor,
uint256 _amount,
uint256 _lockTime
) public validLockTime(_lockTime) {
}
// Test coverage
// [x] Does allowance update correctly?
function setAllowanceForPoolToken(address spender, uint256 value) public {
}
function quitPool() public {
}
// Test coverage
// [x] Does allowance decrease?
// [x] Do oyu need allowance
// [x] Withdraws to correct address
function withdrawFrom(address owner, uint256 _amount) public {
}
// Withdraw tokens from TROPVault.
function withdraw(uint256 _amount) public {
}
// Low level withdraw function
function _withdraw(
uint256 _amount,
address from,
address to
) internal {
}
function updateAndPayOutPending(address from) internal {
}
function emergencyWithdraw() public {
}
function safeTROPTransfer(address _to, uint256 _amount) internal {
}
function transferDevFee() public {
}
function setDevFeeReciever(address _devaddr) public {
}
event Restake(address indexed user, uint256 amount);
function claimAndRestake() public {
}
}
| trop.balanceOf(address(this)).sub(balBefore)==_amount,"stake should not have fee" | 22,684 | trop.balanceOf(address(this)).sub(balBefore)==_amount |
"withdraw: insufficient allowance" | pragma solidity 0.6.12;
// TROPVault distributes fees equally amongst staked pools
// Have fun reading it. Hopefully it's bug-free. God bless.
contract TimeLockLPTokenStaking {
using SafeMath for uint256;
using Address for address;
// Info of each user.
struct UserInfo {
uint256 amount; // How many tokens the user currently has.
uint256 rewardAllocPoint; //this is used for computing user rewards, depending on the staked amount and locked time
uint256 rewardDebt; // Reward debt. See explanation below.
uint256 rewardLocked;
uint256 releaseTime;
//
// We do some fancy math here. Basically, any point in time, the amount of TROPs
// entitled to a user but is pending to be distributed is:
//
// pending reward = (user.amount * pool.accTROPPerRAP) - user.rewardDebt
//
// Whenever a user deposits or withdraws tokens to a pool. Here's what happens:
// 1. The pool's `accTROPPerRAP` (and `lastRewardBlock`) gets updated.
// 2. User receives the pending reward sent to his/her address.
// 3. User's `amount` gets updated.
// 4. User's `rewardDebt` gets updated.
uint256 lpReleaseTime;
uint256 lockedPeriod;
}
// Info of each pool.
struct PoolInfo {
uint256 allocPoint; // How many allocation points assigned to this pool. TROPs to distribute per block.
uint256 accTROPPerRAP; // Accumulated TROPs per rewardAllocPoint RAP, times 1e18. See below.
uint256 totalRewardAllocPoint;
mapping(address => mapping(address => uint256)) allowance;
bool emergencyWithdrawable;
uint256 rewardsInThisEpoch;
uint256 cumulativeRewardsSinceStart;
uint256 startBlock;
uint256 startTime;
uint256 totalStake;
// For easy graphing historical epoch rewards
mapping(uint256 => uint256) epochRewards;
uint256 epochCalculationStartBlock;
}
// Info of each pool.
PoolInfo public poolInfo;
// Info of each user that stakes tokens.
mapping(address => UserInfo) public userInfo;
// The TROP TOKEN!
IERC20 public trop;
function computeReleasableLP(address _addr) public view returns (uint256) {
}
}
contract TROPStakingFixed is OwnableUpgradeSafe, TimeLockLPTokenStaking {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Dev address.
address public devaddr;
// Total allocation poitns. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint;
//// pending rewards awaiting anyone to massUpdate
uint256 public pendingRewards;
uint256 public epoch;
uint256 public constant REWARD_LOCKED_PERIOD = 14 days;
uint256 public constant REWARD_RELEASE_PERCENTAGE = 40;
uint256 public contractStartBlock;
uint256 private tropBalance;
// Sets the dev fee for this contract
// defaults at 7.24%
// Note contract owner is meant to be a governance contract allowing TROP governance consensus
uint16 DEV_FEE;
uint256 public pending_DEV_rewards;
// Returns fees generated since start of this contract
function averageFeesPerBlockSinceStart()
external
view
returns (uint256 averagePerBlock)
{
}
// Returns averge fees in this epoch
function averageFeesPerBlockEpoch()
external
view
returns (uint256 averagePerBlock)
{
}
function getEpochReward(uint256 _epoch) public view returns (uint256) {
}
//Starts a new calculation epoch
// Because averge since start will not be accurate
function startNewEpoch() public {
}
event Deposit(address indexed user, uint256 amount);
event Withdraw(address indexed user, uint256 amount);
event EmergencyWithdraw(address indexed user, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function initialize(address _devFundAddress) public initializer {
}
modifier validLockTime(uint256 _time) {
}
//to avoid exploit in time lock
function checkLockTiming(address _user, uint256 _time) internal {
}
function setEmergencyWithdrawable(bool _withdrawable) public onlyOwner {
}
function setDevFee(uint16 _DEV_FEE) public onlyOwner {
}
// View function to see pending TROPs on frontend.
function pendingTROP(address _user) public view returns (uint256) {
}
function getLockedReward(address _user) public view returns (uint256) {
}
// Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public {
}
// ----
// Function that adds pending rewards, called by the TROP token.
// ----
function updatePendingRewards() public {
}
// Update reward variables of the given pool to be up-to-date.
function updatePool() internal returns (uint256 tropRewardWhole) {
}
function withdrawReward() public {
}
// Deposit tokens to TROPVault for TROP allocation.
function deposit(uint256 _amount, uint256 _lockTime)
public
validLockTime(_lockTime)
{
}
function updateRewardAllocPoint(
address _addr,
uint256 _depositAmount,
uint256 _lockTime
) internal {
}
// Test coverage
// [x] Does user get the deposited amounts?
// [x] Does user that its deposited for update correcty?
// [x] Does the depositor get their tokens decreased
function depositFor(
address _depositFor,
uint256 _amount,
uint256 _lockTime
) public validLockTime(_lockTime) {
}
// Test coverage
// [x] Does allowance update correctly?
function setAllowanceForPoolToken(address spender, uint256 value) public {
}
function quitPool() public {
}
// Test coverage
// [x] Does allowance decrease?
// [x] Do oyu need allowance
// [x] Withdraws to correct address
function withdrawFrom(address owner, uint256 _amount) public {
PoolInfo storage pool = poolInfo;
require(<FILL_ME>)
pool.allowance[owner][msg.sender] = pool.allowance[owner][msg.sender]
.sub(_amount);
_withdraw(_amount, owner, msg.sender);
}
// Withdraw tokens from TROPVault.
function withdraw(uint256 _amount) public {
}
// Low level withdraw function
function _withdraw(
uint256 _amount,
address from,
address to
) internal {
}
function updateAndPayOutPending(address from) internal {
}
function emergencyWithdraw() public {
}
function safeTROPTransfer(address _to, uint256 _amount) internal {
}
function transferDevFee() public {
}
function setDevFeeReciever(address _devaddr) public {
}
event Restake(address indexed user, uint256 amount);
function claimAndRestake() public {
}
}
| pool.allowance[owner][msg.sender]>=_amount,"withdraw: insufficient allowance" | 22,684 | pool.allowance[owner][msg.sender]>=_amount |
"Withdrawing from this pool is disabled" | pragma solidity 0.6.12;
// TROPVault distributes fees equally amongst staked pools
// Have fun reading it. Hopefully it's bug-free. God bless.
contract TimeLockLPTokenStaking {
using SafeMath for uint256;
using Address for address;
// Info of each user.
struct UserInfo {
uint256 amount; // How many tokens the user currently has.
uint256 rewardAllocPoint; //this is used for computing user rewards, depending on the staked amount and locked time
uint256 rewardDebt; // Reward debt. See explanation below.
uint256 rewardLocked;
uint256 releaseTime;
//
// We do some fancy math here. Basically, any point in time, the amount of TROPs
// entitled to a user but is pending to be distributed is:
//
// pending reward = (user.amount * pool.accTROPPerRAP) - user.rewardDebt
//
// Whenever a user deposits or withdraws tokens to a pool. Here's what happens:
// 1. The pool's `accTROPPerRAP` (and `lastRewardBlock`) gets updated.
// 2. User receives the pending reward sent to his/her address.
// 3. User's `amount` gets updated.
// 4. User's `rewardDebt` gets updated.
uint256 lpReleaseTime;
uint256 lockedPeriod;
}
// Info of each pool.
struct PoolInfo {
uint256 allocPoint; // How many allocation points assigned to this pool. TROPs to distribute per block.
uint256 accTROPPerRAP; // Accumulated TROPs per rewardAllocPoint RAP, times 1e18. See below.
uint256 totalRewardAllocPoint;
mapping(address => mapping(address => uint256)) allowance;
bool emergencyWithdrawable;
uint256 rewardsInThisEpoch;
uint256 cumulativeRewardsSinceStart;
uint256 startBlock;
uint256 startTime;
uint256 totalStake;
// For easy graphing historical epoch rewards
mapping(uint256 => uint256) epochRewards;
uint256 epochCalculationStartBlock;
}
// Info of each pool.
PoolInfo public poolInfo;
// Info of each user that stakes tokens.
mapping(address => UserInfo) public userInfo;
// The TROP TOKEN!
IERC20 public trop;
function computeReleasableLP(address _addr) public view returns (uint256) {
}
}
contract TROPStakingFixed is OwnableUpgradeSafe, TimeLockLPTokenStaking {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Dev address.
address public devaddr;
// Total allocation poitns. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint;
//// pending rewards awaiting anyone to massUpdate
uint256 public pendingRewards;
uint256 public epoch;
uint256 public constant REWARD_LOCKED_PERIOD = 14 days;
uint256 public constant REWARD_RELEASE_PERCENTAGE = 40;
uint256 public contractStartBlock;
uint256 private tropBalance;
// Sets the dev fee for this contract
// defaults at 7.24%
// Note contract owner is meant to be a governance contract allowing TROP governance consensus
uint16 DEV_FEE;
uint256 public pending_DEV_rewards;
// Returns fees generated since start of this contract
function averageFeesPerBlockSinceStart()
external
view
returns (uint256 averagePerBlock)
{
}
// Returns averge fees in this epoch
function averageFeesPerBlockEpoch()
external
view
returns (uint256 averagePerBlock)
{
}
function getEpochReward(uint256 _epoch) public view returns (uint256) {
}
//Starts a new calculation epoch
// Because averge since start will not be accurate
function startNewEpoch() public {
}
event Deposit(address indexed user, uint256 amount);
event Withdraw(address indexed user, uint256 amount);
event EmergencyWithdraw(address indexed user, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function initialize(address _devFundAddress) public initializer {
}
modifier validLockTime(uint256 _time) {
}
//to avoid exploit in time lock
function checkLockTiming(address _user, uint256 _time) internal {
}
function setEmergencyWithdrawable(bool _withdrawable) public onlyOwner {
}
function setDevFee(uint16 _DEV_FEE) public onlyOwner {
}
// View function to see pending TROPs on frontend.
function pendingTROP(address _user) public view returns (uint256) {
}
function getLockedReward(address _user) public view returns (uint256) {
}
// Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public {
}
// ----
// Function that adds pending rewards, called by the TROP token.
// ----
function updatePendingRewards() public {
}
// Update reward variables of the given pool to be up-to-date.
function updatePool() internal returns (uint256 tropRewardWhole) {
}
function withdrawReward() public {
}
// Deposit tokens to TROPVault for TROP allocation.
function deposit(uint256 _amount, uint256 _lockTime)
public
validLockTime(_lockTime)
{
}
function updateRewardAllocPoint(
address _addr,
uint256 _depositAmount,
uint256 _lockTime
) internal {
}
// Test coverage
// [x] Does user get the deposited amounts?
// [x] Does user that its deposited for update correcty?
// [x] Does the depositor get their tokens decreased
function depositFor(
address _depositFor,
uint256 _amount,
uint256 _lockTime
) public validLockTime(_lockTime) {
}
// Test coverage
// [x] Does allowance update correctly?
function setAllowanceForPoolToken(address spender, uint256 value) public {
}
function quitPool() public {
}
// Test coverage
// [x] Does allowance decrease?
// [x] Do oyu need allowance
// [x] Withdraws to correct address
function withdrawFrom(address owner, uint256 _amount) public {
}
// Withdraw tokens from TROPVault.
function withdraw(uint256 _amount) public {
}
// Low level withdraw function
function _withdraw(
uint256 _amount,
address from,
address to
) internal {
}
function updateAndPayOutPending(address from) internal {
}
function emergencyWithdraw() public {
PoolInfo storage pool = poolInfo;
require(<FILL_ME>)
UserInfo storage user = userInfo[msg.sender];
trop.safeTransfer(address(msg.sender), user.amount);
if (pool.totalStake >= user.amount) {
pool.totalStake -= user.amount;
}
emit EmergencyWithdraw(msg.sender, user.amount);
if (
user.amount.mul(user.rewardAllocPoint) <= pool.totalRewardAllocPoint
) {
pool.totalRewardAllocPoint = pool.totalRewardAllocPoint.sub(
user.amount.mul(user.rewardAllocPoint)
);
}
user.rewardAllocPoint = 0;
user.amount = 0;
user.rewardDebt = 0;
}
function safeTROPTransfer(address _to, uint256 _amount) internal {
}
function transferDevFee() public {
}
function setDevFeeReciever(address _devaddr) public {
}
event Restake(address indexed user, uint256 amount);
function claimAndRestake() public {
}
}
| pool.emergencyWithdrawable,"Withdrawing from this pool is disabled" | 22,684 | pool.emergencyWithdrawable |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract CryptoFoxes{
function buyTicket(address _to, uint _count) public payable{}
function price(uint256 _count) public view returns (uint256){}
}
contract CryptoFoxesPayment is Ownable {
using SafeMath for uint256;
CryptoFoxes private cryptofoxes;
uint256 public price = 0.04 ether;
uint256 public max = 5;
constructor() {
}
function setCryptoFoxes(address _cryptofoxes) public onlyOwner {
}
function buyTicket(address _to, uint _count) public payable {
}
function calcultateOldPrice(uint256 _count) public view virtual returns (uint256) {
}
function withdrawAll() public onlyOwner {
require(<FILL_ME>)
}
receive() external payable {}
function setPrice(uint256 _price) public onlyOwner{
}
function setMax(uint256 _max) public onlyOwner{
}
}
| payable(_msgSender()).send(address(this).balance) | 22,715 | payable(_msgSender()).send(address(this).balance) |
null | pragma solidity ^0.4.24;
/**
* @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 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) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath128 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint128 a, uint128 b) internal pure returns (uint128 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint128 a, uint128 b) internal pure returns (uint128) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint128 a, uint128 b) internal pure returns (uint128) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath64 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint64 a, uint64 b) internal pure returns (uint64 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint64 a, uint64 b) internal pure returns (uint64) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint64 a, uint64 b) internal pure returns (uint64) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath32 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint32 a, uint32 b) internal pure returns (uint32 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint32 a, uint32 b) internal pure returns (uint32) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint32 a, uint32 b) internal pure returns (uint32) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath16 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint16 a, uint16 b) internal pure returns (uint16 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint16 a, uint16 b) internal pure returns (uint16) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint16 a, uint16 b) internal pure returns (uint16) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint16 a, uint16 b) internal pure returns (uint16 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath8 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint8 a, uint8 b) internal pure returns (uint8 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint8 a, uint8 b) internal pure returns (uint8) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint8 a, uint8 b) internal pure returns (uint8) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint8 a, uint8 b) internal pure returns (uint8 c) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
}
}
/**
* @title Eliptic curve signature operations
*
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
*
* TODO Remove this library once solidity supports passing a signature to ecrecover.
* See https://github.com/ethereum/solidity/issues/864
*
*/
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) {
}
}
contract MintibleUtility is Ownable {
using SafeMath for uint256;
using SafeMath128 for uint128;
using SafeMath64 for uint64;
using SafeMath32 for uint32;
using SafeMath16 for uint16;
using SafeMath8 for uint8;
using AddressUtils for address;
using ECRecovery for bytes32;
uint256 private nonce;
bool public paused;
modifier notPaused() {
}
/*
* @dev Uses binary search to find the index of the off given
*/
function getIndexFromOdd(uint32 _odd, uint32[] _odds) internal pure returns (uint) {
}
/*
* Using the `nonce` and a range, it generates a random value using `keccak256` and random distribution
*/
function rand(uint32 min, uint32 max) internal returns (uint32) {
}
/*
* Sub array utility functions
*/
function getUintSubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint256[]) {
}
function getUint32SubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint32[]) {
}
function getUint64SubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint64[]) {
}
}
contract ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function exists(uint256 _tokenId) public view returns (bool _exists);
function approve(address _to, uint256 _tokenId) public;
function getApproved(uint256 _tokenId) public view returns (address _operator);
function setApprovalForAll(address _operator, bool _approved) public;
function isApprovedForAll(address _owner, address _operator) public view returns (bool);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes _data
)
public;
}
/*
* An interface extension of ERC721
*/
contract MintibleI is ERC721 {
function getLastModifiedNonce(uint256 _id) public view returns (uint);
function payFee(uint256 _id) public payable;
}
/**
* This contract assumes that it was approved beforehand
*/
contract MintibleMarketplace is MintibleUtility {
event EtherOffer(address from, address to, address contractAddress, uint256 id, uint256 price);
event InvalidateSignature(bytes signature);
mapping(bytes32 => bool) public consumed;
mapping(address => bool) public implementsMintibleInterface;
/*
* @dev Function that verifies that `_contractAddress` implements the `MintibleI`
*/
function setImplementsMintibleInterface(address _contractAddress) public notPaused {
require(<FILL_ME>)
implementsMintibleInterface[_contractAddress] = true;
}
/*
* @dev This function consumes a signature to buy an item for ether
*/
function consumeEtherOffer(
address _from,
address _contractAddress,
uint256 _id,
uint256 _expiryBlock,
uint128 _uuid,
bytes _signature
) public payable notPaused {
}
// Sets a hash
function invalidateSignature(bytes32 _hash, bytes _signature) public notPaused {
}
/*
* @dev Transfer `address(this).balance` to `owner`
*/
function withdraw() public onlyOwner {
}
/*
* @dev This function validates that the `_hash` and `_signature` match the `_signer`
*/
function validateConsumedHash(address _signer, bytes32 _hash, bytes _signature) private pure {
}
/*
* Function that verifies whether `payFee(uint256)` was implemented at the given address
*/
function isPayFeeSafe(address _addr)
private
returns (bool _isImplemented)
{
}
/*
* Function that verifies whether `payFee(uint256)` was implemented at the given address
*/
function isGetLastModifiedNonceSafe(address _addr)
private
returns (bool _isImplemented)
{
}
}
| isPayFeeSafe(_contractAddress)&&isGetLastModifiedNonceSafe(_contractAddress) | 22,767 | isPayFeeSafe(_contractAddress)&&isGetLastModifiedNonceSafe(_contractAddress) |
null | pragma solidity ^0.4.24;
/**
* @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 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) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath128 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint128 a, uint128 b) internal pure returns (uint128 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint128 a, uint128 b) internal pure returns (uint128) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint128 a, uint128 b) internal pure returns (uint128) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath64 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint64 a, uint64 b) internal pure returns (uint64 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint64 a, uint64 b) internal pure returns (uint64) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint64 a, uint64 b) internal pure returns (uint64) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath32 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint32 a, uint32 b) internal pure returns (uint32 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint32 a, uint32 b) internal pure returns (uint32) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint32 a, uint32 b) internal pure returns (uint32) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath16 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint16 a, uint16 b) internal pure returns (uint16 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint16 a, uint16 b) internal pure returns (uint16) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint16 a, uint16 b) internal pure returns (uint16) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint16 a, uint16 b) internal pure returns (uint16 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath8 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint8 a, uint8 b) internal pure returns (uint8 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint8 a, uint8 b) internal pure returns (uint8) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint8 a, uint8 b) internal pure returns (uint8) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint8 a, uint8 b) internal pure returns (uint8 c) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
}
}
/**
* @title Eliptic curve signature operations
*
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
*
* TODO Remove this library once solidity supports passing a signature to ecrecover.
* See https://github.com/ethereum/solidity/issues/864
*
*/
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) {
}
}
contract MintibleUtility is Ownable {
using SafeMath for uint256;
using SafeMath128 for uint128;
using SafeMath64 for uint64;
using SafeMath32 for uint32;
using SafeMath16 for uint16;
using SafeMath8 for uint8;
using AddressUtils for address;
using ECRecovery for bytes32;
uint256 private nonce;
bool public paused;
modifier notPaused() {
}
/*
* @dev Uses binary search to find the index of the off given
*/
function getIndexFromOdd(uint32 _odd, uint32[] _odds) internal pure returns (uint) {
}
/*
* Using the `nonce` and a range, it generates a random value using `keccak256` and random distribution
*/
function rand(uint32 min, uint32 max) internal returns (uint32) {
}
/*
* Sub array utility functions
*/
function getUintSubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint256[]) {
}
function getUint32SubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint32[]) {
}
function getUint64SubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint64[]) {
}
}
contract ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function exists(uint256 _tokenId) public view returns (bool _exists);
function approve(address _to, uint256 _tokenId) public;
function getApproved(uint256 _tokenId) public view returns (address _operator);
function setApprovalForAll(address _operator, bool _approved) public;
function isApprovedForAll(address _owner, address _operator) public view returns (bool);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes _data
)
public;
}
/*
* An interface extension of ERC721
*/
contract MintibleI is ERC721 {
function getLastModifiedNonce(uint256 _id) public view returns (uint);
function payFee(uint256 _id) public payable;
}
/**
* This contract assumes that it was approved beforehand
*/
contract MintibleMarketplace is MintibleUtility {
event EtherOffer(address from, address to, address contractAddress, uint256 id, uint256 price);
event InvalidateSignature(bytes signature);
mapping(bytes32 => bool) public consumed;
mapping(address => bool) public implementsMintibleInterface;
/*
* @dev Function that verifies that `_contractAddress` implements the `MintibleI`
*/
function setImplementsMintibleInterface(address _contractAddress) public notPaused {
}
/*
* @dev This function consumes a signature to buy an item for ether
*/
function consumeEtherOffer(
address _from,
address _contractAddress,
uint256 _id,
uint256 _expiryBlock,
uint128 _uuid,
bytes _signature
) public payable notPaused {
uint itemNonce;
if (implementsMintibleInterface[_contractAddress]) {
itemNonce = MintibleI(_contractAddress).getLastModifiedNonce(_id);
}
bytes32 hash = keccak256(abi.encodePacked(address(this), _contractAddress, _id, msg.value, _expiryBlock, _uuid, itemNonce));
// Ensure this hash wasn't already consumed
require(<FILL_ME>)
consumed[hash] = true;
validateConsumedHash(_from, hash, _signature);
// Verify the expiration date of the signature
require(block.number < _expiryBlock);
// 1% marketplace fee
uint256 marketplaceFee = msg.value.mul(10 finney) / 1 ether;
// 2.5% creator fee
uint256 creatorFee = msg.value.mul(25 finney) / 1 ether;
// How much the seller receives
uint256 amountReceived = msg.value.sub(marketplaceFee);
// Transfer token to buyer
MintibleI(_contractAddress).transferFrom(_from, msg.sender, _id);
// Increase balance of creator if contract implements MintibleI
if (implementsMintibleInterface[_contractAddress]) {
amountReceived = amountReceived.sub(creatorFee);
MintibleI(_contractAddress).payFee.value(creatorFee)(_id);
}
// Transfer funds to seller
_from.transfer(amountReceived);
emit EtherOffer(_from, msg.sender, _contractAddress, _id, msg.value);
}
// Sets a hash
function invalidateSignature(bytes32 _hash, bytes _signature) public notPaused {
}
/*
* @dev Transfer `address(this).balance` to `owner`
*/
function withdraw() public onlyOwner {
}
/*
* @dev This function validates that the `_hash` and `_signature` match the `_signer`
*/
function validateConsumedHash(address _signer, bytes32 _hash, bytes _signature) private pure {
}
/*
* Function that verifies whether `payFee(uint256)` was implemented at the given address
*/
function isPayFeeSafe(address _addr)
private
returns (bool _isImplemented)
{
}
/*
* Function that verifies whether `payFee(uint256)` was implemented at the given address
*/
function isGetLastModifiedNonceSafe(address _addr)
private
returns (bool _isImplemented)
{
}
}
| !consumed[hash] | 22,767 | !consumed[hash] |
null | pragma solidity ^0.4.24;
/**
* @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 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) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath128 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint128 a, uint128 b) internal pure returns (uint128 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint128 a, uint128 b) internal pure returns (uint128) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint128 a, uint128 b) internal pure returns (uint128) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath64 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint64 a, uint64 b) internal pure returns (uint64 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint64 a, uint64 b) internal pure returns (uint64) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint64 a, uint64 b) internal pure returns (uint64) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath32 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint32 a, uint32 b) internal pure returns (uint32 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint32 a, uint32 b) internal pure returns (uint32) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint32 a, uint32 b) internal pure returns (uint32) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath16 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint16 a, uint16 b) internal pure returns (uint16 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint16 a, uint16 b) internal pure returns (uint16) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint16 a, uint16 b) internal pure returns (uint16) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint16 a, uint16 b) internal pure returns (uint16 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath8 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint8 a, uint8 b) internal pure returns (uint8 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint8 a, uint8 b) internal pure returns (uint8) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint8 a, uint8 b) internal pure returns (uint8) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint8 a, uint8 b) internal pure returns (uint8 c) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
}
}
/**
* @title Eliptic curve signature operations
*
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
*
* TODO Remove this library once solidity supports passing a signature to ecrecover.
* See https://github.com/ethereum/solidity/issues/864
*
*/
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) {
}
}
contract MintibleUtility is Ownable {
using SafeMath for uint256;
using SafeMath128 for uint128;
using SafeMath64 for uint64;
using SafeMath32 for uint32;
using SafeMath16 for uint16;
using SafeMath8 for uint8;
using AddressUtils for address;
using ECRecovery for bytes32;
uint256 private nonce;
bool public paused;
modifier notPaused() {
}
/*
* @dev Uses binary search to find the index of the off given
*/
function getIndexFromOdd(uint32 _odd, uint32[] _odds) internal pure returns (uint) {
}
/*
* Using the `nonce` and a range, it generates a random value using `keccak256` and random distribution
*/
function rand(uint32 min, uint32 max) internal returns (uint32) {
}
/*
* Sub array utility functions
*/
function getUintSubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint256[]) {
}
function getUint32SubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint32[]) {
}
function getUint64SubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint64[]) {
}
}
contract ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function exists(uint256 _tokenId) public view returns (bool _exists);
function approve(address _to, uint256 _tokenId) public;
function getApproved(uint256 _tokenId) public view returns (address _operator);
function setApprovalForAll(address _operator, bool _approved) public;
function isApprovedForAll(address _owner, address _operator) public view returns (bool);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes _data
)
public;
}
/*
* An interface extension of ERC721
*/
contract MintibleI is ERC721 {
function getLastModifiedNonce(uint256 _id) public view returns (uint);
function payFee(uint256 _id) public payable;
}
/**
* This contract assumes that it was approved beforehand
*/
contract MintibleMarketplace is MintibleUtility {
event EtherOffer(address from, address to, address contractAddress, uint256 id, uint256 price);
event InvalidateSignature(bytes signature);
mapping(bytes32 => bool) public consumed;
mapping(address => bool) public implementsMintibleInterface;
/*
* @dev Function that verifies that `_contractAddress` implements the `MintibleI`
*/
function setImplementsMintibleInterface(address _contractAddress) public notPaused {
}
/*
* @dev This function consumes a signature to buy an item for ether
*/
function consumeEtherOffer(
address _from,
address _contractAddress,
uint256 _id,
uint256 _expiryBlock,
uint128 _uuid,
bytes _signature
) public payable notPaused {
}
// Sets a hash
function invalidateSignature(bytes32 _hash, bytes _signature) public notPaused {
bytes32 signedHash = keccak256(abi.encodePacked('\x19Ethereum Signed Message:\n32', _hash));
require(<FILL_ME>)
consumed[_hash] = true;
emit InvalidateSignature(_signature);
}
/*
* @dev Transfer `address(this).balance` to `owner`
*/
function withdraw() public onlyOwner {
}
/*
* @dev This function validates that the `_hash` and `_signature` match the `_signer`
*/
function validateConsumedHash(address _signer, bytes32 _hash, bytes _signature) private pure {
}
/*
* Function that verifies whether `payFee(uint256)` was implemented at the given address
*/
function isPayFeeSafe(address _addr)
private
returns (bool _isImplemented)
{
}
/*
* Function that verifies whether `payFee(uint256)` was implemented at the given address
*/
function isGetLastModifiedNonceSafe(address _addr)
private
returns (bool _isImplemented)
{
}
}
| signedHash.recover(_signature)==msg.sender | 22,767 | signedHash.recover(_signature)==msg.sender |
null | pragma solidity ^0.4.24;
/**
* @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 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) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath128 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint128 a, uint128 b) internal pure returns (uint128 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint128 a, uint128 b) internal pure returns (uint128) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint128 a, uint128 b) internal pure returns (uint128) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath64 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint64 a, uint64 b) internal pure returns (uint64 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint64 a, uint64 b) internal pure returns (uint64) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint64 a, uint64 b) internal pure returns (uint64) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath32 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint32 a, uint32 b) internal pure returns (uint32 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint32 a, uint32 b) internal pure returns (uint32) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint32 a, uint32 b) internal pure returns (uint32) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath16 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint16 a, uint16 b) internal pure returns (uint16 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint16 a, uint16 b) internal pure returns (uint16) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint16 a, uint16 b) internal pure returns (uint16) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint16 a, uint16 b) internal pure returns (uint16 c) {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath8 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint8 a, uint8 b) internal pure returns (uint8 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint8 a, uint8 b) internal pure returns (uint8) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint8 a, uint8 b) internal pure returns (uint8) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint8 a, uint8 b) internal pure returns (uint8 c) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
}
}
/**
* @title Eliptic curve signature operations
*
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
*
* TODO Remove this library once solidity supports passing a signature to ecrecover.
* See https://github.com/ethereum/solidity/issues/864
*
*/
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) {
}
}
contract MintibleUtility is Ownable {
using SafeMath for uint256;
using SafeMath128 for uint128;
using SafeMath64 for uint64;
using SafeMath32 for uint32;
using SafeMath16 for uint16;
using SafeMath8 for uint8;
using AddressUtils for address;
using ECRecovery for bytes32;
uint256 private nonce;
bool public paused;
modifier notPaused() {
}
/*
* @dev Uses binary search to find the index of the off given
*/
function getIndexFromOdd(uint32 _odd, uint32[] _odds) internal pure returns (uint) {
}
/*
* Using the `nonce` and a range, it generates a random value using `keccak256` and random distribution
*/
function rand(uint32 min, uint32 max) internal returns (uint32) {
}
/*
* Sub array utility functions
*/
function getUintSubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint256[]) {
}
function getUint32SubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint32[]) {
}
function getUint64SubArray(uint256[] _arr, uint256 _start, uint256 _end) internal pure returns (uint64[]) {
}
}
contract ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function exists(uint256 _tokenId) public view returns (bool _exists);
function approve(address _to, uint256 _tokenId) public;
function getApproved(uint256 _tokenId) public view returns (address _operator);
function setApprovalForAll(address _operator, bool _approved) public;
function isApprovedForAll(address _owner, address _operator) public view returns (bool);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes _data
)
public;
}
/*
* An interface extension of ERC721
*/
contract MintibleI is ERC721 {
function getLastModifiedNonce(uint256 _id) public view returns (uint);
function payFee(uint256 _id) public payable;
}
/**
* This contract assumes that it was approved beforehand
*/
contract MintibleMarketplace is MintibleUtility {
event EtherOffer(address from, address to, address contractAddress, uint256 id, uint256 price);
event InvalidateSignature(bytes signature);
mapping(bytes32 => bool) public consumed;
mapping(address => bool) public implementsMintibleInterface;
/*
* @dev Function that verifies that `_contractAddress` implements the `MintibleI`
*/
function setImplementsMintibleInterface(address _contractAddress) public notPaused {
}
/*
* @dev This function consumes a signature to buy an item for ether
*/
function consumeEtherOffer(
address _from,
address _contractAddress,
uint256 _id,
uint256 _expiryBlock,
uint128 _uuid,
bytes _signature
) public payable notPaused {
}
// Sets a hash
function invalidateSignature(bytes32 _hash, bytes _signature) public notPaused {
}
/*
* @dev Transfer `address(this).balance` to `owner`
*/
function withdraw() public onlyOwner {
}
/*
* @dev This function validates that the `_hash` and `_signature` match the `_signer`
*/
function validateConsumedHash(address _signer, bytes32 _hash, bytes _signature) private pure {
bytes32 signedHash = keccak256(abi.encodePacked('\x19Ethereum Signed Message:\n32', _hash));
// Verify signature validity
require(<FILL_ME>)
}
/*
* Function that verifies whether `payFee(uint256)` was implemented at the given address
*/
function isPayFeeSafe(address _addr)
private
returns (bool _isImplemented)
{
}
/*
* Function that verifies whether `payFee(uint256)` was implemented at the given address
*/
function isGetLastModifiedNonceSafe(address _addr)
private
returns (bool _isImplemented)
{
}
}
| signedHash.recover(_signature)==_signer | 22,767 | signedHash.recover(_signature)==_signer |
"Too many requested" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IERC1155Collection.sol";
import "./CollectionBase.sol";
/**
* ERC1155 Collection Drop Contract (Base)
*/
abstract contract ERC1155CollectionBase is CollectionBase, IERC1155Collection {
// Token ID to mint
uint16 internal constant TOKEN_ID = 1;
// Immutable variables that should only be set by the constructor or initializer
uint16 public transactionLimit;
uint16 public purchaseMax;
uint16 public purchaseLimit;
uint256 public purchasePrice;
uint16 public presalePurchaseLimit;
uint256 public presalePurchasePrice;
uint16 public maxSupply;
bool public useDynamicPresalePurchaseLimit;
// Mutable mint state
uint16 public purchaseCount;
uint16 public reserveCount;
mapping(address => uint16) private _mintCount;
// Royalty
uint256 private _royaltyBps;
address payable private _royaltyRecipient;
bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6;
bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a;
bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584;
// Transfer lock
bool public transferLocked;
/**
* Initializer
*/
function _initialize(uint16 maxSupply_, uint16 purchaseMax_, uint256 purchasePrice_, uint16 purchaseLimit_, uint16 transactionLimit_, uint256 presalePurchasePrice_, uint16 presalePurchaseLimit_, address signingAddress_, bool useDynamicPresalePurchaseLimit_) internal {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165) returns (bool) {
}
/**
* @dev See {IERC1155Collection-claim}.
*/
function claim(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override {
}
/**
* @dev See {IERC1155Collection-purchase}.
*/
function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override payable {
_validatePurchaseRestrictions();
// Check purchase amounts
require(amount <= purchaseRemaining() && (transactionLimit == 0 || amount <= transactionLimit), "Too many requested");
uint256 balance = _getMintBalance();
bool isPresale = _isPresale();
if (isPresale) {
require(<FILL_ME>)
_validatePresalePrice(amount);
} else {
require(purchaseLimit == 0 || amount <= (purchaseLimit - balance), "Too many requested");
_validatePrice(amount);
}
if (isPresale && useDynamicPresalePurchaseLimit) {
_validatePurchaseRequestWithAmount(message, signature, nonce, amount);
} else {
_validatePurchaseRequest(message, signature, nonce);
}
_mint(msg.sender, amount, isPresale);
}
/**
* @dev See {IERC1155Collection-state}
*/
function state() external override view returns (CollectionState memory) {
}
/**
* @dev Get balance of address. Similar to IERC1155-balanceOf, but doesn't require token ID
* @param owner The address to get the token balance of
*/
function balanceOf(address owner) public virtual override view returns (uint256);
/**
* @dev See {IERC1155Collection-purchaseRemaining}.
*/
function purchaseRemaining() public virtual override view returns (uint16) {
}
/**
* ROYALTY FUNCTIONS
*/
function getRoyalties(uint256) external view returns (address payable[] memory recipients, uint256[] memory bps) {
}
function getFeeRecipients(uint256) external view returns (address payable[] memory recipients) {
}
function getFeeBps(uint256) external view returns (uint[] memory bps) {
}
function royaltyInfo(uint256, uint256 value) external view returns (address, uint256) {
}
/**
* Premint tokens to the owner. Purchase must not be active.
*/
function _premint(uint16 amount, address owner) internal virtual {
}
/**
* Premint tokens to the list of addresses. Purchase must not be active.
*/
function _premint(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16 amount, address owner) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint function internal to ERC1155CollectionBase to keep track of state
*/
function _mint(address to, uint16 amount, bool presale) internal {
}
/**
* @dev A _mint function is required that calls the underlying ERC1155 mint.
*/
function _mintERC1155(address to, uint16 amount) internal virtual;
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePrice(uint16 amount) internal {
}
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePresalePrice(uint16 amount) internal virtual {
}
/**
* If enabled, lock token transfers until after the sale has ended.
*
* This helps enforce purchase limits, so someone can't buy -> transfer -> buy again
* while the token is minting.
*/
function _validateTokenTransferability(address from) internal view {
}
/**
* Set whether or not token transfers are locked till end of sale
*/
function _setTransferLocked(bool locked) internal {
}
/**
* @dev Update royalties
*/
function _updateRoyalties(address payable recipient, uint256 bps) internal {
}
/**
* @dev Return mint count or balanceOf
*/
function _getMintBalance() internal view returns (uint256) {
}
/**
* @dev Return whether mints need to be tracked
*/
function _shouldTrackMints() internal view returns (bool) {
}
/**
* @dev Return whether mints need to be tracked
* @param isPresale - pass in to explicitly consider in presale
*/
function _shouldTrackMints(bool isPresale) internal view returns (bool) {
}
}
| (presalePurchaseLimit==0||useDynamicPresalePurchaseLimit||amount<=(presalePurchaseLimit-balance))&&(purchaseLimit==0||amount<=(purchaseLimit-balance)),"Too many requested" | 22,816 | (presalePurchaseLimit==0||useDynamicPresalePurchaseLimit||amount<=(presalePurchaseLimit-balance))&&(purchaseLimit==0||amount<=(purchaseLimit-balance)) |
"Already active" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IERC1155Collection.sol";
import "./CollectionBase.sol";
/**
* ERC1155 Collection Drop Contract (Base)
*/
abstract contract ERC1155CollectionBase is CollectionBase, IERC1155Collection {
// Token ID to mint
uint16 internal constant TOKEN_ID = 1;
// Immutable variables that should only be set by the constructor or initializer
uint16 public transactionLimit;
uint16 public purchaseMax;
uint16 public purchaseLimit;
uint256 public purchasePrice;
uint16 public presalePurchaseLimit;
uint256 public presalePurchasePrice;
uint16 public maxSupply;
bool public useDynamicPresalePurchaseLimit;
// Mutable mint state
uint16 public purchaseCount;
uint16 public reserveCount;
mapping(address => uint16) private _mintCount;
// Royalty
uint256 private _royaltyBps;
address payable private _royaltyRecipient;
bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6;
bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a;
bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584;
// Transfer lock
bool public transferLocked;
/**
* Initializer
*/
function _initialize(uint16 maxSupply_, uint16 purchaseMax_, uint256 purchasePrice_, uint16 purchaseLimit_, uint16 transactionLimit_, uint256 presalePurchasePrice_, uint16 presalePurchaseLimit_, address signingAddress_, bool useDynamicPresalePurchaseLimit_) internal {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165) returns (bool) {
}
/**
* @dev See {IERC1155Collection-claim}.
*/
function claim(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override {
}
/**
* @dev See {IERC1155Collection-purchase}.
*/
function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override payable {
}
/**
* @dev See {IERC1155Collection-state}
*/
function state() external override view returns (CollectionState memory) {
}
/**
* @dev Get balance of address. Similar to IERC1155-balanceOf, but doesn't require token ID
* @param owner The address to get the token balance of
*/
function balanceOf(address owner) public virtual override view returns (uint256);
/**
* @dev See {IERC1155Collection-purchaseRemaining}.
*/
function purchaseRemaining() public virtual override view returns (uint16) {
}
/**
* ROYALTY FUNCTIONS
*/
function getRoyalties(uint256) external view returns (address payable[] memory recipients, uint256[] memory bps) {
}
function getFeeRecipients(uint256) external view returns (address payable[] memory recipients) {
}
function getFeeBps(uint256) external view returns (uint[] memory bps) {
}
function royaltyInfo(uint256, uint256 value) external view returns (address, uint256) {
}
/**
* Premint tokens to the owner. Purchase must not be active.
*/
function _premint(uint16 amount, address owner) internal virtual {
require(<FILL_ME>)
_mint(owner, amount, true);
}
/**
* Premint tokens to the list of addresses. Purchase must not be active.
*/
function _premint(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16 amount, address owner) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint function internal to ERC1155CollectionBase to keep track of state
*/
function _mint(address to, uint16 amount, bool presale) internal {
}
/**
* @dev A _mint function is required that calls the underlying ERC1155 mint.
*/
function _mintERC1155(address to, uint16 amount) internal virtual;
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePrice(uint16 amount) internal {
}
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePresalePrice(uint16 amount) internal virtual {
}
/**
* If enabled, lock token transfers until after the sale has ended.
*
* This helps enforce purchase limits, so someone can't buy -> transfer -> buy again
* while the token is minting.
*/
function _validateTokenTransferability(address from) internal view {
}
/**
* Set whether or not token transfers are locked till end of sale
*/
function _setTransferLocked(bool locked) internal {
}
/**
* @dev Update royalties
*/
function _updateRoyalties(address payable recipient, uint256 bps) internal {
}
/**
* @dev Return mint count or balanceOf
*/
function _getMintBalance() internal view returns (uint256) {
}
/**
* @dev Return whether mints need to be tracked
*/
function _shouldTrackMints() internal view returns (bool) {
}
/**
* @dev Return whether mints need to be tracked
* @param isPresale - pass in to explicitly consider in presale
*/
function _shouldTrackMints(bool isPresale) internal view returns (bool) {
}
}
| !active,"Already active" | 22,816 | !active |
"Too many requested" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IERC1155Collection.sol";
import "./CollectionBase.sol";
/**
* ERC1155 Collection Drop Contract (Base)
*/
abstract contract ERC1155CollectionBase is CollectionBase, IERC1155Collection {
// Token ID to mint
uint16 internal constant TOKEN_ID = 1;
// Immutable variables that should only be set by the constructor or initializer
uint16 public transactionLimit;
uint16 public purchaseMax;
uint16 public purchaseLimit;
uint256 public purchasePrice;
uint16 public presalePurchaseLimit;
uint256 public presalePurchasePrice;
uint16 public maxSupply;
bool public useDynamicPresalePurchaseLimit;
// Mutable mint state
uint16 public purchaseCount;
uint16 public reserveCount;
mapping(address => uint16) private _mintCount;
// Royalty
uint256 private _royaltyBps;
address payable private _royaltyRecipient;
bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6;
bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a;
bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584;
// Transfer lock
bool public transferLocked;
/**
* Initializer
*/
function _initialize(uint16 maxSupply_, uint16 purchaseMax_, uint256 purchasePrice_, uint16 purchaseLimit_, uint16 transactionLimit_, uint256 presalePurchasePrice_, uint16 presalePurchaseLimit_, address signingAddress_, bool useDynamicPresalePurchaseLimit_) internal {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165) returns (bool) {
}
/**
* @dev See {IERC1155Collection-claim}.
*/
function claim(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override {
}
/**
* @dev See {IERC1155Collection-purchase}.
*/
function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override payable {
}
/**
* @dev See {IERC1155Collection-state}
*/
function state() external override view returns (CollectionState memory) {
}
/**
* @dev Get balance of address. Similar to IERC1155-balanceOf, but doesn't require token ID
* @param owner The address to get the token balance of
*/
function balanceOf(address owner) public virtual override view returns (uint256);
/**
* @dev See {IERC1155Collection-purchaseRemaining}.
*/
function purchaseRemaining() public virtual override view returns (uint16) {
}
/**
* ROYALTY FUNCTIONS
*/
function getRoyalties(uint256) external view returns (address payable[] memory recipients, uint256[] memory bps) {
}
function getFeeRecipients(uint256) external view returns (address payable[] memory recipients) {
}
function getFeeBps(uint256) external view returns (uint[] memory bps) {
}
function royaltyInfo(uint256, uint256 value) external view returns (address, uint256) {
}
/**
* Premint tokens to the owner. Purchase must not be active.
*/
function _premint(uint16 amount, address owner) internal virtual {
}
/**
* Premint tokens to the list of addresses. Purchase must not be active.
*/
function _premint(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16 amount, address owner) internal virtual {
require(endTime != 0 && endTime <= block.timestamp, "Cannot mint reserve until after sale complete");
require(<FILL_ME>)
reserveCount += amount;
_mintERC1155(owner, amount);
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint function internal to ERC1155CollectionBase to keep track of state
*/
function _mint(address to, uint16 amount, bool presale) internal {
}
/**
* @dev A _mint function is required that calls the underlying ERC1155 mint.
*/
function _mintERC1155(address to, uint16 amount) internal virtual;
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePrice(uint16 amount) internal {
}
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePresalePrice(uint16 amount) internal virtual {
}
/**
* If enabled, lock token transfers until after the sale has ended.
*
* This helps enforce purchase limits, so someone can't buy -> transfer -> buy again
* while the token is minting.
*/
function _validateTokenTransferability(address from) internal view {
}
/**
* Set whether or not token transfers are locked till end of sale
*/
function _setTransferLocked(bool locked) internal {
}
/**
* @dev Update royalties
*/
function _updateRoyalties(address payable recipient, uint256 bps) internal {
}
/**
* @dev Return mint count or balanceOf
*/
function _getMintBalance() internal view returns (uint256) {
}
/**
* @dev Return whether mints need to be tracked
*/
function _shouldTrackMints() internal view returns (bool) {
}
/**
* @dev Return whether mints need to be tracked
* @param isPresale - pass in to explicitly consider in presale
*/
function _shouldTrackMints(bool isPresale) internal view returns (bool) {
}
}
| purchaseCount+reserveCount+amount<=maxSupply,"Too many requested" | 22,816 | purchaseCount+reserveCount+amount<=maxSupply |
"Too many requested" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IERC1155Collection.sol";
import "./CollectionBase.sol";
/**
* ERC1155 Collection Drop Contract (Base)
*/
abstract contract ERC1155CollectionBase is CollectionBase, IERC1155Collection {
// Token ID to mint
uint16 internal constant TOKEN_ID = 1;
// Immutable variables that should only be set by the constructor or initializer
uint16 public transactionLimit;
uint16 public purchaseMax;
uint16 public purchaseLimit;
uint256 public purchasePrice;
uint16 public presalePurchaseLimit;
uint256 public presalePurchasePrice;
uint16 public maxSupply;
bool public useDynamicPresalePurchaseLimit;
// Mutable mint state
uint16 public purchaseCount;
uint16 public reserveCount;
mapping(address => uint16) private _mintCount;
// Royalty
uint256 private _royaltyBps;
address payable private _royaltyRecipient;
bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6;
bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a;
bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584;
// Transfer lock
bool public transferLocked;
/**
* Initializer
*/
function _initialize(uint16 maxSupply_, uint16 purchaseMax_, uint256 purchasePrice_, uint16 purchaseLimit_, uint16 transactionLimit_, uint256 presalePurchasePrice_, uint16 presalePurchaseLimit_, address signingAddress_, bool useDynamicPresalePurchaseLimit_) internal {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165) returns (bool) {
}
/**
* @dev See {IERC1155Collection-claim}.
*/
function claim(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override {
}
/**
* @dev See {IERC1155Collection-purchase}.
*/
function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override payable {
}
/**
* @dev See {IERC1155Collection-state}
*/
function state() external override view returns (CollectionState memory) {
}
/**
* @dev Get balance of address. Similar to IERC1155-balanceOf, but doesn't require token ID
* @param owner The address to get the token balance of
*/
function balanceOf(address owner) public virtual override view returns (uint256);
/**
* @dev See {IERC1155Collection-purchaseRemaining}.
*/
function purchaseRemaining() public virtual override view returns (uint16) {
}
/**
* ROYALTY FUNCTIONS
*/
function getRoyalties(uint256) external view returns (address payable[] memory recipients, uint256[] memory bps) {
}
function getFeeRecipients(uint256) external view returns (address payable[] memory recipients) {
}
function getFeeBps(uint256) external view returns (uint[] memory bps) {
}
function royaltyInfo(uint256, uint256 value) external view returns (address, uint256) {
}
/**
* Premint tokens to the owner. Purchase must not be active.
*/
function _premint(uint16 amount, address owner) internal virtual {
}
/**
* Premint tokens to the list of addresses. Purchase must not be active.
*/
function _premint(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16 amount, address owner) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
require(endTime != 0 && endTime <= block.timestamp, "Cannot mint reserve until after sale complete");
uint16 totalAmount;
for (uint256 i = 0; i < addresses.length; i++) {
totalAmount += amounts[i];
}
require(<FILL_ME>)
reserveCount += totalAmount;
for (uint256 i = 0; i < addresses.length; i++) {
_mintERC1155(addresses[i], amounts[i]);
}
}
/**
* Mint function internal to ERC1155CollectionBase to keep track of state
*/
function _mint(address to, uint16 amount, bool presale) internal {
}
/**
* @dev A _mint function is required that calls the underlying ERC1155 mint.
*/
function _mintERC1155(address to, uint16 amount) internal virtual;
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePrice(uint16 amount) internal {
}
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePresalePrice(uint16 amount) internal virtual {
}
/**
* If enabled, lock token transfers until after the sale has ended.
*
* This helps enforce purchase limits, so someone can't buy -> transfer -> buy again
* while the token is minting.
*/
function _validateTokenTransferability(address from) internal view {
}
/**
* Set whether or not token transfers are locked till end of sale
*/
function _setTransferLocked(bool locked) internal {
}
/**
* @dev Update royalties
*/
function _updateRoyalties(address payable recipient, uint256 bps) internal {
}
/**
* @dev Return mint count or balanceOf
*/
function _getMintBalance() internal view returns (uint256) {
}
/**
* @dev Return whether mints need to be tracked
*/
function _shouldTrackMints() internal view returns (bool) {
}
/**
* @dev Return whether mints need to be tracked
* @param isPresale - pass in to explicitly consider in presale
*/
function _shouldTrackMints(bool isPresale) internal view returns (bool) {
}
}
| purchaseCount+reserveCount+totalAmount<=maxSupply,"Too many requested" | 22,816 | purchaseCount+reserveCount+totalAmount<=maxSupply |
"Transfer locked until sale ends" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IERC1155Collection.sol";
import "./CollectionBase.sol";
/**
* ERC1155 Collection Drop Contract (Base)
*/
abstract contract ERC1155CollectionBase is CollectionBase, IERC1155Collection {
// Token ID to mint
uint16 internal constant TOKEN_ID = 1;
// Immutable variables that should only be set by the constructor or initializer
uint16 public transactionLimit;
uint16 public purchaseMax;
uint16 public purchaseLimit;
uint256 public purchasePrice;
uint16 public presalePurchaseLimit;
uint256 public presalePurchasePrice;
uint16 public maxSupply;
bool public useDynamicPresalePurchaseLimit;
// Mutable mint state
uint16 public purchaseCount;
uint16 public reserveCount;
mapping(address => uint16) private _mintCount;
// Royalty
uint256 private _royaltyBps;
address payable private _royaltyRecipient;
bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6;
bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a;
bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584;
// Transfer lock
bool public transferLocked;
/**
* Initializer
*/
function _initialize(uint16 maxSupply_, uint16 purchaseMax_, uint256 purchasePrice_, uint16 purchaseLimit_, uint16 transactionLimit_, uint256 presalePurchasePrice_, uint16 presalePurchaseLimit_, address signingAddress_, bool useDynamicPresalePurchaseLimit_) internal {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165) returns (bool) {
}
/**
* @dev See {IERC1155Collection-claim}.
*/
function claim(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override {
}
/**
* @dev See {IERC1155Collection-purchase}.
*/
function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override payable {
}
/**
* @dev See {IERC1155Collection-state}
*/
function state() external override view returns (CollectionState memory) {
}
/**
* @dev Get balance of address. Similar to IERC1155-balanceOf, but doesn't require token ID
* @param owner The address to get the token balance of
*/
function balanceOf(address owner) public virtual override view returns (uint256);
/**
* @dev See {IERC1155Collection-purchaseRemaining}.
*/
function purchaseRemaining() public virtual override view returns (uint16) {
}
/**
* ROYALTY FUNCTIONS
*/
function getRoyalties(uint256) external view returns (address payable[] memory recipients, uint256[] memory bps) {
}
function getFeeRecipients(uint256) external view returns (address payable[] memory recipients) {
}
function getFeeBps(uint256) external view returns (uint[] memory bps) {
}
function royaltyInfo(uint256, uint256 value) external view returns (address, uint256) {
}
/**
* Premint tokens to the owner. Purchase must not be active.
*/
function _premint(uint16 amount, address owner) internal virtual {
}
/**
* Premint tokens to the list of addresses. Purchase must not be active.
*/
function _premint(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16 amount, address owner) internal virtual {
}
/**
* Mint reserve tokens. Purchase must be completed.
*/
function _mintReserve(uint16[] calldata amounts, address[] calldata addresses) internal virtual {
}
/**
* Mint function internal to ERC1155CollectionBase to keep track of state
*/
function _mint(address to, uint16 amount, bool presale) internal {
}
/**
* @dev A _mint function is required that calls the underlying ERC1155 mint.
*/
function _mintERC1155(address to, uint16 amount) internal virtual;
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePrice(uint16 amount) internal {
}
/**
* Validate price (override for custom pricing mechanics)
*/
function _validatePresalePrice(uint16 amount) internal virtual {
}
/**
* If enabled, lock token transfers until after the sale has ended.
*
* This helps enforce purchase limits, so someone can't buy -> transfer -> buy again
* while the token is minting.
*/
function _validateTokenTransferability(address from) internal view {
require(<FILL_ME>)
}
/**
* Set whether or not token transfers are locked till end of sale
*/
function _setTransferLocked(bool locked) internal {
}
/**
* @dev Update royalties
*/
function _updateRoyalties(address payable recipient, uint256 bps) internal {
}
/**
* @dev Return mint count or balanceOf
*/
function _getMintBalance() internal view returns (uint256) {
}
/**
* @dev Return whether mints need to be tracked
*/
function _shouldTrackMints() internal view returns (bool) {
}
/**
* @dev Return whether mints need to be tracked
* @param isPresale - pass in to explicitly consider in presale
*/
function _shouldTrackMints(bool isPresale) internal view returns (bool) {
}
}
| !transferLocked||purchaseRemaining()==0||(active&&block.timestamp>=endTime)||from==address(0),"Transfer locked until sale ends" | 22,816 | !transferLocked||purchaseRemaining()==0||(active&&block.timestamp>=endTime)||from==address(0) |
null | /*
Kasei Inu (KASEI)
Website: https://kaseiinu.space
Telegram: https://t.me/kaseiInuETH
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
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) {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract KASEI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Kasei Inu";
string private constant _symbol = "KASEI";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisReward = 2;
uint256 private _marsFee = 4;
uint256 private _previousredisReward = _redisReward;
uint256 private _previousmarsFee = _marsFee;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _marsAddress;
address payable private _marketingAddress;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 5000000000 * 10**9;
uint256 public _swapTokensAtAmount = 50000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
}
constructor(address payable addr1, address payable addr2) {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function launchProject() external onlyOwner() {
}
function manualswap() external {
require(<FILL_ME>)
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
}
function blockBots(address[] memory bots_) public onlyOwner {
}
function unblockBot(address notbot) public onlyOwner {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
function _getTValues(
uint256 tAmount,
uint256 redisReward,
uint256 marsFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
}
function setRedisRewardPercent(uint256 redisReward) external onlyOwner() {
}
function setMarsRewardPercent(uint256 marsFee) external onlyOwner() {
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 newValue) external {
}
}
| _msgSender()==_marsAddress||_msgSender()==_marketingAddress | 22,862 | _msgSender()==_marsAddress||_msgSender()==_marketingAddress |
null | /*
Kasei Inu (KASEI)
Website: https://kaseiinu.space
Telegram: https://t.me/kaseiInuETH
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
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) {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract KASEI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Kasei Inu";
string private constant _symbol = "KASEI";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisReward = 2;
uint256 private _marsFee = 4;
uint256 private _previousredisReward = _redisReward;
uint256 private _previousmarsFee = _marsFee;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _marsAddress;
address payable private _marketingAddress;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 5000000000 * 10**9;
uint256 public _swapTokensAtAmount = 50000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
}
constructor(address payable addr1, address payable addr2) {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function launchProject() external onlyOwner() {
}
function manualswap() external {
}
function manualsend() external {
}
function blockBots(address[] memory bots_) public onlyOwner {
}
function unblockBot(address notbot) public onlyOwner {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
function _getTValues(
uint256 tAmount,
uint256 redisReward,
uint256 marsFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
}
function setRedisRewardPercent(uint256 redisReward) external onlyOwner() {
}
function setMarsRewardPercent(uint256 marsFee) external onlyOwner() {
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 newValue) external {
require(<FILL_ME>)
_swapTokensAtAmount = newValue;
}
}
| _msgSender()==_marsAddress||_msgSender()==_marketingAddress||_msgSender()==owner() | 22,862 | _msgSender()==_marsAddress||_msgSender()==_marketingAddress||_msgSender()==owner() |
null | pragma solidity ^0.5.1;
contract ERC20Interface {
// 代币名称
string public name;
// 代币符号或者说简写
string public symbol;
// 代币小数点位数,代币的最小单位
uint8 public decimals;
// 代币的发行总量
uint public totalSupply;
// 实现代币交易,用于给某个地址转移代币
function transfer(address to, uint tokens) public returns (bool success);
// 实现代币用户之间的交易,从一个地址转移代币到另一个地址
function transferFrom(address from, address to, uint tokens) public returns (bool success);
// 允许spender多次从你的账户取款,并且最多可取tokens个,主要用于某些场景下授权委托其他用户从你的账户上花费代币
function approve(address spender, uint tokens) public returns (bool success);
// 查询spender允许从tokenOwner上花费的代币数量
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
// 代币交易时触发的事件,即调用transfer方法时触发
event Transfer(address indexed from, address indexed to, uint tokens);
// 允许其他用户从你的账户上花费代币时触发的事件,即调用approve方法时触发
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// 实现ERC-20标准接口
contract Free is ERC20Interface {
// 存储每个地址的余额(因为是public的所以会自动生成balanceOf方法)
mapping (address => uint256) public balanceOf;
// 存储每个地址可操作的地址及其可操作的金额
mapping (address => mapping (address => uint256)) internal allowed;
// 初始化属性
constructor() public {
}
function transfer(address to, uint tokens) public returns (bool success) {
// 检验接收者地址是否合法
require(to != address(0));
// 检验发送者账户余额是否足够
require(<FILL_ME>)
// 检验是否会发生溢出
require(balanceOf[to] + tokens >= balanceOf[to]);
// 扣除发送者账户余额
balanceOf[msg.sender] -= tokens;
// 增加接收者账户余额
balanceOf[to] += tokens;
// 触发相应的事件
emit Transfer(msg.sender, to, tokens);
success = true;
}
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
}
function approve(address spender, uint tokens) public returns (bool success) {
}
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
}
| balanceOf[msg.sender]>=tokens | 22,905 | balanceOf[msg.sender]>=tokens |
null | pragma solidity ^0.5.1;
contract ERC20Interface {
// 代币名称
string public name;
// 代币符号或者说简写
string public symbol;
// 代币小数点位数,代币的最小单位
uint8 public decimals;
// 代币的发行总量
uint public totalSupply;
// 实现代币交易,用于给某个地址转移代币
function transfer(address to, uint tokens) public returns (bool success);
// 实现代币用户之间的交易,从一个地址转移代币到另一个地址
function transferFrom(address from, address to, uint tokens) public returns (bool success);
// 允许spender多次从你的账户取款,并且最多可取tokens个,主要用于某些场景下授权委托其他用户从你的账户上花费代币
function approve(address spender, uint tokens) public returns (bool success);
// 查询spender允许从tokenOwner上花费的代币数量
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
// 代币交易时触发的事件,即调用transfer方法时触发
event Transfer(address indexed from, address indexed to, uint tokens);
// 允许其他用户从你的账户上花费代币时触发的事件,即调用approve方法时触发
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// 实现ERC-20标准接口
contract Free is ERC20Interface {
// 存储每个地址的余额(因为是public的所以会自动生成balanceOf方法)
mapping (address => uint256) public balanceOf;
// 存储每个地址可操作的地址及其可操作的金额
mapping (address => mapping (address => uint256)) internal allowed;
// 初始化属性
constructor() public {
}
function transfer(address to, uint tokens) public returns (bool success) {
// 检验接收者地址是否合法
require(to != address(0));
// 检验发送者账户余额是否足够
require(balanceOf[msg.sender] >= tokens);
// 检验是否会发生溢出
require(<FILL_ME>)
// 扣除发送者账户余额
balanceOf[msg.sender] -= tokens;
// 增加接收者账户余额
balanceOf[to] += tokens;
// 触发相应的事件
emit Transfer(msg.sender, to, tokens);
success = true;
}
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
}
function approve(address spender, uint tokens) public returns (bool success) {
}
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
}
| balanceOf[to]+tokens>=balanceOf[to] | 22,905 | balanceOf[to]+tokens>=balanceOf[to] |
null | pragma solidity ^0.5.1;
contract ERC20Interface {
// 代币名称
string public name;
// 代币符号或者说简写
string public symbol;
// 代币小数点位数,代币的最小单位
uint8 public decimals;
// 代币的发行总量
uint public totalSupply;
// 实现代币交易,用于给某个地址转移代币
function transfer(address to, uint tokens) public returns (bool success);
// 实现代币用户之间的交易,从一个地址转移代币到另一个地址
function transferFrom(address from, address to, uint tokens) public returns (bool success);
// 允许spender多次从你的账户取款,并且最多可取tokens个,主要用于某些场景下授权委托其他用户从你的账户上花费代币
function approve(address spender, uint tokens) public returns (bool success);
// 查询spender允许从tokenOwner上花费的代币数量
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
// 代币交易时触发的事件,即调用transfer方法时触发
event Transfer(address indexed from, address indexed to, uint tokens);
// 允许其他用户从你的账户上花费代币时触发的事件,即调用approve方法时触发
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// 实现ERC-20标准接口
contract Free is ERC20Interface {
// 存储每个地址的余额(因为是public的所以会自动生成balanceOf方法)
mapping (address => uint256) public balanceOf;
// 存储每个地址可操作的地址及其可操作的金额
mapping (address => mapping (address => uint256)) internal allowed;
// 初始化属性
constructor() public {
}
function transfer(address to, uint tokens) public returns (bool success) {
}
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
// 检验地址是否合法
require(to != address(0) && from != address(0));
// 检验发送者账户余额是否足够
require(<FILL_ME>)
// 检验操作的金额是否是被允许的
require(allowed[from][msg.sender] <= tokens);
// 检验是否会发生溢出
require(balanceOf[to] + tokens >= balanceOf[to]);
// 扣除发送者账户余额
balanceOf[from] -= tokens;
// 增加接收者账户余额
balanceOf[to] += tokens;
// 触发相应的事件
emit Transfer(from, to, tokens);
success = true;
}
function approve(address spender, uint tokens) public returns (bool success) {
}
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
}
| balanceOf[from]>=tokens | 22,905 | balanceOf[from]>=tokens |
null | pragma solidity ^0.5.1;
contract ERC20Interface {
// 代币名称
string public name;
// 代币符号或者说简写
string public symbol;
// 代币小数点位数,代币的最小单位
uint8 public decimals;
// 代币的发行总量
uint public totalSupply;
// 实现代币交易,用于给某个地址转移代币
function transfer(address to, uint tokens) public returns (bool success);
// 实现代币用户之间的交易,从一个地址转移代币到另一个地址
function transferFrom(address from, address to, uint tokens) public returns (bool success);
// 允许spender多次从你的账户取款,并且最多可取tokens个,主要用于某些场景下授权委托其他用户从你的账户上花费代币
function approve(address spender, uint tokens) public returns (bool success);
// 查询spender允许从tokenOwner上花费的代币数量
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
// 代币交易时触发的事件,即调用transfer方法时触发
event Transfer(address indexed from, address indexed to, uint tokens);
// 允许其他用户从你的账户上花费代币时触发的事件,即调用approve方法时触发
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// 实现ERC-20标准接口
contract Free is ERC20Interface {
// 存储每个地址的余额(因为是public的所以会自动生成balanceOf方法)
mapping (address => uint256) public balanceOf;
// 存储每个地址可操作的地址及其可操作的金额
mapping (address => mapping (address => uint256)) internal allowed;
// 初始化属性
constructor() public {
}
function transfer(address to, uint tokens) public returns (bool success) {
}
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
// 检验地址是否合法
require(to != address(0) && from != address(0));
// 检验发送者账户余额是否足够
require(balanceOf[from] >= tokens);
// 检验操作的金额是否是被允许的
require(<FILL_ME>)
// 检验是否会发生溢出
require(balanceOf[to] + tokens >= balanceOf[to]);
// 扣除发送者账户余额
balanceOf[from] -= tokens;
// 增加接收者账户余额
balanceOf[to] += tokens;
// 触发相应的事件
emit Transfer(from, to, tokens);
success = true;
}
function approve(address spender, uint tokens) public returns (bool success) {
}
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
}
| allowed[from][msg.sender]<=tokens | 22,905 | allowed[from][msg.sender]<=tokens |
"caller not a minter" | // ___ _ ___ _ _ _
// / __\_ __ _ _ _ __ | |_ ___ / __\(_)| |_ (_) ___ ___
// / / | '__|| | | || '_ \ | __|/ _ \ / / | || __|| | / _ \/ __|
// / /___| | | |_| || |_) || |_| (_) |/ /___ | || |_ | || __/\__ \
// \____/|_| \__, || .__/ \__|\___/ \____/ |_| \__||_| \___||___/
// |___/ |_|
//
// CryptoCities is an ERC721 compliant smart contract for this project:
// (https://cryptocities.net)
//
// In addition to a standard ERC721 interface it also includes:
// - a maker / taker off-chain marketplace which executes final trades here
// - batch functions for most token read functions
// - a limited supply of 25000 tokens
//
// Discord:
// https://discord.gg/Y4mhwWg
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://cryptocities.net/bug_bounty
//
// Disclaimer:
// We take the greatest of care when making our smart contracts but this is crypto and the future
// is always unknown. Even if it is exciting and full of wonderful possibilities, anything can happen,
// blockchains will evolve, vulnerabilities can arise, and markets can go up and down. CryptoCities and its
// owners accept no liability for any issues relating to the use of this contract or any losses that may occur.
// Please see our full terms here:
// https://cryptocities.net/terms
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./base/ERC721Batchable.sol";
contract CryptoCities is ERC721Batchable
{
// there can only ever be a max of this many tokens in the contract
uint public constant tokenLimit = 25000;
// the base url used for all meta data
// likely to be stored on IPFS over time
string private _baseTokenURI;
// the opensea proxy registry contract (can be changed if this registry ever moves to a new contract)
// 0xa5409ec958C83C3f309868babACA7c86DCB077c1 mainnet
// 0xF57B2c51dED3A29e6891aba85459d600256Cf317 rinkeby
// 0x0000000000000000000000000000000000000000 local
address private _proxyRegistryAddress;
// only authorized minters can mint tokens
// this will originally be set to a swapping contract to allow users to swap their tokens to this new contract
mapping (address => bool) public isMinter;
// pausing the market disables the built-in maker/taker offer system
// it does not affect normal ERC721 transfers
bool public marketPaused;
// the marketplace fee for any internal paid trades (stored in basis points eg. 250 = 2.5% fee)
uint16 public marketFee;
// the marketplace witness is used to validate marketplace offers
address private _marketWitness;
// offer that can no longer be used any more
mapping (bytes32 => bool) private _cancelledOrCompletedOffers;
// support for ERC2981
uint16 private _royaltyFee;
address private _royaltyReciever;
constructor(address _owner, address _recovery, address proxyRegistryAddress) ERC721("CryptoCities", unicode"⬢City")
{
}
/// BASE URI
// base uri is where the metadata lives
// only the owner can change this
function setBaseURI(string memory baseTokenURI) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
/// PROXY REGISTRY
// registers a proxy address for OpenSea or others
// can only be changed by the contract owner
// setting address to 0 will disable the proxy
function setProxyRegistry(address proxyRegistry) external onlyOwner {
}
// this override allows us to whitelist user's OpenSea proxy accounts to enable gas-less listings
function isApprovedForAll(address token_owner, address operator) public view override returns (bool)
{
}
/// MINTING
// only authorized minters can mint
// can't mint more tokens than the token limit
// ERC721 standard checks:
// can't mint while the contract is paused (checked in _beforeTokenTransfer())
// token id's can't already exist
// cant mint to address(0)
// if 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
// emitted when a minter's authorization changes
event MinterSet(address indexed minter, bool auth);
// only allows an authorized minter to call the function
modifier onlyMinters()
{
require(<FILL_ME>)
_;
}
// changes a minter's authorization
function setMinter(address minter, bool authorized) external onlyOwner
{
}
// mint a single token
function mint(address to, uint256 tokenId) external onlyMinters
{
}
// mint a batch of tokens
// (gas: this function can run out of gas if too many id's are provided
// limiting to 25 will currently fit in the block gas limit but this may change in future)
function mintBatch(address to, uint256[] memory tokenIds) external onlyMinters
{
}
/// BURNING
// only the contract owner can burn tokens it owns
// the contract owner can't burn someone elses tokens
// normal users can't burn tokens
// ERC721 standard checks:
// can't burn while the contract is paused (checked in _beforeTokenTransfer())
// the token id must exist
function burn(uint256 tokenId) external onlyOwner
{
}
/// MARKETPLACE
// this contract includes a maker / taker offerplace
// (similar to those seen in OpenSea, 0x Protocol and other NFT projects)
//
// offers are made by makers off-chain and filled by callers on-chain
// makers do this by signing their offer with their wallet
// smart contracts can't be makers because they can't sign messages
// if a witness address is set then it must sign the offer hash too (eg. the website marketplace)
// there are two types of offers depending on whether the maker specifies a taker in their offer:
// maker / taker (peer-to-peer offer: two users agreeing to trade items)
// maker / no taker (open offer: one user listing their items in the marketplace)
// if eth is paid then it will always be on the taker side (the maker never pays eth in this simplified model)
// a market fee is charged if eth is paid
// trading tokens with no eth is free and no fee is deducted
// allowed exchanges:
// maker tokens > < eth (maker sells their tokens to anyone)
// maker tokens > (maker gives their tokens away to anyone)
// maker tokens > taker (maker gives their tokens to a specific taker)
// maker tokens > < taker tokens .. for specific tokens back
// maker tokens > < taker tokens & eth .. for specific tokens and eth back
// maker tokens > < taker eth .. for eth only
// maker < taker tokens (taker gives their tokens to the maker)
// maker < taker tokens & eth .. and with eth
event OfferAccepted(bytes32 indexed hash, address indexed maker, address indexed taker, uint[] makerIds, uint[] takerIds, uint takerWei, uint marketFee);
event OfferCancelled(bytes32 indexed hash);
struct Offer {
address maker;
address taker;
uint256[] makerIds;
uint256[] takerIds;
uint256 takerWei;
uint256 expiry;
uint256 nonce;
}
// pausing the market will stop offers from being able to be accepted (they can still be generated or cancelled)
function pauseMarket(bool pauseTrading) external onlyOwner {
}
// the market fee is set in basis points (eg. 250 basis points = 2.5%)
function setMarketFee(uint16 basisPoints) external onlyOwner {
}
// if a market witness is set then it will need to sign all offers too (set to 0 to disable)
function setMarketWitness(address newWitness) external onlyOwner {
}
// recovers the signer address from a offer hash and signature
function signerOfHash(bytes32 offer_hash, bytes memory signature) public pure returns (address signer){
}
// this generates a hash of an offer that can then be signed by a maker
// the offer has to have basic validity before it can be hashed
// if checking ids then the tokens need to be owned by the parties too
function hashOffer(Offer memory offer, bool checkIds) public view returns (bytes32){
}
// an offer is valid if:
// it's maker / taker details are valid
// it has been signed by the maker
// it has not been cancelled or completed yet
// the parties own their tokens (if checking ids)
// the witness has signed it (if witnessing is enabled)
// the trade is valid (if requested)
function validOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature, bool checkIds, bool checkTradeValid, uint checkValue) external view returns (bool){
}
// if a market witness is set then they need to sign the offer hash too
function _validWitness(bytes32 _offer_hash, bytes memory witnessSignature) internal view {
}
// gets the hash of an offer and checks that it has been signed by the maker
function _getValidOfferHash(Offer memory offer, bytes memory signature, bool checkIds, bool checkTradeValid, uint checkValue) internal view returns (bytes32){
}
// (gas: these functions can run out of gas if too many id's are provided
// not limiting them here because block gas limits change over time and we don't know what they will be in future)
// stops the offer hash from being usable in future
// can only be cancelled by the maker or the contract owner
function cancelOffer(Offer memory offer) external {
}
// fills an offer
// offers can't be traded when the market is paused or the contract is paused
// offers must be valid and signed by the maker
// the caller has to be the taker or can be an unknown party if no taker is set
// eth may or may not be required by the offer
// tokens must belong to the makers and takers
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard {
}
/// ERC2981 support
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
{
}
// the royalties fee is set in basis points (eg. 250 basis points = 2.5%)
function setRoyalties(address newReceiver, uint16 basisPoints) external onlyOwner {
}
}
// used to whitelist proxy accounts of OpenSea users so that they are automatically able to trade any item on OpenSea
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| isMinter[_msgSender()]==true,"caller not a minter" | 22,918 | isMinter[_msgSender()]==true |
"token limit reached" | // ___ _ ___ _ _ _
// / __\_ __ _ _ _ __ | |_ ___ / __\(_)| |_ (_) ___ ___
// / / | '__|| | | || '_ \ | __|/ _ \ / / | || __|| | / _ \/ __|
// / /___| | | |_| || |_) || |_| (_) |/ /___ | || |_ | || __/\__ \
// \____/|_| \__, || .__/ \__|\___/ \____/ |_| \__||_| \___||___/
// |___/ |_|
//
// CryptoCities is an ERC721 compliant smart contract for this project:
// (https://cryptocities.net)
//
// In addition to a standard ERC721 interface it also includes:
// - a maker / taker off-chain marketplace which executes final trades here
// - batch functions for most token read functions
// - a limited supply of 25000 tokens
//
// Discord:
// https://discord.gg/Y4mhwWg
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://cryptocities.net/bug_bounty
//
// Disclaimer:
// We take the greatest of care when making our smart contracts but this is crypto and the future
// is always unknown. Even if it is exciting and full of wonderful possibilities, anything can happen,
// blockchains will evolve, vulnerabilities can arise, and markets can go up and down. CryptoCities and its
// owners accept no liability for any issues relating to the use of this contract or any losses that may occur.
// Please see our full terms here:
// https://cryptocities.net/terms
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./base/ERC721Batchable.sol";
contract CryptoCities is ERC721Batchable
{
// there can only ever be a max of this many tokens in the contract
uint public constant tokenLimit = 25000;
// the base url used for all meta data
// likely to be stored on IPFS over time
string private _baseTokenURI;
// the opensea proxy registry contract (can be changed if this registry ever moves to a new contract)
// 0xa5409ec958C83C3f309868babACA7c86DCB077c1 mainnet
// 0xF57B2c51dED3A29e6891aba85459d600256Cf317 rinkeby
// 0x0000000000000000000000000000000000000000 local
address private _proxyRegistryAddress;
// only authorized minters can mint tokens
// this will originally be set to a swapping contract to allow users to swap their tokens to this new contract
mapping (address => bool) public isMinter;
// pausing the market disables the built-in maker/taker offer system
// it does not affect normal ERC721 transfers
bool public marketPaused;
// the marketplace fee for any internal paid trades (stored in basis points eg. 250 = 2.5% fee)
uint16 public marketFee;
// the marketplace witness is used to validate marketplace offers
address private _marketWitness;
// offer that can no longer be used any more
mapping (bytes32 => bool) private _cancelledOrCompletedOffers;
// support for ERC2981
uint16 private _royaltyFee;
address private _royaltyReciever;
constructor(address _owner, address _recovery, address proxyRegistryAddress) ERC721("CryptoCities", unicode"⬢City")
{
}
/// BASE URI
// base uri is where the metadata lives
// only the owner can change this
function setBaseURI(string memory baseTokenURI) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
/// PROXY REGISTRY
// registers a proxy address for OpenSea or others
// can only be changed by the contract owner
// setting address to 0 will disable the proxy
function setProxyRegistry(address proxyRegistry) external onlyOwner {
}
// this override allows us to whitelist user's OpenSea proxy accounts to enable gas-less listings
function isApprovedForAll(address token_owner, address operator) public view override returns (bool)
{
}
/// MINTING
// only authorized minters can mint
// can't mint more tokens than the token limit
// ERC721 standard checks:
// can't mint while the contract is paused (checked in _beforeTokenTransfer())
// token id's can't already exist
// cant mint to address(0)
// if 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
// emitted when a minter's authorization changes
event MinterSet(address indexed minter, bool auth);
// only allows an authorized minter to call the function
modifier onlyMinters()
{
}
// changes a minter's authorization
function setMinter(address minter, bool authorized) external onlyOwner
{
}
// mint a single token
function mint(address to, uint256 tokenId) external onlyMinters
{
require(<FILL_ME>)
_safeMint(to, tokenId);
}
// mint a batch of tokens
// (gas: this function can run out of gas if too many id's are provided
// limiting to 25 will currently fit in the block gas limit but this may change in future)
function mintBatch(address to, uint256[] memory tokenIds) external onlyMinters
{
}
/// BURNING
// only the contract owner can burn tokens it owns
// the contract owner can't burn someone elses tokens
// normal users can't burn tokens
// ERC721 standard checks:
// can't burn while the contract is paused (checked in _beforeTokenTransfer())
// the token id must exist
function burn(uint256 tokenId) external onlyOwner
{
}
/// MARKETPLACE
// this contract includes a maker / taker offerplace
// (similar to those seen in OpenSea, 0x Protocol and other NFT projects)
//
// offers are made by makers off-chain and filled by callers on-chain
// makers do this by signing their offer with their wallet
// smart contracts can't be makers because they can't sign messages
// if a witness address is set then it must sign the offer hash too (eg. the website marketplace)
// there are two types of offers depending on whether the maker specifies a taker in their offer:
// maker / taker (peer-to-peer offer: two users agreeing to trade items)
// maker / no taker (open offer: one user listing their items in the marketplace)
// if eth is paid then it will always be on the taker side (the maker never pays eth in this simplified model)
// a market fee is charged if eth is paid
// trading tokens with no eth is free and no fee is deducted
// allowed exchanges:
// maker tokens > < eth (maker sells their tokens to anyone)
// maker tokens > (maker gives their tokens away to anyone)
// maker tokens > taker (maker gives their tokens to a specific taker)
// maker tokens > < taker tokens .. for specific tokens back
// maker tokens > < taker tokens & eth .. for specific tokens and eth back
// maker tokens > < taker eth .. for eth only
// maker < taker tokens (taker gives their tokens to the maker)
// maker < taker tokens & eth .. and with eth
event OfferAccepted(bytes32 indexed hash, address indexed maker, address indexed taker, uint[] makerIds, uint[] takerIds, uint takerWei, uint marketFee);
event OfferCancelled(bytes32 indexed hash);
struct Offer {
address maker;
address taker;
uint256[] makerIds;
uint256[] takerIds;
uint256 takerWei;
uint256 expiry;
uint256 nonce;
}
// pausing the market will stop offers from being able to be accepted (they can still be generated or cancelled)
function pauseMarket(bool pauseTrading) external onlyOwner {
}
// the market fee is set in basis points (eg. 250 basis points = 2.5%)
function setMarketFee(uint16 basisPoints) external onlyOwner {
}
// if a market witness is set then it will need to sign all offers too (set to 0 to disable)
function setMarketWitness(address newWitness) external onlyOwner {
}
// recovers the signer address from a offer hash and signature
function signerOfHash(bytes32 offer_hash, bytes memory signature) public pure returns (address signer){
}
// this generates a hash of an offer that can then be signed by a maker
// the offer has to have basic validity before it can be hashed
// if checking ids then the tokens need to be owned by the parties too
function hashOffer(Offer memory offer, bool checkIds) public view returns (bytes32){
}
// an offer is valid if:
// it's maker / taker details are valid
// it has been signed by the maker
// it has not been cancelled or completed yet
// the parties own their tokens (if checking ids)
// the witness has signed it (if witnessing is enabled)
// the trade is valid (if requested)
function validOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature, bool checkIds, bool checkTradeValid, uint checkValue) external view returns (bool){
}
// if a market witness is set then they need to sign the offer hash too
function _validWitness(bytes32 _offer_hash, bytes memory witnessSignature) internal view {
}
// gets the hash of an offer and checks that it has been signed by the maker
function _getValidOfferHash(Offer memory offer, bytes memory signature, bool checkIds, bool checkTradeValid, uint checkValue) internal view returns (bytes32){
}
// (gas: these functions can run out of gas if too many id's are provided
// not limiting them here because block gas limits change over time and we don't know what they will be in future)
// stops the offer hash from being usable in future
// can only be cancelled by the maker or the contract owner
function cancelOffer(Offer memory offer) external {
}
// fills an offer
// offers can't be traded when the market is paused or the contract is paused
// offers must be valid and signed by the maker
// the caller has to be the taker or can be an unknown party if no taker is set
// eth may or may not be required by the offer
// tokens must belong to the makers and takers
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard {
}
/// ERC2981 support
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
{
}
// the royalties fee is set in basis points (eg. 250 basis points = 2.5%)
function setRoyalties(address newReceiver, uint16 basisPoints) external onlyOwner {
}
}
// used to whitelist proxy accounts of OpenSea users so that they are automatically able to trade any item on OpenSea
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| totalSupply()<tokenLimit,"token limit reached" | 22,918 | totalSupply()<tokenLimit |
"batch exceeds token limit" | // ___ _ ___ _ _ _
// / __\_ __ _ _ _ __ | |_ ___ / __\(_)| |_ (_) ___ ___
// / / | '__|| | | || '_ \ | __|/ _ \ / / | || __|| | / _ \/ __|
// / /___| | | |_| || |_) || |_| (_) |/ /___ | || |_ | || __/\__ \
// \____/|_| \__, || .__/ \__|\___/ \____/ |_| \__||_| \___||___/
// |___/ |_|
//
// CryptoCities is an ERC721 compliant smart contract for this project:
// (https://cryptocities.net)
//
// In addition to a standard ERC721 interface it also includes:
// - a maker / taker off-chain marketplace which executes final trades here
// - batch functions for most token read functions
// - a limited supply of 25000 tokens
//
// Discord:
// https://discord.gg/Y4mhwWg
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://cryptocities.net/bug_bounty
//
// Disclaimer:
// We take the greatest of care when making our smart contracts but this is crypto and the future
// is always unknown. Even if it is exciting and full of wonderful possibilities, anything can happen,
// blockchains will evolve, vulnerabilities can arise, and markets can go up and down. CryptoCities and its
// owners accept no liability for any issues relating to the use of this contract or any losses that may occur.
// Please see our full terms here:
// https://cryptocities.net/terms
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./base/ERC721Batchable.sol";
contract CryptoCities is ERC721Batchable
{
// there can only ever be a max of this many tokens in the contract
uint public constant tokenLimit = 25000;
// the base url used for all meta data
// likely to be stored on IPFS over time
string private _baseTokenURI;
// the opensea proxy registry contract (can be changed if this registry ever moves to a new contract)
// 0xa5409ec958C83C3f309868babACA7c86DCB077c1 mainnet
// 0xF57B2c51dED3A29e6891aba85459d600256Cf317 rinkeby
// 0x0000000000000000000000000000000000000000 local
address private _proxyRegistryAddress;
// only authorized minters can mint tokens
// this will originally be set to a swapping contract to allow users to swap their tokens to this new contract
mapping (address => bool) public isMinter;
// pausing the market disables the built-in maker/taker offer system
// it does not affect normal ERC721 transfers
bool public marketPaused;
// the marketplace fee for any internal paid trades (stored in basis points eg. 250 = 2.5% fee)
uint16 public marketFee;
// the marketplace witness is used to validate marketplace offers
address private _marketWitness;
// offer that can no longer be used any more
mapping (bytes32 => bool) private _cancelledOrCompletedOffers;
// support for ERC2981
uint16 private _royaltyFee;
address private _royaltyReciever;
constructor(address _owner, address _recovery, address proxyRegistryAddress) ERC721("CryptoCities", unicode"⬢City")
{
}
/// BASE URI
// base uri is where the metadata lives
// only the owner can change this
function setBaseURI(string memory baseTokenURI) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
/// PROXY REGISTRY
// registers a proxy address for OpenSea or others
// can only be changed by the contract owner
// setting address to 0 will disable the proxy
function setProxyRegistry(address proxyRegistry) external onlyOwner {
}
// this override allows us to whitelist user's OpenSea proxy accounts to enable gas-less listings
function isApprovedForAll(address token_owner, address operator) public view override returns (bool)
{
}
/// MINTING
// only authorized minters can mint
// can't mint more tokens than the token limit
// ERC721 standard checks:
// can't mint while the contract is paused (checked in _beforeTokenTransfer())
// token id's can't already exist
// cant mint to address(0)
// if 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
// emitted when a minter's authorization changes
event MinterSet(address indexed minter, bool auth);
// only allows an authorized minter to call the function
modifier onlyMinters()
{
}
// changes a minter's authorization
function setMinter(address minter, bool authorized) external onlyOwner
{
}
// mint a single token
function mint(address to, uint256 tokenId) external onlyMinters
{
}
// mint a batch of tokens
// (gas: this function can run out of gas if too many id's are provided
// limiting to 25 will currently fit in the block gas limit but this may change in future)
function mintBatch(address to, uint256[] memory tokenIds) external onlyMinters
{
require(tokenIds.length <= 25, "more than 25 ids");
require(<FILL_ME>)
for (uint256 i = 0; i < tokenIds.length; i++) {
// we safe mint the first token
if(i==0) _safeMint(to, tokenIds[i]);
// then we assume the rest are safe because they are going to the same receiver
else _mint(to, tokenIds[i]);
}
}
/// BURNING
// only the contract owner can burn tokens it owns
// the contract owner can't burn someone elses tokens
// normal users can't burn tokens
// ERC721 standard checks:
// can't burn while the contract is paused (checked in _beforeTokenTransfer())
// the token id must exist
function burn(uint256 tokenId) external onlyOwner
{
}
/// MARKETPLACE
// this contract includes a maker / taker offerplace
// (similar to those seen in OpenSea, 0x Protocol and other NFT projects)
//
// offers are made by makers off-chain and filled by callers on-chain
// makers do this by signing their offer with their wallet
// smart contracts can't be makers because they can't sign messages
// if a witness address is set then it must sign the offer hash too (eg. the website marketplace)
// there are two types of offers depending on whether the maker specifies a taker in their offer:
// maker / taker (peer-to-peer offer: two users agreeing to trade items)
// maker / no taker (open offer: one user listing their items in the marketplace)
// if eth is paid then it will always be on the taker side (the maker never pays eth in this simplified model)
// a market fee is charged if eth is paid
// trading tokens with no eth is free and no fee is deducted
// allowed exchanges:
// maker tokens > < eth (maker sells their tokens to anyone)
// maker tokens > (maker gives their tokens away to anyone)
// maker tokens > taker (maker gives their tokens to a specific taker)
// maker tokens > < taker tokens .. for specific tokens back
// maker tokens > < taker tokens & eth .. for specific tokens and eth back
// maker tokens > < taker eth .. for eth only
// maker < taker tokens (taker gives their tokens to the maker)
// maker < taker tokens & eth .. and with eth
event OfferAccepted(bytes32 indexed hash, address indexed maker, address indexed taker, uint[] makerIds, uint[] takerIds, uint takerWei, uint marketFee);
event OfferCancelled(bytes32 indexed hash);
struct Offer {
address maker;
address taker;
uint256[] makerIds;
uint256[] takerIds;
uint256 takerWei;
uint256 expiry;
uint256 nonce;
}
// pausing the market will stop offers from being able to be accepted (they can still be generated or cancelled)
function pauseMarket(bool pauseTrading) external onlyOwner {
}
// the market fee is set in basis points (eg. 250 basis points = 2.5%)
function setMarketFee(uint16 basisPoints) external onlyOwner {
}
// if a market witness is set then it will need to sign all offers too (set to 0 to disable)
function setMarketWitness(address newWitness) external onlyOwner {
}
// recovers the signer address from a offer hash and signature
function signerOfHash(bytes32 offer_hash, bytes memory signature) public pure returns (address signer){
}
// this generates a hash of an offer that can then be signed by a maker
// the offer has to have basic validity before it can be hashed
// if checking ids then the tokens need to be owned by the parties too
function hashOffer(Offer memory offer, bool checkIds) public view returns (bytes32){
}
// an offer is valid if:
// it's maker / taker details are valid
// it has been signed by the maker
// it has not been cancelled or completed yet
// the parties own their tokens (if checking ids)
// the witness has signed it (if witnessing is enabled)
// the trade is valid (if requested)
function validOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature, bool checkIds, bool checkTradeValid, uint checkValue) external view returns (bool){
}
// if a market witness is set then they need to sign the offer hash too
function _validWitness(bytes32 _offer_hash, bytes memory witnessSignature) internal view {
}
// gets the hash of an offer and checks that it has been signed by the maker
function _getValidOfferHash(Offer memory offer, bytes memory signature, bool checkIds, bool checkTradeValid, uint checkValue) internal view returns (bytes32){
}
// (gas: these functions can run out of gas if too many id's are provided
// not limiting them here because block gas limits change over time and we don't know what they will be in future)
// stops the offer hash from being usable in future
// can only be cancelled by the maker or the contract owner
function cancelOffer(Offer memory offer) external {
}
// fills an offer
// offers can't be traded when the market is paused or the contract is paused
// offers must be valid and signed by the maker
// the caller has to be the taker or can be an unknown party if no taker is set
// eth may or may not be required by the offer
// tokens must belong to the makers and takers
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard {
}
/// ERC2981 support
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
{
}
// the royalties fee is set in basis points (eg. 250 basis points = 2.5%)
function setRoyalties(address newReceiver, uint16 basisPoints) external onlyOwner {
}
}
// used to whitelist proxy accounts of OpenSea users so that they are automatically able to trade any item on OpenSea
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| totalSupply()+tokenIds.length<=tokenLimit,"batch exceeds token limit" | 22,918 | totalSupply()+tokenIds.length<=tokenLimit |
"token owner not contract owner" | // ___ _ ___ _ _ _
// / __\_ __ _ _ _ __ | |_ ___ / __\(_)| |_ (_) ___ ___
// / / | '__|| | | || '_ \ | __|/ _ \ / / | || __|| | / _ \/ __|
// / /___| | | |_| || |_) || |_| (_) |/ /___ | || |_ | || __/\__ \
// \____/|_| \__, || .__/ \__|\___/ \____/ |_| \__||_| \___||___/
// |___/ |_|
//
// CryptoCities is an ERC721 compliant smart contract for this project:
// (https://cryptocities.net)
//
// In addition to a standard ERC721 interface it also includes:
// - a maker / taker off-chain marketplace which executes final trades here
// - batch functions for most token read functions
// - a limited supply of 25000 tokens
//
// Discord:
// https://discord.gg/Y4mhwWg
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://cryptocities.net/bug_bounty
//
// Disclaimer:
// We take the greatest of care when making our smart contracts but this is crypto and the future
// is always unknown. Even if it is exciting and full of wonderful possibilities, anything can happen,
// blockchains will evolve, vulnerabilities can arise, and markets can go up and down. CryptoCities and its
// owners accept no liability for any issues relating to the use of this contract or any losses that may occur.
// Please see our full terms here:
// https://cryptocities.net/terms
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./base/ERC721Batchable.sol";
contract CryptoCities is ERC721Batchable
{
// there can only ever be a max of this many tokens in the contract
uint public constant tokenLimit = 25000;
// the base url used for all meta data
// likely to be stored on IPFS over time
string private _baseTokenURI;
// the opensea proxy registry contract (can be changed if this registry ever moves to a new contract)
// 0xa5409ec958C83C3f309868babACA7c86DCB077c1 mainnet
// 0xF57B2c51dED3A29e6891aba85459d600256Cf317 rinkeby
// 0x0000000000000000000000000000000000000000 local
address private _proxyRegistryAddress;
// only authorized minters can mint tokens
// this will originally be set to a swapping contract to allow users to swap their tokens to this new contract
mapping (address => bool) public isMinter;
// pausing the market disables the built-in maker/taker offer system
// it does not affect normal ERC721 transfers
bool public marketPaused;
// the marketplace fee for any internal paid trades (stored in basis points eg. 250 = 2.5% fee)
uint16 public marketFee;
// the marketplace witness is used to validate marketplace offers
address private _marketWitness;
// offer that can no longer be used any more
mapping (bytes32 => bool) private _cancelledOrCompletedOffers;
// support for ERC2981
uint16 private _royaltyFee;
address private _royaltyReciever;
constructor(address _owner, address _recovery, address proxyRegistryAddress) ERC721("CryptoCities", unicode"⬢City")
{
}
/// BASE URI
// base uri is where the metadata lives
// only the owner can change this
function setBaseURI(string memory baseTokenURI) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
/// PROXY REGISTRY
// registers a proxy address for OpenSea or others
// can only be changed by the contract owner
// setting address to 0 will disable the proxy
function setProxyRegistry(address proxyRegistry) external onlyOwner {
}
// this override allows us to whitelist user's OpenSea proxy accounts to enable gas-less listings
function isApprovedForAll(address token_owner, address operator) public view override returns (bool)
{
}
/// MINTING
// only authorized minters can mint
// can't mint more tokens than the token limit
// ERC721 standard checks:
// can't mint while the contract is paused (checked in _beforeTokenTransfer())
// token id's can't already exist
// cant mint to address(0)
// if 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
// emitted when a minter's authorization changes
event MinterSet(address indexed minter, bool auth);
// only allows an authorized minter to call the function
modifier onlyMinters()
{
}
// changes a minter's authorization
function setMinter(address minter, bool authorized) external onlyOwner
{
}
// mint a single token
function mint(address to, uint256 tokenId) external onlyMinters
{
}
// mint a batch of tokens
// (gas: this function can run out of gas if too many id's are provided
// limiting to 25 will currently fit in the block gas limit but this may change in future)
function mintBatch(address to, uint256[] memory tokenIds) external onlyMinters
{
}
/// BURNING
// only the contract owner can burn tokens it owns
// the contract owner can't burn someone elses tokens
// normal users can't burn tokens
// ERC721 standard checks:
// can't burn while the contract is paused (checked in _beforeTokenTransfer())
// the token id must exist
function burn(uint256 tokenId) external onlyOwner
{
require(<FILL_ME>)
_burn(tokenId);
}
/// MARKETPLACE
// this contract includes a maker / taker offerplace
// (similar to those seen in OpenSea, 0x Protocol and other NFT projects)
//
// offers are made by makers off-chain and filled by callers on-chain
// makers do this by signing their offer with their wallet
// smart contracts can't be makers because they can't sign messages
// if a witness address is set then it must sign the offer hash too (eg. the website marketplace)
// there are two types of offers depending on whether the maker specifies a taker in their offer:
// maker / taker (peer-to-peer offer: two users agreeing to trade items)
// maker / no taker (open offer: one user listing their items in the marketplace)
// if eth is paid then it will always be on the taker side (the maker never pays eth in this simplified model)
// a market fee is charged if eth is paid
// trading tokens with no eth is free and no fee is deducted
// allowed exchanges:
// maker tokens > < eth (maker sells their tokens to anyone)
// maker tokens > (maker gives their tokens away to anyone)
// maker tokens > taker (maker gives their tokens to a specific taker)
// maker tokens > < taker tokens .. for specific tokens back
// maker tokens > < taker tokens & eth .. for specific tokens and eth back
// maker tokens > < taker eth .. for eth only
// maker < taker tokens (taker gives their tokens to the maker)
// maker < taker tokens & eth .. and with eth
event OfferAccepted(bytes32 indexed hash, address indexed maker, address indexed taker, uint[] makerIds, uint[] takerIds, uint takerWei, uint marketFee);
event OfferCancelled(bytes32 indexed hash);
struct Offer {
address maker;
address taker;
uint256[] makerIds;
uint256[] takerIds;
uint256 takerWei;
uint256 expiry;
uint256 nonce;
}
// pausing the market will stop offers from being able to be accepted (they can still be generated or cancelled)
function pauseMarket(bool pauseTrading) external onlyOwner {
}
// the market fee is set in basis points (eg. 250 basis points = 2.5%)
function setMarketFee(uint16 basisPoints) external onlyOwner {
}
// if a market witness is set then it will need to sign all offers too (set to 0 to disable)
function setMarketWitness(address newWitness) external onlyOwner {
}
// recovers the signer address from a offer hash and signature
function signerOfHash(bytes32 offer_hash, bytes memory signature) public pure returns (address signer){
}
// this generates a hash of an offer that can then be signed by a maker
// the offer has to have basic validity before it can be hashed
// if checking ids then the tokens need to be owned by the parties too
function hashOffer(Offer memory offer, bool checkIds) public view returns (bytes32){
}
// an offer is valid if:
// it's maker / taker details are valid
// it has been signed by the maker
// it has not been cancelled or completed yet
// the parties own their tokens (if checking ids)
// the witness has signed it (if witnessing is enabled)
// the trade is valid (if requested)
function validOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature, bool checkIds, bool checkTradeValid, uint checkValue) external view returns (bool){
}
// if a market witness is set then they need to sign the offer hash too
function _validWitness(bytes32 _offer_hash, bytes memory witnessSignature) internal view {
}
// gets the hash of an offer and checks that it has been signed by the maker
function _getValidOfferHash(Offer memory offer, bytes memory signature, bool checkIds, bool checkTradeValid, uint checkValue) internal view returns (bytes32){
}
// (gas: these functions can run out of gas if too many id's are provided
// not limiting them here because block gas limits change over time and we don't know what they will be in future)
// stops the offer hash from being usable in future
// can only be cancelled by the maker or the contract owner
function cancelOffer(Offer memory offer) external {
}
// fills an offer
// offers can't be traded when the market is paused or the contract is paused
// offers must be valid and signed by the maker
// the caller has to be the taker or can be an unknown party if no taker is set
// eth may or may not be required by the offer
// tokens must belong to the makers and takers
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard {
}
/// ERC2981 support
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
{
}
// the royalties fee is set in basis points (eg. 250 basis points = 2.5%)
function setRoyalties(address newReceiver, uint16 basisPoints) external onlyOwner {
}
}
// used to whitelist proxy accounts of OpenSea users so that they are automatically able to trade any item on OpenSea
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| ownerOf(tokenId)==owner(),"token owner not contract owner" | 22,918 | ownerOf(tokenId)==owner() |
"bad maker ids" | // ___ _ ___ _ _ _
// / __\_ __ _ _ _ __ | |_ ___ / __\(_)| |_ (_) ___ ___
// / / | '__|| | | || '_ \ | __|/ _ \ / / | || __|| | / _ \/ __|
// / /___| | | |_| || |_) || |_| (_) |/ /___ | || |_ | || __/\__ \
// \____/|_| \__, || .__/ \__|\___/ \____/ |_| \__||_| \___||___/
// |___/ |_|
//
// CryptoCities is an ERC721 compliant smart contract for this project:
// (https://cryptocities.net)
//
// In addition to a standard ERC721 interface it also includes:
// - a maker / taker off-chain marketplace which executes final trades here
// - batch functions for most token read functions
// - a limited supply of 25000 tokens
//
// Discord:
// https://discord.gg/Y4mhwWg
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://cryptocities.net/bug_bounty
//
// Disclaimer:
// We take the greatest of care when making our smart contracts but this is crypto and the future
// is always unknown. Even if it is exciting and full of wonderful possibilities, anything can happen,
// blockchains will evolve, vulnerabilities can arise, and markets can go up and down. CryptoCities and its
// owners accept no liability for any issues relating to the use of this contract or any losses that may occur.
// Please see our full terms here:
// https://cryptocities.net/terms
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./base/ERC721Batchable.sol";
contract CryptoCities is ERC721Batchable
{
// there can only ever be a max of this many tokens in the contract
uint public constant tokenLimit = 25000;
// the base url used for all meta data
// likely to be stored on IPFS over time
string private _baseTokenURI;
// the opensea proxy registry contract (can be changed if this registry ever moves to a new contract)
// 0xa5409ec958C83C3f309868babACA7c86DCB077c1 mainnet
// 0xF57B2c51dED3A29e6891aba85459d600256Cf317 rinkeby
// 0x0000000000000000000000000000000000000000 local
address private _proxyRegistryAddress;
// only authorized minters can mint tokens
// this will originally be set to a swapping contract to allow users to swap their tokens to this new contract
mapping (address => bool) public isMinter;
// pausing the market disables the built-in maker/taker offer system
// it does not affect normal ERC721 transfers
bool public marketPaused;
// the marketplace fee for any internal paid trades (stored in basis points eg. 250 = 2.5% fee)
uint16 public marketFee;
// the marketplace witness is used to validate marketplace offers
address private _marketWitness;
// offer that can no longer be used any more
mapping (bytes32 => bool) private _cancelledOrCompletedOffers;
// support for ERC2981
uint16 private _royaltyFee;
address private _royaltyReciever;
constructor(address _owner, address _recovery, address proxyRegistryAddress) ERC721("CryptoCities", unicode"⬢City")
{
}
/// BASE URI
// base uri is where the metadata lives
// only the owner can change this
function setBaseURI(string memory baseTokenURI) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
/// PROXY REGISTRY
// registers a proxy address for OpenSea or others
// can only be changed by the contract owner
// setting address to 0 will disable the proxy
function setProxyRegistry(address proxyRegistry) external onlyOwner {
}
// this override allows us to whitelist user's OpenSea proxy accounts to enable gas-less listings
function isApprovedForAll(address token_owner, address operator) public view override returns (bool)
{
}
/// MINTING
// only authorized minters can mint
// can't mint more tokens than the token limit
// ERC721 standard checks:
// can't mint while the contract is paused (checked in _beforeTokenTransfer())
// token id's can't already exist
// cant mint to address(0)
// if 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
// emitted when a minter's authorization changes
event MinterSet(address indexed minter, bool auth);
// only allows an authorized minter to call the function
modifier onlyMinters()
{
}
// changes a minter's authorization
function setMinter(address minter, bool authorized) external onlyOwner
{
}
// mint a single token
function mint(address to, uint256 tokenId) external onlyMinters
{
}
// mint a batch of tokens
// (gas: this function can run out of gas if too many id's are provided
// limiting to 25 will currently fit in the block gas limit but this may change in future)
function mintBatch(address to, uint256[] memory tokenIds) external onlyMinters
{
}
/// BURNING
// only the contract owner can burn tokens it owns
// the contract owner can't burn someone elses tokens
// normal users can't burn tokens
// ERC721 standard checks:
// can't burn while the contract is paused (checked in _beforeTokenTransfer())
// the token id must exist
function burn(uint256 tokenId) external onlyOwner
{
}
/// MARKETPLACE
// this contract includes a maker / taker offerplace
// (similar to those seen in OpenSea, 0x Protocol and other NFT projects)
//
// offers are made by makers off-chain and filled by callers on-chain
// makers do this by signing their offer with their wallet
// smart contracts can't be makers because they can't sign messages
// if a witness address is set then it must sign the offer hash too (eg. the website marketplace)
// there are two types of offers depending on whether the maker specifies a taker in their offer:
// maker / taker (peer-to-peer offer: two users agreeing to trade items)
// maker / no taker (open offer: one user listing their items in the marketplace)
// if eth is paid then it will always be on the taker side (the maker never pays eth in this simplified model)
// a market fee is charged if eth is paid
// trading tokens with no eth is free and no fee is deducted
// allowed exchanges:
// maker tokens > < eth (maker sells their tokens to anyone)
// maker tokens > (maker gives their tokens away to anyone)
// maker tokens > taker (maker gives their tokens to a specific taker)
// maker tokens > < taker tokens .. for specific tokens back
// maker tokens > < taker tokens & eth .. for specific tokens and eth back
// maker tokens > < taker eth .. for eth only
// maker < taker tokens (taker gives their tokens to the maker)
// maker < taker tokens & eth .. and with eth
event OfferAccepted(bytes32 indexed hash, address indexed maker, address indexed taker, uint[] makerIds, uint[] takerIds, uint takerWei, uint marketFee);
event OfferCancelled(bytes32 indexed hash);
struct Offer {
address maker;
address taker;
uint256[] makerIds;
uint256[] takerIds;
uint256 takerWei;
uint256 expiry;
uint256 nonce;
}
// pausing the market will stop offers from being able to be accepted (they can still be generated or cancelled)
function pauseMarket(bool pauseTrading) external onlyOwner {
}
// the market fee is set in basis points (eg. 250 basis points = 2.5%)
function setMarketFee(uint16 basisPoints) external onlyOwner {
}
// if a market witness is set then it will need to sign all offers too (set to 0 to disable)
function setMarketWitness(address newWitness) external onlyOwner {
}
// recovers the signer address from a offer hash and signature
function signerOfHash(bytes32 offer_hash, bytes memory signature) public pure returns (address signer){
}
// this generates a hash of an offer that can then be signed by a maker
// the offer has to have basic validity before it can be hashed
// if checking ids then the tokens need to be owned by the parties too
function hashOffer(Offer memory offer, bool checkIds) public view returns (bytes32){
// the maker can't be 0
require(offer.maker!=address(0), "maker is 0");
// maker and taker can't be the same
require(offer.maker!=offer.taker, "same maker / taker");
// the offer must not be expired yet
require(block.timestamp < offer.expiry, "expired");
// token id must be in the offer
require(offer.makerIds.length>0 || offer.takerIds.length>0, "no ids");
// if checking ids then maker must own the maker token ids
if(checkIds){
for(uint i=0; i<offer.makerIds.length; i++){
require(<FILL_ME>)
}
}
// if no taker has been specified (open offer - i.e. typical marketplace listing)
if(offer.taker==address(0)){
// then there can't be taker token ids in the offer
require(offer.takerIds.length==0, "taker ids with no taker");
}
// if a taker has been specified (peer-to-peer offer - i.e. direct trade between two users)
else{
if(checkIds){
// then the taker must own all the taker token ids
for(uint i=0; i<offer.takerIds.length; i++){
require(ownerOf(offer.takerIds[i])==offer.taker, "bad taker ids");
}
}
}
// now return the hash
return keccak256(abi.encode(
offer.maker,
offer.taker,
keccak256(abi.encodePacked(offer.makerIds)),
keccak256(abi.encodePacked(offer.takerIds)),
offer.takerWei,
offer.expiry,
offer.nonce,
address(this) // including the contract address prevents cross-contract replays
));
}
// an offer is valid if:
// it's maker / taker details are valid
// it has been signed by the maker
// it has not been cancelled or completed yet
// the parties own their tokens (if checking ids)
// the witness has signed it (if witnessing is enabled)
// the trade is valid (if requested)
function validOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature, bool checkIds, bool checkTradeValid, uint checkValue) external view returns (bool){
}
// if a market witness is set then they need to sign the offer hash too
function _validWitness(bytes32 _offer_hash, bytes memory witnessSignature) internal view {
}
// gets the hash of an offer and checks that it has been signed by the maker
function _getValidOfferHash(Offer memory offer, bytes memory signature, bool checkIds, bool checkTradeValid, uint checkValue) internal view returns (bytes32){
}
// (gas: these functions can run out of gas if too many id's are provided
// not limiting them here because block gas limits change over time and we don't know what they will be in future)
// stops the offer hash from being usable in future
// can only be cancelled by the maker or the contract owner
function cancelOffer(Offer memory offer) external {
}
// fills an offer
// offers can't be traded when the market is paused or the contract is paused
// offers must be valid and signed by the maker
// the caller has to be the taker or can be an unknown party if no taker is set
// eth may or may not be required by the offer
// tokens must belong to the makers and takers
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard {
}
/// ERC2981 support
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
{
}
// the royalties fee is set in basis points (eg. 250 basis points = 2.5%)
function setRoyalties(address newReceiver, uint16 basisPoints) external onlyOwner {
}
}
// used to whitelist proxy accounts of OpenSea users so that they are automatically able to trade any item on OpenSea
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| ownerOf(offer.makerIds[i])==offer.maker,"bad maker ids" | 22,918 | ownerOf(offer.makerIds[i])==offer.maker |
"bad taker ids" | // ___ _ ___ _ _ _
// / __\_ __ _ _ _ __ | |_ ___ / __\(_)| |_ (_) ___ ___
// / / | '__|| | | || '_ \ | __|/ _ \ / / | || __|| | / _ \/ __|
// / /___| | | |_| || |_) || |_| (_) |/ /___ | || |_ | || __/\__ \
// \____/|_| \__, || .__/ \__|\___/ \____/ |_| \__||_| \___||___/
// |___/ |_|
//
// CryptoCities is an ERC721 compliant smart contract for this project:
// (https://cryptocities.net)
//
// In addition to a standard ERC721 interface it also includes:
// - a maker / taker off-chain marketplace which executes final trades here
// - batch functions for most token read functions
// - a limited supply of 25000 tokens
//
// Discord:
// https://discord.gg/Y4mhwWg
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://cryptocities.net/bug_bounty
//
// Disclaimer:
// We take the greatest of care when making our smart contracts but this is crypto and the future
// is always unknown. Even if it is exciting and full of wonderful possibilities, anything can happen,
// blockchains will evolve, vulnerabilities can arise, and markets can go up and down. CryptoCities and its
// owners accept no liability for any issues relating to the use of this contract or any losses that may occur.
// Please see our full terms here:
// https://cryptocities.net/terms
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./base/ERC721Batchable.sol";
contract CryptoCities is ERC721Batchable
{
// there can only ever be a max of this many tokens in the contract
uint public constant tokenLimit = 25000;
// the base url used for all meta data
// likely to be stored on IPFS over time
string private _baseTokenURI;
// the opensea proxy registry contract (can be changed if this registry ever moves to a new contract)
// 0xa5409ec958C83C3f309868babACA7c86DCB077c1 mainnet
// 0xF57B2c51dED3A29e6891aba85459d600256Cf317 rinkeby
// 0x0000000000000000000000000000000000000000 local
address private _proxyRegistryAddress;
// only authorized minters can mint tokens
// this will originally be set to a swapping contract to allow users to swap their tokens to this new contract
mapping (address => bool) public isMinter;
// pausing the market disables the built-in maker/taker offer system
// it does not affect normal ERC721 transfers
bool public marketPaused;
// the marketplace fee for any internal paid trades (stored in basis points eg. 250 = 2.5% fee)
uint16 public marketFee;
// the marketplace witness is used to validate marketplace offers
address private _marketWitness;
// offer that can no longer be used any more
mapping (bytes32 => bool) private _cancelledOrCompletedOffers;
// support for ERC2981
uint16 private _royaltyFee;
address private _royaltyReciever;
constructor(address _owner, address _recovery, address proxyRegistryAddress) ERC721("CryptoCities", unicode"⬢City")
{
}
/// BASE URI
// base uri is where the metadata lives
// only the owner can change this
function setBaseURI(string memory baseTokenURI) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
/// PROXY REGISTRY
// registers a proxy address for OpenSea or others
// can only be changed by the contract owner
// setting address to 0 will disable the proxy
function setProxyRegistry(address proxyRegistry) external onlyOwner {
}
// this override allows us to whitelist user's OpenSea proxy accounts to enable gas-less listings
function isApprovedForAll(address token_owner, address operator) public view override returns (bool)
{
}
/// MINTING
// only authorized minters can mint
// can't mint more tokens than the token limit
// ERC721 standard checks:
// can't mint while the contract is paused (checked in _beforeTokenTransfer())
// token id's can't already exist
// cant mint to address(0)
// if 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
// emitted when a minter's authorization changes
event MinterSet(address indexed minter, bool auth);
// only allows an authorized minter to call the function
modifier onlyMinters()
{
}
// changes a minter's authorization
function setMinter(address minter, bool authorized) external onlyOwner
{
}
// mint a single token
function mint(address to, uint256 tokenId) external onlyMinters
{
}
// mint a batch of tokens
// (gas: this function can run out of gas if too many id's are provided
// limiting to 25 will currently fit in the block gas limit but this may change in future)
function mintBatch(address to, uint256[] memory tokenIds) external onlyMinters
{
}
/// BURNING
// only the contract owner can burn tokens it owns
// the contract owner can't burn someone elses tokens
// normal users can't burn tokens
// ERC721 standard checks:
// can't burn while the contract is paused (checked in _beforeTokenTransfer())
// the token id must exist
function burn(uint256 tokenId) external onlyOwner
{
}
/// MARKETPLACE
// this contract includes a maker / taker offerplace
// (similar to those seen in OpenSea, 0x Protocol and other NFT projects)
//
// offers are made by makers off-chain and filled by callers on-chain
// makers do this by signing their offer with their wallet
// smart contracts can't be makers because they can't sign messages
// if a witness address is set then it must sign the offer hash too (eg. the website marketplace)
// there are two types of offers depending on whether the maker specifies a taker in their offer:
// maker / taker (peer-to-peer offer: two users agreeing to trade items)
// maker / no taker (open offer: one user listing their items in the marketplace)
// if eth is paid then it will always be on the taker side (the maker never pays eth in this simplified model)
// a market fee is charged if eth is paid
// trading tokens with no eth is free and no fee is deducted
// allowed exchanges:
// maker tokens > < eth (maker sells their tokens to anyone)
// maker tokens > (maker gives their tokens away to anyone)
// maker tokens > taker (maker gives their tokens to a specific taker)
// maker tokens > < taker tokens .. for specific tokens back
// maker tokens > < taker tokens & eth .. for specific tokens and eth back
// maker tokens > < taker eth .. for eth only
// maker < taker tokens (taker gives their tokens to the maker)
// maker < taker tokens & eth .. and with eth
event OfferAccepted(bytes32 indexed hash, address indexed maker, address indexed taker, uint[] makerIds, uint[] takerIds, uint takerWei, uint marketFee);
event OfferCancelled(bytes32 indexed hash);
struct Offer {
address maker;
address taker;
uint256[] makerIds;
uint256[] takerIds;
uint256 takerWei;
uint256 expiry;
uint256 nonce;
}
// pausing the market will stop offers from being able to be accepted (they can still be generated or cancelled)
function pauseMarket(bool pauseTrading) external onlyOwner {
}
// the market fee is set in basis points (eg. 250 basis points = 2.5%)
function setMarketFee(uint16 basisPoints) external onlyOwner {
}
// if a market witness is set then it will need to sign all offers too (set to 0 to disable)
function setMarketWitness(address newWitness) external onlyOwner {
}
// recovers the signer address from a offer hash and signature
function signerOfHash(bytes32 offer_hash, bytes memory signature) public pure returns (address signer){
}
// this generates a hash of an offer that can then be signed by a maker
// the offer has to have basic validity before it can be hashed
// if checking ids then the tokens need to be owned by the parties too
function hashOffer(Offer memory offer, bool checkIds) public view returns (bytes32){
// the maker can't be 0
require(offer.maker!=address(0), "maker is 0");
// maker and taker can't be the same
require(offer.maker!=offer.taker, "same maker / taker");
// the offer must not be expired yet
require(block.timestamp < offer.expiry, "expired");
// token id must be in the offer
require(offer.makerIds.length>0 || offer.takerIds.length>0, "no ids");
// if checking ids then maker must own the maker token ids
if(checkIds){
for(uint i=0; i<offer.makerIds.length; i++){
require(ownerOf(offer.makerIds[i])==offer.maker, "bad maker ids");
}
}
// if no taker has been specified (open offer - i.e. typical marketplace listing)
if(offer.taker==address(0)){
// then there can't be taker token ids in the offer
require(offer.takerIds.length==0, "taker ids with no taker");
}
// if a taker has been specified (peer-to-peer offer - i.e. direct trade between two users)
else{
if(checkIds){
// then the taker must own all the taker token ids
for(uint i=0; i<offer.takerIds.length; i++){
require(<FILL_ME>)
}
}
}
// now return the hash
return keccak256(abi.encode(
offer.maker,
offer.taker,
keccak256(abi.encodePacked(offer.makerIds)),
keccak256(abi.encodePacked(offer.takerIds)),
offer.takerWei,
offer.expiry,
offer.nonce,
address(this) // including the contract address prevents cross-contract replays
));
}
// an offer is valid if:
// it's maker / taker details are valid
// it has been signed by the maker
// it has not been cancelled or completed yet
// the parties own their tokens (if checking ids)
// the witness has signed it (if witnessing is enabled)
// the trade is valid (if requested)
function validOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature, bool checkIds, bool checkTradeValid, uint checkValue) external view returns (bool){
}
// if a market witness is set then they need to sign the offer hash too
function _validWitness(bytes32 _offer_hash, bytes memory witnessSignature) internal view {
}
// gets the hash of an offer and checks that it has been signed by the maker
function _getValidOfferHash(Offer memory offer, bytes memory signature, bool checkIds, bool checkTradeValid, uint checkValue) internal view returns (bytes32){
}
// (gas: these functions can run out of gas if too many id's are provided
// not limiting them here because block gas limits change over time and we don't know what they will be in future)
// stops the offer hash from being usable in future
// can only be cancelled by the maker or the contract owner
function cancelOffer(Offer memory offer) external {
}
// fills an offer
// offers can't be traded when the market is paused or the contract is paused
// offers must be valid and signed by the maker
// the caller has to be the taker or can be an unknown party if no taker is set
// eth may or may not be required by the offer
// tokens must belong to the makers and takers
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard {
}
/// ERC2981 support
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
{
}
// the royalties fee is set in basis points (eg. 250 basis points = 2.5%)
function setRoyalties(address newReceiver, uint16 basisPoints) external onlyOwner {
}
}
// used to whitelist proxy accounts of OpenSea users so that they are automatically able to trade any item on OpenSea
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| ownerOf(offer.takerIds[i])==offer.taker,"bad taker ids" | 22,918 | ownerOf(offer.takerIds[i])==offer.taker |
"offer cancelled or completed" | // ___ _ ___ _ _ _
// / __\_ __ _ _ _ __ | |_ ___ / __\(_)| |_ (_) ___ ___
// / / | '__|| | | || '_ \ | __|/ _ \ / / | || __|| | / _ \/ __|
// / /___| | | |_| || |_) || |_| (_) |/ /___ | || |_ | || __/\__ \
// \____/|_| \__, || .__/ \__|\___/ \____/ |_| \__||_| \___||___/
// |___/ |_|
//
// CryptoCities is an ERC721 compliant smart contract for this project:
// (https://cryptocities.net)
//
// In addition to a standard ERC721 interface it also includes:
// - a maker / taker off-chain marketplace which executes final trades here
// - batch functions for most token read functions
// - a limited supply of 25000 tokens
//
// Discord:
// https://discord.gg/Y4mhwWg
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://cryptocities.net/bug_bounty
//
// Disclaimer:
// We take the greatest of care when making our smart contracts but this is crypto and the future
// is always unknown. Even if it is exciting and full of wonderful possibilities, anything can happen,
// blockchains will evolve, vulnerabilities can arise, and markets can go up and down. CryptoCities and its
// owners accept no liability for any issues relating to the use of this contract or any losses that may occur.
// Please see our full terms here:
// https://cryptocities.net/terms
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./base/ERC721Batchable.sol";
contract CryptoCities is ERC721Batchable
{
// there can only ever be a max of this many tokens in the contract
uint public constant tokenLimit = 25000;
// the base url used for all meta data
// likely to be stored on IPFS over time
string private _baseTokenURI;
// the opensea proxy registry contract (can be changed if this registry ever moves to a new contract)
// 0xa5409ec958C83C3f309868babACA7c86DCB077c1 mainnet
// 0xF57B2c51dED3A29e6891aba85459d600256Cf317 rinkeby
// 0x0000000000000000000000000000000000000000 local
address private _proxyRegistryAddress;
// only authorized minters can mint tokens
// this will originally be set to a swapping contract to allow users to swap their tokens to this new contract
mapping (address => bool) public isMinter;
// pausing the market disables the built-in maker/taker offer system
// it does not affect normal ERC721 transfers
bool public marketPaused;
// the marketplace fee for any internal paid trades (stored in basis points eg. 250 = 2.5% fee)
uint16 public marketFee;
// the marketplace witness is used to validate marketplace offers
address private _marketWitness;
// offer that can no longer be used any more
mapping (bytes32 => bool) private _cancelledOrCompletedOffers;
// support for ERC2981
uint16 private _royaltyFee;
address private _royaltyReciever;
constructor(address _owner, address _recovery, address proxyRegistryAddress) ERC721("CryptoCities", unicode"⬢City")
{
}
/// BASE URI
// base uri is where the metadata lives
// only the owner can change this
function setBaseURI(string memory baseTokenURI) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
/// PROXY REGISTRY
// registers a proxy address for OpenSea or others
// can only be changed by the contract owner
// setting address to 0 will disable the proxy
function setProxyRegistry(address proxyRegistry) external onlyOwner {
}
// this override allows us to whitelist user's OpenSea proxy accounts to enable gas-less listings
function isApprovedForAll(address token_owner, address operator) public view override returns (bool)
{
}
/// MINTING
// only authorized minters can mint
// can't mint more tokens than the token limit
// ERC721 standard checks:
// can't mint while the contract is paused (checked in _beforeTokenTransfer())
// token id's can't already exist
// cant mint to address(0)
// if 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
// emitted when a minter's authorization changes
event MinterSet(address indexed minter, bool auth);
// only allows an authorized minter to call the function
modifier onlyMinters()
{
}
// changes a minter's authorization
function setMinter(address minter, bool authorized) external onlyOwner
{
}
// mint a single token
function mint(address to, uint256 tokenId) external onlyMinters
{
}
// mint a batch of tokens
// (gas: this function can run out of gas if too many id's are provided
// limiting to 25 will currently fit in the block gas limit but this may change in future)
function mintBatch(address to, uint256[] memory tokenIds) external onlyMinters
{
}
/// BURNING
// only the contract owner can burn tokens it owns
// the contract owner can't burn someone elses tokens
// normal users can't burn tokens
// ERC721 standard checks:
// can't burn while the contract is paused (checked in _beforeTokenTransfer())
// the token id must exist
function burn(uint256 tokenId) external onlyOwner
{
}
/// MARKETPLACE
// this contract includes a maker / taker offerplace
// (similar to those seen in OpenSea, 0x Protocol and other NFT projects)
//
// offers are made by makers off-chain and filled by callers on-chain
// makers do this by signing their offer with their wallet
// smart contracts can't be makers because they can't sign messages
// if a witness address is set then it must sign the offer hash too (eg. the website marketplace)
// there are two types of offers depending on whether the maker specifies a taker in their offer:
// maker / taker (peer-to-peer offer: two users agreeing to trade items)
// maker / no taker (open offer: one user listing their items in the marketplace)
// if eth is paid then it will always be on the taker side (the maker never pays eth in this simplified model)
// a market fee is charged if eth is paid
// trading tokens with no eth is free and no fee is deducted
// allowed exchanges:
// maker tokens > < eth (maker sells their tokens to anyone)
// maker tokens > (maker gives their tokens away to anyone)
// maker tokens > taker (maker gives their tokens to a specific taker)
// maker tokens > < taker tokens .. for specific tokens back
// maker tokens > < taker tokens & eth .. for specific tokens and eth back
// maker tokens > < taker eth .. for eth only
// maker < taker tokens (taker gives their tokens to the maker)
// maker < taker tokens & eth .. and with eth
event OfferAccepted(bytes32 indexed hash, address indexed maker, address indexed taker, uint[] makerIds, uint[] takerIds, uint takerWei, uint marketFee);
event OfferCancelled(bytes32 indexed hash);
struct Offer {
address maker;
address taker;
uint256[] makerIds;
uint256[] takerIds;
uint256 takerWei;
uint256 expiry;
uint256 nonce;
}
// pausing the market will stop offers from being able to be accepted (they can still be generated or cancelled)
function pauseMarket(bool pauseTrading) external onlyOwner {
}
// the market fee is set in basis points (eg. 250 basis points = 2.5%)
function setMarketFee(uint16 basisPoints) external onlyOwner {
}
// if a market witness is set then it will need to sign all offers too (set to 0 to disable)
function setMarketWitness(address newWitness) external onlyOwner {
}
// recovers the signer address from a offer hash and signature
function signerOfHash(bytes32 offer_hash, bytes memory signature) public pure returns (address signer){
}
// this generates a hash of an offer that can then be signed by a maker
// the offer has to have basic validity before it can be hashed
// if checking ids then the tokens need to be owned by the parties too
function hashOffer(Offer memory offer, bool checkIds) public view returns (bytes32){
}
// an offer is valid if:
// it's maker / taker details are valid
// it has been signed by the maker
// it has not been cancelled or completed yet
// the parties own their tokens (if checking ids)
// the witness has signed it (if witnessing is enabled)
// the trade is valid (if requested)
function validOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature, bool checkIds, bool checkTradeValid, uint checkValue) external view returns (bool){
}
// if a market witness is set then they need to sign the offer hash too
function _validWitness(bytes32 _offer_hash, bytes memory witnessSignature) internal view {
}
// gets the hash of an offer and checks that it has been signed by the maker
function _getValidOfferHash(Offer memory offer, bytes memory signature, bool checkIds, bool checkTradeValid, uint checkValue) internal view returns (bytes32){
// get the offer signer
bytes32 _offer_hash = hashOffer(offer, checkIds);
address _signer = signerOfHash(_offer_hash, signature);
// the signer must be the maker
require(offer.maker==_signer, "maker not signer");
// the offer can't be cancelled or completed already
require(<FILL_ME>)
// if checking the trade then we need to check the taker side too
if(checkTradeValid){
address caller = _msgSender();
// no trading when paused
require(!marketPaused, "marketplace paused");
// caller can't be the maker
require(caller!=offer.maker, "caller is the maker");
// if there is a taker specified then they must be the caller
require(caller==offer.taker || offer.taker==address(0), "caller not the taker");
// check the correct wei has been provided by the taker (can be 0)
require(checkValue==offer.takerWei, "wrong payment sent");
}
return _offer_hash;
}
// (gas: these functions can run out of gas if too many id's are provided
// not limiting them here because block gas limits change over time and we don't know what they will be in future)
// stops the offer hash from being usable in future
// can only be cancelled by the maker or the contract owner
function cancelOffer(Offer memory offer) external {
}
// fills an offer
// offers can't be traded when the market is paused or the contract is paused
// offers must be valid and signed by the maker
// the caller has to be the taker or can be an unknown party if no taker is set
// eth may or may not be required by the offer
// tokens must belong to the makers and takers
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard {
}
/// ERC2981 support
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
{
}
// the royalties fee is set in basis points (eg. 250 basis points = 2.5%)
function setRoyalties(address newReceiver, uint16 basisPoints) external onlyOwner {
}
}
// used to whitelist proxy accounts of OpenSea users so that they are automatically able to trade any item on OpenSea
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| _cancelledOrCompletedOffers[_offer_hash]!=true,"offer cancelled or completed" | 22,918 | _cancelledOrCompletedOffers[_offer_hash]!=true |
"marketplace paused" | // ___ _ ___ _ _ _
// / __\_ __ _ _ _ __ | |_ ___ / __\(_)| |_ (_) ___ ___
// / / | '__|| | | || '_ \ | __|/ _ \ / / | || __|| | / _ \/ __|
// / /___| | | |_| || |_) || |_| (_) |/ /___ | || |_ | || __/\__ \
// \____/|_| \__, || .__/ \__|\___/ \____/ |_| \__||_| \___||___/
// |___/ |_|
//
// CryptoCities is an ERC721 compliant smart contract for this project:
// (https://cryptocities.net)
//
// In addition to a standard ERC721 interface it also includes:
// - a maker / taker off-chain marketplace which executes final trades here
// - batch functions for most token read functions
// - a limited supply of 25000 tokens
//
// Discord:
// https://discord.gg/Y4mhwWg
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://cryptocities.net/bug_bounty
//
// Disclaimer:
// We take the greatest of care when making our smart contracts but this is crypto and the future
// is always unknown. Even if it is exciting and full of wonderful possibilities, anything can happen,
// blockchains will evolve, vulnerabilities can arise, and markets can go up and down. CryptoCities and its
// owners accept no liability for any issues relating to the use of this contract or any losses that may occur.
// Please see our full terms here:
// https://cryptocities.net/terms
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./base/ERC721Batchable.sol";
contract CryptoCities is ERC721Batchable
{
// there can only ever be a max of this many tokens in the contract
uint public constant tokenLimit = 25000;
// the base url used for all meta data
// likely to be stored on IPFS over time
string private _baseTokenURI;
// the opensea proxy registry contract (can be changed if this registry ever moves to a new contract)
// 0xa5409ec958C83C3f309868babACA7c86DCB077c1 mainnet
// 0xF57B2c51dED3A29e6891aba85459d600256Cf317 rinkeby
// 0x0000000000000000000000000000000000000000 local
address private _proxyRegistryAddress;
// only authorized minters can mint tokens
// this will originally be set to a swapping contract to allow users to swap their tokens to this new contract
mapping (address => bool) public isMinter;
// pausing the market disables the built-in maker/taker offer system
// it does not affect normal ERC721 transfers
bool public marketPaused;
// the marketplace fee for any internal paid trades (stored in basis points eg. 250 = 2.5% fee)
uint16 public marketFee;
// the marketplace witness is used to validate marketplace offers
address private _marketWitness;
// offer that can no longer be used any more
mapping (bytes32 => bool) private _cancelledOrCompletedOffers;
// support for ERC2981
uint16 private _royaltyFee;
address private _royaltyReciever;
constructor(address _owner, address _recovery, address proxyRegistryAddress) ERC721("CryptoCities", unicode"⬢City")
{
}
/// BASE URI
// base uri is where the metadata lives
// only the owner can change this
function setBaseURI(string memory baseTokenURI) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
/// PROXY REGISTRY
// registers a proxy address for OpenSea or others
// can only be changed by the contract owner
// setting address to 0 will disable the proxy
function setProxyRegistry(address proxyRegistry) external onlyOwner {
}
// this override allows us to whitelist user's OpenSea proxy accounts to enable gas-less listings
function isApprovedForAll(address token_owner, address operator) public view override returns (bool)
{
}
/// MINTING
// only authorized minters can mint
// can't mint more tokens than the token limit
// ERC721 standard checks:
// can't mint while the contract is paused (checked in _beforeTokenTransfer())
// token id's can't already exist
// cant mint to address(0)
// if 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
// emitted when a minter's authorization changes
event MinterSet(address indexed minter, bool auth);
// only allows an authorized minter to call the function
modifier onlyMinters()
{
}
// changes a minter's authorization
function setMinter(address minter, bool authorized) external onlyOwner
{
}
// mint a single token
function mint(address to, uint256 tokenId) external onlyMinters
{
}
// mint a batch of tokens
// (gas: this function can run out of gas if too many id's are provided
// limiting to 25 will currently fit in the block gas limit but this may change in future)
function mintBatch(address to, uint256[] memory tokenIds) external onlyMinters
{
}
/// BURNING
// only the contract owner can burn tokens it owns
// the contract owner can't burn someone elses tokens
// normal users can't burn tokens
// ERC721 standard checks:
// can't burn while the contract is paused (checked in _beforeTokenTransfer())
// the token id must exist
function burn(uint256 tokenId) external onlyOwner
{
}
/// MARKETPLACE
// this contract includes a maker / taker offerplace
// (similar to those seen in OpenSea, 0x Protocol and other NFT projects)
//
// offers are made by makers off-chain and filled by callers on-chain
// makers do this by signing their offer with their wallet
// smart contracts can't be makers because they can't sign messages
// if a witness address is set then it must sign the offer hash too (eg. the website marketplace)
// there are two types of offers depending on whether the maker specifies a taker in their offer:
// maker / taker (peer-to-peer offer: two users agreeing to trade items)
// maker / no taker (open offer: one user listing their items in the marketplace)
// if eth is paid then it will always be on the taker side (the maker never pays eth in this simplified model)
// a market fee is charged if eth is paid
// trading tokens with no eth is free and no fee is deducted
// allowed exchanges:
// maker tokens > < eth (maker sells their tokens to anyone)
// maker tokens > (maker gives their tokens away to anyone)
// maker tokens > taker (maker gives their tokens to a specific taker)
// maker tokens > < taker tokens .. for specific tokens back
// maker tokens > < taker tokens & eth .. for specific tokens and eth back
// maker tokens > < taker eth .. for eth only
// maker < taker tokens (taker gives their tokens to the maker)
// maker < taker tokens & eth .. and with eth
event OfferAccepted(bytes32 indexed hash, address indexed maker, address indexed taker, uint[] makerIds, uint[] takerIds, uint takerWei, uint marketFee);
event OfferCancelled(bytes32 indexed hash);
struct Offer {
address maker;
address taker;
uint256[] makerIds;
uint256[] takerIds;
uint256 takerWei;
uint256 expiry;
uint256 nonce;
}
// pausing the market will stop offers from being able to be accepted (they can still be generated or cancelled)
function pauseMarket(bool pauseTrading) external onlyOwner {
}
// the market fee is set in basis points (eg. 250 basis points = 2.5%)
function setMarketFee(uint16 basisPoints) external onlyOwner {
}
// if a market witness is set then it will need to sign all offers too (set to 0 to disable)
function setMarketWitness(address newWitness) external onlyOwner {
}
// recovers the signer address from a offer hash and signature
function signerOfHash(bytes32 offer_hash, bytes memory signature) public pure returns (address signer){
}
// this generates a hash of an offer that can then be signed by a maker
// the offer has to have basic validity before it can be hashed
// if checking ids then the tokens need to be owned by the parties too
function hashOffer(Offer memory offer, bool checkIds) public view returns (bytes32){
}
// an offer is valid if:
// it's maker / taker details are valid
// it has been signed by the maker
// it has not been cancelled or completed yet
// the parties own their tokens (if checking ids)
// the witness has signed it (if witnessing is enabled)
// the trade is valid (if requested)
function validOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature, bool checkIds, bool checkTradeValid, uint checkValue) external view returns (bool){
}
// if a market witness is set then they need to sign the offer hash too
function _validWitness(bytes32 _offer_hash, bytes memory witnessSignature) internal view {
}
// gets the hash of an offer and checks that it has been signed by the maker
function _getValidOfferHash(Offer memory offer, bytes memory signature, bool checkIds, bool checkTradeValid, uint checkValue) internal view returns (bytes32){
// get the offer signer
bytes32 _offer_hash = hashOffer(offer, checkIds);
address _signer = signerOfHash(_offer_hash, signature);
// the signer must be the maker
require(offer.maker==_signer, "maker not signer");
// the offer can't be cancelled or completed already
require(_cancelledOrCompletedOffers[_offer_hash]!=true, "offer cancelled or completed");
// if checking the trade then we need to check the taker side too
if(checkTradeValid){
address caller = _msgSender();
// no trading when paused
require(<FILL_ME>)
// caller can't be the maker
require(caller!=offer.maker, "caller is the maker");
// if there is a taker specified then they must be the caller
require(caller==offer.taker || offer.taker==address(0), "caller not the taker");
// check the correct wei has been provided by the taker (can be 0)
require(checkValue==offer.takerWei, "wrong payment sent");
}
return _offer_hash;
}
// (gas: these functions can run out of gas if too many id's are provided
// not limiting them here because block gas limits change over time and we don't know what they will be in future)
// stops the offer hash from being usable in future
// can only be cancelled by the maker or the contract owner
function cancelOffer(Offer memory offer) external {
}
// fills an offer
// offers can't be traded when the market is paused or the contract is paused
// offers must be valid and signed by the maker
// the caller has to be the taker or can be an unknown party if no taker is set
// eth may or may not be required by the offer
// tokens must belong to the makers and takers
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard {
}
/// ERC2981 support
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
{
}
// the royalties fee is set in basis points (eg. 250 basis points = 2.5%)
function setRoyalties(address newReceiver, uint16 basisPoints) external onlyOwner {
}
}
// used to whitelist proxy accounts of OpenSea users so that they are automatically able to trade any item on OpenSea
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| !marketPaused,"marketplace paused" | 22,918 | !marketPaused |
null | pragma solidity ^0.4.24;
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() { }
}
contract MultiTransfer is Ownable {
event Transacted(
address msgSender, // 트랜잭션을 시작한 메시지의 발신자 주소
address toAddress, // 트랜잭션이 전송된 주소
uint value // 주소로 보낸 Wei 금액
);
/**
* @param _to 대상 주소
* @param _amount 전송할 wei의 양
*/
function multiTransfer(address[] _to, uint256[] _amount) public payable onlyOwner returns (bool) {
require(_to.length == _amount.length);
uint256 ui;
uint256 amountSum = 0;
for (ui = 0; ui < _to.length; ui++) {
require(<FILL_ME>)
amountSum = amountSum + _amount[ui];
}
require(amountSum <= msg.value);
for (ui = 0; ui < _to.length; ui++) {
_to[ui].transfer(_amount[ui]);
emit Transacted(msg.sender, _to[ui], _amount[ui]);
}
return true;
}
}
| _to[ui]!=address(0) | 23,035 | _to[ui]!=address(0) |
"Not eligible" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
import "./NFTX.sol";
contract NFTXv2 is NFTX {
/* function transferERC721(uint256 vaultId, uint256 tokenId, address to)
public
virtual
onlyOwner
{
store.nft(vaultId).transferFrom(address(this), to, tokenId);
}
function createVault(
address _xTokenAddress,
address _assetAddress,
bool _isD2Vault
) public virtual override nonReentrant returns (uint256) {
if (_xTokenAddress != _assetAddress && _isD2Vault) {
return 0;
}
return 0;
} */
function _mint(uint256 vaultId, uint256[] memory nftIds, bool isDualOp)
internal
virtual
override
{
for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
uint256 nftId = nftIds[i];
require(<FILL_ME>)
require(
store.nft(vaultId).ownerOf(nftId) != address(this),
"Already owner"
);
store.nft(vaultId).transferFrom(msg.sender, address(this), nftId);
require(
store.nft(vaultId).ownerOf(nftId) == address(this),
"Not received"
);
if (store.shouldReserve(vaultId, nftId)) {
store.reservesAdd(vaultId, nftId);
} else {
store.holdingsAdd(vaultId, nftId);
}
}
if (!isDualOp) {
uint256 amount = nftIds.length.mul(10**18);
store.xToken(vaultId).mint(msg.sender, amount);
}
}
}
| isEligible(vaultId,nftId),"Not eligible" | 23,144 | isEligible(vaultId,nftId) |
"Already owner" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
import "./NFTX.sol";
contract NFTXv2 is NFTX {
/* function transferERC721(uint256 vaultId, uint256 tokenId, address to)
public
virtual
onlyOwner
{
store.nft(vaultId).transferFrom(address(this), to, tokenId);
}
function createVault(
address _xTokenAddress,
address _assetAddress,
bool _isD2Vault
) public virtual override nonReentrant returns (uint256) {
if (_xTokenAddress != _assetAddress && _isD2Vault) {
return 0;
}
return 0;
} */
function _mint(uint256 vaultId, uint256[] memory nftIds, bool isDualOp)
internal
virtual
override
{
for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
uint256 nftId = nftIds[i];
require(isEligible(vaultId, nftId), "Not eligible");
require(<FILL_ME>)
store.nft(vaultId).transferFrom(msg.sender, address(this), nftId);
require(
store.nft(vaultId).ownerOf(nftId) == address(this),
"Not received"
);
if (store.shouldReserve(vaultId, nftId)) {
store.reservesAdd(vaultId, nftId);
} else {
store.holdingsAdd(vaultId, nftId);
}
}
if (!isDualOp) {
uint256 amount = nftIds.length.mul(10**18);
store.xToken(vaultId).mint(msg.sender, amount);
}
}
}
| store.nft(vaultId).ownerOf(nftId)!=address(this),"Already owner" | 23,144 | store.nft(vaultId).ownerOf(nftId)!=address(this) |
"Not received" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
import "./NFTX.sol";
contract NFTXv2 is NFTX {
/* function transferERC721(uint256 vaultId, uint256 tokenId, address to)
public
virtual
onlyOwner
{
store.nft(vaultId).transferFrom(address(this), to, tokenId);
}
function createVault(
address _xTokenAddress,
address _assetAddress,
bool _isD2Vault
) public virtual override nonReentrant returns (uint256) {
if (_xTokenAddress != _assetAddress && _isD2Vault) {
return 0;
}
return 0;
} */
function _mint(uint256 vaultId, uint256[] memory nftIds, bool isDualOp)
internal
virtual
override
{
for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
uint256 nftId = nftIds[i];
require(isEligible(vaultId, nftId), "Not eligible");
require(
store.nft(vaultId).ownerOf(nftId) != address(this),
"Already owner"
);
store.nft(vaultId).transferFrom(msg.sender, address(this), nftId);
require(<FILL_ME>)
if (store.shouldReserve(vaultId, nftId)) {
store.reservesAdd(vaultId, nftId);
} else {
store.holdingsAdd(vaultId, nftId);
}
}
if (!isDualOp) {
uint256 amount = nftIds.length.mul(10**18);
store.xToken(vaultId).mint(msg.sender, amount);
}
}
}
| store.nft(vaultId).ownerOf(nftId)==address(this),"Not received" | 23,144 | store.nft(vaultId).ownerOf(nftId)==address(this) |
"Staking amount greater than ALPHA balance" | // SPDX-License-Identifier: ISC
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "../interfaces/IALPHAStaking.sol";
import "../interfaces/IStakingProxy.sol";
contract StakingProxy is IStakingProxy, Initializable, OwnableUpgradeable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
// The alpha contracts
IAlphaStaking private alphaStaking;
function initialize(address _alphaStaking) public override initializer {
}
function getTotalStaked() public view override returns (uint256) {
}
function getUnbondingAmount() public view override returns (uint256) {
}
function getLastUnbondingTimestamp() external view override returns (uint256) {
}
function getWithdrawableAmount() external view override returns (uint256) {
}
function isUnbonding() external view override returns (bool) {
}
function withdraw() external override onlyOwner returns (uint256) {
}
function stake(uint256 amount) external override onlyOwner {
require(<FILL_ME>)
alphaStaking.stake(amount);
}
function unbond() external override onlyOwner {
}
function withdrawToken(address token) external override onlyOwner {
}
function _stakingShareToAmount(uint256 share) internal view returns (uint256) {
}
}
| IERC20(alphaStaking.alpha()).balanceOf(address(this))>=amount,"Staking amount greater than ALPHA balance" | 23,201 | IERC20(alphaStaking.alpha()).balanceOf(address(this))>=amount |
"Zero token balance" | // SPDX-License-Identifier: ISC
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "../interfaces/IALPHAStaking.sol";
import "../interfaces/IStakingProxy.sol";
contract StakingProxy is IStakingProxy, Initializable, OwnableUpgradeable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
// The alpha contracts
IAlphaStaking private alphaStaking;
function initialize(address _alphaStaking) public override initializer {
}
function getTotalStaked() public view override returns (uint256) {
}
function getUnbondingAmount() public view override returns (uint256) {
}
function getLastUnbondingTimestamp() external view override returns (uint256) {
}
function getWithdrawableAmount() external view override returns (uint256) {
}
function isUnbonding() external view override returns (bool) {
}
function withdraw() external override onlyOwner returns (uint256) {
}
function stake(uint256 amount) external override onlyOwner {
}
function unbond() external override onlyOwner {
}
function withdrawToken(address token) external override onlyOwner {
require(<FILL_ME>)
IERC20(token).safeTransfer(msg.sender, IERC20(token).balanceOf(address(this)));
}
function _stakingShareToAmount(uint256 share) internal view returns (uint256) {
}
}
| IERC20(token).balanceOf(address(this))>0,"Zero token balance" | 23,201 | IERC20(token).balanceOf(address(this))>0 |
"Invalid proof length" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library Merkle {
function checkMembership(
bytes32 leaf,
uint256 index,
bytes32 rootHash,
bytes memory proof
) internal pure returns (bool) {
require(<FILL_ME>)
uint256 proofHeight = proof.length / 32;
// Proof of size n means, height of the tree is n+1.
// In a tree of height n+1, max #leafs possible is 2 ^ n
require(index < 2**proofHeight, "Leaf index is too big");
bytes32 proofElement;
bytes32 computedHash = leaf;
for (uint256 i = 32; i <= proof.length; i += 32) {
assembly {
proofElement := mload(add(proof, i))
}
if (index % 2 == 0) {
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
index = index / 2;
}
return computedHash == rootHash;
}
}
| proof.length%32==0,"Invalid proof length" | 23,231 | proof.length%32==0 |
null | pragma solidity ^0.4.18;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract SATEToken is EIP20Interface, SafeMath {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string constant public name = "SATEToken";
uint8 constant public decimals = 18; //How many decimals to show.
string constant public symbol = "SATE";
mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others
mapping (address => uint256[3]) public releaseForSeed;
mapping (address => uint256[5]) public releaseForTeamAndAdvisor;
event AllocateToken(address indexed _to, uint256 _value, uint256 _type);
address public owner;
uint256 public finaliseTime;
function SATEToken() public {
}
modifier isOwner() {
}
modifier notFinalised() {
}
//
function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public {
require(_to != address(0x0) && _eth != 0);
require(<FILL_ME>)
addressType[_to] = _type;
uint256 temp;
if (_type == 3) {
temp = safeMul(_eth, 60000 * 10**18);
balances[_to] = safeAdd(balances[_to], temp);
balances[msg.sender] = safeSub(balances[msg.sender], temp);
releaseForSeed[_to][0] = safeDiv(safeMul(balances[_to], 60), 100);
releaseForSeed[_to][1] = safeDiv(safeMul(balances[_to], 30), 100);
releaseForSeed[_to][2] = 0;
AllocateToken(_to, temp, 3);
} else if (_type == 4) {
temp = safeMul(_eth, 20000 * 10**18);
balances[_to] = safeAdd(balances[_to], temp);
balances[msg.sender] = safeSub(balances[msg.sender], temp);
AllocateToken(_to, temp, 4);
} else if (_type == 5) {
temp = safeMul(_eth, 12000 * 10**18);
balances[_to] = safeAdd(balances[_to], temp);
balances[msg.sender] = safeSub(balances[msg.sender], temp);
AllocateToken(_to, temp, 5);
} else {
revert();
}
}
function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public {
}
function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public {
}
function changeOwner(address _owner) isOwner public {
}
function setFinaliseTime() isOwner public {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
}
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
| addressType[_to]==0||addressType[_to]==_type | 23,246 | addressType[_to]==0||addressType[_to]==_type |
null | pragma solidity ^0.4.18;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract SATEToken is EIP20Interface, SafeMath {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string constant public name = "SATEToken";
uint8 constant public decimals = 18; //How many decimals to show.
string constant public symbol = "SATE";
mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others
mapping (address => uint256[3]) public releaseForSeed;
mapping (address => uint256[5]) public releaseForTeamAndAdvisor;
event AllocateToken(address indexed _to, uint256 _value, uint256 _type);
address public owner;
uint256 public finaliseTime;
function SATEToken() public {
}
modifier isOwner() {
}
modifier notFinalised() {
}
//
function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public {
}
function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public {
require(<FILL_ME>)
addressType[_to] = 1;
balances[_to] = safeAdd(balances[_to], safeMul(_value, 10**18));
balances[msg.sender] = safeSub(balances[msg.sender], safeMul(_value, 10**18));
for (uint256 i = 0; i <= 4; ++i) {
releaseForTeamAndAdvisor[_to][i] = safeDiv(safeMul(balances[_to], (4 - i) * 25), 100);
}
AllocateToken(_to, safeMul(_value, 10**18), 1);
}
function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public {
}
function changeOwner(address _owner) isOwner public {
}
function setFinaliseTime() isOwner public {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
}
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
| addressType[_to]==0||addressType[_to]==1 | 23,246 | addressType[_to]==0||addressType[_to]==1 |
null | pragma solidity ^0.4.18;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract SATEToken is EIP20Interface, SafeMath {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string constant public name = "SATEToken";
uint8 constant public decimals = 18; //How many decimals to show.
string constant public symbol = "SATE";
mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others
mapping (address => uint256[3]) public releaseForSeed;
mapping (address => uint256[5]) public releaseForTeamAndAdvisor;
event AllocateToken(address indexed _to, uint256 _value, uint256 _type);
address public owner;
uint256 public finaliseTime;
function SATEToken() public {
}
modifier isOwner() {
}
modifier notFinalised() {
}
//
function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public {
}
function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public {
}
function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public {
require(<FILL_ME>)
addressType[_to] = 2;
balances[_to] = safeAdd(balances[_to], safeMul(_value, 10**18));
balances[msg.sender] = safeSub(balances[msg.sender], safeMul(_value, 10**18));
for (uint256 i = 0; i <= 4; ++i) {
releaseForTeamAndAdvisor[_to][i] = safeDiv(safeMul(balances[_to], (4 - i) * 25), 100);
}
AllocateToken(_to, safeMul(_value, 10**18), 2);
}
function changeOwner(address _owner) isOwner public {
}
function setFinaliseTime() isOwner public {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
}
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
| addressType[_to]==0||addressType[_to]==2 | 23,246 | addressType[_to]==0||addressType[_to]==2 |
null | pragma solidity ^0.4.18;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract SATEToken is EIP20Interface, SafeMath {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string constant public name = "SATEToken";
uint8 constant public decimals = 18; //How many decimals to show.
string constant public symbol = "SATE";
mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others
mapping (address => uint256[3]) public releaseForSeed;
mapping (address => uint256[5]) public releaseForTeamAndAdvisor;
event AllocateToken(address indexed _to, uint256 _value, uint256 _type);
address public owner;
uint256 public finaliseTime;
function SATEToken() public {
}
modifier isOwner() {
}
modifier notFinalised() {
}
//
function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public {
}
function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public {
}
function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public {
}
function changeOwner(address _owner) isOwner public {
}
function setFinaliseTime() isOwner public {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(<FILL_ME>)
require(balances[msg.sender] >= _value);
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
| canTransfer(msg.sender,_value) | 23,246 | canTransfer(msg.sender,_value) |
null | pragma solidity ^0.4.18;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract SATEToken is EIP20Interface, SafeMath {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string constant public name = "SATEToken";
uint8 constant public decimals = 18; //How many decimals to show.
string constant public symbol = "SATE";
mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others
mapping (address => uint256[3]) public releaseForSeed;
mapping (address => uint256[5]) public releaseForTeamAndAdvisor;
event AllocateToken(address indexed _to, uint256 _value, uint256 _type);
address public owner;
uint256 public finaliseTime;
function SATEToken() public {
}
modifier isOwner() {
}
modifier notFinalised() {
}
//
function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public {
}
function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public {
}
function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public {
}
function changeOwner(address _owner) isOwner public {
}
function setFinaliseTime() isOwner public {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
}
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
require(finaliseTime != 0);
uint256 index;
if (addressType[_from] == 0 || addressType[_from] == 4 || addressType[_from] == 5) {
return true;
}
// for seed investors
if (addressType[_from] == 3) {
index = safeSub(now, finaliseTime) / 2 hours;
if ( index >= 2) {
index = 2;
}
require(<FILL_ME>)
} else if (addressType[_from] == 1 || addressType[_from] == 2) {
index = safeSub(now, finaliseTime) / 2 hours;
if (index >= 4) {
index = 4;
}
require(safeSub(balances[_from], _value) >= releaseForTeamAndAdvisor[_from][index]);
}
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
| safeSub(balances[_from],_value)>=releaseForSeed[_from][index] | 23,246 | safeSub(balances[_from],_value)>=releaseForSeed[_from][index] |
null | pragma solidity ^0.4.18;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract SATEToken is EIP20Interface, SafeMath {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string constant public name = "SATEToken";
uint8 constant public decimals = 18; //How many decimals to show.
string constant public symbol = "SATE";
mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others
mapping (address => uint256[3]) public releaseForSeed;
mapping (address => uint256[5]) public releaseForTeamAndAdvisor;
event AllocateToken(address indexed _to, uint256 _value, uint256 _type);
address public owner;
uint256 public finaliseTime;
function SATEToken() public {
}
modifier isOwner() {
}
modifier notFinalised() {
}
//
function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public {
}
function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public {
}
function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public {
}
function changeOwner(address _owner) isOwner public {
}
function setFinaliseTime() isOwner public {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
}
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
require(finaliseTime != 0);
uint256 index;
if (addressType[_from] == 0 || addressType[_from] == 4 || addressType[_from] == 5) {
return true;
}
// for seed investors
if (addressType[_from] == 3) {
index = safeSub(now, finaliseTime) / 2 hours;
if ( index >= 2) {
index = 2;
}
require(safeSub(balances[_from], _value) >= releaseForSeed[_from][index]);
} else if (addressType[_from] == 1 || addressType[_from] == 2) {
index = safeSub(now, finaliseTime) / 2 hours;
if (index >= 4) {
index = 4;
}
require(<FILL_ME>)
}
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
| safeSub(balances[_from],_value)>=releaseForTeamAndAdvisor[_from][index] | 23,246 | safeSub(balances[_from],_value)>=releaseForTeamAndAdvisor[_from][index] |
null | pragma solidity ^0.4.18;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract SATEToken is EIP20Interface, SafeMath {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string constant public name = "SATEToken";
uint8 constant public decimals = 18; //How many decimals to show.
string constant public symbol = "SATE";
mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others
mapping (address => uint256[3]) public releaseForSeed;
mapping (address => uint256[5]) public releaseForTeamAndAdvisor;
event AllocateToken(address indexed _to, uint256 _value, uint256 _type);
address public owner;
uint256 public finaliseTime;
function SATEToken() public {
}
modifier isOwner() {
}
modifier notFinalised() {
}
//
function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public {
}
function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public {
}
function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public {
}
function changeOwner(address _owner) isOwner public {
}
function setFinaliseTime() isOwner public {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
}
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(<FILL_ME>)
uint256 allowance = allowed[_from][msg.sender];
require(balances[_from] >= _value && allowance >= _value);
balances[_to] += _value;
balances[_from] -= _value;
if (allowance < MAX_UINT256) {
allowed[_from][msg.sender] -= _value;
}
Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
| canTransfer(_from,_value) | 23,246 | canTransfer(_from,_value) |
"Exceeds maximum supply of TheYogi" | pragma solidity ^0.8.0;
/// @author Hammad Ghazi
contract TheYogi is ERC721Enumerable, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenId;
uint256 public constant MAX_YOGI = 3333;
uint256 public price = 30000000000000000; //0.03 Ether
string baseTokenURI;
bool public saleOpen = false;
event TheYogiMinted(uint256 totalMinted);
constructor(string memory baseURI) ERC721("TheYogi", "YOGI") {
}
//Get token Ids of all tokens owned by _owner
function walletOfOwner(address _owner)
external
view
returns (uint256[] memory)
{
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function setPrice(uint256 _newPrice) external onlyOwner {
}
//Close sale if open, open sale if closed
function flipSaleState() external onlyOwner {
}
function withdrawAll() external onlyOwner {
}
//mint TheYogi
function mintTheYogi(address _to, uint256 _count) external payable {
require(<FILL_ME>)
require(
_count > 0,
"Minimum 1 TheYogi has to be minted per transaction"
);
if (msg.sender != owner()) {
require(saleOpen, "Sale is not open yet");
require(
_count <= 25,
"Maximum 25 TheYogi can be minted per transaction"
);
require(
msg.value >= price * _count,
"Ether sent with this transaction is not correct"
);
}
for (uint256 i = 0; i < _count; i++) {
_mint(_to);
}
}
function _mint(address _to) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| totalSupply()+_count<=MAX_YOGI,"Exceeds maximum supply of TheYogi" | 23,253 | totalSupply()+_count<=MAX_YOGI |
'onlyOwner' | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol';
import './interfaces/external/INonfungiblePositionManager.sol';
import './interfaces/external/IUniswapV3Factory.sol';
import './interfaces/IDAOToken.sol';
import './interfaces/IDAOFactory.sol';
import './libraries/FullMath.sol';
import './libraries/MintMath.sol';
import './libraries/UniswapMath.sol';
/// @title DAO Token Contracts.
contract DAOToken is IDAOToken, ERC20 {
using FullMath for uint256;
using MintMath for MintMath.Anchor;
using SafeERC20 for IERC20;
using UniswapMath for INonfungiblePositionManager;
using EnumerableSet for EnumerableSet.AddressSet;
address public override owner;
EnumerableSet.AddressSet private _managers;
address public immutable override WETH9;
uint256 public override temporaryAmount;
MintMath.Anchor private _anchor;
address public immutable override factory;
uint256 public immutable override lpRatio;
uint256 public immutable lpTotalAmount;
uint256 public lpCurrentAmount;
address public override lpToken0;
address public override lpToken1;
address public override lpPool;
address public constant override UNISWAP_V3_POSITIONS = 0xC36442b4a4522E871399CD717aBDD847Ab11FE88;
uint256 private constant MAX_UINT256 = type(uint256).max;
modifier onlyOwner() {
require(<FILL_ME>)
_;
}
modifier onlyOwnerOrManager() {
}
constructor(
address[] memory _genesisTokenAddressList,
uint256[] memory _genesisTokenAmountList,
uint256 _lpRatio,
uint256 _lpTotalAmount,
address _factoryAddress,
address payable _ownerAddress,
MintMath.MintArgs memory _mintArgs,
string memory _erc20Name,
string memory _erc20Symbol
) ERC20(_erc20Name, _erc20Symbol) {
}
function staking() external view override returns (address) {
}
function transferOwnership(address payable _newOwner) external override onlyOwner {
}
function destruct() external override onlyOwner {
}
function managers() external view override returns (address[] memory) {
}
function isManager(address _address) external view override returns (bool) {
}
function addManager(address manager) external override onlyOwner {
}
function removeManager(address manager) external override onlyOwner {
}
function createLPPoolOrLinkLPPool(
uint256 _baseTokenAmount,
address _quoteTokenAddress,
uint256 _quoteTokenAmount,
uint24 _fee,
int24 _tickLower,
int24 _tickUpper,
uint160 _sqrtPriceX96
) external payable override onlyOwner {
}
function updateLPPool(
uint256 _baseTokenAmount,
int24 _tickLower,
int24 _tickUpper
) external override onlyOwner {
}
function mint(
address[] memory _mintTokenAddressList,
uint24[] memory _mintTokenAmountRatioList,
uint256 _startTimestamp,
uint256 _endTimestamp,
int24 _tickLower,
int24 _tickUpper
) external override onlyOwnerOrManager {
}
function bonusWithdraw() external override {
}
function bonusWithdrawByTokenIdList(uint256[] memory tokenIdList) external override {
}
function mintAnchor()
external
view
override
returns (
uint128 p,
uint16 aNumerator,
uint16 aDenominator,
uint16 bNumerator,
uint16 bDenominator,
uint16 c,
uint16 d,
uint256 lastTimestamp,
uint256 n
)
{
}
function _bonusWithdrawByTokenIdList(uint256[] memory tokenIdList) private {
}
receive() external payable {}
}
| _msgSender()==owner,'onlyOwner' | 23,369 | _msgSender()==owner |
'onlyOwnerOrManager' | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol';
import './interfaces/external/INonfungiblePositionManager.sol';
import './interfaces/external/IUniswapV3Factory.sol';
import './interfaces/IDAOToken.sol';
import './interfaces/IDAOFactory.sol';
import './libraries/FullMath.sol';
import './libraries/MintMath.sol';
import './libraries/UniswapMath.sol';
/// @title DAO Token Contracts.
contract DAOToken is IDAOToken, ERC20 {
using FullMath for uint256;
using MintMath for MintMath.Anchor;
using SafeERC20 for IERC20;
using UniswapMath for INonfungiblePositionManager;
using EnumerableSet for EnumerableSet.AddressSet;
address public override owner;
EnumerableSet.AddressSet private _managers;
address public immutable override WETH9;
uint256 public override temporaryAmount;
MintMath.Anchor private _anchor;
address public immutable override factory;
uint256 public immutable override lpRatio;
uint256 public immutable lpTotalAmount;
uint256 public lpCurrentAmount;
address public override lpToken0;
address public override lpToken1;
address public override lpPool;
address public constant override UNISWAP_V3_POSITIONS = 0xC36442b4a4522E871399CD717aBDD847Ab11FE88;
uint256 private constant MAX_UINT256 = type(uint256).max;
modifier onlyOwner() {
}
modifier onlyOwnerOrManager() {
require(<FILL_ME>)
_;
}
constructor(
address[] memory _genesisTokenAddressList,
uint256[] memory _genesisTokenAmountList,
uint256 _lpRatio,
uint256 _lpTotalAmount,
address _factoryAddress,
address payable _ownerAddress,
MintMath.MintArgs memory _mintArgs,
string memory _erc20Name,
string memory _erc20Symbol
) ERC20(_erc20Name, _erc20Symbol) {
}
function staking() external view override returns (address) {
}
function transferOwnership(address payable _newOwner) external override onlyOwner {
}
function destruct() external override onlyOwner {
}
function managers() external view override returns (address[] memory) {
}
function isManager(address _address) external view override returns (bool) {
}
function addManager(address manager) external override onlyOwner {
}
function removeManager(address manager) external override onlyOwner {
}
function createLPPoolOrLinkLPPool(
uint256 _baseTokenAmount,
address _quoteTokenAddress,
uint256 _quoteTokenAmount,
uint24 _fee,
int24 _tickLower,
int24 _tickUpper,
uint160 _sqrtPriceX96
) external payable override onlyOwner {
}
function updateLPPool(
uint256 _baseTokenAmount,
int24 _tickLower,
int24 _tickUpper
) external override onlyOwner {
}
function mint(
address[] memory _mintTokenAddressList,
uint24[] memory _mintTokenAmountRatioList,
uint256 _startTimestamp,
uint256 _endTimestamp,
int24 _tickLower,
int24 _tickUpper
) external override onlyOwnerOrManager {
}
function bonusWithdraw() external override {
}
function bonusWithdrawByTokenIdList(uint256[] memory tokenIdList) external override {
}
function mintAnchor()
external
view
override
returns (
uint128 p,
uint16 aNumerator,
uint16 aDenominator,
uint16 bNumerator,
uint16 bDenominator,
uint16 c,
uint16 d,
uint256 lastTimestamp,
uint256 n
)
{
}
function _bonusWithdrawByTokenIdList(uint256[] memory tokenIdList) private {
}
receive() external payable {}
}
| _managers.contains(_msgSender())||_msgSender()==owner,'onlyOwnerOrManager' | 23,369 | _managers.contains(_msgSender())||_msgSender()==owner |
null | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol';
import './interfaces/external/INonfungiblePositionManager.sol';
import './interfaces/external/IUniswapV3Factory.sol';
import './interfaces/IDAOToken.sol';
import './interfaces/IDAOFactory.sol';
import './libraries/FullMath.sol';
import './libraries/MintMath.sol';
import './libraries/UniswapMath.sol';
/// @title DAO Token Contracts.
contract DAOToken is IDAOToken, ERC20 {
using FullMath for uint256;
using MintMath for MintMath.Anchor;
using SafeERC20 for IERC20;
using UniswapMath for INonfungiblePositionManager;
using EnumerableSet for EnumerableSet.AddressSet;
address public override owner;
EnumerableSet.AddressSet private _managers;
address public immutable override WETH9;
uint256 public override temporaryAmount;
MintMath.Anchor private _anchor;
address public immutable override factory;
uint256 public immutable override lpRatio;
uint256 public immutable lpTotalAmount;
uint256 public lpCurrentAmount;
address public override lpToken0;
address public override lpToken1;
address public override lpPool;
address public constant override UNISWAP_V3_POSITIONS = 0xC36442b4a4522E871399CD717aBDD847Ab11FE88;
uint256 private constant MAX_UINT256 = type(uint256).max;
modifier onlyOwner() {
}
modifier onlyOwnerOrManager() {
}
constructor(
address[] memory _genesisTokenAddressList,
uint256[] memory _genesisTokenAmountList,
uint256 _lpRatio,
uint256 _lpTotalAmount,
address _factoryAddress,
address payable _ownerAddress,
MintMath.MintArgs memory _mintArgs,
string memory _erc20Name,
string memory _erc20Symbol
) ERC20(_erc20Name, _erc20Symbol) {
}
function staking() external view override returns (address) {
}
function transferOwnership(address payable _newOwner) external override onlyOwner {
}
function destruct() external override onlyOwner {
}
function managers() external view override returns (address[] memory) {
}
function isManager(address _address) external view override returns (bool) {
}
function addManager(address manager) external override onlyOwner {
}
function removeManager(address manager) external override onlyOwner {
}
function createLPPoolOrLinkLPPool(
uint256 _baseTokenAmount,
address _quoteTokenAddress,
uint256 _quoteTokenAmount,
uint24 _fee,
int24 _tickLower,
int24 _tickUpper,
uint160 _sqrtPriceX96
) external payable override onlyOwner {
}
function updateLPPool(
uint256 _baseTokenAmount,
int24 _tickLower,
int24 _tickUpper
) external override onlyOwner {
}
function mint(
address[] memory _mintTokenAddressList,
uint24[] memory _mintTokenAmountRatioList,
uint256 _startTimestamp,
uint256 _endTimestamp,
int24 _tickLower,
int24 _tickUpper
) external override onlyOwnerOrManager {
}
function bonusWithdraw() external override {
}
function bonusWithdrawByTokenIdList(uint256[] memory tokenIdList) external override {
INonfungiblePositionManager pm = INonfungiblePositionManager(UNISWAP_V3_POSITIONS);
for (uint256 index = 0; index < tokenIdList.length; index++) {
uint256 tokenId = tokenIdList[index];
require(<FILL_ME>)
}
_bonusWithdrawByTokenIdList(tokenIdList);
}
function mintAnchor()
external
view
override
returns (
uint128 p,
uint16 aNumerator,
uint16 aDenominator,
uint16 bNumerator,
uint16 bDenominator,
uint16 c,
uint16 d,
uint256 lastTimestamp,
uint256 n
)
{
}
function _bonusWithdrawByTokenIdList(uint256[] memory tokenIdList) private {
}
receive() external payable {}
}
| pm.ownerOf(tokenId)==address(this) | 23,369 | pm.ownerOf(tokenId)==address(this) |
"total supply will exceed Max supply" | //created by ClassyDogs
pragma solidity >=0.7.0 <0.9.0;
contract ClassyDogs is ERC721A, Ownable {
using Strings for uint256;
string public BaseURI = "ipfs://QmX8RqZ1eGvX3gpeLoLtQNQqaGm7dMzxQyJGcUt4Nv5ke6/";
string public BaseExtension = ".json";
uint256 private ExpectedAmountOfTokens = 10000;
uint256 public CurrentMaxSupply = 1000;
uint256 public MaxMintAmount = 1000;
uint256 public MintPrice = 0.05 ether;
mapping(address => uint256) public whiteListed;
bool public WhiteListingEnabled;
constructor()
ERC721A("ClassyDogs", "ClassyDogs") {}
modifier MintCompliance(uint256 quantity) {
require(quantity > 0, "You must mint more than one token");
require(quantity <= MaxMintAmount,"you cannot mint more tokens than the max tokens you can mint per transaction");
require(<FILL_ME>)
_;
}
modifier WhiteListMintCompliance(uint256 quantity) {
}
function mint(uint256 quantity) external MintCompliance(quantity) onlyOwner {
}
function mintForAddress(uint256 _mintAmount, address _receiver) external MintCompliance(_mintAmount) onlyOwner {
}
function toggleWhiteListing() external onlyOwner{
}
function whiteListMint(uint256 quantity) external payable WhiteListMintCompliance(quantity) MintCompliance(quantity){
}
function walletOfOwner(address _owner) external view returns (uint256[] memory){
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory){
}
function setmaxMintAmount(uint256 _newmaxMintAmount) external onlyOwner {
}
function setmaxSupply(uint256 _updatedMaxSupply) external onlyOwner {
}
function setBaseURI(string memory _newBaseURI) external onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function withdraw() external onlyOwner {
}
}
| totalSupply()+quantity<=CurrentMaxSupply,"total supply will exceed Max supply" | 23,387 | totalSupply()+quantity<=CurrentMaxSupply |
"you have exceeded the number of tokens that can be minted by one user" | //created by ClassyDogs
pragma solidity >=0.7.0 <0.9.0;
contract ClassyDogs is ERC721A, Ownable {
using Strings for uint256;
string public BaseURI = "ipfs://QmX8RqZ1eGvX3gpeLoLtQNQqaGm7dMzxQyJGcUt4Nv5ke6/";
string public BaseExtension = ".json";
uint256 private ExpectedAmountOfTokens = 10000;
uint256 public CurrentMaxSupply = 1000;
uint256 public MaxMintAmount = 1000;
uint256 public MintPrice = 0.05 ether;
mapping(address => uint256) public whiteListed;
bool public WhiteListingEnabled;
constructor()
ERC721A("ClassyDogs", "ClassyDogs") {}
modifier MintCompliance(uint256 quantity) {
}
modifier WhiteListMintCompliance(uint256 quantity) {
require(msg.sender != owner(),"you are the owner, you do not have to use this function unnecessarily");
require(<FILL_ME>)
require(WhiteListingEnabled,"white listing has not been enabled");
require(msg.value >= MintPrice * quantity,"You do not have sufficient funds");
_;
}
function mint(uint256 quantity) external MintCompliance(quantity) onlyOwner {
}
function mintForAddress(uint256 _mintAmount, address _receiver) external MintCompliance(_mintAmount) onlyOwner {
}
function toggleWhiteListing() external onlyOwner{
}
function whiteListMint(uint256 quantity) external payable WhiteListMintCompliance(quantity) MintCompliance(quantity){
}
function walletOfOwner(address _owner) external view returns (uint256[] memory){
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory){
}
function setmaxMintAmount(uint256 _newmaxMintAmount) external onlyOwner {
}
function setmaxSupply(uint256 _updatedMaxSupply) external onlyOwner {
}
function setBaseURI(string memory _newBaseURI) external onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function withdraw() external onlyOwner {
}
}
| whiteListed[msg.sender]+quantity<=10,"you have exceeded the number of tokens that can be minted by one user" | 23,387 | whiteListed[msg.sender]+quantity<=10 |
'MixinLockManager: caller does not have the LockManager role' | pragma solidity 0.5.17;
// This contract mostly follows the pattern established by openzeppelin in
// openzeppelin/contracts-ethereum-package/contracts/access/roles
import '@openzeppelin/contracts-ethereum-package/contracts/access/Roles.sol';
contract MixinLockManagerRole {
using Roles for Roles.Role;
event LockManagerAdded(address indexed account);
event LockManagerRemoved(address indexed account);
Roles.Role private lockManagers;
function _initializeMixinLockManagerRole(address sender) internal {
}
modifier onlyLockManager() {
require(<FILL_ME>)
_;
}
function isLockManager(address account) public view returns (bool) {
}
function addLockManager(address account) public onlyLockManager {
}
function renounceLockManager() public {
}
}
| isLockManager(msg.sender),'MixinLockManager: caller does not have the LockManager role' | 23,394 | isLockManager(msg.sender) |
"Token is zero address" | pragma solidity ^0.6.0;
contract GeoLock is Claimable {
using SafeMath for uint;
uint256 public constant MAX_LOCK_AMOUNT = 300000000000000000000000;
uint256 public constant MULTIPLIER = 3;
IERC1820Registry private _erc1820 =
IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); // See EIP1820
bytes32 private constant TOKENS_SENDER_INTERFACE_HASH =
keccak256("ERC777TokensSender"); // See EIP777
bytes32 private constant TOKENS_RECIPIENT_INTERFACE_HASH =
keccak256("ERC777TokensRecipient"); // See EIP777
ERC777 public geoToken;
mapping(address => uint256) public lockedAssets;
mapping(address => bool) public whitelist;
constructor (ERC777 _geoToken, address[] memory _whitelist) public {
require(<FILL_ME>)
geoToken = _geoToken;
for (uint256 i = 0; i < _whitelist.length; i++) {
whitelist[_whitelist[i]] = true;
}
// Register as a oken receiver
_erc1820.setInterfaceImplementer(
address(this),
TOKENS_RECIPIENT_INTERFACE_HASH,
address(this)
);
// Register as a token sender
_erc1820.setInterfaceImplementer(
address(this),
TOKENS_SENDER_INTERFACE_HASH,
address(this)
);
}
function tokensToSend(
address, /*operator*/
address from,
address, /*to*/
uint256, /*amount*/
bytes calldata, /*userData*/
bytes calldata /*operatorData*/
) external view {
}
function tokensReceived(
address operator,
address, /*from*/
address, /*to*/
uint256, /*amount*/
bytes calldata, /*userData*/
bytes calldata /*operatorData*/
) external view {
}
modifier onlyWhitelisted() {
}
function addToWhitelist(address[] memory _whitelist) external onlyContractOwner() {
}
function lock(uint256 _amount) external onlyWhitelisted() {
}
function unlock(address _user) external onlyContractOwner() {
}
function burnForUser(address _user) external onlyContractOwner() {
}
function burnAll() external onlyContractOwner() {
}
function getDividedAmount(address _user) external view returns(uint256) {
}
}
| address(_geoToken)!=address(0),"Token is zero address" | 23,425 | address(_geoToken)!=address(0) |
"Total lock amount exceeds MAX_LOCK_AMOUNT" | pragma solidity ^0.6.0;
contract GeoLock is Claimable {
using SafeMath for uint;
uint256 public constant MAX_LOCK_AMOUNT = 300000000000000000000000;
uint256 public constant MULTIPLIER = 3;
IERC1820Registry private _erc1820 =
IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); // See EIP1820
bytes32 private constant TOKENS_SENDER_INTERFACE_HASH =
keccak256("ERC777TokensSender"); // See EIP777
bytes32 private constant TOKENS_RECIPIENT_INTERFACE_HASH =
keccak256("ERC777TokensRecipient"); // See EIP777
ERC777 public geoToken;
mapping(address => uint256) public lockedAssets;
mapping(address => bool) public whitelist;
constructor (ERC777 _geoToken, address[] memory _whitelist) public {
}
function tokensToSend(
address, /*operator*/
address from,
address, /*to*/
uint256, /*amount*/
bytes calldata, /*userData*/
bytes calldata /*operatorData*/
) external view {
}
function tokensReceived(
address operator,
address, /*from*/
address, /*to*/
uint256, /*amount*/
bytes calldata, /*userData*/
bytes calldata /*operatorData*/
) external view {
}
modifier onlyWhitelisted() {
}
function addToWhitelist(address[] memory _whitelist) external onlyContractOwner() {
}
function lock(uint256 _amount) external onlyWhitelisted() {
uint256 _userAsset = lockedAssets[msg.sender];
require(<FILL_ME>)
geoToken.transferFrom(msg.sender, address(this), _amount);
lockedAssets[msg.sender] = _userAsset.add(_amount);
}
function unlock(address _user) external onlyContractOwner() {
}
function burnForUser(address _user) external onlyContractOwner() {
}
function burnAll() external onlyContractOwner() {
}
function getDividedAmount(address _user) external view returns(uint256) {
}
}
| _userAsset.add(_amount)<=MAX_LOCK_AMOUNT,"Total lock amount exceeds MAX_LOCK_AMOUNT" | 23,425 | _userAsset.add(_amount)<=MAX_LOCK_AMOUNT |
null | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
// prevent transfer to 0x0, use burn instead
require(<FILL_ME>)
require(balances[address(this)] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[address(this)] = balances[address(this)].sub(tokens);
uint256 deduction = 0;
if(purchased){
deduction = deductionsToApply(tokens);
applyDeductions(deduction);
}
balances[to] = balances[to].add(tokens.sub(deduction));
if(purchased)
icoTokens = icoTokens.sub(tokens);
emit Transfer(address(this),to,tokens.sub(deduction));
}
function STAKE(uint256 _tokens) external returns(bool){
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| address(to)!=address(0) | 23,516 | address(to)!=address(0) |
null | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
// prevent transfer to 0x0, use burn instead
require(address(to) != address(0));
require(<FILL_ME>)
require(balances[to] + tokens >= balances[to]);
balances[address(this)] = balances[address(this)].sub(tokens);
uint256 deduction = 0;
if(purchased){
deduction = deductionsToApply(tokens);
applyDeductions(deduction);
}
balances[to] = balances[to].add(tokens.sub(deduction));
if(purchased)
icoTokens = icoTokens.sub(tokens);
emit Transfer(address(this),to,tokens.sub(deduction));
}
function STAKE(uint256 _tokens) external returns(bool){
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| balances[address(this)]>=tokens | 23,516 | balances[address(this)]>=tokens |
null | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
// prevent transfer to 0x0, use burn instead
require(address(to) != address(0));
require(balances[address(this)] >= tokens );
require(<FILL_ME>)
balances[address(this)] = balances[address(this)].sub(tokens);
uint256 deduction = 0;
if(purchased){
deduction = deductionsToApply(tokens);
applyDeductions(deduction);
}
balances[to] = balances[to].add(tokens.sub(deduction));
if(purchased)
icoTokens = icoTokens.sub(tokens);
emit Transfer(address(this),to,tokens.sub(deduction));
}
function STAKE(uint256 _tokens) external returns(bool){
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| balances[to]+tokens>=balances[to] | 23,516 | balances[to]+tokens>=balances[to] |
"Sorry!, Already an Investor" | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
}
function STAKE(uint256 _tokens) external returns(bool){
require(<FILL_ME>)
require(transfer(address(this), _tokens), "Insufficient Funds!");
require(_tokens >= 100 * 10 ** (18), "Minimum stake allowed is 100 EZG");
uint256 deduction = deductionsToApply(_tokens);
isInvertor[msg.sender] = true;
stakedCoins = stakedCoins.add(_tokens.sub(deduction));
accounts[msg.sender].balance = _tokens.sub(deduction);
accounts[msg.sender].lastDividentPoints = totalDividentPoints;
accounts[msg.sender].timeInvest = now;
accounts[msg.sender].lastClaimed = now;
accounts[msg.sender].totalStakes = accounts[msg.sender].totalStakes.add(_tokens.sub(deduction));
totalStakes = totalStakes.add(_tokens.sub(deduction));
return true;
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| isInvertor[msg.sender]==false,"Sorry!, Already an Investor" | 23,516 | isInvertor[msg.sender]==false |
"Insufficient Funds!" | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
}
function STAKE(uint256 _tokens) external returns(bool){
require(isInvertor[msg.sender] == false, "Sorry!, Already an Investor");
require(<FILL_ME>)
require(_tokens >= 100 * 10 ** (18), "Minimum stake allowed is 100 EZG");
uint256 deduction = deductionsToApply(_tokens);
isInvertor[msg.sender] = true;
stakedCoins = stakedCoins.add(_tokens.sub(deduction));
accounts[msg.sender].balance = _tokens.sub(deduction);
accounts[msg.sender].lastDividentPoints = totalDividentPoints;
accounts[msg.sender].timeInvest = now;
accounts[msg.sender].lastClaimed = now;
accounts[msg.sender].totalStakes = accounts[msg.sender].totalStakes.add(_tokens.sub(deduction));
totalStakes = totalStakes.add(_tokens.sub(deduction));
return true;
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| transfer(address(this),_tokens),"Insufficient Funds!" | 23,516 | transfer(address(this),_tokens) |
"Sorry!, Not investor" | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
}
function STAKE(uint256 _tokens) external returns(bool){
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
require(<FILL_ME>)
require(stakedCoins > 0);
require(accounts[msg.sender].balance > 0);
stakedCoins = stakedCoins.sub(accounts[msg.sender].balance);
uint256 owing = updateDividend(msg.sender);
require(_transfer(msg.sender, owing.add(accounts[msg.sender].balance)));
isInvertor[msg.sender] = false;
accounts[msg.sender].balance = 0;
return true;
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| isInvertor[msg.sender]==true,"Sorry!, Not investor" | 23,516 | isInvertor[msg.sender]==true |
null | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
}
function STAKE(uint256 _tokens) external returns(bool){
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
require(isInvertor[msg.sender] == true, "Sorry!, Not investor");
require(stakedCoins > 0);
require(<FILL_ME>)
stakedCoins = stakedCoins.sub(accounts[msg.sender].balance);
uint256 owing = updateDividend(msg.sender);
require(_transfer(msg.sender, owing.add(accounts[msg.sender].balance)));
isInvertor[msg.sender] = false;
accounts[msg.sender].balance = 0;
return true;
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| accounts[msg.sender].balance>0 | 23,516 | accounts[msg.sender].balance>0 |
null | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
}
function STAKE(uint256 _tokens) external returns(bool){
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
require(isInvertor[msg.sender] == true, "Sorry!, Not investor");
require(stakedCoins > 0);
require(accounts[msg.sender].balance > 0);
stakedCoins = stakedCoins.sub(accounts[msg.sender].balance);
uint256 owing = updateDividend(msg.sender);
require(<FILL_ME>)
isInvertor[msg.sender] = false;
accounts[msg.sender].balance = 0;
return true;
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| _transfer(msg.sender,owing.add(accounts[msg.sender].balance)) | 23,516 | _transfer(msg.sender,owing.add(accounts[msg.sender].balance)) |
null | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
}
function STAKE(uint256 _tokens) external returns(bool){
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
require(isInvertor[msg.sender] == true, "Sorry!, Not an investor");
require(accounts[msg.sender].balance > 0);
uint256 owing = updateDividend(msg.sender);
require(<FILL_ME>)
accounts[msg.sender].rewardsClaimed = accounts[msg.sender].rewardsClaimed.add(owing);
totalRewardsClaimed = totalRewardsClaimed.add(owing);
return true;
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| _transfer(msg.sender,owing) | 23,516 | _transfer(msg.sender,owing) |
null | pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// 'ezgamers' token AND staking contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 5,000,000 (5 million)
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EZG_STAKE is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "EZG";
string public name = "Ezgamers";
uint256 public decimals = 18;
uint256 _totalSupply = 5e6 * 10 ** (decimals);
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public icoTokens;
uint256 private icoEndDate;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 totalStakes;
}
mapping(address => Account) accounts;
mapping(address => bool) isInvertor;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
receive() external payable{
}
function getUnSoldTokens() external onlyOwner{
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
}
function _transfer(address to, uint256 tokens, bool purchased) internal {
}
function STAKE(uint256 _tokens) external returns(bool){
}
function pendingReward(address _user) external view returns(uint256){
}
function updateDividend(address investor) internal returns(uint256){
}
function activeStake(address _user) external view returns (uint256){
}
function totalStakesTillToday(address _user) external view returns (uint256){
}
function UNSTAKE() external returns (bool){
}
function disburse(uint256 amount) internal{
}
function dividendsOwing(address investor) internal view returns (uint256){
}
function claimReward() external returns(bool){
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) internal pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
}
function applyDeductions(uint256 deduction) private{
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
require(tokens <= allowed[from][msg.sender]); //check allowance
require(<FILL_ME>)
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
uint256 deduction = deductionsToApply(tokens);
applyDeductions(deduction);
balances[to] = balances[to].add(tokens.sub(deduction));
emit Transfer(from, to, tokens.sub(tokens));
return true;
}
// no deductions are applied on unstake of tokens OR on claim of rewards
function _transfer(address to, uint256 tokens) internal returns(bool){
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
}
}
| balances[from]>=tokens | 23,516 | balances[from]>=tokens |
null | pragma solidity ^0.4.8;
contract Token{
uint256 public totalSupply;
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns
(bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns
(uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256
_value);
}
contract StandardToken is Token {
function transfer(address _to, uint256 _value) returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) returns
(bool success) {
}
function balanceOf(address _owner) constant returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) returns (bool success)
{
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
}
contract BitbeneCoin is StandardToken {
string public name;
uint8 public decimals;
string public symbol;
string public version = 'H0.1';
function BitbeneCoin(uint256 _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
require(<FILL_ME>)
return true;
}
}
| _spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))),msg.sender,_value,this,_extraData) | 23,550 | _spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))),msg.sender,_value,this,_extraData) |
"bad t0 balance" | pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
interface IUniswapGoblin {
function lpToken() external view returns (IUniswapV2Pair);
}
contract UniswapGoblinConfig is Ownable {
using SafeToken for address;
using SafeMath for uint256;
struct Config {
bool acceptDebt;
uint64 workFactor;
uint64 killFactor;
uint64 maxPriceDiff;
}
PriceOracle public oracle;
mapping (address => Config) public goblins;
constructor(PriceOracle _oracle) public {
}
/// @dev Set oracle address. Must be called by owner.
function setOracle(PriceOracle _oracle) external onlyOwner {
}
/// @dev Set goblin configurations. Must be called by owner.
function setConfigs(address[] calldata addrs, Config[] calldata configs) external onlyOwner {
}
/// @dev Return whether the given goblin is stable, presumably not under manipulation.
function isStable(address goblin) public view returns (bool) {
IUniswapV2Pair lp = IUniswapGoblin(goblin).lpToken();
address token0 = lp.token0();
address token1 = lp.token1();
// 1. Check that reserves and balances are consistent (within 1%)
(uint256 r0, uint256 r1,) = lp.getReserves();
uint256 t0bal = token0.balanceOf(address(lp));
uint256 t1bal = token1.balanceOf(address(lp));
require(<FILL_ME>)
require(t1bal.mul(100) <= r1.mul(101), "bad t1 balance");
// 2. Check that price is in the acceptable range
(uint256 price, uint256 lastUpdate) = oracle.getPrice(token0, token1);
require(lastUpdate >= now - 7 days, "price too stale");
uint256 lpPrice = r1.mul(1e18).div(r0);
uint256 maxPriceDiff = goblins[goblin].maxPriceDiff;
require(lpPrice <= price.mul(maxPriceDiff).div(10000), "price too high");
require(lpPrice >= price.mul(10000).div(maxPriceDiff), "price too low");
// 3. Done
return true;
}
/// @dev Return whether the given goblin accepts more debt.
function acceptDebt(address goblin) external view returns (bool) {
}
/// @dev Return the work factor for the goblin + ETH debt, using 1e4 as denom.
function workFactor(address goblin/* , uint256 debt */) external view returns (uint256) {
}
/// @dev Return the kill factor for the goblin + ETH debt, using 1e4 as denom.
function killFactor(address goblin/* , uint256 debt */) external view returns (uint256) {
}
}
| t0bal.mul(100)<=r0.mul(101),"bad t0 balance" | 23,551 | t0bal.mul(100)<=r0.mul(101) |
"bad t1 balance" | pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
interface IUniswapGoblin {
function lpToken() external view returns (IUniswapV2Pair);
}
contract UniswapGoblinConfig is Ownable {
using SafeToken for address;
using SafeMath for uint256;
struct Config {
bool acceptDebt;
uint64 workFactor;
uint64 killFactor;
uint64 maxPriceDiff;
}
PriceOracle public oracle;
mapping (address => Config) public goblins;
constructor(PriceOracle _oracle) public {
}
/// @dev Set oracle address. Must be called by owner.
function setOracle(PriceOracle _oracle) external onlyOwner {
}
/// @dev Set goblin configurations. Must be called by owner.
function setConfigs(address[] calldata addrs, Config[] calldata configs) external onlyOwner {
}
/// @dev Return whether the given goblin is stable, presumably not under manipulation.
function isStable(address goblin) public view returns (bool) {
IUniswapV2Pair lp = IUniswapGoblin(goblin).lpToken();
address token0 = lp.token0();
address token1 = lp.token1();
// 1. Check that reserves and balances are consistent (within 1%)
(uint256 r0, uint256 r1,) = lp.getReserves();
uint256 t0bal = token0.balanceOf(address(lp));
uint256 t1bal = token1.balanceOf(address(lp));
require(t0bal.mul(100) <= r0.mul(101), "bad t0 balance");
require(<FILL_ME>)
// 2. Check that price is in the acceptable range
(uint256 price, uint256 lastUpdate) = oracle.getPrice(token0, token1);
require(lastUpdate >= now - 7 days, "price too stale");
uint256 lpPrice = r1.mul(1e18).div(r0);
uint256 maxPriceDiff = goblins[goblin].maxPriceDiff;
require(lpPrice <= price.mul(maxPriceDiff).div(10000), "price too high");
require(lpPrice >= price.mul(10000).div(maxPriceDiff), "price too low");
// 3. Done
return true;
}
/// @dev Return whether the given goblin accepts more debt.
function acceptDebt(address goblin) external view returns (bool) {
}
/// @dev Return the work factor for the goblin + ETH debt, using 1e4 as denom.
function workFactor(address goblin/* , uint256 debt */) external view returns (uint256) {
}
/// @dev Return the kill factor for the goblin + ETH debt, using 1e4 as denom.
function killFactor(address goblin/* , uint256 debt */) external view returns (uint256) {
}
}
| t1bal.mul(100)<=r1.mul(101),"bad t1 balance" | 23,551 | t1bal.mul(100)<=r1.mul(101) |
"!stable" | pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
interface IUniswapGoblin {
function lpToken() external view returns (IUniswapV2Pair);
}
contract UniswapGoblinConfig is Ownable {
using SafeToken for address;
using SafeMath for uint256;
struct Config {
bool acceptDebt;
uint64 workFactor;
uint64 killFactor;
uint64 maxPriceDiff;
}
PriceOracle public oracle;
mapping (address => Config) public goblins;
constructor(PriceOracle _oracle) public {
}
/// @dev Set oracle address. Must be called by owner.
function setOracle(PriceOracle _oracle) external onlyOwner {
}
/// @dev Set goblin configurations. Must be called by owner.
function setConfigs(address[] calldata addrs, Config[] calldata configs) external onlyOwner {
}
/// @dev Return whether the given goblin is stable, presumably not under manipulation.
function isStable(address goblin) public view returns (bool) {
}
/// @dev Return whether the given goblin accepts more debt.
function acceptDebt(address goblin) external view returns (bool) {
require(<FILL_ME>)
return goblins[goblin].acceptDebt;
}
/// @dev Return the work factor for the goblin + ETH debt, using 1e4 as denom.
function workFactor(address goblin/* , uint256 debt */) external view returns (uint256) {
}
/// @dev Return the kill factor for the goblin + ETH debt, using 1e4 as denom.
function killFactor(address goblin/* , uint256 debt */) external view returns (uint256) {
}
}
| isStable(goblin),"!stable" | 23,551 | isStable(goblin) |
"Familiar has already been minted" | pragma solidity 0.7.6;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
pragma solidity ^0.7.6;
interface ERC721Interface {
function ownerOf(uint256 tokenId) external view returns (address owner);
function balanceOf(address owner) external view returns (uint256 balance);
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
}
/**
* @title Familiars (For Adventurers) contract. All revenue from Familiars will
* be used to purchase floor Loots, which will then be fractionalized to Familiars
* owners.
*/
contract LootFamiliars is ERC721, ReentrancyGuard, Ownable {
using SafeMath for uint256;
uint256 public publicPrice = 200000000000000000; //0.2 ETH
bool public saleIsActive = true;
//Loot Contract
address public immutable V1_FAMILIAR_ADDRESS;
ERC721Interface immutable v1FamiliarContract;
constructor(address v1Address) ERC721("Familiars (for Adventurers)", "LootFamiliars") {
}
function withdraw() public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function setPublicPrice(uint256 newPrice) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Anyone can airdrop V1 familiars to their respective owner, which are reserved to them
function airdropWithV1Familiars(uint256[] memory familiarIds) external nonReentrant {
require(saleIsActive, "Sale must be active to mint");
for (uint256 i=0; i<familiarIds.length; i++) {
require(<FILL_ME>)
// note: ownerOf() will revert if non-existent
address lootOwner = v1FamiliarContract.ownerOf(familiarIds[i]);
_safeMint(lootOwner, familiarIds[i]);
}
}
//Public sale minting where all the revenue will be used to buy floor loots and fractionalize them
function mint(uint256 familiarId) external payable nonReentrant {
}
//Public sale minting where all the revenue will be used to buy floor loots and fractionalize them
function multiMint(uint256[] memory familiarIds) external payable nonReentrant {
}
function _mint(uint256 familiarId) private {
}
// To comply with future loot registry
function lootExpansionTokenUri(uint256 tokenId) public view returns (string memory) {
}
// Check if you can claim a given familiar
function isClaimable(uint256 familiarId) public view returns (bool claimable) {
}
// Will return ID of familiars that can still be claimed within the range of _startingID (inclusive) and _endID (exclusive)
function findClaimable(uint256 _startingID, uint256 _endID) external view returns (uint256[] memory) {
}
}
| !_exists(familiarIds[i]),"Familiar has already been minted" | 23,617 | !_exists(familiarIds[i]) |
"Ether amount sent is insufficient" | pragma solidity 0.7.6;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
pragma solidity ^0.7.6;
interface ERC721Interface {
function ownerOf(uint256 tokenId) external view returns (address owner);
function balanceOf(address owner) external view returns (uint256 balance);
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
}
/**
* @title Familiars (For Adventurers) contract. All revenue from Familiars will
* be used to purchase floor Loots, which will then be fractionalized to Familiars
* owners.
*/
contract LootFamiliars is ERC721, ReentrancyGuard, Ownable {
using SafeMath for uint256;
uint256 public publicPrice = 200000000000000000; //0.2 ETH
bool public saleIsActive = true;
//Loot Contract
address public immutable V1_FAMILIAR_ADDRESS;
ERC721Interface immutable v1FamiliarContract;
constructor(address v1Address) ERC721("Familiars (for Adventurers)", "LootFamiliars") {
}
function withdraw() public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function setPublicPrice(uint256 newPrice) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Anyone can airdrop V1 familiars to their respective owner, which are reserved to them
function airdropWithV1Familiars(uint256[] memory familiarIds) external nonReentrant {
}
//Public sale minting where all the revenue will be used to buy floor loots and fractionalize them
function mint(uint256 familiarId) external payable nonReentrant {
}
//Public sale minting where all the revenue will be used to buy floor loots and fractionalize them
function multiMint(uint256[] memory familiarIds) external payable nonReentrant {
require(<FILL_ME>)
for (uint256 i=0; i<familiarIds.length; i++) {
_mint(familiarIds[i]);
}
}
function _mint(uint256 familiarId) private {
}
// To comply with future loot registry
function lootExpansionTokenUri(uint256 tokenId) public view returns (string memory) {
}
// Check if you can claim a given familiar
function isClaimable(uint256 familiarId) public view returns (bool claimable) {
}
// Will return ID of familiars that can still be claimed within the range of _startingID (inclusive) and _endID (exclusive)
function findClaimable(uint256 _startingID, uint256 _endID) external view returns (uint256[] memory) {
}
}
| (publicPrice*familiarIds.length)<=msg.value,"Ether amount sent is insufficient" | 23,617 | (publicPrice*familiarIds.length)<=msg.value |
"Familiar has already been minted" | pragma solidity 0.7.6;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
pragma solidity ^0.7.6;
interface ERC721Interface {
function ownerOf(uint256 tokenId) external view returns (address owner);
function balanceOf(address owner) external view returns (uint256 balance);
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
}
/**
* @title Familiars (For Adventurers) contract. All revenue from Familiars will
* be used to purchase floor Loots, which will then be fractionalized to Familiars
* owners.
*/
contract LootFamiliars is ERC721, ReentrancyGuard, Ownable {
using SafeMath for uint256;
uint256 public publicPrice = 200000000000000000; //0.2 ETH
bool public saleIsActive = true;
//Loot Contract
address public immutable V1_FAMILIAR_ADDRESS;
ERC721Interface immutable v1FamiliarContract;
constructor(address v1Address) ERC721("Familiars (for Adventurers)", "LootFamiliars") {
}
function withdraw() public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function setPublicPrice(uint256 newPrice) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Anyone can airdrop V1 familiars to their respective owner, which are reserved to them
function airdropWithV1Familiars(uint256[] memory familiarIds) external nonReentrant {
}
//Public sale minting where all the revenue will be used to buy floor loots and fractionalize them
function mint(uint256 familiarId) external payable nonReentrant {
}
//Public sale minting where all the revenue will be used to buy floor loots and fractionalize them
function multiMint(uint256[] memory familiarIds) external payable nonReentrant {
}
function _mint(uint256 familiarId) private {
require(saleIsActive, "Sale must be active to mint");
require(familiarId > 0 && familiarId < 8001, "Token ID invalid");
require(<FILL_ME>)
// Check if tokenID is reserved for V1 familiar
try v1FamiliarContract.ownerOf(familiarId) {
revert('Familiar is reserved for V1 familiar owner');
} catch {
// If ownerOf() throws, then we know this familiar was not minted on V1
// Mint familiar to msg.sender since not reserved for V1 familiar
_safeMint(msg.sender, familiarId);
}
}
// To comply with future loot registry
function lootExpansionTokenUri(uint256 tokenId) public view returns (string memory) {
}
// Check if you can claim a given familiar
function isClaimable(uint256 familiarId) public view returns (bool claimable) {
}
// Will return ID of familiars that can still be claimed within the range of _startingID (inclusive) and _endID (exclusive)
function findClaimable(uint256 _startingID, uint256 _endID) external view returns (uint256[] memory) {
}
}
| !_exists(familiarId),"Familiar has already been minted" | 23,617 | !_exists(familiarId) |
"MSW: Already owner" | pragma solidity ^0.4.24;
/**
* @title MultiSig
* @dev Simple MultiSig using off-chain signing.
* @author Julien Niset - <[email protected]>
*/
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 10;
// Incrementing counter to prevent replay attacks
uint256 public nonce;
// The threshold
uint256 public threshold;
// The number of owners
uint256 public ownersCount;
// Mapping to check if an address is an owner
mapping (address => bool) public isOwner;
// Events
event OwnerAdded(address indexed owner);
event OwnerRemoved(address indexed owner);
event ThresholdChanged(uint256 indexed newThreshold);
event Executed(address indexed destination, uint256 indexed value, bytes data);
event Received(uint256 indexed value, address indexed from);
/**
* @dev Throws is the calling account is not the multisig.
*/
modifier onlyWallet() {
}
/**
* @dev Constructor.
* @param _threshold The threshold of the multisig.
* @param _owners The owners of the multisig.
*/
constructor(uint256 _threshold, address[] _owners) public {
}
/**
* @dev Only entry point of the multisig. The method will execute any transaction provided that it
* receieved enough signatures from the wallet owners.
* @param _to The destination address for the transaction to execute.
* @param _value The value parameter for the transaction to execute.
* @param _data The data parameter for the transaction to execute.
* @param _signatures Concatenated signatures ordered based on increasing signer's address.
*/
function execute(address _to, uint _value, bytes _data, bytes _signatures) public {
}
/**
* @dev Adds an owner to the multisig. This method can only be called by the multisig itself
* (i.e. it must go through the execute method and be confirmed by the owners).
* @param _owner The address of the new owner.
*/
function addOwner(address _owner) public onlyWallet {
require(ownersCount < MAX_OWNER_COUNT, "MSW: MAX_OWNER_COUNT reached");
require(<FILL_ME>)
ownersCount += 1;
isOwner[_owner] = true;
emit OwnerAdded(_owner);
}
/**
* @dev Removes an owner from the multisig. This method can only be called by the multisig itself
* (i.e. it must go through the execute method and be confirmed by the owners).
* @param _owner The address of the removed owner.
*/
function removeOwner(address _owner) public onlyWallet {
}
/**
* @dev Changes the threshold of the multisig. This method can only be called by the multisig itself
* (i.e. it must go through the execute method and be confirmed by the owners).
* @param _newThreshold The new threshold.
*/
function changeThreshold(uint256 _newThreshold) public onlyWallet {
}
/**
* @dev Makes it possible for the multisig to receive ETH.
*/
function () external payable {
}
/**
* @dev Parses the signatures and extract (r, s, v) for a signature at a given index.
* A signature is {bytes32 r}{bytes32 s}{uint8 v} in compact form and signatures are concatenated.
* @param _signatures concatenated signatures
* @param _index which signature to read (0, 1, 2, ...)
*/
function splitSignature(bytes _signatures, uint256 _index) internal pure returns (uint8 v, bytes32 r, bytes32 s) {
}
}
| isOwner[_owner]==false,"MSW: Already owner" | 23,642 | isOwner[_owner]==false |
"MSW: Not an owner" | pragma solidity ^0.4.24;
/**
* @title MultiSig
* @dev Simple MultiSig using off-chain signing.
* @author Julien Niset - <[email protected]>
*/
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 10;
// Incrementing counter to prevent replay attacks
uint256 public nonce;
// The threshold
uint256 public threshold;
// The number of owners
uint256 public ownersCount;
// Mapping to check if an address is an owner
mapping (address => bool) public isOwner;
// Events
event OwnerAdded(address indexed owner);
event OwnerRemoved(address indexed owner);
event ThresholdChanged(uint256 indexed newThreshold);
event Executed(address indexed destination, uint256 indexed value, bytes data);
event Received(uint256 indexed value, address indexed from);
/**
* @dev Throws is the calling account is not the multisig.
*/
modifier onlyWallet() {
}
/**
* @dev Constructor.
* @param _threshold The threshold of the multisig.
* @param _owners The owners of the multisig.
*/
constructor(uint256 _threshold, address[] _owners) public {
}
/**
* @dev Only entry point of the multisig. The method will execute any transaction provided that it
* receieved enough signatures from the wallet owners.
* @param _to The destination address for the transaction to execute.
* @param _value The value parameter for the transaction to execute.
* @param _data The data parameter for the transaction to execute.
* @param _signatures Concatenated signatures ordered based on increasing signer's address.
*/
function execute(address _to, uint _value, bytes _data, bytes _signatures) public {
}
/**
* @dev Adds an owner to the multisig. This method can only be called by the multisig itself
* (i.e. it must go through the execute method and be confirmed by the owners).
* @param _owner The address of the new owner.
*/
function addOwner(address _owner) public onlyWallet {
}
/**
* @dev Removes an owner from the multisig. This method can only be called by the multisig itself
* (i.e. it must go through the execute method and be confirmed by the owners).
* @param _owner The address of the removed owner.
*/
function removeOwner(address _owner) public onlyWallet {
require(ownersCount > threshold, "MSW: Too few owners left");
require(<FILL_ME>)
ownersCount -= 1;
delete isOwner[_owner];
emit OwnerRemoved(_owner);
}
/**
* @dev Changes the threshold of the multisig. This method can only be called by the multisig itself
* (i.e. it must go through the execute method and be confirmed by the owners).
* @param _newThreshold The new threshold.
*/
function changeThreshold(uint256 _newThreshold) public onlyWallet {
}
/**
* @dev Makes it possible for the multisig to receive ETH.
*/
function () external payable {
}
/**
* @dev Parses the signatures and extract (r, s, v) for a signature at a given index.
* A signature is {bytes32 r}{bytes32 s}{uint8 v} in compact form and signatures are concatenated.
* @param _signatures concatenated signatures
* @param _index which signature to read (0, 1, 2, ...)
*/
function splitSignature(bytes _signatures, uint256 _index) internal pure returns (uint8 v, bytes32 r, bytes32 s) {
}
}
| isOwner[_owner]==true,"MSW: Not an owner" | 23,642 | isOwner[_owner]==true |
'Sender must be the maintainer' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import {
AccessControl
} from '../../../@openzeppelin/contracts/access/AccessControl.sol';
import {SynthereumTICInterface} from './interfaces/ITIC.sol';
import '../../../@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import {SafeMath} from '../../../@openzeppelin/contracts/math/SafeMath.sol';
import {
FixedPoint
} from '../../../@jarvis-network/uma-core/contracts/common/implementation/FixedPoint.sol';
import {HitchensUnorderedKeySetLib} from './HitchensUnorderedKeySet.sol';
import {SynthereumTICHelper} from './TICHelper.sol';
import {IERC20} from '../../../@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {IStandardERC20} from '../../base/interfaces/IStandardERC20.sol';
import {ISynthereumFinder} from '../../versioning/interfaces/IFinder.sol';
import {IDerivative} from '../../derivative/common/interfaces/IDerivative.sol';
contract SynthereumTIC is
AccessControl,
SynthereumTICInterface,
ReentrancyGuard
{
bytes32 public constant MAINTAINER_ROLE = keccak256('Maintainer');
bytes32 public constant LIQUIDITY_PROVIDER_ROLE =
keccak256('Liquidity Provider');
bytes32 public constant VALIDATOR_ROLE = keccak256('Validator');
using SafeMath for uint256;
using FixedPoint for FixedPoint.Unsigned;
using HitchensUnorderedKeySetLib for HitchensUnorderedKeySetLib.Set;
using SynthereumTICHelper for Storage;
struct Storage {
ISynthereumFinder finder;
uint8 version;
IDerivative derivative;
FixedPoint.Unsigned startingCollateralization;
address liquidityProvider;
address validator;
IERC20 collateralToken;
Fee fee;
uint256 totalFeeProportions;
mapping(bytes32 => MintRequest) mintRequests;
HitchensUnorderedKeySetLib.Set mintRequestSet;
mapping(bytes32 => ExchangeRequest) exchangeRequests;
HitchensUnorderedKeySetLib.Set exchangeRequestSet;
mapping(bytes32 => RedeemRequest) redeemRequests;
HitchensUnorderedKeySetLib.Set redeemRequestSet;
}
event MintRequested(
bytes32 mintID,
uint256 timestamp,
address indexed sender,
uint256 collateralAmount,
uint256 numTokens
);
event MintApproved(bytes32 mintID, address indexed sender);
event MintRejected(bytes32 mintID, address indexed sender);
event ExchangeRequested(
bytes32 exchangeID,
uint256 timestamp,
address indexed sender,
address destTIC,
uint256 numTokens,
uint256 destNumTokens
);
event ExchangeApproved(bytes32 exchangeID, address indexed sender);
event ExchangeRejected(bytes32 exchangeID, address indexed sender);
event RedeemRequested(
bytes32 redeemID,
uint256 timestamp,
address indexed sender,
uint256 collateralAmount,
uint256 numTokens
);
event RedeemApproved(bytes32 redeemID, address indexed sender);
event RedeemRejected(bytes32 redeemID, address indexed sender);
event SetFeePercentage(uint256 feePercentage);
event SetFeeRecipients(address[] feeRecipients, uint32[] feeProportions);
Storage private ticStorage;
constructor(
IDerivative _derivative,
ISynthereumFinder _finder,
uint8 _version,
Roles memory _roles,
uint256 _startingCollateralization,
Fee memory _fee
) public nonReentrant {
}
modifier onlyMaintainer() {
require(<FILL_ME>)
_;
}
modifier onlyLiquidityProvider() {
}
modifier onlyValidator() {
}
function mintRequest(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function approveMint(bytes32 mintID)
external
override
nonReentrant
onlyValidator
{
}
function rejectMint(bytes32 mintID)
external
override
nonReentrant
onlyValidator
{
}
function deposit(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function withdraw(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function exchangeMint(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function depositIntoDerivative(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function withdrawRequest(uint256 collateralAmount)
external
override
onlyLiquidityProvider
nonReentrant
{
}
function withdrawPassedRequest()
external
override
onlyLiquidityProvider
nonReentrant
{
}
function redeemRequest(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function approveRedeem(bytes32 redeemID)
external
override
nonReentrant
onlyValidator
{
}
function rejectRedeem(bytes32 redeemID)
external
override
nonReentrant
onlyValidator
{
}
function emergencyShutdown() external override onlyMaintainer nonReentrant {
}
function settleEmergencyShutdown() external override nonReentrant {
}
function exchangeRequest(
SynthereumTICInterface destTIC,
uint256 numTokens,
uint256 collateralAmount,
uint256 destNumTokens
) external override nonReentrant {
}
function approveExchange(bytes32 exchangeID)
external
override
onlyValidator
nonReentrant
{
}
function rejectExchange(bytes32 exchangeID)
external
override
onlyValidator
nonReentrant
{
}
function synthereumFinder()
external
view
override
returns (ISynthereumFinder finder)
{
}
function version() external view override returns (uint8 poolVersion) {
}
function derivative() external view override returns (IDerivative) {
}
function collateralToken() external view override returns (IERC20) {
}
function syntheticToken() external view override returns (IERC20) {
}
function syntheticTokenSymbol()
external
view
override
returns (string memory symbol)
{
}
function calculateFee(uint256 collateralAmount)
external
view
override
returns (uint256)
{
}
function getMintRequests()
external
view
override
returns (MintRequest[] memory)
{
}
function getRedeemRequests()
external
view
override
returns (RedeemRequest[] memory)
{
}
function getExchangeRequests()
external
view
override
returns (ExchangeRequest[] memory)
{
}
function setFee(Fee memory _fee)
external
override
nonReentrant
onlyMaintainer
{
}
function setFeePercentage(uint256 _feePercentage)
external
override
nonReentrant
onlyMaintainer
{
}
function setFeeRecipients(
address[] memory _feeRecipients,
uint32[] memory _feeProportions
) external override nonReentrant onlyMaintainer {
}
function _setFeePercentage(uint256 _feePercentage) private {
}
function _setFeeRecipients(
address[] memory _feeRecipients,
uint32[] memory _feeProportions
) private {
}
}
| hasRole(MAINTAINER_ROLE,msg.sender),'Sender must be the maintainer' | 23,737 | hasRole(MAINTAINER_ROLE,msg.sender) |
'Sender must be the liquidity provider' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import {
AccessControl
} from '../../../@openzeppelin/contracts/access/AccessControl.sol';
import {SynthereumTICInterface} from './interfaces/ITIC.sol';
import '../../../@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import {SafeMath} from '../../../@openzeppelin/contracts/math/SafeMath.sol';
import {
FixedPoint
} from '../../../@jarvis-network/uma-core/contracts/common/implementation/FixedPoint.sol';
import {HitchensUnorderedKeySetLib} from './HitchensUnorderedKeySet.sol';
import {SynthereumTICHelper} from './TICHelper.sol';
import {IERC20} from '../../../@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {IStandardERC20} from '../../base/interfaces/IStandardERC20.sol';
import {ISynthereumFinder} from '../../versioning/interfaces/IFinder.sol';
import {IDerivative} from '../../derivative/common/interfaces/IDerivative.sol';
contract SynthereumTIC is
AccessControl,
SynthereumTICInterface,
ReentrancyGuard
{
bytes32 public constant MAINTAINER_ROLE = keccak256('Maintainer');
bytes32 public constant LIQUIDITY_PROVIDER_ROLE =
keccak256('Liquidity Provider');
bytes32 public constant VALIDATOR_ROLE = keccak256('Validator');
using SafeMath for uint256;
using FixedPoint for FixedPoint.Unsigned;
using HitchensUnorderedKeySetLib for HitchensUnorderedKeySetLib.Set;
using SynthereumTICHelper for Storage;
struct Storage {
ISynthereumFinder finder;
uint8 version;
IDerivative derivative;
FixedPoint.Unsigned startingCollateralization;
address liquidityProvider;
address validator;
IERC20 collateralToken;
Fee fee;
uint256 totalFeeProportions;
mapping(bytes32 => MintRequest) mintRequests;
HitchensUnorderedKeySetLib.Set mintRequestSet;
mapping(bytes32 => ExchangeRequest) exchangeRequests;
HitchensUnorderedKeySetLib.Set exchangeRequestSet;
mapping(bytes32 => RedeemRequest) redeemRequests;
HitchensUnorderedKeySetLib.Set redeemRequestSet;
}
event MintRequested(
bytes32 mintID,
uint256 timestamp,
address indexed sender,
uint256 collateralAmount,
uint256 numTokens
);
event MintApproved(bytes32 mintID, address indexed sender);
event MintRejected(bytes32 mintID, address indexed sender);
event ExchangeRequested(
bytes32 exchangeID,
uint256 timestamp,
address indexed sender,
address destTIC,
uint256 numTokens,
uint256 destNumTokens
);
event ExchangeApproved(bytes32 exchangeID, address indexed sender);
event ExchangeRejected(bytes32 exchangeID, address indexed sender);
event RedeemRequested(
bytes32 redeemID,
uint256 timestamp,
address indexed sender,
uint256 collateralAmount,
uint256 numTokens
);
event RedeemApproved(bytes32 redeemID, address indexed sender);
event RedeemRejected(bytes32 redeemID, address indexed sender);
event SetFeePercentage(uint256 feePercentage);
event SetFeeRecipients(address[] feeRecipients, uint32[] feeProportions);
Storage private ticStorage;
constructor(
IDerivative _derivative,
ISynthereumFinder _finder,
uint8 _version,
Roles memory _roles,
uint256 _startingCollateralization,
Fee memory _fee
) public nonReentrant {
}
modifier onlyMaintainer() {
}
modifier onlyLiquidityProvider() {
require(<FILL_ME>)
_;
}
modifier onlyValidator() {
}
function mintRequest(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function approveMint(bytes32 mintID)
external
override
nonReentrant
onlyValidator
{
}
function rejectMint(bytes32 mintID)
external
override
nonReentrant
onlyValidator
{
}
function deposit(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function withdraw(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function exchangeMint(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function depositIntoDerivative(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function withdrawRequest(uint256 collateralAmount)
external
override
onlyLiquidityProvider
nonReentrant
{
}
function withdrawPassedRequest()
external
override
onlyLiquidityProvider
nonReentrant
{
}
function redeemRequest(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function approveRedeem(bytes32 redeemID)
external
override
nonReentrant
onlyValidator
{
}
function rejectRedeem(bytes32 redeemID)
external
override
nonReentrant
onlyValidator
{
}
function emergencyShutdown() external override onlyMaintainer nonReentrant {
}
function settleEmergencyShutdown() external override nonReentrant {
}
function exchangeRequest(
SynthereumTICInterface destTIC,
uint256 numTokens,
uint256 collateralAmount,
uint256 destNumTokens
) external override nonReentrant {
}
function approveExchange(bytes32 exchangeID)
external
override
onlyValidator
nonReentrant
{
}
function rejectExchange(bytes32 exchangeID)
external
override
onlyValidator
nonReentrant
{
}
function synthereumFinder()
external
view
override
returns (ISynthereumFinder finder)
{
}
function version() external view override returns (uint8 poolVersion) {
}
function derivative() external view override returns (IDerivative) {
}
function collateralToken() external view override returns (IERC20) {
}
function syntheticToken() external view override returns (IERC20) {
}
function syntheticTokenSymbol()
external
view
override
returns (string memory symbol)
{
}
function calculateFee(uint256 collateralAmount)
external
view
override
returns (uint256)
{
}
function getMintRequests()
external
view
override
returns (MintRequest[] memory)
{
}
function getRedeemRequests()
external
view
override
returns (RedeemRequest[] memory)
{
}
function getExchangeRequests()
external
view
override
returns (ExchangeRequest[] memory)
{
}
function setFee(Fee memory _fee)
external
override
nonReentrant
onlyMaintainer
{
}
function setFeePercentage(uint256 _feePercentage)
external
override
nonReentrant
onlyMaintainer
{
}
function setFeeRecipients(
address[] memory _feeRecipients,
uint32[] memory _feeProportions
) external override nonReentrant onlyMaintainer {
}
function _setFeePercentage(uint256 _feePercentage) private {
}
function _setFeeRecipients(
address[] memory _feeRecipients,
uint32[] memory _feeProportions
) private {
}
}
| hasRole(LIQUIDITY_PROVIDER_ROLE,msg.sender),'Sender must be the liquidity provider' | 23,737 | hasRole(LIQUIDITY_PROVIDER_ROLE,msg.sender) |
'Sender must be the validator' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import {
AccessControl
} from '../../../@openzeppelin/contracts/access/AccessControl.sol';
import {SynthereumTICInterface} from './interfaces/ITIC.sol';
import '../../../@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import {SafeMath} from '../../../@openzeppelin/contracts/math/SafeMath.sol';
import {
FixedPoint
} from '../../../@jarvis-network/uma-core/contracts/common/implementation/FixedPoint.sol';
import {HitchensUnorderedKeySetLib} from './HitchensUnorderedKeySet.sol';
import {SynthereumTICHelper} from './TICHelper.sol';
import {IERC20} from '../../../@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {IStandardERC20} from '../../base/interfaces/IStandardERC20.sol';
import {ISynthereumFinder} from '../../versioning/interfaces/IFinder.sol';
import {IDerivative} from '../../derivative/common/interfaces/IDerivative.sol';
contract SynthereumTIC is
AccessControl,
SynthereumTICInterface,
ReentrancyGuard
{
bytes32 public constant MAINTAINER_ROLE = keccak256('Maintainer');
bytes32 public constant LIQUIDITY_PROVIDER_ROLE =
keccak256('Liquidity Provider');
bytes32 public constant VALIDATOR_ROLE = keccak256('Validator');
using SafeMath for uint256;
using FixedPoint for FixedPoint.Unsigned;
using HitchensUnorderedKeySetLib for HitchensUnorderedKeySetLib.Set;
using SynthereumTICHelper for Storage;
struct Storage {
ISynthereumFinder finder;
uint8 version;
IDerivative derivative;
FixedPoint.Unsigned startingCollateralization;
address liquidityProvider;
address validator;
IERC20 collateralToken;
Fee fee;
uint256 totalFeeProportions;
mapping(bytes32 => MintRequest) mintRequests;
HitchensUnorderedKeySetLib.Set mintRequestSet;
mapping(bytes32 => ExchangeRequest) exchangeRequests;
HitchensUnorderedKeySetLib.Set exchangeRequestSet;
mapping(bytes32 => RedeemRequest) redeemRequests;
HitchensUnorderedKeySetLib.Set redeemRequestSet;
}
event MintRequested(
bytes32 mintID,
uint256 timestamp,
address indexed sender,
uint256 collateralAmount,
uint256 numTokens
);
event MintApproved(bytes32 mintID, address indexed sender);
event MintRejected(bytes32 mintID, address indexed sender);
event ExchangeRequested(
bytes32 exchangeID,
uint256 timestamp,
address indexed sender,
address destTIC,
uint256 numTokens,
uint256 destNumTokens
);
event ExchangeApproved(bytes32 exchangeID, address indexed sender);
event ExchangeRejected(bytes32 exchangeID, address indexed sender);
event RedeemRequested(
bytes32 redeemID,
uint256 timestamp,
address indexed sender,
uint256 collateralAmount,
uint256 numTokens
);
event RedeemApproved(bytes32 redeemID, address indexed sender);
event RedeemRejected(bytes32 redeemID, address indexed sender);
event SetFeePercentage(uint256 feePercentage);
event SetFeeRecipients(address[] feeRecipients, uint32[] feeProportions);
Storage private ticStorage;
constructor(
IDerivative _derivative,
ISynthereumFinder _finder,
uint8 _version,
Roles memory _roles,
uint256 _startingCollateralization,
Fee memory _fee
) public nonReentrant {
}
modifier onlyMaintainer() {
}
modifier onlyLiquidityProvider() {
}
modifier onlyValidator() {
require(<FILL_ME>)
_;
}
function mintRequest(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function approveMint(bytes32 mintID)
external
override
nonReentrant
onlyValidator
{
}
function rejectMint(bytes32 mintID)
external
override
nonReentrant
onlyValidator
{
}
function deposit(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function withdraw(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function exchangeMint(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function depositIntoDerivative(uint256 collateralAmount)
external
override
nonReentrant
onlyLiquidityProvider
{
}
function withdrawRequest(uint256 collateralAmount)
external
override
onlyLiquidityProvider
nonReentrant
{
}
function withdrawPassedRequest()
external
override
onlyLiquidityProvider
nonReentrant
{
}
function redeemRequest(uint256 collateralAmount, uint256 numTokens)
external
override
nonReentrant
{
}
function approveRedeem(bytes32 redeemID)
external
override
nonReentrant
onlyValidator
{
}
function rejectRedeem(bytes32 redeemID)
external
override
nonReentrant
onlyValidator
{
}
function emergencyShutdown() external override onlyMaintainer nonReentrant {
}
function settleEmergencyShutdown() external override nonReentrant {
}
function exchangeRequest(
SynthereumTICInterface destTIC,
uint256 numTokens,
uint256 collateralAmount,
uint256 destNumTokens
) external override nonReentrant {
}
function approveExchange(bytes32 exchangeID)
external
override
onlyValidator
nonReentrant
{
}
function rejectExchange(bytes32 exchangeID)
external
override
onlyValidator
nonReentrant
{
}
function synthereumFinder()
external
view
override
returns (ISynthereumFinder finder)
{
}
function version() external view override returns (uint8 poolVersion) {
}
function derivative() external view override returns (IDerivative) {
}
function collateralToken() external view override returns (IERC20) {
}
function syntheticToken() external view override returns (IERC20) {
}
function syntheticTokenSymbol()
external
view
override
returns (string memory symbol)
{
}
function calculateFee(uint256 collateralAmount)
external
view
override
returns (uint256)
{
}
function getMintRequests()
external
view
override
returns (MintRequest[] memory)
{
}
function getRedeemRequests()
external
view
override
returns (RedeemRequest[] memory)
{
}
function getExchangeRequests()
external
view
override
returns (ExchangeRequest[] memory)
{
}
function setFee(Fee memory _fee)
external
override
nonReentrant
onlyMaintainer
{
}
function setFeePercentage(uint256 _feePercentage)
external
override
nonReentrant
onlyMaintainer
{
}
function setFeeRecipients(
address[] memory _feeRecipients,
uint32[] memory _feeProportions
) external override nonReentrant onlyMaintainer {
}
function _setFeePercentage(uint256 _feePercentage) private {
}
function _setFeeRecipients(
address[] memory _feeRecipients,
uint32[] memory _feeProportions
) private {
}
}
| hasRole(VALIDATOR_ROLE,msg.sender),'Sender must be the validator' | 23,737 | hasRole(VALIDATOR_ROLE,msg.sender) |
'UnorderedKeySet(101) - Key already exists in the set.' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
library HitchensUnorderedKeySetLib {
struct Set {
mapping(bytes32 => uint256) keyPointers;
bytes32[] keyList;
}
function insert(Set storage self, bytes32 key) internal {
require(key != 0x0, 'UnorderedKeySet(100) - Key cannot be 0x0');
require(<FILL_ME>)
self.keyList.push(key);
self.keyPointers[key] = self.keyList.length - 1;
}
function remove(Set storage self, bytes32 key) internal {
}
function count(Set storage self) internal view returns (uint256) {
}
function exists(Set storage self, bytes32 key) internal view returns (bool) {
}
function keyAtIndex(Set storage self, uint256 index)
internal
view
returns (bytes32)
{
}
function nukeSet(Set storage self) public {
}
}
contract HitchensUnorderedKeySet {
using HitchensUnorderedKeySetLib for HitchensUnorderedKeySetLib.Set;
HitchensUnorderedKeySetLib.Set set;
event LogUpdate(address sender, string action, bytes32 key);
function exists(bytes32 key) public view returns (bool) {
}
function insert(bytes32 key) public {
}
function remove(bytes32 key) public {
}
function count() public view returns (uint256) {
}
function keyAtIndex(uint256 index) public view returns (bytes32) {
}
function nukeSet() public {
}
}
| !exists(self,key),'UnorderedKeySet(101) - Key already exists in the set.' | 23,739 | !exists(self,key) |
'UnorderedKeySet(102) - Key does not exist in the set.' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
library HitchensUnorderedKeySetLib {
struct Set {
mapping(bytes32 => uint256) keyPointers;
bytes32[] keyList;
}
function insert(Set storage self, bytes32 key) internal {
}
function remove(Set storage self, bytes32 key) internal {
require(<FILL_ME>)
bytes32 keyToMove = self.keyList[count(self) - 1];
uint256 rowToReplace = self.keyPointers[key];
self.keyPointers[keyToMove] = rowToReplace;
self.keyList[rowToReplace] = keyToMove;
delete self.keyPointers[key];
self.keyList.pop();
}
function count(Set storage self) internal view returns (uint256) {
}
function exists(Set storage self, bytes32 key) internal view returns (bool) {
}
function keyAtIndex(Set storage self, uint256 index)
internal
view
returns (bytes32)
{
}
function nukeSet(Set storage self) public {
}
}
contract HitchensUnorderedKeySet {
using HitchensUnorderedKeySetLib for HitchensUnorderedKeySetLib.Set;
HitchensUnorderedKeySetLib.Set set;
event LogUpdate(address sender, string action, bytes32 key);
function exists(bytes32 key) public view returns (bool) {
}
function insert(bytes32 key) public {
}
function remove(bytes32 key) public {
}
function count() public view returns (uint256) {
}
function keyAtIndex(uint256 index) public view returns (bytes32) {
}
function nukeSet() public {
}
}
| exists(self,key),'UnorderedKeySet(102) - Key does not exist in the set.' | 23,739 | exists(self,key) |
'CR is more than 100%' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import '../../../../../@openzeppelin/contracts/math/SafeMath.sol';
import '../../../../../@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import './PerpetualPositionManagerPoolParty.sol';
import '../../common/implementation/FixedPoint.sol';
import './PerpetualPositionManagerPoolPartyLib.sol';
import './PerpetualLiquidatablePoolPartyLib.sol';
contract PerpetualLiquidatablePoolParty is PerpetualPositionManagerPoolParty {
using FixedPoint for FixedPoint.Unsigned;
using SafeMath for uint256;
using SafeERC20 for IERC20;
using FeePayerPoolPartyLib for FixedPoint.Unsigned;
using PerpetualLiquidatablePoolPartyLib for PerpetualPositionManagerPoolParty.PositionData;
using PerpetualLiquidatablePoolPartyLib for LiquidationData;
enum Status {
Uninitialized,
PreDispute,
PendingDispute,
DisputeSucceeded,
DisputeFailed
}
struct LiquidatableParams {
uint256 liquidationLiveness;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPct;
FixedPoint.Unsigned sponsorDisputeRewardPct;
FixedPoint.Unsigned disputerDisputeRewardPct;
}
struct LiquidationData {
address sponsor;
address liquidator;
Status state;
uint256 liquidationTime;
FixedPoint.Unsigned tokensOutstanding;
FixedPoint.Unsigned lockedCollateral;
FixedPoint.Unsigned liquidatedCollateral;
FixedPoint.Unsigned rawUnitCollateral;
address disputer;
FixedPoint.Unsigned settlementPrice;
FixedPoint.Unsigned finalFee;
}
struct ConstructorParams {
PerpetualPositionManagerPoolParty.PositionManagerParams positionManagerParams;
PerpetualPositionManagerPoolParty.Roles roles;
LiquidatableParams liquidatableParams;
}
struct LiquidatableData {
FixedPoint.Unsigned rawLiquidationCollateral;
uint256 liquidationLiveness;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPct;
FixedPoint.Unsigned sponsorDisputeRewardPct;
FixedPoint.Unsigned disputerDisputeRewardPct;
}
struct RewardsData {
FixedPoint.Unsigned payToSponsor;
FixedPoint.Unsigned payToLiquidator;
FixedPoint.Unsigned payToDisputer;
FixedPoint.Unsigned paidToSponsor;
FixedPoint.Unsigned paidToLiquidator;
FixedPoint.Unsigned paidToDisputer;
}
mapping(address => LiquidationData[]) public liquidations;
LiquidatableData public liquidatableData;
event LiquidationCreated(
address indexed sponsor,
address indexed liquidator,
uint256 indexed liquidationId,
uint256 tokensOutstanding,
uint256 lockedCollateral,
uint256 liquidatedCollateral,
uint256 liquidationTime
);
event LiquidationDisputed(
address indexed sponsor,
address indexed liquidator,
address indexed disputer,
uint256 liquidationId,
uint256 disputeBondAmount
);
event DisputeSettled(
address indexed caller,
address indexed sponsor,
address indexed liquidator,
address disputer,
uint256 liquidationId,
bool disputeSucceeded
);
event LiquidationWithdrawn(
address indexed caller,
uint256 paidToLiquidator,
uint256 paidToDisputer,
uint256 paidToSponsor,
Status indexed liquidationStatus,
uint256 settlementPrice
);
modifier disputable(uint256 liquidationId, address sponsor) {
}
modifier withdrawable(uint256 liquidationId, address sponsor) {
}
constructor(ConstructorParams memory params)
public
PerpetualPositionManagerPoolParty(
params.positionManagerParams,
params.roles
)
{
require(<FILL_ME>)
require(
params
.liquidatableParams
.sponsorDisputeRewardPct
.add(params.liquidatableParams.disputerDisputeRewardPct)
.isLessThan(1),
'Rewards are more than 100%'
);
liquidatableData.liquidationLiveness = params
.liquidatableParams
.liquidationLiveness;
liquidatableData.collateralRequirement = params
.liquidatableParams
.collateralRequirement;
liquidatableData.disputeBondPct = params.liquidatableParams.disputeBondPct;
liquidatableData.sponsorDisputeRewardPct = params
.liquidatableParams
.sponsorDisputeRewardPct;
liquidatableData.disputerDisputeRewardPct = params
.liquidatableParams
.disputerDisputeRewardPct;
}
function createLiquidation(
address sponsor,
FixedPoint.Unsigned calldata minCollateralPerToken,
FixedPoint.Unsigned calldata maxCollateralPerToken,
FixedPoint.Unsigned calldata maxTokensToLiquidate,
uint256 deadline
)
external
fees()
notEmergencyShutdown()
nonReentrant()
returns (
uint256 liquidationId,
FixedPoint.Unsigned memory tokensLiquidated,
FixedPoint.Unsigned memory finalFeeBond
)
{
}
function dispute(uint256 liquidationId, address sponsor)
external
disputable(liquidationId, sponsor)
fees()
nonReentrant()
returns (FixedPoint.Unsigned memory totalPaid)
{
}
function withdrawLiquidation(uint256 liquidationId, address sponsor)
public
withdrawable(liquidationId, sponsor)
fees()
nonReentrant()
returns (RewardsData memory)
{
}
function deleteLiquidation(uint256 liquidationId, address sponsor)
external
onlyThisContract
{
}
function _pfc() internal view override returns (FixedPoint.Unsigned memory) {
}
function _getLiquidationData(address sponsor, uint256 liquidationId)
internal
view
returns (LiquidationData storage liquidation)
{
}
function _getLiquidationExpiry(LiquidationData storage liquidation)
internal
view
returns (uint256)
{
}
function _disputable(uint256 liquidationId, address sponsor) internal view {
}
function _withdrawable(uint256 liquidationId, address sponsor) internal view {
}
}
| params.liquidatableParams.collateralRequirement.isGreaterThan(1),'CR is more than 100%' | 23,748 | params.liquidatableParams.collateralRequirement.isGreaterThan(1) |
'Rewards are more than 100%' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import '../../../../../@openzeppelin/contracts/math/SafeMath.sol';
import '../../../../../@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import './PerpetualPositionManagerPoolParty.sol';
import '../../common/implementation/FixedPoint.sol';
import './PerpetualPositionManagerPoolPartyLib.sol';
import './PerpetualLiquidatablePoolPartyLib.sol';
contract PerpetualLiquidatablePoolParty is PerpetualPositionManagerPoolParty {
using FixedPoint for FixedPoint.Unsigned;
using SafeMath for uint256;
using SafeERC20 for IERC20;
using FeePayerPoolPartyLib for FixedPoint.Unsigned;
using PerpetualLiquidatablePoolPartyLib for PerpetualPositionManagerPoolParty.PositionData;
using PerpetualLiquidatablePoolPartyLib for LiquidationData;
enum Status {
Uninitialized,
PreDispute,
PendingDispute,
DisputeSucceeded,
DisputeFailed
}
struct LiquidatableParams {
uint256 liquidationLiveness;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPct;
FixedPoint.Unsigned sponsorDisputeRewardPct;
FixedPoint.Unsigned disputerDisputeRewardPct;
}
struct LiquidationData {
address sponsor;
address liquidator;
Status state;
uint256 liquidationTime;
FixedPoint.Unsigned tokensOutstanding;
FixedPoint.Unsigned lockedCollateral;
FixedPoint.Unsigned liquidatedCollateral;
FixedPoint.Unsigned rawUnitCollateral;
address disputer;
FixedPoint.Unsigned settlementPrice;
FixedPoint.Unsigned finalFee;
}
struct ConstructorParams {
PerpetualPositionManagerPoolParty.PositionManagerParams positionManagerParams;
PerpetualPositionManagerPoolParty.Roles roles;
LiquidatableParams liquidatableParams;
}
struct LiquidatableData {
FixedPoint.Unsigned rawLiquidationCollateral;
uint256 liquidationLiveness;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPct;
FixedPoint.Unsigned sponsorDisputeRewardPct;
FixedPoint.Unsigned disputerDisputeRewardPct;
}
struct RewardsData {
FixedPoint.Unsigned payToSponsor;
FixedPoint.Unsigned payToLiquidator;
FixedPoint.Unsigned payToDisputer;
FixedPoint.Unsigned paidToSponsor;
FixedPoint.Unsigned paidToLiquidator;
FixedPoint.Unsigned paidToDisputer;
}
mapping(address => LiquidationData[]) public liquidations;
LiquidatableData public liquidatableData;
event LiquidationCreated(
address indexed sponsor,
address indexed liquidator,
uint256 indexed liquidationId,
uint256 tokensOutstanding,
uint256 lockedCollateral,
uint256 liquidatedCollateral,
uint256 liquidationTime
);
event LiquidationDisputed(
address indexed sponsor,
address indexed liquidator,
address indexed disputer,
uint256 liquidationId,
uint256 disputeBondAmount
);
event DisputeSettled(
address indexed caller,
address indexed sponsor,
address indexed liquidator,
address disputer,
uint256 liquidationId,
bool disputeSucceeded
);
event LiquidationWithdrawn(
address indexed caller,
uint256 paidToLiquidator,
uint256 paidToDisputer,
uint256 paidToSponsor,
Status indexed liquidationStatus,
uint256 settlementPrice
);
modifier disputable(uint256 liquidationId, address sponsor) {
}
modifier withdrawable(uint256 liquidationId, address sponsor) {
}
constructor(ConstructorParams memory params)
public
PerpetualPositionManagerPoolParty(
params.positionManagerParams,
params.roles
)
{
require(
params.liquidatableParams.collateralRequirement.isGreaterThan(1),
'CR is more than 100%'
);
require(<FILL_ME>)
liquidatableData.liquidationLiveness = params
.liquidatableParams
.liquidationLiveness;
liquidatableData.collateralRequirement = params
.liquidatableParams
.collateralRequirement;
liquidatableData.disputeBondPct = params.liquidatableParams.disputeBondPct;
liquidatableData.sponsorDisputeRewardPct = params
.liquidatableParams
.sponsorDisputeRewardPct;
liquidatableData.disputerDisputeRewardPct = params
.liquidatableParams
.disputerDisputeRewardPct;
}
function createLiquidation(
address sponsor,
FixedPoint.Unsigned calldata minCollateralPerToken,
FixedPoint.Unsigned calldata maxCollateralPerToken,
FixedPoint.Unsigned calldata maxTokensToLiquidate,
uint256 deadline
)
external
fees()
notEmergencyShutdown()
nonReentrant()
returns (
uint256 liquidationId,
FixedPoint.Unsigned memory tokensLiquidated,
FixedPoint.Unsigned memory finalFeeBond
)
{
}
function dispute(uint256 liquidationId, address sponsor)
external
disputable(liquidationId, sponsor)
fees()
nonReentrant()
returns (FixedPoint.Unsigned memory totalPaid)
{
}
function withdrawLiquidation(uint256 liquidationId, address sponsor)
public
withdrawable(liquidationId, sponsor)
fees()
nonReentrant()
returns (RewardsData memory)
{
}
function deleteLiquidation(uint256 liquidationId, address sponsor)
external
onlyThisContract
{
}
function _pfc() internal view override returns (FixedPoint.Unsigned memory) {
}
function _getLiquidationData(address sponsor, uint256 liquidationId)
internal
view
returns (LiquidationData storage liquidation)
{
}
function _getLiquidationExpiry(LiquidationData storage liquidation)
internal
view
returns (uint256)
{
}
function _disputable(uint256 liquidationId, address sponsor) internal view {
}
function _withdrawable(uint256 liquidationId, address sponsor) internal view {
}
}
| params.liquidatableParams.sponsorDisputeRewardPct.add(params.liquidatableParams.disputerDisputeRewardPct).isLessThan(1),'Rewards are more than 100%' | 23,748 | params.liquidatableParams.sponsorDisputeRewardPct.add(params.liquidatableParams.disputerDisputeRewardPct).isLessThan(1) |
'Liquidation not disputable' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import '../../../../../@openzeppelin/contracts/math/SafeMath.sol';
import '../../../../../@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import './PerpetualPositionManagerPoolParty.sol';
import '../../common/implementation/FixedPoint.sol';
import './PerpetualPositionManagerPoolPartyLib.sol';
import './PerpetualLiquidatablePoolPartyLib.sol';
contract PerpetualLiquidatablePoolParty is PerpetualPositionManagerPoolParty {
using FixedPoint for FixedPoint.Unsigned;
using SafeMath for uint256;
using SafeERC20 for IERC20;
using FeePayerPoolPartyLib for FixedPoint.Unsigned;
using PerpetualLiquidatablePoolPartyLib for PerpetualPositionManagerPoolParty.PositionData;
using PerpetualLiquidatablePoolPartyLib for LiquidationData;
enum Status {
Uninitialized,
PreDispute,
PendingDispute,
DisputeSucceeded,
DisputeFailed
}
struct LiquidatableParams {
uint256 liquidationLiveness;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPct;
FixedPoint.Unsigned sponsorDisputeRewardPct;
FixedPoint.Unsigned disputerDisputeRewardPct;
}
struct LiquidationData {
address sponsor;
address liquidator;
Status state;
uint256 liquidationTime;
FixedPoint.Unsigned tokensOutstanding;
FixedPoint.Unsigned lockedCollateral;
FixedPoint.Unsigned liquidatedCollateral;
FixedPoint.Unsigned rawUnitCollateral;
address disputer;
FixedPoint.Unsigned settlementPrice;
FixedPoint.Unsigned finalFee;
}
struct ConstructorParams {
PerpetualPositionManagerPoolParty.PositionManagerParams positionManagerParams;
PerpetualPositionManagerPoolParty.Roles roles;
LiquidatableParams liquidatableParams;
}
struct LiquidatableData {
FixedPoint.Unsigned rawLiquidationCollateral;
uint256 liquidationLiveness;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPct;
FixedPoint.Unsigned sponsorDisputeRewardPct;
FixedPoint.Unsigned disputerDisputeRewardPct;
}
struct RewardsData {
FixedPoint.Unsigned payToSponsor;
FixedPoint.Unsigned payToLiquidator;
FixedPoint.Unsigned payToDisputer;
FixedPoint.Unsigned paidToSponsor;
FixedPoint.Unsigned paidToLiquidator;
FixedPoint.Unsigned paidToDisputer;
}
mapping(address => LiquidationData[]) public liquidations;
LiquidatableData public liquidatableData;
event LiquidationCreated(
address indexed sponsor,
address indexed liquidator,
uint256 indexed liquidationId,
uint256 tokensOutstanding,
uint256 lockedCollateral,
uint256 liquidatedCollateral,
uint256 liquidationTime
);
event LiquidationDisputed(
address indexed sponsor,
address indexed liquidator,
address indexed disputer,
uint256 liquidationId,
uint256 disputeBondAmount
);
event DisputeSettled(
address indexed caller,
address indexed sponsor,
address indexed liquidator,
address disputer,
uint256 liquidationId,
bool disputeSucceeded
);
event LiquidationWithdrawn(
address indexed caller,
uint256 paidToLiquidator,
uint256 paidToDisputer,
uint256 paidToSponsor,
Status indexed liquidationStatus,
uint256 settlementPrice
);
modifier disputable(uint256 liquidationId, address sponsor) {
}
modifier withdrawable(uint256 liquidationId, address sponsor) {
}
constructor(ConstructorParams memory params)
public
PerpetualPositionManagerPoolParty(
params.positionManagerParams,
params.roles
)
{
}
function createLiquidation(
address sponsor,
FixedPoint.Unsigned calldata minCollateralPerToken,
FixedPoint.Unsigned calldata maxCollateralPerToken,
FixedPoint.Unsigned calldata maxTokensToLiquidate,
uint256 deadline
)
external
fees()
notEmergencyShutdown()
nonReentrant()
returns (
uint256 liquidationId,
FixedPoint.Unsigned memory tokensLiquidated,
FixedPoint.Unsigned memory finalFeeBond
)
{
}
function dispute(uint256 liquidationId, address sponsor)
external
disputable(liquidationId, sponsor)
fees()
nonReentrant()
returns (FixedPoint.Unsigned memory totalPaid)
{
}
function withdrawLiquidation(uint256 liquidationId, address sponsor)
public
withdrawable(liquidationId, sponsor)
fees()
nonReentrant()
returns (RewardsData memory)
{
}
function deleteLiquidation(uint256 liquidationId, address sponsor)
external
onlyThisContract
{
}
function _pfc() internal view override returns (FixedPoint.Unsigned memory) {
}
function _getLiquidationData(address sponsor, uint256 liquidationId)
internal
view
returns (LiquidationData storage liquidation)
{
}
function _getLiquidationExpiry(LiquidationData storage liquidation)
internal
view
returns (uint256)
{
}
function _disputable(uint256 liquidationId, address sponsor) internal view {
LiquidationData storage liquidation =
_getLiquidationData(sponsor, liquidationId);
require(<FILL_ME>)
}
function _withdrawable(uint256 liquidationId, address sponsor) internal view {
}
}
| (getCurrentTime()<_getLiquidationExpiry(liquidation))&&(liquidation.state==Status.PreDispute),'Liquidation not disputable' | 23,748 | (getCurrentTime()<_getLiquidationExpiry(liquidation))&&(liquidation.state==Status.PreDispute) |
'Liquidation not withdrawable' | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import '../../../../../@openzeppelin/contracts/math/SafeMath.sol';
import '../../../../../@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import './PerpetualPositionManagerPoolParty.sol';
import '../../common/implementation/FixedPoint.sol';
import './PerpetualPositionManagerPoolPartyLib.sol';
import './PerpetualLiquidatablePoolPartyLib.sol';
contract PerpetualLiquidatablePoolParty is PerpetualPositionManagerPoolParty {
using FixedPoint for FixedPoint.Unsigned;
using SafeMath for uint256;
using SafeERC20 for IERC20;
using FeePayerPoolPartyLib for FixedPoint.Unsigned;
using PerpetualLiquidatablePoolPartyLib for PerpetualPositionManagerPoolParty.PositionData;
using PerpetualLiquidatablePoolPartyLib for LiquidationData;
enum Status {
Uninitialized,
PreDispute,
PendingDispute,
DisputeSucceeded,
DisputeFailed
}
struct LiquidatableParams {
uint256 liquidationLiveness;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPct;
FixedPoint.Unsigned sponsorDisputeRewardPct;
FixedPoint.Unsigned disputerDisputeRewardPct;
}
struct LiquidationData {
address sponsor;
address liquidator;
Status state;
uint256 liquidationTime;
FixedPoint.Unsigned tokensOutstanding;
FixedPoint.Unsigned lockedCollateral;
FixedPoint.Unsigned liquidatedCollateral;
FixedPoint.Unsigned rawUnitCollateral;
address disputer;
FixedPoint.Unsigned settlementPrice;
FixedPoint.Unsigned finalFee;
}
struct ConstructorParams {
PerpetualPositionManagerPoolParty.PositionManagerParams positionManagerParams;
PerpetualPositionManagerPoolParty.Roles roles;
LiquidatableParams liquidatableParams;
}
struct LiquidatableData {
FixedPoint.Unsigned rawLiquidationCollateral;
uint256 liquidationLiveness;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPct;
FixedPoint.Unsigned sponsorDisputeRewardPct;
FixedPoint.Unsigned disputerDisputeRewardPct;
}
struct RewardsData {
FixedPoint.Unsigned payToSponsor;
FixedPoint.Unsigned payToLiquidator;
FixedPoint.Unsigned payToDisputer;
FixedPoint.Unsigned paidToSponsor;
FixedPoint.Unsigned paidToLiquidator;
FixedPoint.Unsigned paidToDisputer;
}
mapping(address => LiquidationData[]) public liquidations;
LiquidatableData public liquidatableData;
event LiquidationCreated(
address indexed sponsor,
address indexed liquidator,
uint256 indexed liquidationId,
uint256 tokensOutstanding,
uint256 lockedCollateral,
uint256 liquidatedCollateral,
uint256 liquidationTime
);
event LiquidationDisputed(
address indexed sponsor,
address indexed liquidator,
address indexed disputer,
uint256 liquidationId,
uint256 disputeBondAmount
);
event DisputeSettled(
address indexed caller,
address indexed sponsor,
address indexed liquidator,
address disputer,
uint256 liquidationId,
bool disputeSucceeded
);
event LiquidationWithdrawn(
address indexed caller,
uint256 paidToLiquidator,
uint256 paidToDisputer,
uint256 paidToSponsor,
Status indexed liquidationStatus,
uint256 settlementPrice
);
modifier disputable(uint256 liquidationId, address sponsor) {
}
modifier withdrawable(uint256 liquidationId, address sponsor) {
}
constructor(ConstructorParams memory params)
public
PerpetualPositionManagerPoolParty(
params.positionManagerParams,
params.roles
)
{
}
function createLiquidation(
address sponsor,
FixedPoint.Unsigned calldata minCollateralPerToken,
FixedPoint.Unsigned calldata maxCollateralPerToken,
FixedPoint.Unsigned calldata maxTokensToLiquidate,
uint256 deadline
)
external
fees()
notEmergencyShutdown()
nonReentrant()
returns (
uint256 liquidationId,
FixedPoint.Unsigned memory tokensLiquidated,
FixedPoint.Unsigned memory finalFeeBond
)
{
}
function dispute(uint256 liquidationId, address sponsor)
external
disputable(liquidationId, sponsor)
fees()
nonReentrant()
returns (FixedPoint.Unsigned memory totalPaid)
{
}
function withdrawLiquidation(uint256 liquidationId, address sponsor)
public
withdrawable(liquidationId, sponsor)
fees()
nonReentrant()
returns (RewardsData memory)
{
}
function deleteLiquidation(uint256 liquidationId, address sponsor)
external
onlyThisContract
{
}
function _pfc() internal view override returns (FixedPoint.Unsigned memory) {
}
function _getLiquidationData(address sponsor, uint256 liquidationId)
internal
view
returns (LiquidationData storage liquidation)
{
}
function _getLiquidationExpiry(LiquidationData storage liquidation)
internal
view
returns (uint256)
{
}
function _disputable(uint256 liquidationId, address sponsor) internal view {
}
function _withdrawable(uint256 liquidationId, address sponsor) internal view {
LiquidationData storage liquidation =
_getLiquidationData(sponsor, liquidationId);
Status state = liquidation.state;
require(<FILL_ME>)
}
}
| (state>Status.PreDispute)||((_getLiquidationExpiry(liquidation)<=getCurrentTime())&&(state==Status.PreDispute)),'Liquidation not withdrawable' | 23,748 | (state>Status.PreDispute)||((_getLiquidationExpiry(liquidation)<=getCurrentTime())&&(state==Status.PreDispute)) |
null | contract PaintingOwnership is BitpaintingBase, ERC721 {
/// @notice Name and symbol of the non fungible token, as defined in ERC721.
string public constant name = "BitPaintings";
string public constant symbol = "BP";
ERC721Metadata public erc721Metadata;
bytes4 constant InterfaceSignature_ERC165 =
bytes4(keccak256('supportsInterface(bytes4)'));
bytes4 constant InterfaceSignature_ERC721 =
bytes4(keccak256('name()')) ^
bytes4(keccak256('symbol()')) ^
bytes4(keccak256('totalSupply()')) ^
bytes4(keccak256('balanceOf(address)')) ^
bytes4(keccak256('ownerOf(uint256)')) ^
bytes4(keccak256('approve(address,uint256)')) ^
bytes4(keccak256('transfer(address,uint256)')) ^
bytes4(keccak256('transferFrom(address,address,uint256)')) ^
bytes4(keccak256('tokensOfOwner(address)')) ^
bytes4(keccak256('tokenMetadata(uint256,string)'));
/// @notice Introspection interface as per ERC-165 (https://github.com/ethereum/EIPs/issues/165).
/// Returns true for any standardized interfaces implemented by this contract. We implement
/// ERC-165 (obviously!) and ERC-721.
function supportsInterface(bytes4 _interfaceID) external constant returns (bool)
{
}
/// @dev Set the address of the sibling contract that tracks metadata.
/// CEO only.
function setMetadataAddress(address _contractAddress) public onlyOwner {
}
function _owns(address _claimant, uint256 _tokenId) internal constant returns (bool) {
}
function balanceOf(address _owner) public constant returns (uint256 count) {
}
function _approve(uint256 _tokenId, address _approved) internal {
}
function _approvedFor(address _claimant, uint256 _tokenId)
internal constant returns (bool) {
}
function transfer(
address _to,
uint256 _tokenId
)
external
whenNotPaused
{
require(_to != address(0));
require(_to != address(this));
require(<FILL_ME>)
_transfer(msg.sender, _to, _tokenId);
}
function approve(
address _to,
uint256 _tokenId
)
external
whenNotPaused
{
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
)
external whenNotPaused {
}
function _transferFrom(
address _from,
address _to,
uint256 _tokenId
)
internal
whenNotPaused
{
}
function totalSupply() public constant returns (uint) {
}
function ownerOf(uint256 _tokenId)
external constant returns (address) {
}
function _ownerOf(uint256 _tokenId)
internal constant returns (address) {
}
function tokensOfOwner(address _owner)
external constant returns(uint256[]) {
}
/// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>)
/// This method is licenced under the Apache License.
/// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol
function _memcpy(uint _dest, uint _src, uint _len) private constant {
}
/// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>)
/// This method is licenced under the Apache License.
/// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol
function _toString(bytes32[4] _rawBytes, uint256 _stringLength) private constant returns (string) {
}
/// @notice Returns a URI pointing to a metadata package for this token conforming to
/// ERC-721 (https://github.com/ethereum/EIPs/issues/721)
/// @param _tokenId The ID number of the Kitty whose metadata should be returned.
function tokenMetadata(uint256 _tokenId, string _preferredTransport) external constant returns (string infoUrl) {
}
function withdraw() external onlyOwner {
}
}
| _owns(msg.sender,_tokenId) | 23,786 | _owns(msg.sender,_tokenId) |
null | contract PaintingOwnership is BitpaintingBase, ERC721 {
/// @notice Name and symbol of the non fungible token, as defined in ERC721.
string public constant name = "BitPaintings";
string public constant symbol = "BP";
ERC721Metadata public erc721Metadata;
bytes4 constant InterfaceSignature_ERC165 =
bytes4(keccak256('supportsInterface(bytes4)'));
bytes4 constant InterfaceSignature_ERC721 =
bytes4(keccak256('name()')) ^
bytes4(keccak256('symbol()')) ^
bytes4(keccak256('totalSupply()')) ^
bytes4(keccak256('balanceOf(address)')) ^
bytes4(keccak256('ownerOf(uint256)')) ^
bytes4(keccak256('approve(address,uint256)')) ^
bytes4(keccak256('transfer(address,uint256)')) ^
bytes4(keccak256('transferFrom(address,address,uint256)')) ^
bytes4(keccak256('tokensOfOwner(address)')) ^
bytes4(keccak256('tokenMetadata(uint256,string)'));
/// @notice Introspection interface as per ERC-165 (https://github.com/ethereum/EIPs/issues/165).
/// Returns true for any standardized interfaces implemented by this contract. We implement
/// ERC-165 (obviously!) and ERC-721.
function supportsInterface(bytes4 _interfaceID) external constant returns (bool)
{
}
/// @dev Set the address of the sibling contract that tracks metadata.
/// CEO only.
function setMetadataAddress(address _contractAddress) public onlyOwner {
}
function _owns(address _claimant, uint256 _tokenId) internal constant returns (bool) {
}
function balanceOf(address _owner) public constant returns (uint256 count) {
}
function _approve(uint256 _tokenId, address _approved) internal {
}
function _approvedFor(address _claimant, uint256 _tokenId)
internal constant returns (bool) {
}
function transfer(
address _to,
uint256 _tokenId
)
external
whenNotPaused
{
}
function approve(
address _to,
uint256 _tokenId
)
external
whenNotPaused
{
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
)
external whenNotPaused {
}
function _transferFrom(
address _from,
address _to,
uint256 _tokenId
)
internal
whenNotPaused
{
require(_to != address(0));
require(_to != address(this));
require(<FILL_ME>)
require(_owns(_from, _tokenId));
_transfer(_from, _to, _tokenId);
}
function totalSupply() public constant returns (uint) {
}
function ownerOf(uint256 _tokenId)
external constant returns (address) {
}
function _ownerOf(uint256 _tokenId)
internal constant returns (address) {
}
function tokensOfOwner(address _owner)
external constant returns(uint256[]) {
}
/// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>)
/// This method is licenced under the Apache License.
/// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol
function _memcpy(uint _dest, uint _src, uint _len) private constant {
}
/// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>)
/// This method is licenced under the Apache License.
/// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol
function _toString(bytes32[4] _rawBytes, uint256 _stringLength) private constant returns (string) {
}
/// @notice Returns a URI pointing to a metadata package for this token conforming to
/// ERC-721 (https://github.com/ethereum/EIPs/issues/721)
/// @param _tokenId The ID number of the Kitty whose metadata should be returned.
function tokenMetadata(uint256 _tokenId, string _preferredTransport) external constant returns (string infoUrl) {
}
function withdraw() external onlyOwner {
}
}
| _approvedFor(msg.sender,_tokenId) | 23,786 | _approvedFor(msg.sender,_tokenId) |
null | contract PaintingOwnership is BitpaintingBase, ERC721 {
/// @notice Name and symbol of the non fungible token, as defined in ERC721.
string public constant name = "BitPaintings";
string public constant symbol = "BP";
ERC721Metadata public erc721Metadata;
bytes4 constant InterfaceSignature_ERC165 =
bytes4(keccak256('supportsInterface(bytes4)'));
bytes4 constant InterfaceSignature_ERC721 =
bytes4(keccak256('name()')) ^
bytes4(keccak256('symbol()')) ^
bytes4(keccak256('totalSupply()')) ^
bytes4(keccak256('balanceOf(address)')) ^
bytes4(keccak256('ownerOf(uint256)')) ^
bytes4(keccak256('approve(address,uint256)')) ^
bytes4(keccak256('transfer(address,uint256)')) ^
bytes4(keccak256('transferFrom(address,address,uint256)')) ^
bytes4(keccak256('tokensOfOwner(address)')) ^
bytes4(keccak256('tokenMetadata(uint256,string)'));
/// @notice Introspection interface as per ERC-165 (https://github.com/ethereum/EIPs/issues/165).
/// Returns true for any standardized interfaces implemented by this contract. We implement
/// ERC-165 (obviously!) and ERC-721.
function supportsInterface(bytes4 _interfaceID) external constant returns (bool)
{
}
/// @dev Set the address of the sibling contract that tracks metadata.
/// CEO only.
function setMetadataAddress(address _contractAddress) public onlyOwner {
}
function _owns(address _claimant, uint256 _tokenId) internal constant returns (bool) {
}
function balanceOf(address _owner) public constant returns (uint256 count) {
}
function _approve(uint256 _tokenId, address _approved) internal {
}
function _approvedFor(address _claimant, uint256 _tokenId)
internal constant returns (bool) {
}
function transfer(
address _to,
uint256 _tokenId
)
external
whenNotPaused
{
}
function approve(
address _to,
uint256 _tokenId
)
external
whenNotPaused
{
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
)
external whenNotPaused {
}
function _transferFrom(
address _from,
address _to,
uint256 _tokenId
)
internal
whenNotPaused
{
require(_to != address(0));
require(_to != address(this));
require(_approvedFor(msg.sender, _tokenId));
require(<FILL_ME>)
_transfer(_from, _to, _tokenId);
}
function totalSupply() public constant returns (uint) {
}
function ownerOf(uint256 _tokenId)
external constant returns (address) {
}
function _ownerOf(uint256 _tokenId)
internal constant returns (address) {
}
function tokensOfOwner(address _owner)
external constant returns(uint256[]) {
}
/// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>)
/// This method is licenced under the Apache License.
/// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol
function _memcpy(uint _dest, uint _src, uint _len) private constant {
}
/// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>)
/// This method is licenced under the Apache License.
/// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol
function _toString(bytes32[4] _rawBytes, uint256 _stringLength) private constant returns (string) {
}
/// @notice Returns a URI pointing to a metadata package for this token conforming to
/// ERC-721 (https://github.com/ethereum/EIPs/issues/721)
/// @param _tokenId The ID number of the Kitty whose metadata should be returned.
function tokenMetadata(uint256 _tokenId, string _preferredTransport) external constant returns (string infoUrl) {
}
function withdraw() external onlyOwner {
}
}
| _owns(_from,_tokenId) | 23,786 | _owns(_from,_tokenId) |
"BF: wallet locked" | // Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz>
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.s
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* @title BaseFeature
* @notice Base Feature contract that contains methods common to all Feature contracts.
* @author Julien Niset - <[email protected]>, Olivier VDB - <[email protected]>
*/
contract BaseFeature is IFeature {
// Empty calldata
bytes constant internal EMPTY_BYTES = "";
// Mock token address for ETH
address constant internal ETH_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
// The address of the Lock storage
ILockStorage internal lockStorage;
// The address of the Version Manager
IVersionManager internal versionManager;
event FeatureCreated(bytes32 name);
/**
* @notice Throws if the wallet is locked.
*/
modifier onlyWhenUnlocked(address _wallet) {
require(<FILL_ME>)
_;
}
/**
* @notice Throws if the sender is not the VersionManager.
*/
modifier onlyVersionManager() {
}
/**
* @notice Throws if the sender is not the owner of the target wallet.
*/
modifier onlyWalletOwner(address _wallet) {
}
/**
* @notice Throws if the sender is not an authorised feature of the target wallet.
*/
modifier onlyWalletFeature(address _wallet) {
}
/**
* @notice Throws if the sender is not the owner of the target wallet or the feature itself.
*/
modifier onlyWalletOwnerOrFeature(address _wallet) {
}
constructor(
ILockStorage _lockStorage,
IVersionManager _versionManager,
bytes32 _name
) public {
}
/**
* @inheritdoc IFeature
*/
function recoverToken(address _token) external virtual override {
}
/**
* @notice Inits the feature for a wallet by doing nothing.
* @dev !! Overriding methods need make sure `init()` can only be called by the VersionManager !!
* @param _wallet The wallet.
*/
function init(address _wallet) external virtual override {}
/**
* @inheritdoc IFeature
*/
function getRequiredSignatures(address, bytes calldata) external virtual view override returns (uint256, OwnerSignature) {
}
/**
* @inheritdoc IFeature
*/
function getStaticCallSignatures() external virtual override view returns (bytes4[] memory _sigs) {}
/**
* @inheritdoc IFeature
*/
function isFeatureAuthorisedInVersionManager(address _wallet, address _feature) public override view returns (bool) {
}
/**
* @notice Checks that the wallet address provided as the first parameter of _data matches _wallet
* @return false if the addresses are different.
*/
function verifyData(address _wallet, bytes calldata _data) internal pure returns (bool) {
}
/**
* @notice Helper method to check if an address is the owner of a target wallet.
* @param _wallet The target wallet.
* @param _addr The address.
*/
function isOwner(address _wallet, address _addr) internal view returns (bool) {
}
/**
* @notice Verify that the caller is an authorised feature or the wallet owner.
* @param _wallet The target wallet.
* @param _sender The caller.
*/
function verifyOwnerOrAuthorisedFeature(address _wallet, address _sender) internal view {
}
/**
* @notice Helper method to invoke a wallet.
* @param _wallet The target wallet.
* @param _to The target address for the transaction.
* @param _value The value of the transaction.
* @param _data The data of the transaction.
*/
function invokeWallet(address _wallet, address _to, uint256 _value, bytes memory _data)
internal
returns (bytes memory _res)
{
}
}
| !lockStorage.isLocked(_wallet),"BF: wallet locked" | 23,806 | !lockStorage.isLocked(_wallet) |
"BF: must be wallet owner" | // Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz>
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.s
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* @title BaseFeature
* @notice Base Feature contract that contains methods common to all Feature contracts.
* @author Julien Niset - <[email protected]>, Olivier VDB - <[email protected]>
*/
contract BaseFeature is IFeature {
// Empty calldata
bytes constant internal EMPTY_BYTES = "";
// Mock token address for ETH
address constant internal ETH_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
// The address of the Lock storage
ILockStorage internal lockStorage;
// The address of the Version Manager
IVersionManager internal versionManager;
event FeatureCreated(bytes32 name);
/**
* @notice Throws if the wallet is locked.
*/
modifier onlyWhenUnlocked(address _wallet) {
}
/**
* @notice Throws if the sender is not the VersionManager.
*/
modifier onlyVersionManager() {
}
/**
* @notice Throws if the sender is not the owner of the target wallet.
*/
modifier onlyWalletOwner(address _wallet) {
require(<FILL_ME>)
_;
}
/**
* @notice Throws if the sender is not an authorised feature of the target wallet.
*/
modifier onlyWalletFeature(address _wallet) {
}
/**
* @notice Throws if the sender is not the owner of the target wallet or the feature itself.
*/
modifier onlyWalletOwnerOrFeature(address _wallet) {
}
constructor(
ILockStorage _lockStorage,
IVersionManager _versionManager,
bytes32 _name
) public {
}
/**
* @inheritdoc IFeature
*/
function recoverToken(address _token) external virtual override {
}
/**
* @notice Inits the feature for a wallet by doing nothing.
* @dev !! Overriding methods need make sure `init()` can only be called by the VersionManager !!
* @param _wallet The wallet.
*/
function init(address _wallet) external virtual override {}
/**
* @inheritdoc IFeature
*/
function getRequiredSignatures(address, bytes calldata) external virtual view override returns (uint256, OwnerSignature) {
}
/**
* @inheritdoc IFeature
*/
function getStaticCallSignatures() external virtual override view returns (bytes4[] memory _sigs) {}
/**
* @inheritdoc IFeature
*/
function isFeatureAuthorisedInVersionManager(address _wallet, address _feature) public override view returns (bool) {
}
/**
* @notice Checks that the wallet address provided as the first parameter of _data matches _wallet
* @return false if the addresses are different.
*/
function verifyData(address _wallet, bytes calldata _data) internal pure returns (bool) {
}
/**
* @notice Helper method to check if an address is the owner of a target wallet.
* @param _wallet The target wallet.
* @param _addr The address.
*/
function isOwner(address _wallet, address _addr) internal view returns (bool) {
}
/**
* @notice Verify that the caller is an authorised feature or the wallet owner.
* @param _wallet The target wallet.
* @param _sender The caller.
*/
function verifyOwnerOrAuthorisedFeature(address _wallet, address _sender) internal view {
}
/**
* @notice Helper method to invoke a wallet.
* @param _wallet The target wallet.
* @param _to The target address for the transaction.
* @param _value The value of the transaction.
* @param _data The data of the transaction.
*/
function invokeWallet(address _wallet, address _to, uint256 _value, bytes memory _data)
internal
returns (bytes memory _res)
{
}
}
| isOwner(_wallet,msg.sender),"BF: must be wallet owner" | 23,806 | isOwner(_wallet,msg.sender) |
"BF: must be a wallet feature" | // Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz>
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.s
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* @title BaseFeature
* @notice Base Feature contract that contains methods common to all Feature contracts.
* @author Julien Niset - <[email protected]>, Olivier VDB - <[email protected]>
*/
contract BaseFeature is IFeature {
// Empty calldata
bytes constant internal EMPTY_BYTES = "";
// Mock token address for ETH
address constant internal ETH_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
// The address of the Lock storage
ILockStorage internal lockStorage;
// The address of the Version Manager
IVersionManager internal versionManager;
event FeatureCreated(bytes32 name);
/**
* @notice Throws if the wallet is locked.
*/
modifier onlyWhenUnlocked(address _wallet) {
}
/**
* @notice Throws if the sender is not the VersionManager.
*/
modifier onlyVersionManager() {
}
/**
* @notice Throws if the sender is not the owner of the target wallet.
*/
modifier onlyWalletOwner(address _wallet) {
}
/**
* @notice Throws if the sender is not an authorised feature of the target wallet.
*/
modifier onlyWalletFeature(address _wallet) {
require(<FILL_ME>)
_;
}
/**
* @notice Throws if the sender is not the owner of the target wallet or the feature itself.
*/
modifier onlyWalletOwnerOrFeature(address _wallet) {
}
constructor(
ILockStorage _lockStorage,
IVersionManager _versionManager,
bytes32 _name
) public {
}
/**
* @inheritdoc IFeature
*/
function recoverToken(address _token) external virtual override {
}
/**
* @notice Inits the feature for a wallet by doing nothing.
* @dev !! Overriding methods need make sure `init()` can only be called by the VersionManager !!
* @param _wallet The wallet.
*/
function init(address _wallet) external virtual override {}
/**
* @inheritdoc IFeature
*/
function getRequiredSignatures(address, bytes calldata) external virtual view override returns (uint256, OwnerSignature) {
}
/**
* @inheritdoc IFeature
*/
function getStaticCallSignatures() external virtual override view returns (bytes4[] memory _sigs) {}
/**
* @inheritdoc IFeature
*/
function isFeatureAuthorisedInVersionManager(address _wallet, address _feature) public override view returns (bool) {
}
/**
* @notice Checks that the wallet address provided as the first parameter of _data matches _wallet
* @return false if the addresses are different.
*/
function verifyData(address _wallet, bytes calldata _data) internal pure returns (bool) {
}
/**
* @notice Helper method to check if an address is the owner of a target wallet.
* @param _wallet The target wallet.
* @param _addr The address.
*/
function isOwner(address _wallet, address _addr) internal view returns (bool) {
}
/**
* @notice Verify that the caller is an authorised feature or the wallet owner.
* @param _wallet The target wallet.
* @param _sender The caller.
*/
function verifyOwnerOrAuthorisedFeature(address _wallet, address _sender) internal view {
}
/**
* @notice Helper method to invoke a wallet.
* @param _wallet The target wallet.
* @param _to The target address for the transaction.
* @param _value The value of the transaction.
* @param _data The data of the transaction.
*/
function invokeWallet(address _wallet, address _to, uint256 _value, bytes memory _data)
internal
returns (bytes memory _res)
{
}
}
| versionManager.isFeatureAuthorised(_wallet,msg.sender),"BF: must be a wallet feature" | 23,806 | versionManager.isFeatureAuthorised(_wallet,msg.sender) |
"BF: must be owner or feature" | // Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz>
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.s
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* @title BaseFeature
* @notice Base Feature contract that contains methods common to all Feature contracts.
* @author Julien Niset - <[email protected]>, Olivier VDB - <[email protected]>
*/
contract BaseFeature is IFeature {
// Empty calldata
bytes constant internal EMPTY_BYTES = "";
// Mock token address for ETH
address constant internal ETH_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
// The address of the Lock storage
ILockStorage internal lockStorage;
// The address of the Version Manager
IVersionManager internal versionManager;
event FeatureCreated(bytes32 name);
/**
* @notice Throws if the wallet is locked.
*/
modifier onlyWhenUnlocked(address _wallet) {
}
/**
* @notice Throws if the sender is not the VersionManager.
*/
modifier onlyVersionManager() {
}
/**
* @notice Throws if the sender is not the owner of the target wallet.
*/
modifier onlyWalletOwner(address _wallet) {
}
/**
* @notice Throws if the sender is not an authorised feature of the target wallet.
*/
modifier onlyWalletFeature(address _wallet) {
}
/**
* @notice Throws if the sender is not the owner of the target wallet or the feature itself.
*/
modifier onlyWalletOwnerOrFeature(address _wallet) {
}
constructor(
ILockStorage _lockStorage,
IVersionManager _versionManager,
bytes32 _name
) public {
}
/**
* @inheritdoc IFeature
*/
function recoverToken(address _token) external virtual override {
}
/**
* @notice Inits the feature for a wallet by doing nothing.
* @dev !! Overriding methods need make sure `init()` can only be called by the VersionManager !!
* @param _wallet The wallet.
*/
function init(address _wallet) external virtual override {}
/**
* @inheritdoc IFeature
*/
function getRequiredSignatures(address, bytes calldata) external virtual view override returns (uint256, OwnerSignature) {
}
/**
* @inheritdoc IFeature
*/
function getStaticCallSignatures() external virtual override view returns (bytes4[] memory _sigs) {}
/**
* @inheritdoc IFeature
*/
function isFeatureAuthorisedInVersionManager(address _wallet, address _feature) public override view returns (bool) {
}
/**
* @notice Checks that the wallet address provided as the first parameter of _data matches _wallet
* @return false if the addresses are different.
*/
function verifyData(address _wallet, bytes calldata _data) internal pure returns (bool) {
}
/**
* @notice Helper method to check if an address is the owner of a target wallet.
* @param _wallet The target wallet.
* @param _addr The address.
*/
function isOwner(address _wallet, address _addr) internal view returns (bool) {
}
/**
* @notice Verify that the caller is an authorised feature or the wallet owner.
* @param _wallet The target wallet.
* @param _sender The caller.
*/
function verifyOwnerOrAuthorisedFeature(address _wallet, address _sender) internal view {
require(<FILL_ME>)
}
/**
* @notice Helper method to invoke a wallet.
* @param _wallet The target wallet.
* @param _to The target address for the transaction.
* @param _value The value of the transaction.
* @param _data The data of the transaction.
*/
function invokeWallet(address _wallet, address _to, uint256 _value, bytes memory _data)
internal
returns (bytes memory _res)
{
}
}
| isFeatureAuthorisedInVersionManager(_wallet,_sender)||isOwner(_wallet,_sender),"BF: must be owner or feature" | 23,806 | isFeatureAuthorisedInVersionManager(_wallet,_sender)||isOwner(_wallet,_sender) |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
event Blacklist(address indexed blackListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
require(<FILL_ME>)
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public whenNotPaused onlyOwner returns (bool success) {
}
}
contract NwC is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
constructor(string memory _name, string memory _symbol, uint256 _decimals, uint256 _supply, address tokenOwner) public {
}
function burn(uint256 _value) public {
}
function _burn(address _who, uint256 _value) internal {
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
| tokenBlacklist[msg.sender]==false | 23,844 | tokenBlacklist[msg.sender]==false |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
event Blacklist(address indexed blackListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
require(<FILL_ME>)
tokenBlacklist[_address] = _isBlackListed;
emit Blacklist(_address, _isBlackListed);
return true;
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public whenNotPaused onlyOwner returns (bool success) {
}
}
contract NwC is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
constructor(string memory _name, string memory _symbol, uint256 _decimals, uint256 _supply, address tokenOwner) public {
}
function burn(uint256 _value) public {
}
function _burn(address _who, uint256 _value) internal {
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
| tokenBlacklist[_address]!=_isBlackListed | 23,844 | tokenBlacklist[_address]!=_isBlackListed |
null | pragma solidity 0.4.24;
/**
* @title Roles
* @author Francisco Giordano (@frangio)
* @dev Library for managing addresses assigned to a Role.
* See RBAC.sol for example usage.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
}
/**
* @dev remove an address' access to this role
*/
function remove(Role storage role, address addr)
internal
{
}
/**
* @dev check if an address has this role
* // reverts
*/
function check(Role storage role, address addr)
view
internal
{
require(<FILL_ME>)
}
/**
* @dev check if an address has this role
* @return bool
*/
function has(Role storage role, address addr)
view
internal
returns (bool)
{
}
}
/**
* @title RBAC (Role-Based Access Control)
* @author Matt Condon (@Shrugs)
* @dev Stores and provides setters and getters for roles and addresses.
* @dev Supports unlimited numbers of roles and addresses.
* @dev See //contracts/mocks/RBACMock.sol for an example of usage.
* This RBAC method uses strings to key roles. It may be beneficial
* for you to write your own implementation of this interface using Enums or similar.
* It's also recommended that you define constants in the contract, like ROLE_ADMIN below,
* to avoid typos.
*/
contract RBAC {
using Roles for Roles.Role;
mapping (string => Roles.Role) private roles;
event RoleAdded(address addr, string roleName);
event RoleRemoved(address addr, string roleName);
/**
* @dev reverts if addr does not have role
* @param addr address
* @param roleName the name of the role
* // reverts
*/
function checkRole(address addr, string roleName)
view
public
{
}
/**
* @dev determine if addr has role
* @param addr address
* @param roleName the name of the role
* @return bool
*/
function hasRole(address addr, string roleName)
view
public
returns (bool)
{
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function addRole(address addr, string roleName)
internal
{
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function removeRole(address addr, string roleName)
internal
{
}
/**
* @dev modifier to scope access to a single role (uses msg.sender as addr)
* @param roleName the name of the role
* // reverts
*/
modifier onlyRole(string roleName)
{
}
/**
* @dev modifier to scope access to a set of roles (uses msg.sender as addr)
* @param roleNames the names of the roles to scope access to
* // reverts
*
* @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
* see: https://github.com/ethereum/solidity/issues/2467
*/
// modifier onlyRoles(string[] roleNames) {
// bool hasAnyRole = false;
// for (uint8 i = 0; i < roleNames.length; i++) {
// if (hasRole(msg.sender, roleNames[i])) {
// hasAnyRole = true;
// break;
// }
// }
// require(hasAnyRole);
// _;
// }
}
/**
* @title RBACWithAdmin
* @author Matt Condon (@Shrugs)
* @dev It's recommended that you define constants in the contract,
* @dev like ROLE_ADMIN below, to avoid typos.
*/
contract RBACWithAdmin is RBAC {
/**
* A constant role name for indicating admins.
*/
string public constant ROLE_ADMIN = "admin";
/**
* @dev modifier to scope access to admins
* // reverts
*/
modifier onlyAdmin()
{
}
/**
* @dev constructor. Sets msg.sender as admin by default
*/
function RBACWithAdmin()
public
{
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function adminAddRole(address addr, string roleName)
onlyAdmin
public
{
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function adminRemoveRole(address addr, string roleName)
onlyAdmin
public
{
}
}
/**
* @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 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 ERC20 {
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
}
// Contract Code for Faculty - Faculty Devs
contract FacultyPool is RBACWithAdmin {
using SafeMath for uint;
// Constants
// ========================================================
uint8 constant CONTRACT_OPEN = 1;
uint8 constant CONTRACT_CLOSED = 2;
uint8 constant CONTRACT_SUBMIT_FUNDS = 3;
// 500,000 max gas
uint256 constant public gasLimit = 50000000000;
// 0.1 ether
uint256 constant public minContribution = 100000000000000000;
// State Vars
// ========================================================
// recipient address for fee
address public owner;
// the fee taken in tokens from the pool
uint256 public feePct;
// open our contract initially
uint8 public contractStage = CONTRACT_OPEN;
// the current Beneficiary Cap level in wei
uint256 public currentBeneficiaryCap;
// the total cap in wei of the pool
uint256 public totalPoolCap;
// the destination for this contract
address public receiverAddress;
// our beneficiaries
mapping (address => Beneficiary) beneficiaries;
// the total we raised before closing pool
uint256 public finalBalance;
// a set of refund amounts we may need to process
uint256[] public ethRefundAmount;
// mapping that holds the token allocation struct for each token address
mapping (address => TokenAllocation) tokenAllocationMap;
// the default token address
address public defaultToken;
// Modifiers and Structs
// ========================================================
// only run certain methods when contract is open
modifier isOpenContract() {
}
// stop double processing attacks
bool locked;
modifier noReentrancy() {
}
// Beneficiary
struct Beneficiary {
uint256 ethRefund;
uint256 balance;
uint256 cap;
mapping (address => uint256) tokensClaimed;
}
// data structure for holding information related to token withdrawals.
struct TokenAllocation {
ERC20 token;
uint256[] pct;
uint256 balanceRemaining;
}
// Events
// ========================================================
event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance);
event ReceiverAddressSet(address indexed receiverAddress);
event ERC223Received(address indexed token, uint256 value);
event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit);
event PoolStageChanged(uint8 stage);
event PoolSubmitted(address indexed receiver, uint256 amount);
event RefundReceived(address indexed sender, uint256 amount);
event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount);
event EthRefunded(address indexed beneficiary, uint256 amount);
// CODE BELOW HERE
// ========================================================
/*
* Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And,
* optionally, the receiving address if know at time of contract creation.
* fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000
*/
constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public {
}
// we pay in here
function () payable public {
}
// receive funds. gas limited. min contrib.
function _receiveDeposit() isOpenContract internal {
}
// Handle refunds only in closed state.
function _receiveRefund() internal {
}
function getCurrentBeneficiaryCap() public view returns(uint256 cap) {
}
function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) {
}
// close the pool from receiving more funds
function closePool() onlyAdmin isOpenContract public {
}
function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy {
}
function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){
}
function withdraw(address _tokenAddress) public {
}
// This function allows the contract owner to force a withdrawal to any contributor.
function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin {
}
function _withdraw (address _beneficiary, address _tokenAddr) internal {
}
function setReceiver(address addr) public onlyAdmin {
}
// once we have tokens we can enable the withdrawal
// setting this _useAsDefault to true will set this incoming address to the defaultToken.
function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy {
}
// get the available tokens
function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) {
}
// This is a standard function required for ERC223 compatibility.
function tokenFallback (address from, uint value, bytes data) public {
}
// returns a value as a % accurate to 20 decimal points
function _toPct (uint numerator, uint denominator ) internal pure returns (uint) {
}
// returns % of any number, where % given was generated with toPct
function _applyPct (uint numerator, uint pct) internal pure returns (uint) {
}
}
| has(role,addr) | 23,991 | has(role,addr) |
Subsets and Splits