comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
null
/* ***************************************** * BORG Pre-sale Contract v1.0 *********** ***************************************** * BORG v1.1 - Resistance Is Futile ****** ***************************************** * https://Assimilate.eth.link *********** * https://t.me/BORG_ResistanceIsFutile ** ***************************************** */ pragma solidity ^0.7.0; //SPDX-License-Identifier: MIT interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address who) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); function unPauseTransferForever() external; function uniswapV2Pair() external returns(address); } interface IUNIv2 { function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); function WETH() external pure returns (address); } interface IUnicrypt { event onDeposit(address, uint256, uint256); event onWithdraw(address, uint256); function depositToken(address token, uint256 amount, uint256 unlock_date) external payable; function withdrawToken(address token, uint256 amount) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function createPair(address tokenA, address tokenB) external returns (address pair); } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } 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() { } } contract BorgPresale is Context, ReentrancyGuard { using SafeMath for uint; IERC20 public ABS; address public _burnPool = 0x000000000000000000000000000000000000dEaD; IUNIv2 constant uniswap = IUNIv2(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); IUniswapV2Factory constant uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); IUnicrypt constant unicrypt = IUnicrypt(0x17e00383A843A9922bCA3B280C0ADE9f8BA48449); uint public tokensBought; bool public isStopped = false; bool public teamClaimed = false; bool public isRefundEnabled = false; bool public presaleStarted = false; bool justTrigger = false; uint constant teamTokens = 77777 ether; address payable owner; address payable constant owner1 = 0xDe87EA52cD67a32eC71d1A9817856f532b3145bf; // BORG Marketing address payable constant owner2 = 0x635bF673DB15bd80846ed9eD0091D7B308b86D9d; // BORG Treasury address payable constant owner3 = 0x6fE00946Dfa366360b8BB02a68d5536d8D92d488; // BORG Development Fund address public pool; uint256 public liquidityUnlock; uint256 public ethSent; uint256 constant tokensPerETH = 777; uint256 public lockedLiquidityAmount; uint256 public timeTowithdrawTeamTokens; uint256 public refundTime; mapping(address => uint) ethSpent; modifier onlyOwner() { } constructor() { } receive() external payable { } function EMERGENCY_ALLOW_REFUNDS() external onlyOwner nonReentrant { } function getRefund() external nonReentrant { } function lockWithUnicrypt() external onlyOwner { } function withdrawFromUnicrypt(uint256 amount) external onlyOwner { } function withdrawTeamTokens() external onlyOwner nonReentrant { } function setBORG(IERC20 addr) external onlyOwner nonReentrant { } function startPresale() external onlyOwner { } function pausePresale() external onlyOwner { } function buyBORGTokens() public payable nonReentrant { } function userEthSpenttInPresale(address user) external view returns(uint){ } function claimTeamFeeAndAddLiquidity() external onlyOwner { require(<FILL_ME>) uint256 LowamountETH = address(this).balance.mul(1).div(100); owner1.transfer(LowamountETH); owner2.transfer(LowamountETH); owner3.transfer(LowamountETH); teamClaimed = true; addLiquidity(); } function addLiquidity() internal { } function withdrawLockedTokensAfter1Year(address tokenAddress, uint256 tokenAmount) external onlyOwner { } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } }
!teamClaimed
391,024
!teamClaimed
null
/* KDGToken: ERC223 compatible with ERC20 @author: BLV */ pragma solidity ^ 0.5.0; // ERC223 interface interface ContractReceiver { function tokenFallback(address from, uint value, bytes calldata data)external; } interface TokenRecipient { function receiveApproval(address from, uint256 value, bytes calldata data)external; } interface ERC223TokenBasic { function transfer(address receiver, uint256 amount, bytes calldata data) external; function balanceOf(address owner) external view returns(uint); function transferFrom(address from, address to, uint256 value) external returns(bool success); } contract KDGToken is ERC223TokenBasic{ address constant private ADDRESS_ZERO = 0x0000000000000000000000000000000000000000; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public issuer; mapping(address => uint256)balances_; mapping(address => mapping(address => uint256))allowances_; // ERC20 event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint256 value); // Ethereum Token event Burn(address indexed from, uint256 value); constructor(uint256 initialSupply, string memory tokenName, uint8 decimalUnits, string memory tokenSymbol)public{ } function () external payable { } // does not accept ETH // ERC20 function balanceOf(address owner)public view returns(uint) { } // ERC20 // // WARNING! When changing the approval amount, first set it back to zero // AND wait until the transaction is mined. Only afterwards set the new // amount. Otherwise you may be prone to a race condition attack. // See: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 function approve(address spender, uint256 value)public returns(bool success) { } // recommended fix for known attack on any ERC20 function safeApprove(address _spender, uint256 _currentValue, uint256 _value)public returns(bool success) { } // ERC20 function allowance(address owner, address spender)public view returns(uint256 remaining) { } function transfer(address to, uint256 value)public returns(bool success) { } // ERC20 function transferFrom(address from, address to, uint256 value)public returns(bool success) { } // Ethereum Token function approveAndCall(address spender, uint256 value, bytes memory context)public returns(bool success) { } // Ethereum Token function burn(uint256 value)public returns(bool success) { require(<FILL_ME>) balances_[msg.sender] -= value; totalSupply -= value; emit Burn(msg.sender, value); return true; } // Ethereum Token function burnFrom(address from, uint256 value)public returns(bool success) { } // ERC223 Transfer to a contract or externally-owned account function transfer(address to, uint value, bytes calldata data)external{ } // ERC223 Transfer and invoke specified callback // Truffle 5.0 doesn't compile function transfer(address to, uint value, bytes memory data, string memory custom_fallback)public returns(bool success) { } // ERC223 Transfer to contract and invoke tokenFallback() method function transferToContract(address to, uint value, bytes memory data)private returns(bool success) { } // ERC223 fetch contract size (must be nonzero to be a contract) function isContract(address _addr)private view returns(bool) { } function _transfer(address from, address to, uint value, bytes memory data)internal{ } }
balances_[msg.sender]>=value
391,072
balances_[msg.sender]>=value
null
/* KDGToken: ERC223 compatible with ERC20 @author: BLV */ pragma solidity ^ 0.5.0; // ERC223 interface interface ContractReceiver { function tokenFallback(address from, uint value, bytes calldata data)external; } interface TokenRecipient { function receiveApproval(address from, uint256 value, bytes calldata data)external; } interface ERC223TokenBasic { function transfer(address receiver, uint256 amount, bytes calldata data) external; function balanceOf(address owner) external view returns(uint); function transferFrom(address from, address to, uint256 value) external returns(bool success); } contract KDGToken is ERC223TokenBasic{ address constant private ADDRESS_ZERO = 0x0000000000000000000000000000000000000000; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public issuer; mapping(address => uint256)balances_; mapping(address => mapping(address => uint256))allowances_; // ERC20 event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint256 value); // Ethereum Token event Burn(address indexed from, uint256 value); constructor(uint256 initialSupply, string memory tokenName, uint8 decimalUnits, string memory tokenSymbol)public{ } function () external payable { } // does not accept ETH // ERC20 function balanceOf(address owner)public view returns(uint) { } // ERC20 // // WARNING! When changing the approval amount, first set it back to zero // AND wait until the transaction is mined. Only afterwards set the new // amount. Otherwise you may be prone to a race condition attack. // See: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 function approve(address spender, uint256 value)public returns(bool success) { } // recommended fix for known attack on any ERC20 function safeApprove(address _spender, uint256 _currentValue, uint256 _value)public returns(bool success) { } // ERC20 function allowance(address owner, address spender)public view returns(uint256 remaining) { } function transfer(address to, uint256 value)public returns(bool success) { } // ERC20 function transferFrom(address from, address to, uint256 value)public returns(bool success) { } // Ethereum Token function approveAndCall(address spender, uint256 value, bytes memory context)public returns(bool success) { } // Ethereum Token function burn(uint256 value)public returns(bool success) { } // Ethereum Token function burnFrom(address from, uint256 value)public returns(bool success) { require(<FILL_ME>) require(value <= allowances_[from][msg.sender]); balances_[from] -= value; allowances_[from][msg.sender] -= value; totalSupply -= value; emit Burn(from, value); return true; } // ERC223 Transfer to a contract or externally-owned account function transfer(address to, uint value, bytes calldata data)external{ } // ERC223 Transfer and invoke specified callback // Truffle 5.0 doesn't compile function transfer(address to, uint value, bytes memory data, string memory custom_fallback)public returns(bool success) { } // ERC223 Transfer to contract and invoke tokenFallback() method function transferToContract(address to, uint value, bytes memory data)private returns(bool success) { } // ERC223 fetch contract size (must be nonzero to be a contract) function isContract(address _addr)private view returns(bool) { } function _transfer(address from, address to, uint value, bytes memory data)internal{ } }
balances_[from]>=value
391,072
balances_[from]>=value
null
/* KDGToken: ERC223 compatible with ERC20 @author: BLV */ pragma solidity ^ 0.5.0; // ERC223 interface interface ContractReceiver { function tokenFallback(address from, uint value, bytes calldata data)external; } interface TokenRecipient { function receiveApproval(address from, uint256 value, bytes calldata data)external; } interface ERC223TokenBasic { function transfer(address receiver, uint256 amount, bytes calldata data) external; function balanceOf(address owner) external view returns(uint); function transferFrom(address from, address to, uint256 value) external returns(bool success); } contract KDGToken is ERC223TokenBasic{ address constant private ADDRESS_ZERO = 0x0000000000000000000000000000000000000000; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public issuer; mapping(address => uint256)balances_; mapping(address => mapping(address => uint256))allowances_; // ERC20 event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint256 value); // Ethereum Token event Burn(address indexed from, uint256 value); constructor(uint256 initialSupply, string memory tokenName, uint8 decimalUnits, string memory tokenSymbol)public{ } function () external payable { } // does not accept ETH // ERC20 function balanceOf(address owner)public view returns(uint) { } // ERC20 // // WARNING! When changing the approval amount, first set it back to zero // AND wait until the transaction is mined. Only afterwards set the new // amount. Otherwise you may be prone to a race condition attack. // See: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 function approve(address spender, uint256 value)public returns(bool success) { } // recommended fix for known attack on any ERC20 function safeApprove(address _spender, uint256 _currentValue, uint256 _value)public returns(bool success) { } // ERC20 function allowance(address owner, address spender)public view returns(uint256 remaining) { } function transfer(address to, uint256 value)public returns(bool success) { } // ERC20 function transferFrom(address from, address to, uint256 value)public returns(bool success) { } // Ethereum Token function approveAndCall(address spender, uint256 value, bytes memory context)public returns(bool success) { } // Ethereum Token function burn(uint256 value)public returns(bool success) { } // Ethereum Token function burnFrom(address from, uint256 value)public returns(bool success) { } // ERC223 Transfer to a contract or externally-owned account function transfer(address to, uint value, bytes calldata data)external{ } // ERC223 Transfer and invoke specified callback // Truffle 5.0 doesn't compile function transfer(address to, uint value, bytes memory data, string memory custom_fallback)public returns(bool success) { } // ERC223 Transfer to contract and invoke tokenFallback() method function transferToContract(address to, uint value, bytes memory data)private returns(bool success) { } // ERC223 fetch contract size (must be nonzero to be a contract) function isContract(address _addr)private view returns(bool) { } function _transfer(address from, address to, uint value, bytes memory data)internal{ require(to != ADDRESS_ZERO); require(balances_[from] >= value); require(<FILL_ME>) // catch overflow balances_[from] -= value; balances_[to] += value; //Transfer( from, to, value, data ); ERC223-compat version bytes memory empty; empty = data; emit Transfer(from, to, value); // ERC20-compat version } }
balances_[to]+value>balances_[to]
391,072
balances_[to]+value>balances_[to]
'Genesis - BigBang: need more permission'
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; //Contract deployed by LK Tech Club Incubator 2021 dba Lift.Kitchen - 4/24/2021 // -------------------------------------------------------------------------------------- // GENESISVault.sol - 3/16/2021 by CryptoGamblers // - A staking vault that accepts wbtc // - Call Terminated to end Staking // - At Genesis // - mints lfbtc = wbtc staked (generates IdeaFund wbtc/lfbtc LP) // - mints multiplied value of wbtc into proper values of lfbtc/lift, adds pair to liqudity token, stakes into LquidityProvider Vault on behalf of staker // - Final step call Migrate to migrate token ownership to Treasury // Webpage: // Allows people to stake wbtc, shows the total staked wbtc, lfbtc value, lift value (formula), // calculates and shows the initial pool values // // shows list of addresses with amount staked. (may require making the staker list / struct public?) import '@openzeppelin/contracts/math/Math.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; import './interfaces/IUniswapV2Pair.sol'; import './interfaces/IUniswapV2Router02.sol'; import './interfaces/IUniswapV2Factory.sol'; import './interfaces/IOracle.sol'; import './interfaces/IBasisAsset.sol'; import './interfaces/ISimpleERCFund.sol'; import './interfaces/ILPTokenSharePool.sol'; import './lib/UniswapV2Library.sol'; import './lib/Babylonian.sol'; import './lib/FixedPoint.sol'; import './utils/Operator.sol'; import './utils/ContractGuard.sol'; //import 'hardhat/console.sol'; abstract contract TokenVault is Operator { using SafeMath for uint256; using SafeERC20 for IERC20; address public stakingToken; //WBTC uint256 private _totalSupply; mapping(address => uint256) private _balances; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } //We should only accept wbtc into the STAKE in any quanitity. function stake(uint256 amount, uint term) public virtual { } } contract GenesisVault is TokenVault, ContractGuard { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; /* ========== DATA STRUCTURES ========== */ //uint public currentMultiplier = 5; // change to 2 after 1m total value staked in wbtc uint public weeklyEmissions = 10000; uint public variableReduction = 10; uint256 public totalMultipliedWBTCTokens = 0; address public pairTo; bool public migrated = false; bool public terminated = false; bool public generated = false; /* ========== STATE VARIABLES ========== */ address public peg; //LFBTC address public share; //LIFT address public ideaFund; //Where the LP goes address public lfbtcliftLPPool; // where the stakers get LP staked uint256 public starttime; IUniswapV2Router02 public router; address public theOracle; struct StakingSeat { //staked tokens * currentMultiplier uint256 multipliedNumWBTCTokens2x; uint256 multipliedNumWBTCTokens3x; uint256 multipliedNumWBTCTokens4x; uint256 multipliedNumWBTCTokens5x; bool isEntity; } mapping(address => StakingSeat) private stakers; address[] private stakersList; /* ========== CONSTRUCTOR ========== */ // Oracle - Oracle Address // PEG - lfbtc // Share - LIFT // StakingToken - wBTC // StakingTokenPartner - any token that is paired in UniSwap with wBTC (kBTC) // lfbtc + LIFT liqudity pool // router - Uniswap Router // IdeaFund - Idea Fund Address constructor(address _theOracle, address _peg, address _share, address _stakingToken, address _lfbtcliftLPPool, address _router, address _ideaFund, uint256 _startTime) { } // MODIFIERS modifier checkOperator { require(<FILL_ME>) _; } modifier started() { } // term 1 = 2x, 30 days || 2 = 3x, 60 days || 3 = 4x, 90 days || 4 = 5x, 120 days modifier updateStaking(address staker, uint256 amount, uint term) { } // function terminateStaking() onlyOperator public { // terminated = true; // } // function setCurrentMultplier(uint _newMultiplier) onlyOperator public { // currentMultiplier = _newMultiplier; // } function totalStakedValue() public view returns (uint256) { } function getStakingTokenPrice() public view returns (uint256) { } //returns share price as an 18 decimel number function getShareTokenPrice() public view returns (uint256) { } function mintPegToken() onlyOperator public { } function addliquidityForStakingPeg() onlyOperator public { } function mintShareToken() onlyOperator public { } function addliquidityForPegShare() onlyOperator public { } // mints required peg (lfbtc) token and creates the initial staking/peg LP (wbtc/lfbtc) function beginGenesis() onlyOperator public { } /* ========== MUTATIVE FUNCTIONS ========== */ function stake(uint256 amount, uint term) public override onlyOneBlock started updateStaking(msg.sender, amount, term) { } // RESCUE Functions -- call after Genesis to migrate token owner/operator to Treasury function migrate(address target) public onlyOperator { } // If anyone sends tokens directly to the contract we can refund them. function cleanUpDust(uint256 amount, address tokenAddress, address sendTo) onlyOperator public { } function updateOracle(address newOracle) public onlyOperator { } function updateStakingToken(address newToken) public onlyOperator { } function setIdeaFund(address newFund) public onlyOperator { } /* ========== EVENTS ========== */ event Staked(address indexed user, uint256 amount); event Migration(address target); }
IBasisAsset(peg).operator()==address(this)&&IBasisAsset(share).operator()==address(this),'Genesis - BigBang: need more permission'
391,173
IBasisAsset(peg).operator()==address(this)&&IBasisAsset(share).operator()==address(this)
'No stakingToken to begin genesis'
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; //Contract deployed by LK Tech Club Incubator 2021 dba Lift.Kitchen - 4/24/2021 // -------------------------------------------------------------------------------------- // GENESISVault.sol - 3/16/2021 by CryptoGamblers // - A staking vault that accepts wbtc // - Call Terminated to end Staking // - At Genesis // - mints lfbtc = wbtc staked (generates IdeaFund wbtc/lfbtc LP) // - mints multiplied value of wbtc into proper values of lfbtc/lift, adds pair to liqudity token, stakes into LquidityProvider Vault on behalf of staker // - Final step call Migrate to migrate token ownership to Treasury // Webpage: // Allows people to stake wbtc, shows the total staked wbtc, lfbtc value, lift value (formula), // calculates and shows the initial pool values // // shows list of addresses with amount staked. (may require making the staker list / struct public?) import '@openzeppelin/contracts/math/Math.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; import './interfaces/IUniswapV2Pair.sol'; import './interfaces/IUniswapV2Router02.sol'; import './interfaces/IUniswapV2Factory.sol'; import './interfaces/IOracle.sol'; import './interfaces/IBasisAsset.sol'; import './interfaces/ISimpleERCFund.sol'; import './interfaces/ILPTokenSharePool.sol'; import './lib/UniswapV2Library.sol'; import './lib/Babylonian.sol'; import './lib/FixedPoint.sol'; import './utils/Operator.sol'; import './utils/ContractGuard.sol'; //import 'hardhat/console.sol'; abstract contract TokenVault is Operator { using SafeMath for uint256; using SafeERC20 for IERC20; address public stakingToken; //WBTC uint256 private _totalSupply; mapping(address => uint256) private _balances; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } //We should only accept wbtc into the STAKE in any quanitity. function stake(uint256 amount, uint term) public virtual { } } contract GenesisVault is TokenVault, ContractGuard { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; /* ========== DATA STRUCTURES ========== */ //uint public currentMultiplier = 5; // change to 2 after 1m total value staked in wbtc uint public weeklyEmissions = 10000; uint public variableReduction = 10; uint256 public totalMultipliedWBTCTokens = 0; address public pairTo; bool public migrated = false; bool public terminated = false; bool public generated = false; /* ========== STATE VARIABLES ========== */ address public peg; //LFBTC address public share; //LIFT address public ideaFund; //Where the LP goes address public lfbtcliftLPPool; // where the stakers get LP staked uint256 public starttime; IUniswapV2Router02 public router; address public theOracle; struct StakingSeat { //staked tokens * currentMultiplier uint256 multipliedNumWBTCTokens2x; uint256 multipliedNumWBTCTokens3x; uint256 multipliedNumWBTCTokens4x; uint256 multipliedNumWBTCTokens5x; bool isEntity; } mapping(address => StakingSeat) private stakers; address[] private stakersList; /* ========== CONSTRUCTOR ========== */ // Oracle - Oracle Address // PEG - lfbtc // Share - LIFT // StakingToken - wBTC // StakingTokenPartner - any token that is paired in UniSwap with wBTC (kBTC) // lfbtc + LIFT liqudity pool // router - Uniswap Router // IdeaFund - Idea Fund Address constructor(address _theOracle, address _peg, address _share, address _stakingToken, address _lfbtcliftLPPool, address _router, address _ideaFund, uint256 _startTime) { } // MODIFIERS modifier checkOperator { } modifier started() { } // term 1 = 2x, 30 days || 2 = 3x, 60 days || 3 = 4x, 90 days || 4 = 5x, 120 days modifier updateStaking(address staker, uint256 amount, uint term) { } // function terminateStaking() onlyOperator public { // terminated = true; // } // function setCurrentMultplier(uint _newMultiplier) onlyOperator public { // currentMultiplier = _newMultiplier; // } function totalStakedValue() public view returns (uint256) { } function getStakingTokenPrice() public view returns (uint256) { } //returns share price as an 18 decimel number function getShareTokenPrice() public view returns (uint256) { } function mintPegToken() onlyOperator public { require(<FILL_ME>) IBasisAsset(peg).mint(address(this), IERC20(stakingToken).balanceOf(address(this)).mul(1e10).add(totalMultipliedWBTCTokens.mul(1e10).div(2))); } function addliquidityForStakingPeg() onlyOperator public { } function mintShareToken() onlyOperator public { } function addliquidityForPegShare() onlyOperator public { } // mints required peg (lfbtc) token and creates the initial staking/peg LP (wbtc/lfbtc) function beginGenesis() onlyOperator public { } /* ========== MUTATIVE FUNCTIONS ========== */ function stake(uint256 amount, uint term) public override onlyOneBlock started updateStaking(msg.sender, amount, term) { } // RESCUE Functions -- call after Genesis to migrate token owner/operator to Treasury function migrate(address target) public onlyOperator { } // If anyone sends tokens directly to the contract we can refund them. function cleanUpDust(uint256 amount, address tokenAddress, address sendTo) onlyOperator public { } function updateOracle(address newOracle) public onlyOperator { } function updateStakingToken(address newToken) public onlyOperator { } function setIdeaFund(address newFund) public onlyOperator { } /* ========== EVENTS ========== */ event Staked(address indexed user, uint256 amount); event Migration(address target); }
IERC20(stakingToken).balanceOf(address(this))>0,'No stakingToken to begin genesis'
391,173
IERC20(stakingToken).balanceOf(address(this))>0
"Token id taken"
//SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; // _________________________ __ ___________________________________________ // 7 77 77 77 V V 77 _ 77 _ 77 77 77 77 \ // | _ || ___!!__ __!| | | || _|| _ || - || - || ___!| 7 | // | 7 || __| 7 7 | ! ! || _ \ | 7 || ___!| ___!| __|_| | | // | | || 7 | | | || 7 || | || 7 | 7 | 7| ! | // !__!__!!__! !__! !________!!__!__!!__!__!!__! !__! !_____!!_____! // Smart Contract by: @backseats_eth contract NFTWrapped is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenSupply; uint256 public ethPrice = 0.05 ether; uint256 public sosPrice = 75000000000000000000000000; // 75,000,000 $SOS bool public mintEnabled; IERC20 public paymentToken = IERC20(0x3b484b82567a09e2588A13D54D032153f0c0aEe0); address public withdrawAddress = 0x8CD058f25BefF759239c9777D6fF4a5501bf145B; string baseURI = "https://nftwrapped.s3.us-west-2.amazonaws.com/minted/"; mapping(uint => bool) internal takenTokenIds; // Events event WrappedMintedWithETH(address indexed _who); event WrappedMintedWithSOS(address indexed _who); event FundsWithdrawn(uint256 indexed _ethBalance, uint256 indexed _sosBalance, address indexed _to); // Modifiers modifier isNotPaused() { } modifier tokenIdIsValid(uint256 _id) { require(_id > 0, "Invalid id"); require(<FILL_ME>) _; } // Constructor constructor() ERC721("NFTWrapped", "NFTWRAP") {} // Public Functions // Mint with ETH function mint(uint256 _tokenId) public payable isNotPaused tokenIdIsValid(_tokenId) { } function mintWithSOS(uint256 _tokenId) public isNotPaused tokenIdIsValid(_tokenId) { } // Since we generate the ID on the site and pipe it into the mint functions, this function keeps the actual count of NFTs minted function mintedCount() public view returns (uint) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } // Internal Function function _baseURI() internal view virtual override returns (string memory) { } // Ownable Functions function setMintEnabled(bool _val) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } // Important: Set new price in wei (i.e. 80000000000000000 for 0.08 ETH) function setETHPrice(uint256 _newCost) public onlyOwner { } // Important, similar to above. Use a tool like https://eth-converter.com/extended-converter.html to set the correct amount. Set the 'ether' value in the tool to the desired new price, and send the 'wei' amount into this function. function setSOSPrice(uint256 _newAmount) public onlyOwner { } function setWithdrawAddress(address _newAddress) public onlyOwner { } // Withdraw function withdraw() external onlyOwner { } }
!takenTokenIds[_id],"Token id taken"
391,405
!takenTokenIds[_id]
"Insufficient SOS balance"
//SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; // _________________________ __ ___________________________________________ // 7 77 77 77 V V 77 _ 77 _ 77 77 77 77 \ // | _ || ___!!__ __!| | | || _|| _ || - || - || ___!| 7 | // | 7 || __| 7 7 | ! ! || _ \ | 7 || ___!| ___!| __|_| | | // | | || 7 | | | || 7 || | || 7 | 7 | 7| ! | // !__!__!!__! !__! !________!!__!__!!__!__!!__! !__! !_____!!_____! // Smart Contract by: @backseats_eth contract NFTWrapped is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenSupply; uint256 public ethPrice = 0.05 ether; uint256 public sosPrice = 75000000000000000000000000; // 75,000,000 $SOS bool public mintEnabled; IERC20 public paymentToken = IERC20(0x3b484b82567a09e2588A13D54D032153f0c0aEe0); address public withdrawAddress = 0x8CD058f25BefF759239c9777D6fF4a5501bf145B; string baseURI = "https://nftwrapped.s3.us-west-2.amazonaws.com/minted/"; mapping(uint => bool) internal takenTokenIds; // Events event WrappedMintedWithETH(address indexed _who); event WrappedMintedWithSOS(address indexed _who); event FundsWithdrawn(uint256 indexed _ethBalance, uint256 indexed _sosBalance, address indexed _to); // Modifiers modifier isNotPaused() { } modifier tokenIdIsValid(uint256 _id) { } // Constructor constructor() ERC721("NFTWrapped", "NFTWRAP") {} // Public Functions // Mint with ETH function mint(uint256 _tokenId) public payable isNotPaused tokenIdIsValid(_tokenId) { } function mintWithSOS(uint256 _tokenId) public isNotPaused tokenIdIsValid(_tokenId) { require(<FILL_ME>) require(paymentToken.transferFrom(msg.sender, address(this), sosPrice)); _tokenSupply.increment(); _safeMint(msg.sender, _tokenId); takenTokenIds[_tokenId] = true; emit WrappedMintedWithSOS(msg.sender); } // Since we generate the ID on the site and pipe it into the mint functions, this function keeps the actual count of NFTs minted function mintedCount() public view returns (uint) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } // Internal Function function _baseURI() internal view virtual override returns (string memory) { } // Ownable Functions function setMintEnabled(bool _val) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } // Important: Set new price in wei (i.e. 80000000000000000 for 0.08 ETH) function setETHPrice(uint256 _newCost) public onlyOwner { } // Important, similar to above. Use a tool like https://eth-converter.com/extended-converter.html to set the correct amount. Set the 'ether' value in the tool to the desired new price, and send the 'wei' amount into this function. function setSOSPrice(uint256 _newAmount) public onlyOwner { } function setWithdrawAddress(address _newAddress) public onlyOwner { } // Withdraw function withdraw() external onlyOwner { } }
paymentToken.balanceOf(msg.sender)>=sosPrice,"Insufficient SOS balance"
391,405
paymentToken.balanceOf(msg.sender)>=sosPrice
null
//SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; // _________________________ __ ___________________________________________ // 7 77 77 77 V V 77 _ 77 _ 77 77 77 77 \ // | _ || ___!!__ __!| | | || _|| _ || - || - || ___!| 7 | // | 7 || __| 7 7 | ! ! || _ \ | 7 || ___!| ___!| __|_| | | // | | || 7 | | | || 7 || | || 7 | 7 | 7| ! | // !__!__!!__! !__! !________!!__!__!!__!__!!__! !__! !_____!!_____! // Smart Contract by: @backseats_eth contract NFTWrapped is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenSupply; uint256 public ethPrice = 0.05 ether; uint256 public sosPrice = 75000000000000000000000000; // 75,000,000 $SOS bool public mintEnabled; IERC20 public paymentToken = IERC20(0x3b484b82567a09e2588A13D54D032153f0c0aEe0); address public withdrawAddress = 0x8CD058f25BefF759239c9777D6fF4a5501bf145B; string baseURI = "https://nftwrapped.s3.us-west-2.amazonaws.com/minted/"; mapping(uint => bool) internal takenTokenIds; // Events event WrappedMintedWithETH(address indexed _who); event WrappedMintedWithSOS(address indexed _who); event FundsWithdrawn(uint256 indexed _ethBalance, uint256 indexed _sosBalance, address indexed _to); // Modifiers modifier isNotPaused() { } modifier tokenIdIsValid(uint256 _id) { } // Constructor constructor() ERC721("NFTWrapped", "NFTWRAP") {} // Public Functions // Mint with ETH function mint(uint256 _tokenId) public payable isNotPaused tokenIdIsValid(_tokenId) { } function mintWithSOS(uint256 _tokenId) public isNotPaused tokenIdIsValid(_tokenId) { require(paymentToken.balanceOf(msg.sender) >= sosPrice, "Insufficient SOS balance"); require(<FILL_ME>) _tokenSupply.increment(); _safeMint(msg.sender, _tokenId); takenTokenIds[_tokenId] = true; emit WrappedMintedWithSOS(msg.sender); } // Since we generate the ID on the site and pipe it into the mint functions, this function keeps the actual count of NFTs minted function mintedCount() public view returns (uint) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } // Internal Function function _baseURI() internal view virtual override returns (string memory) { } // Ownable Functions function setMintEnabled(bool _val) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } // Important: Set new price in wei (i.e. 80000000000000000 for 0.08 ETH) function setETHPrice(uint256 _newCost) public onlyOwner { } // Important, similar to above. Use a tool like https://eth-converter.com/extended-converter.html to set the correct amount. Set the 'ether' value in the tool to the desired new price, and send the 'wei' amount into this function. function setSOSPrice(uint256 _newAmount) public onlyOwner { } function setWithdrawAddress(address _newAddress) public onlyOwner { } // Withdraw function withdraw() external onlyOwner { } }
paymentToken.transferFrom(msg.sender,address(this),sosPrice)
391,405
paymentToken.transferFrom(msg.sender,address(this),sosPrice)
"Token doesn't exist"
//SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; // _________________________ __ ___________________________________________ // 7 77 77 77 V V 77 _ 77 _ 77 77 77 77 \ // | _ || ___!!__ __!| | | || _|| _ || - || - || ___!| 7 | // | 7 || __| 7 7 | ! ! || _ \ | 7 || ___!| ___!| __|_| | | // | | || 7 | | | || 7 || | || 7 | 7 | 7| ! | // !__!__!!__! !__! !________!!__!__!!__!__!!__! !__! !_____!!_____! // Smart Contract by: @backseats_eth contract NFTWrapped is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenSupply; uint256 public ethPrice = 0.05 ether; uint256 public sosPrice = 75000000000000000000000000; // 75,000,000 $SOS bool public mintEnabled; IERC20 public paymentToken = IERC20(0x3b484b82567a09e2588A13D54D032153f0c0aEe0); address public withdrawAddress = 0x8CD058f25BefF759239c9777D6fF4a5501bf145B; string baseURI = "https://nftwrapped.s3.us-west-2.amazonaws.com/minted/"; mapping(uint => bool) internal takenTokenIds; // Events event WrappedMintedWithETH(address indexed _who); event WrappedMintedWithSOS(address indexed _who); event FundsWithdrawn(uint256 indexed _ethBalance, uint256 indexed _sosBalance, address indexed _to); // Modifiers modifier isNotPaused() { } modifier tokenIdIsValid(uint256 _id) { } // Constructor constructor() ERC721("NFTWrapped", "NFTWRAP") {} // Public Functions // Mint with ETH function mint(uint256 _tokenId) public payable isNotPaused tokenIdIsValid(_tokenId) { } function mintWithSOS(uint256 _tokenId) public isNotPaused tokenIdIsValid(_tokenId) { } // Since we generate the ID on the site and pipe it into the mint functions, this function keeps the actual count of NFTs minted function mintedCount() public view returns (uint) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { require(<FILL_ME>) return string(abi.encodePacked(_baseURI(), Strings.toString(_tokenId), ".json")); } // Internal Function function _baseURI() internal view virtual override returns (string memory) { } // Ownable Functions function setMintEnabled(bool _val) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } // Important: Set new price in wei (i.e. 80000000000000000 for 0.08 ETH) function setETHPrice(uint256 _newCost) public onlyOwner { } // Important, similar to above. Use a tool like https://eth-converter.com/extended-converter.html to set the correct amount. Set the 'ether' value in the tool to the desired new price, and send the 'wei' amount into this function. function setSOSPrice(uint256 _newAmount) public onlyOwner { } function setWithdrawAddress(address _newAddress) public onlyOwner { } // Withdraw function withdraw() external onlyOwner { } }
takenTokenIds[_tokenId],"Token doesn't exist"
391,405
takenTokenIds[_tokenId]
"Forwarder is not trusted"
pragma solidity >=0.7.6; /** * Abstract base class to be inherited by a concrete Paymaster * A subclass must implement: * - preRelayedCall * - postRelayedCall */ abstract contract BasePaymaster is IPaymaster, Ownable { IRelayHub internal relayHub; IForwarder public override trustedForwarder; function getHubAddr() public override view returns (address) { } //overhead of forwarder verify+signature, plus hub overhead. uint256 constant public FORWARDER_HUB_OVERHEAD = 50000; //These parameters are documented in IPaymaster.GasAndDataLimits uint256 constant public PRE_RELAYED_CALL_GAS_LIMIT = 100000; uint256 constant public POST_RELAYED_CALL_GAS_LIMIT = 110000; uint256 constant public PAYMASTER_ACCEPTANCE_BUDGET = PRE_RELAYED_CALL_GAS_LIMIT + FORWARDER_HUB_OVERHEAD; uint256 constant public CALLDATA_SIZE_LIMIT = 10500; function getGasAndDataLimits() public override virtual view returns ( IPaymaster.GasAndDataLimits memory limits ) { } // this method must be called from preRelayedCall to validate that the forwarder // is approved by the paymaster as well as by the recipient contract. function _verifyForwarder(GsnTypes.RelayRequest calldata relayRequest) public view { require(<FILL_ME>) GsnEip712Library.verifyForwarderTrusted(relayRequest); } /* * modifier to be used by recipients as access control protection for preRelayedCall & postRelayedCall */ modifier relayHubOnly() { } function setRelayHub(IRelayHub hub) public onlyOwner { } function setTrustedForwarder(IForwarder forwarder) public onlyOwner { } /// check current deposit on relay hub. function getRelayHubDeposit() public override view returns (uint) { } // any money moved into the paymaster is transferred as a deposit. // This way, we don't need to understand the RelayHub API in order to replenish // the paymaster. receive() external virtual payable { } /// withdraw deposit from relayHub function withdrawRelayHubDepositTo(uint amount, address payable target) public onlyOwner { } }
address(trustedForwarder)==relayRequest.relayData.forwarder,"Forwarder is not trusted"
391,420
address(trustedForwarder)==relayRequest.relayData.forwarder
"already in list"
/** Deployed by Ren Project, https://renproject.io Commit hash: 89c31ce Repository: https://github.com/renproject/darknode-sol Issues: https://github.com/renproject/darknode-sol/issues Licenses openzeppelin-solidity: (MIT) https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE darknode-sol: (GNU GPL V3) https://github.com/renproject/darknode-sol/blob/master/LICENSE */ pragma solidity ^0.5.8; contract Claimable { address private _pendingOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } modifier onlyPendingOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function claimOwnership() public onlyPendingOwner { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } contract ERC20Shifted is ERC20, ERC20Detailed, Claimable { constructor(string memory _name, string memory _symbol, uint8 _decimals) public ERC20Detailed(_name, _symbol, _decimals) {} function burn(address _from, uint256 _amount) public onlyOwner { } function mint(address _to, uint256 _amount) public onlyOwner { } } library LinkedList { address public constant NULL = address(0); struct Node { bool inList; address previous; address next; } struct List { mapping (address => Node) list; } function insertBefore(List storage self, address target, address newNode) internal { require(<FILL_ME>) require(isInList(self, target) || target == NULL, "not in list"); address prev = self.list[target].previous; self.list[newNode].next = target; self.list[newNode].previous = prev; self.list[target].previous = newNode; self.list[prev].next = newNode; self.list[newNode].inList = true; } function insertAfter(List storage self, address target, address newNode) internal { } function remove(List storage self, address node) internal { } function prepend(List storage self, address node) internal { } function append(List storage self, address node) internal { } function swap(List storage self, address left, address right) internal { } function isInList(List storage self, address node) internal view returns (bool) { } function begin(List storage self) internal view returns (address) { } function end(List storage self) internal view returns (address) { } function next(List storage self, address node) internal view returns (address) { } function previous(List storage self, address node) internal view returns (address) { } } interface IShifter { function shiftIn(bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes calldata _sig) external returns (uint256); function shiftOut(bytes calldata _to, uint256 _amount) external returns (uint256); } contract ShifterRegistry is Claimable { event LogShifterRegistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterDeregistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterUpdated(address indexed _tokenAddress, address indexed _currentShifterAddress, address indexed _newShifterAddress); uint256 numShifters = 0; LinkedList.List private shifterList; LinkedList.List private shiftedTokenList; mapping (address=>address) private shifterByToken; mapping (string=>address) private tokenBySymbol; function setShifter(address _tokenAddress, address _shifterAddress) external onlyOwner { } function updateShifter(address _tokenAddress, address _newShifterAddress) external onlyOwner { } function removeShifter(string calldata _symbol) external onlyOwner { } function getShifters(address _start, uint256 _count) external view returns (address[] memory) { } function getShiftedTokens(address _start, uint256 _count) external view returns (address[] memory) { } function getShifterByToken(address _tokenAddress) external view returns (IShifter) { } function getShifterBySymbol(string calldata _tokenSymbol) external view returns (IShifter) { } function getTokenBySymbol(string calldata _tokenSymbol) external view returns (address) { } }
!isInList(self,newNode),"already in list"
391,422
!isInList(self,newNode)
"not in list"
/** Deployed by Ren Project, https://renproject.io Commit hash: 89c31ce Repository: https://github.com/renproject/darknode-sol Issues: https://github.com/renproject/darknode-sol/issues Licenses openzeppelin-solidity: (MIT) https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE darknode-sol: (GNU GPL V3) https://github.com/renproject/darknode-sol/blob/master/LICENSE */ pragma solidity ^0.5.8; contract Claimable { address private _pendingOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } modifier onlyPendingOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function claimOwnership() public onlyPendingOwner { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } contract ERC20Shifted is ERC20, ERC20Detailed, Claimable { constructor(string memory _name, string memory _symbol, uint8 _decimals) public ERC20Detailed(_name, _symbol, _decimals) {} function burn(address _from, uint256 _amount) public onlyOwner { } function mint(address _to, uint256 _amount) public onlyOwner { } } library LinkedList { address public constant NULL = address(0); struct Node { bool inList; address previous; address next; } struct List { mapping (address => Node) list; } function insertBefore(List storage self, address target, address newNode) internal { require(!isInList(self, newNode), "already in list"); require(<FILL_ME>) address prev = self.list[target].previous; self.list[newNode].next = target; self.list[newNode].previous = prev; self.list[target].previous = newNode; self.list[prev].next = newNode; self.list[newNode].inList = true; } function insertAfter(List storage self, address target, address newNode) internal { } function remove(List storage self, address node) internal { } function prepend(List storage self, address node) internal { } function append(List storage self, address node) internal { } function swap(List storage self, address left, address right) internal { } function isInList(List storage self, address node) internal view returns (bool) { } function begin(List storage self) internal view returns (address) { } function end(List storage self) internal view returns (address) { } function next(List storage self, address node) internal view returns (address) { } function previous(List storage self, address node) internal view returns (address) { } } interface IShifter { function shiftIn(bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes calldata _sig) external returns (uint256); function shiftOut(bytes calldata _to, uint256 _amount) external returns (uint256); } contract ShifterRegistry is Claimable { event LogShifterRegistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterDeregistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterUpdated(address indexed _tokenAddress, address indexed _currentShifterAddress, address indexed _newShifterAddress); uint256 numShifters = 0; LinkedList.List private shifterList; LinkedList.List private shiftedTokenList; mapping (address=>address) private shifterByToken; mapping (string=>address) private tokenBySymbol; function setShifter(address _tokenAddress, address _shifterAddress) external onlyOwner { } function updateShifter(address _tokenAddress, address _newShifterAddress) external onlyOwner { } function removeShifter(string calldata _symbol) external onlyOwner { } function getShifters(address _start, uint256 _count) external view returns (address[] memory) { } function getShiftedTokens(address _start, uint256 _count) external view returns (address[] memory) { } function getShifterByToken(address _tokenAddress) external view returns (IShifter) { } function getShifterBySymbol(string calldata _tokenSymbol) external view returns (IShifter) { } function getTokenBySymbol(string calldata _tokenSymbol) external view returns (address) { } }
isInList(self,target)||target==NULL,"not in list"
391,422
isInList(self,target)||target==NULL
"not in list"
/** Deployed by Ren Project, https://renproject.io Commit hash: 89c31ce Repository: https://github.com/renproject/darknode-sol Issues: https://github.com/renproject/darknode-sol/issues Licenses openzeppelin-solidity: (MIT) https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE darknode-sol: (GNU GPL V3) https://github.com/renproject/darknode-sol/blob/master/LICENSE */ pragma solidity ^0.5.8; contract Claimable { address private _pendingOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } modifier onlyPendingOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function claimOwnership() public onlyPendingOwner { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } contract ERC20Shifted is ERC20, ERC20Detailed, Claimable { constructor(string memory _name, string memory _symbol, uint8 _decimals) public ERC20Detailed(_name, _symbol, _decimals) {} function burn(address _from, uint256 _amount) public onlyOwner { } function mint(address _to, uint256 _amount) public onlyOwner { } } library LinkedList { address public constant NULL = address(0); struct Node { bool inList; address previous; address next; } struct List { mapping (address => Node) list; } function insertBefore(List storage self, address target, address newNode) internal { } function insertAfter(List storage self, address target, address newNode) internal { } function remove(List storage self, address node) internal { require(<FILL_ME>) if (node == NULL) { return; } address p = self.list[node].previous; address n = self.list[node].next; self.list[p].next = n; self.list[n].previous = p; self.list[node].inList = false; delete self.list[node]; } function prepend(List storage self, address node) internal { } function append(List storage self, address node) internal { } function swap(List storage self, address left, address right) internal { } function isInList(List storage self, address node) internal view returns (bool) { } function begin(List storage self) internal view returns (address) { } function end(List storage self) internal view returns (address) { } function next(List storage self, address node) internal view returns (address) { } function previous(List storage self, address node) internal view returns (address) { } } interface IShifter { function shiftIn(bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes calldata _sig) external returns (uint256); function shiftOut(bytes calldata _to, uint256 _amount) external returns (uint256); } contract ShifterRegistry is Claimable { event LogShifterRegistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterDeregistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterUpdated(address indexed _tokenAddress, address indexed _currentShifterAddress, address indexed _newShifterAddress); uint256 numShifters = 0; LinkedList.List private shifterList; LinkedList.List private shiftedTokenList; mapping (address=>address) private shifterByToken; mapping (string=>address) private tokenBySymbol; function setShifter(address _tokenAddress, address _shifterAddress) external onlyOwner { } function updateShifter(address _tokenAddress, address _newShifterAddress) external onlyOwner { } function removeShifter(string calldata _symbol) external onlyOwner { } function getShifters(address _start, uint256 _count) external view returns (address[] memory) { } function getShiftedTokens(address _start, uint256 _count) external view returns (address[] memory) { } function getShifterByToken(address _tokenAddress) external view returns (IShifter) { } function getShifterBySymbol(string calldata _tokenSymbol) external view returns (IShifter) { } function getTokenBySymbol(string calldata _tokenSymbol) external view returns (address) { } }
isInList(self,node),"not in list"
391,422
isInList(self,node)
"shifter already registered"
/** Deployed by Ren Project, https://renproject.io Commit hash: 89c31ce Repository: https://github.com/renproject/darknode-sol Issues: https://github.com/renproject/darknode-sol/issues Licenses openzeppelin-solidity: (MIT) https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE darknode-sol: (GNU GPL V3) https://github.com/renproject/darknode-sol/blob/master/LICENSE */ pragma solidity ^0.5.8; contract Claimable { address private _pendingOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } modifier onlyPendingOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function claimOwnership() public onlyPendingOwner { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } contract ERC20Shifted is ERC20, ERC20Detailed, Claimable { constructor(string memory _name, string memory _symbol, uint8 _decimals) public ERC20Detailed(_name, _symbol, _decimals) {} function burn(address _from, uint256 _amount) public onlyOwner { } function mint(address _to, uint256 _amount) public onlyOwner { } } library LinkedList { address public constant NULL = address(0); struct Node { bool inList; address previous; address next; } struct List { mapping (address => Node) list; } function insertBefore(List storage self, address target, address newNode) internal { } function insertAfter(List storage self, address target, address newNode) internal { } function remove(List storage self, address node) internal { } function prepend(List storage self, address node) internal { } function append(List storage self, address node) internal { } function swap(List storage self, address left, address right) internal { } function isInList(List storage self, address node) internal view returns (bool) { } function begin(List storage self) internal view returns (address) { } function end(List storage self) internal view returns (address) { } function next(List storage self, address node) internal view returns (address) { } function previous(List storage self, address node) internal view returns (address) { } } interface IShifter { function shiftIn(bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes calldata _sig) external returns (uint256); function shiftOut(bytes calldata _to, uint256 _amount) external returns (uint256); } contract ShifterRegistry is Claimable { event LogShifterRegistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterDeregistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterUpdated(address indexed _tokenAddress, address indexed _currentShifterAddress, address indexed _newShifterAddress); uint256 numShifters = 0; LinkedList.List private shifterList; LinkedList.List private shiftedTokenList; mapping (address=>address) private shifterByToken; mapping (string=>address) private tokenBySymbol; function setShifter(address _tokenAddress, address _shifterAddress) external onlyOwner { require(<FILL_ME>) require(shifterByToken[_tokenAddress] == address(0x0), "token already registered"); string memory symbol = ERC20Shifted(_tokenAddress).symbol(); require(tokenBySymbol[symbol] == address(0x0), "symbol already registered"); LinkedList.append(shifterList, _shifterAddress); LinkedList.append(shiftedTokenList, _tokenAddress); tokenBySymbol[symbol] = _tokenAddress; shifterByToken[_tokenAddress] = _shifterAddress; numShifters += 1; emit LogShifterRegistered(symbol, symbol, _tokenAddress, _shifterAddress); } function updateShifter(address _tokenAddress, address _newShifterAddress) external onlyOwner { } function removeShifter(string calldata _symbol) external onlyOwner { } function getShifters(address _start, uint256 _count) external view returns (address[] memory) { } function getShiftedTokens(address _start, uint256 _count) external view returns (address[] memory) { } function getShifterByToken(address _tokenAddress) external view returns (IShifter) { } function getShifterBySymbol(string calldata _tokenSymbol) external view returns (IShifter) { } function getTokenBySymbol(string calldata _tokenSymbol) external view returns (address) { } }
!LinkedList.isInList(shifterList,_shifterAddress),"shifter already registered"
391,422
!LinkedList.isInList(shifterList,_shifterAddress)
"token already registered"
/** Deployed by Ren Project, https://renproject.io Commit hash: 89c31ce Repository: https://github.com/renproject/darknode-sol Issues: https://github.com/renproject/darknode-sol/issues Licenses openzeppelin-solidity: (MIT) https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE darknode-sol: (GNU GPL V3) https://github.com/renproject/darknode-sol/blob/master/LICENSE */ pragma solidity ^0.5.8; contract Claimable { address private _pendingOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } modifier onlyPendingOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function claimOwnership() public onlyPendingOwner { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } contract ERC20Shifted is ERC20, ERC20Detailed, Claimable { constructor(string memory _name, string memory _symbol, uint8 _decimals) public ERC20Detailed(_name, _symbol, _decimals) {} function burn(address _from, uint256 _amount) public onlyOwner { } function mint(address _to, uint256 _amount) public onlyOwner { } } library LinkedList { address public constant NULL = address(0); struct Node { bool inList; address previous; address next; } struct List { mapping (address => Node) list; } function insertBefore(List storage self, address target, address newNode) internal { } function insertAfter(List storage self, address target, address newNode) internal { } function remove(List storage self, address node) internal { } function prepend(List storage self, address node) internal { } function append(List storage self, address node) internal { } function swap(List storage self, address left, address right) internal { } function isInList(List storage self, address node) internal view returns (bool) { } function begin(List storage self) internal view returns (address) { } function end(List storage self) internal view returns (address) { } function next(List storage self, address node) internal view returns (address) { } function previous(List storage self, address node) internal view returns (address) { } } interface IShifter { function shiftIn(bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes calldata _sig) external returns (uint256); function shiftOut(bytes calldata _to, uint256 _amount) external returns (uint256); } contract ShifterRegistry is Claimable { event LogShifterRegistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterDeregistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterUpdated(address indexed _tokenAddress, address indexed _currentShifterAddress, address indexed _newShifterAddress); uint256 numShifters = 0; LinkedList.List private shifterList; LinkedList.List private shiftedTokenList; mapping (address=>address) private shifterByToken; mapping (string=>address) private tokenBySymbol; function setShifter(address _tokenAddress, address _shifterAddress) external onlyOwner { require(!LinkedList.isInList(shifterList, _shifterAddress), "shifter already registered"); require(<FILL_ME>) string memory symbol = ERC20Shifted(_tokenAddress).symbol(); require(tokenBySymbol[symbol] == address(0x0), "symbol already registered"); LinkedList.append(shifterList, _shifterAddress); LinkedList.append(shiftedTokenList, _tokenAddress); tokenBySymbol[symbol] = _tokenAddress; shifterByToken[_tokenAddress] = _shifterAddress; numShifters += 1; emit LogShifterRegistered(symbol, symbol, _tokenAddress, _shifterAddress); } function updateShifter(address _tokenAddress, address _newShifterAddress) external onlyOwner { } function removeShifter(string calldata _symbol) external onlyOwner { } function getShifters(address _start, uint256 _count) external view returns (address[] memory) { } function getShiftedTokens(address _start, uint256 _count) external view returns (address[] memory) { } function getShifterByToken(address _tokenAddress) external view returns (IShifter) { } function getShifterBySymbol(string calldata _tokenSymbol) external view returns (IShifter) { } function getTokenBySymbol(string calldata _tokenSymbol) external view returns (address) { } }
shifterByToken[_tokenAddress]==address(0x0),"token already registered"
391,422
shifterByToken[_tokenAddress]==address(0x0)
"symbol already registered"
/** Deployed by Ren Project, https://renproject.io Commit hash: 89c31ce Repository: https://github.com/renproject/darknode-sol Issues: https://github.com/renproject/darknode-sol/issues Licenses openzeppelin-solidity: (MIT) https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE darknode-sol: (GNU GPL V3) https://github.com/renproject/darknode-sol/blob/master/LICENSE */ pragma solidity ^0.5.8; contract Claimable { address private _pendingOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } modifier onlyPendingOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function claimOwnership() public onlyPendingOwner { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } contract ERC20Shifted is ERC20, ERC20Detailed, Claimable { constructor(string memory _name, string memory _symbol, uint8 _decimals) public ERC20Detailed(_name, _symbol, _decimals) {} function burn(address _from, uint256 _amount) public onlyOwner { } function mint(address _to, uint256 _amount) public onlyOwner { } } library LinkedList { address public constant NULL = address(0); struct Node { bool inList; address previous; address next; } struct List { mapping (address => Node) list; } function insertBefore(List storage self, address target, address newNode) internal { } function insertAfter(List storage self, address target, address newNode) internal { } function remove(List storage self, address node) internal { } function prepend(List storage self, address node) internal { } function append(List storage self, address node) internal { } function swap(List storage self, address left, address right) internal { } function isInList(List storage self, address node) internal view returns (bool) { } function begin(List storage self) internal view returns (address) { } function end(List storage self) internal view returns (address) { } function next(List storage self, address node) internal view returns (address) { } function previous(List storage self, address node) internal view returns (address) { } } interface IShifter { function shiftIn(bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes calldata _sig) external returns (uint256); function shiftOut(bytes calldata _to, uint256 _amount) external returns (uint256); } contract ShifterRegistry is Claimable { event LogShifterRegistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterDeregistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterUpdated(address indexed _tokenAddress, address indexed _currentShifterAddress, address indexed _newShifterAddress); uint256 numShifters = 0; LinkedList.List private shifterList; LinkedList.List private shiftedTokenList; mapping (address=>address) private shifterByToken; mapping (string=>address) private tokenBySymbol; function setShifter(address _tokenAddress, address _shifterAddress) external onlyOwner { require(!LinkedList.isInList(shifterList, _shifterAddress), "shifter already registered"); require(shifterByToken[_tokenAddress] == address(0x0), "token already registered"); string memory symbol = ERC20Shifted(_tokenAddress).symbol(); require(<FILL_ME>) LinkedList.append(shifterList, _shifterAddress); LinkedList.append(shiftedTokenList, _tokenAddress); tokenBySymbol[symbol] = _tokenAddress; shifterByToken[_tokenAddress] = _shifterAddress; numShifters += 1; emit LogShifterRegistered(symbol, symbol, _tokenAddress, _shifterAddress); } function updateShifter(address _tokenAddress, address _newShifterAddress) external onlyOwner { } function removeShifter(string calldata _symbol) external onlyOwner { } function getShifters(address _start, uint256 _count) external view returns (address[] memory) { } function getShiftedTokens(address _start, uint256 _count) external view returns (address[] memory) { } function getShifterByToken(address _tokenAddress) external view returns (IShifter) { } function getShifterBySymbol(string calldata _tokenSymbol) external view returns (IShifter) { } function getTokenBySymbol(string calldata _tokenSymbol) external view returns (address) { } }
tokenBySymbol[symbol]==address(0x0),"symbol already registered"
391,422
tokenBySymbol[symbol]==address(0x0)
"token not registered"
/** Deployed by Ren Project, https://renproject.io Commit hash: 89c31ce Repository: https://github.com/renproject/darknode-sol Issues: https://github.com/renproject/darknode-sol/issues Licenses openzeppelin-solidity: (MIT) https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE darknode-sol: (GNU GPL V3) https://github.com/renproject/darknode-sol/blob/master/LICENSE */ pragma solidity ^0.5.8; contract Claimable { address private _pendingOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } modifier onlyPendingOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function claimOwnership() public onlyPendingOwner { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } contract ERC20Shifted is ERC20, ERC20Detailed, Claimable { constructor(string memory _name, string memory _symbol, uint8 _decimals) public ERC20Detailed(_name, _symbol, _decimals) {} function burn(address _from, uint256 _amount) public onlyOwner { } function mint(address _to, uint256 _amount) public onlyOwner { } } library LinkedList { address public constant NULL = address(0); struct Node { bool inList; address previous; address next; } struct List { mapping (address => Node) list; } function insertBefore(List storage self, address target, address newNode) internal { } function insertAfter(List storage self, address target, address newNode) internal { } function remove(List storage self, address node) internal { } function prepend(List storage self, address node) internal { } function append(List storage self, address node) internal { } function swap(List storage self, address left, address right) internal { } function isInList(List storage self, address node) internal view returns (bool) { } function begin(List storage self) internal view returns (address) { } function end(List storage self) internal view returns (address) { } function next(List storage self, address node) internal view returns (address) { } function previous(List storage self, address node) internal view returns (address) { } } interface IShifter { function shiftIn(bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes calldata _sig) external returns (uint256); function shiftOut(bytes calldata _to, uint256 _amount) external returns (uint256); } contract ShifterRegistry is Claimable { event LogShifterRegistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterDeregistered(string _symbol, string indexed _indexedSymbol, address indexed _tokenAddress, address indexed _shifterAddress); event LogShifterUpdated(address indexed _tokenAddress, address indexed _currentShifterAddress, address indexed _newShifterAddress); uint256 numShifters = 0; LinkedList.List private shifterList; LinkedList.List private shiftedTokenList; mapping (address=>address) private shifterByToken; mapping (string=>address) private tokenBySymbol; function setShifter(address _tokenAddress, address _shifterAddress) external onlyOwner { } function updateShifter(address _tokenAddress, address _newShifterAddress) external onlyOwner { address currentShifter = shifterByToken[_tokenAddress]; require(<FILL_ME>) LinkedList.remove(shifterList, currentShifter); LinkedList.append(shifterList, _newShifterAddress); shifterByToken[_tokenAddress] = _newShifterAddress; emit LogShifterUpdated(_tokenAddress, currentShifter, _newShifterAddress); } function removeShifter(string calldata _symbol) external onlyOwner { } function getShifters(address _start, uint256 _count) external view returns (address[] memory) { } function getShiftedTokens(address _start, uint256 _count) external view returns (address[] memory) { } function getShifterByToken(address _tokenAddress) external view returns (IShifter) { } function getShifterBySymbol(string calldata _tokenSymbol) external view returns (IShifter) { } function getTokenBySymbol(string calldata _tokenSymbol) external view returns (address) { } }
shifterByToken[_tokenAddress]!=address(0x0),"token not registered"
391,422
shifterByToken[_tokenAddress]!=address(0x0)
null
pragma solidity ^0.4.16; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function add(uint256 a, uint256 b) internal returns (uint256) { } function div(uint256 a, uint256 b) internal returns (uint256) { } function mul(uint256 a, uint256 b) internal returns (uint256) { } function sub(uint256 a, uint256 b) internal returns (uint256) { } } contract GigsToken { using SafeMath for uint256; /**For unlimited supply set _totalSupply to 0, delete the word "constant", *and uncomment "_totalSupply" in createTokens() */ uint public constant _totalSupply = 16000000; string public constant symbol = "GIX"; string public constant name = "Blockchain Gigs"; uint8 public constant decimals = 18; uint256 public constant totalSupply = _totalSupply * 10 ** uint256(decimals); // 1 ether = 500 gigs uint256 public constant RATE = 500; address public owner; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; function () public payable { } function GigsToken() { } function createTokens() payable { } 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){ require(_to != 0x0); 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); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) returns (bool success){ } function allowance(address _owner, address _spender) constant returns (uint256 remaining){ } }
allowed[_from][msg.sender]>=0&&balances[_from]>=_value&&_value>0
391,490
allowed[_from][msg.sender]>=0&&balances[_from]>=_value&&_value>0
"REQUEST_INVALID"
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; contract LibSignatureValidation { using LibBytes for bytes; function isValidSignature(bytes32 hash, address signerAddress, bytes memory signature) internal pure returns (bool) { } } contract LibTransferRequest { // EIP191 header for EIP712 prefix string constant internal EIP191_HEADER = "\x19\x01"; // EIP712 Domain Name value string constant internal EIP712_DOMAIN_NAME = "Dola Core"; // EIP712 Domain Version value string constant internal EIP712_DOMAIN_VERSION = "1"; // Hash of the EIP712 Domain Separator Schema bytes32 public constant EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked( "EIP712Domain(", "string name,", "string version,", "address verifyingContract", ")" )); // Hash of the EIP712 Domain Separator data bytes32 public EIP712_DOMAIN_HASH; bytes32 constant internal EIP712_TRANSFER_REQUEST_TYPE_HASH = keccak256(abi.encodePacked( "TransferRequest(", "address senderAddress,", "address receiverAddress,", "uint256 value,", "address relayerAddress,", "uint256 relayerFee,", "uint256 salt,", ")" )); struct TransferRequest { address senderAddress; address receiverAddress; uint256 value; address relayerAddress; uint256 relayerFee; uint256 salt; } constructor() public { } function hashTransferRequest(TransferRequest memory request) internal view returns (bytes32) { } } contract DolaCore is LibTransferRequest, LibSignatureValidation { using LibBytes for bytes; address public TOKEN_ADDRESS; mapping (address => mapping (address => uint256)) public requestEpoch; event TransferRequestFilled(address indexed from, address indexed to); constructor (address _tokenAddress) public LibTransferRequest() { } function executeTransfer(TransferRequest memory request, bytes memory signature) public { // make sure the request hasn't been sent already require(<FILL_ME>) // Validate the sender is allowed to execute this transfer require(request.relayerAddress == msg.sender, "REQUEST_INVALID"); // Validate the sender's signature bytes32 requestHash = hashTransferRequest(request); require(isValidSignature(requestHash, request.senderAddress, signature), "INVALID_REQUEST_SIGNATURE"); address tokenAddress = TOKEN_ADDRESS; assembly { mstore(32, 0x23b872dd00000000000000000000000000000000000000000000000000000000) calldatacopy(36, 4, 96) let success := call( gas, // forward all gas tokenAddress, // call address of token contract 0, // don't send any ETH 32, // pointer to start of input 100, // length of input 0, // write output to far position 32 // output size should be 32 bytes ) success := and(success, or( iszero(returndatasize), and( eq(returndatasize, 32), gt(mload(0), 0) ) )) if iszero(success) { mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000) mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000) mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000) mstore(96, 0) revert(0, 100) } calldatacopy(68, 100, 64) success := call( gas, // forward all gas tokenAddress, // call address of token contract 0, // don't send any ETH 32, // pointer to start of input 100, // length of input 0, // write output over input 32 // output size should be 32 bytes ) success := and(success, or( iszero(returndatasize), and( eq(returndatasize, 32), gt(mload(0), 0) ) )) if iszero(success) { mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000) mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000) mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000) mstore(96, 0) revert(0, 100) } } requestEpoch[request.senderAddress][request.relayerAddress] = request.salt + 1; } } library LibBytes { using LibBytes for bytes; /// @dev Gets the memory address for a byte array. /// @param input Byte array to lookup. /// @return memoryAddress Memory address of byte array. This /// points to the header of the byte array which contains /// the length. function rawAddress(bytes memory input) internal pure returns (uint256 memoryAddress) { } /// @dev Gets the memory address for the contents of a byte array. /// @param input Byte array to lookup. /// @return memoryAddress Memory address of the contents of the byte array. function contentAddress(bytes memory input) internal pure returns (uint256 memoryAddress) { } /// @dev Copies `length` bytes from memory location `source` to `dest`. /// @param dest memory address to copy bytes to. /// @param source memory address to copy bytes from. /// @param length number of bytes to copy. function memCopy( uint256 dest, uint256 source, uint256 length ) internal pure { } /// @dev Returns a slices from a byte array. /// @param b The byte array to take a slice from. /// @param from The starting index for the slice (inclusive). /// @param to The final index for the slice (exclusive). /// @return result The slice containing bytes at indices [from, to) function slice( bytes memory b, uint256 from, uint256 to ) internal pure returns (bytes memory result) { } /// @dev Returns a slice from a byte array without preserving the input. /// @param b The byte array to take a slice from. Will be destroyed in the process. /// @param from The starting index for the slice (inclusive). /// @param to The final index for the slice (exclusive). /// @return result The slice containing bytes at indices [from, to) /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted. function sliceDestructive( bytes memory b, uint256 from, uint256 to ) internal pure returns (bytes memory result) { } /// @dev Pops the last byte off of a byte array by modifying its length. /// @param b Byte array that will be modified. /// @return The byte that was popped off. function popLastByte(bytes memory b) internal pure returns (bytes1 result) { } /// @dev Pops the last 20 bytes off of a byte array by modifying its length. /// @param b Byte array that will be modified. /// @return The 20 byte address that was popped off. function popLast20Bytes(bytes memory b) internal pure returns (address result) { } /// @dev Tests equality of two byte arrays. /// @param lhs First byte array to compare. /// @param rhs Second byte array to compare. /// @return True if arrays are the same. False otherwise. function equals( bytes memory lhs, bytes memory rhs ) internal pure returns (bool equal) { } /// @dev Reads an address from a position in a byte array. /// @param b Byte array containing an address. /// @param index Index in byte array of address. /// @return address from byte array. function readAddress( bytes memory b, uint256 index ) internal pure returns (address result) { } /// @dev Writes an address into a specific position in a byte array. /// @param b Byte array to insert address into. /// @param index Index in byte array of address. /// @param input Address to put into byte array. function writeAddress( bytes memory b, uint256 index, address input ) internal pure { } /// @dev Reads a bytes32 value from a position in a byte array. /// @param b Byte array containing a bytes32 value. /// @param index Index in byte array of bytes32 value. /// @return bytes32 value from byte array. function readBytes32( bytes memory b, uint256 index ) internal pure returns (bytes32 result) { } /// @dev Writes a bytes32 into a specific position in a byte array. /// @param b Byte array to insert <input> into. /// @param index Index in byte array of <input>. /// @param input bytes32 to put into byte array. function writeBytes32( bytes memory b, uint256 index, bytes32 input ) internal pure { } /// @dev Reads a uint256 value from a position in a byte array. /// @param b Byte array containing a uint256 value. /// @param index Index in byte array of uint256 value. /// @return uint256 value from byte array. function readUint256( bytes memory b, uint256 index ) internal pure returns (uint256 result) { } /// @dev Writes a uint256 into a specific position in a byte array. /// @param b Byte array to insert <input> into. /// @param index Index in byte array of <input>. /// @param input uint256 to put into byte array. function writeUint256( bytes memory b, uint256 index, uint256 input ) internal pure { } /// @dev Reads an unpadded bytes4 value from a position in a byte array. /// @param b Byte array containing a bytes4 value. /// @param index Index in byte array of bytes4 value. /// @return bytes4 value from byte array. function readBytes4( bytes memory b, uint256 index ) internal pure returns (bytes4 result) { } /// @dev Reads nested bytes from a specific position. /// @dev NOTE: the returned value overlaps with the input value. /// Both should be treated as immutable. /// @param b Byte array containing nested bytes. /// @param index Index of nested bytes. /// @return result Nested bytes. function readBytesWithLength( bytes memory b, uint256 index ) internal pure returns (bytes memory result) { } /// @dev Inserts bytes at a specific position in a byte array. /// @param b Byte array to insert <input> into. /// @param index Index in byte array of <input>. /// @param input bytes to insert. function writeBytesWithLength( bytes memory b, uint256 index, bytes memory input ) internal pure { } /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length. /// @param dest Byte array that will be overwritten with source bytes. /// @param source Byte array to copy onto dest bytes. function deepCopyBytes( bytes memory dest, bytes memory source ) internal pure { } }
requestEpoch[request.senderAddress][request.relayerAddress]<=request.salt,"REQUEST_INVALID"
391,505
requestEpoch[request.senderAddress][request.relayerAddress]<=request.salt
"INVALID_REQUEST_SIGNATURE"
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; contract LibSignatureValidation { using LibBytes for bytes; function isValidSignature(bytes32 hash, address signerAddress, bytes memory signature) internal pure returns (bool) { } } contract LibTransferRequest { // EIP191 header for EIP712 prefix string constant internal EIP191_HEADER = "\x19\x01"; // EIP712 Domain Name value string constant internal EIP712_DOMAIN_NAME = "Dola Core"; // EIP712 Domain Version value string constant internal EIP712_DOMAIN_VERSION = "1"; // Hash of the EIP712 Domain Separator Schema bytes32 public constant EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked( "EIP712Domain(", "string name,", "string version,", "address verifyingContract", ")" )); // Hash of the EIP712 Domain Separator data bytes32 public EIP712_DOMAIN_HASH; bytes32 constant internal EIP712_TRANSFER_REQUEST_TYPE_HASH = keccak256(abi.encodePacked( "TransferRequest(", "address senderAddress,", "address receiverAddress,", "uint256 value,", "address relayerAddress,", "uint256 relayerFee,", "uint256 salt,", ")" )); struct TransferRequest { address senderAddress; address receiverAddress; uint256 value; address relayerAddress; uint256 relayerFee; uint256 salt; } constructor() public { } function hashTransferRequest(TransferRequest memory request) internal view returns (bytes32) { } } contract DolaCore is LibTransferRequest, LibSignatureValidation { using LibBytes for bytes; address public TOKEN_ADDRESS; mapping (address => mapping (address => uint256)) public requestEpoch; event TransferRequestFilled(address indexed from, address indexed to); constructor (address _tokenAddress) public LibTransferRequest() { } function executeTransfer(TransferRequest memory request, bytes memory signature) public { // make sure the request hasn't been sent already require(requestEpoch[request.senderAddress][request.relayerAddress] <= request.salt, "REQUEST_INVALID"); // Validate the sender is allowed to execute this transfer require(request.relayerAddress == msg.sender, "REQUEST_INVALID"); // Validate the sender's signature bytes32 requestHash = hashTransferRequest(request); require(<FILL_ME>) address tokenAddress = TOKEN_ADDRESS; assembly { mstore(32, 0x23b872dd00000000000000000000000000000000000000000000000000000000) calldatacopy(36, 4, 96) let success := call( gas, // forward all gas tokenAddress, // call address of token contract 0, // don't send any ETH 32, // pointer to start of input 100, // length of input 0, // write output to far position 32 // output size should be 32 bytes ) success := and(success, or( iszero(returndatasize), and( eq(returndatasize, 32), gt(mload(0), 0) ) )) if iszero(success) { mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000) mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000) mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000) mstore(96, 0) revert(0, 100) } calldatacopy(68, 100, 64) success := call( gas, // forward all gas tokenAddress, // call address of token contract 0, // don't send any ETH 32, // pointer to start of input 100, // length of input 0, // write output over input 32 // output size should be 32 bytes ) success := and(success, or( iszero(returndatasize), and( eq(returndatasize, 32), gt(mload(0), 0) ) )) if iszero(success) { mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000) mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000) mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000) mstore(96, 0) revert(0, 100) } } requestEpoch[request.senderAddress][request.relayerAddress] = request.salt + 1; } } library LibBytes { using LibBytes for bytes; /// @dev Gets the memory address for a byte array. /// @param input Byte array to lookup. /// @return memoryAddress Memory address of byte array. This /// points to the header of the byte array which contains /// the length. function rawAddress(bytes memory input) internal pure returns (uint256 memoryAddress) { } /// @dev Gets the memory address for the contents of a byte array. /// @param input Byte array to lookup. /// @return memoryAddress Memory address of the contents of the byte array. function contentAddress(bytes memory input) internal pure returns (uint256 memoryAddress) { } /// @dev Copies `length` bytes from memory location `source` to `dest`. /// @param dest memory address to copy bytes to. /// @param source memory address to copy bytes from. /// @param length number of bytes to copy. function memCopy( uint256 dest, uint256 source, uint256 length ) internal pure { } /// @dev Returns a slices from a byte array. /// @param b The byte array to take a slice from. /// @param from The starting index for the slice (inclusive). /// @param to The final index for the slice (exclusive). /// @return result The slice containing bytes at indices [from, to) function slice( bytes memory b, uint256 from, uint256 to ) internal pure returns (bytes memory result) { } /// @dev Returns a slice from a byte array without preserving the input. /// @param b The byte array to take a slice from. Will be destroyed in the process. /// @param from The starting index for the slice (inclusive). /// @param to The final index for the slice (exclusive). /// @return result The slice containing bytes at indices [from, to) /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted. function sliceDestructive( bytes memory b, uint256 from, uint256 to ) internal pure returns (bytes memory result) { } /// @dev Pops the last byte off of a byte array by modifying its length. /// @param b Byte array that will be modified. /// @return The byte that was popped off. function popLastByte(bytes memory b) internal pure returns (bytes1 result) { } /// @dev Pops the last 20 bytes off of a byte array by modifying its length. /// @param b Byte array that will be modified. /// @return The 20 byte address that was popped off. function popLast20Bytes(bytes memory b) internal pure returns (address result) { } /// @dev Tests equality of two byte arrays. /// @param lhs First byte array to compare. /// @param rhs Second byte array to compare. /// @return True if arrays are the same. False otherwise. function equals( bytes memory lhs, bytes memory rhs ) internal pure returns (bool equal) { } /// @dev Reads an address from a position in a byte array. /// @param b Byte array containing an address. /// @param index Index in byte array of address. /// @return address from byte array. function readAddress( bytes memory b, uint256 index ) internal pure returns (address result) { } /// @dev Writes an address into a specific position in a byte array. /// @param b Byte array to insert address into. /// @param index Index in byte array of address. /// @param input Address to put into byte array. function writeAddress( bytes memory b, uint256 index, address input ) internal pure { } /// @dev Reads a bytes32 value from a position in a byte array. /// @param b Byte array containing a bytes32 value. /// @param index Index in byte array of bytes32 value. /// @return bytes32 value from byte array. function readBytes32( bytes memory b, uint256 index ) internal pure returns (bytes32 result) { } /// @dev Writes a bytes32 into a specific position in a byte array. /// @param b Byte array to insert <input> into. /// @param index Index in byte array of <input>. /// @param input bytes32 to put into byte array. function writeBytes32( bytes memory b, uint256 index, bytes32 input ) internal pure { } /// @dev Reads a uint256 value from a position in a byte array. /// @param b Byte array containing a uint256 value. /// @param index Index in byte array of uint256 value. /// @return uint256 value from byte array. function readUint256( bytes memory b, uint256 index ) internal pure returns (uint256 result) { } /// @dev Writes a uint256 into a specific position in a byte array. /// @param b Byte array to insert <input> into. /// @param index Index in byte array of <input>. /// @param input uint256 to put into byte array. function writeUint256( bytes memory b, uint256 index, uint256 input ) internal pure { } /// @dev Reads an unpadded bytes4 value from a position in a byte array. /// @param b Byte array containing a bytes4 value. /// @param index Index in byte array of bytes4 value. /// @return bytes4 value from byte array. function readBytes4( bytes memory b, uint256 index ) internal pure returns (bytes4 result) { } /// @dev Reads nested bytes from a specific position. /// @dev NOTE: the returned value overlaps with the input value. /// Both should be treated as immutable. /// @param b Byte array containing nested bytes. /// @param index Index of nested bytes. /// @return result Nested bytes. function readBytesWithLength( bytes memory b, uint256 index ) internal pure returns (bytes memory result) { } /// @dev Inserts bytes at a specific position in a byte array. /// @param b Byte array to insert <input> into. /// @param index Index in byte array of <input>. /// @param input bytes to insert. function writeBytesWithLength( bytes memory b, uint256 index, bytes memory input ) internal pure { } /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length. /// @param dest Byte array that will be overwritten with source bytes. /// @param source Byte array to copy onto dest bytes. function deepCopyBytes( bytes memory dest, bytes memory source ) internal pure { } }
isValidSignature(requestHash,request.senderAddress,signature),"INVALID_REQUEST_SIGNATURE"
391,505
isValidSignature(requestHash,request.senderAddress,signature)
"Trying to remove non-existing admin"
pragma solidity >= 0.5.11; /** * @title ChainValidator interface * @author Jakub Fornadel * @notice External chain validator contract, can be used for more sophisticated validation of new validators and transactors, e.g. custom min. required conditions, * concrete users whitelisting, etc... **/ interface ChainValidator { /** * @notice Validation function for new validators * * @param vesting How many tokens new validator wants to vest * @param acc Account address of the validator * @param mining Flag if validator is going to mine. * mining == false in case validateNewValidator is called during vestInChain method * mining == true in case validateNewValidator is called during startMining method * @param actNumOfValidators How many active validators is currently in chain **/ function validateNewValidator(uint256 vesting, address acc, bool mining, uint256 actNumOfValidators) external returns (bool); /** * @notice Validation function for new transactors * * @param deposit How many tokens new transactor wants to deposit * @param acc Account address of the transactor * @param actNumOfTransactors How many whitelisted transactors (their deposit balance >= min. required balance) is currently in chain **/ function validateNewTransactor(uint256 deposit, address acc, uint256 actNumOfTransactors) external returns (bool); } /** * @title EnergyChainValidator for Lition energy chain * @author Jakub Fornadel * @notice External chain validator contract with specific conditions tailored for Lition Energy chain **/ contract EnergyChainValidator is ChainValidator { /**************************************************************************************************************************/ /************************************************** Constants *************************************************************/ /**************************************************************************************************************************/ // Token precision. 1 LIT token = 1*10^18 uint256 constant LIT_PRECISION = 10**18; // Min deposit value uint256 constant MIN_DEPOSIT = 5000*LIT_PRECISION; // Min vesting value uint256 constant MIN_VESTING = 1000*LIT_PRECISION; // Min vesting value uint256 constant MAX_VESTING = 500000*LIT_PRECISION; /**************************************************************************************************************************/ /*********************************** Structs and functions related to the list of users ***********************************/ /**************************************************************************************************************************/ // Iterable map that is used only together with the Users mapping as data holder struct IterableMap { // map of indexes to the list array // indexes are shifted +1 compared to the real indexes of this list, because 0 means non-existing element mapping(address => uint256) listIndex; // list of addresses address[] list; } // Adds acc from the map function insertAcc(IterableMap storage map, address acc) internal { } // Removes acc from the map function removeAcc(IterableMap storage map, address acc) internal { } // Returns true, if acc exists in the iterable map, otherwise false function existAcc(IterableMap storage map, address acc) internal view returns (bool) { } /**************************************************************************************************************************/ /******************************************** Other structs and functions *************************************************/ /**************************************************************************************************************************/ // List of admins - they can add/remove whitelisted validators and users IterableMap private admins; // List of whitelisted users who can deposit IterableMap private whitelistedUsers; constructor() public { } /**************************************************************************************************************************/ /*********************************************** Contract Interface *******************************************************/ /**************************************************************************************************************************/ /** * @notice Validation function for new validators. All validators with vesting in range <1000, 50000> LIT tokens are allowed * * @param vesting How many tokens new validator wants to vest * @param acc Account address of the validator * @param mining Flag if validator is going to mine. * mining == false in case validateNewValidator is called during vestInChain method * mining == true in case validateNewValidator is called during startMining method * @param actNumOfValidators How many active validators is currently in chain **/ function validateNewValidator(uint256 vesting, address acc, bool mining, uint256 actNumOfValidators) external returns (bool) { } /** * @notice Validation function for new transactors. Only whitelisted accounts are allowed * * @param deposit How many tokens new transactor wants to deposit * @param acc Account address of the transactor * @param actNumOfTransactors How many whitelisted transactors (their deposit balance >= min. required balance) is currently in chain **/ function validateNewTransactor(uint256 deposit, address acc, uint256 actNumOfTransactors) external returns (bool) { } /** * @notice Adds new whitelisted accounts that are allowed to transact on Lition energy chain * Provided existing accounts are ignored * * @param accounts List of accounts **/ function addWhitelistedUsers(address[] calldata accounts) external { } /** * @notice Removes existing whitelisted accounts that are allowed to transact on Lition energy chain. * Provided non-existing accounts are ignored * * @param accounts List of accounts **/ function removeWhitelistedUsers(address[] calldata accounts) external { } /** * @notice Adds new admins that are allowed to add/remove whitelisted users * Provided existing accounts are ignored* * @param accounts List of accounts **/ function addAdmins(address[] calldata accounts) external { } /** * @notice Removes existing admin that is allowed to add/remove whitelisted users. * Provided account must exist as registered admin * * @param account List of accounts **/ function removeAdmin(address account) external { require(admins.list.length > 1, "Cannot remove all admins, at least one must be always present"); require(<FILL_ME>) removeAcc(admins, account); } /** * @notice Returns list of admins (their accounts) * * @param batch Batch number to be fetched. If the list is too big it cannot return all admins in one call. Instead, users are fetching batches of 100 account at a time * * @return accounts List(batch of 100) of account * @return count How many accounts are returned in specified batch * @return end Flag if there are no more accounts left. To get all accounts, caller should fetch all batches until he sees end == true **/ function getAdmins(uint256 batch) external view returns (address[100] memory accounts, uint256 count, bool end) { } /** * @notice Returns list of whitelisted users (their accounts) * * @param batch Batch number to be fetched. If the list is too big it cannot return all admins in one call. Instead, users are fetching batches of 100 account at a time * * @return accounts List(batch of 100) of account * @return count How many accounts are returned in specified batch * @return end Flag if there are no more accounts left. To get all accounts, caller should fetch all batches until he sees end == true **/ function getWhitelistedUsers(uint256 batch) external view returns (address[100] memory accounts, uint256 count, bool end) { } /*************************************************************************************************************************/ /******************************************** Contract internal functions ************************************************/ /*************************************************************************************************************************/ // Returns list of suers users function getUsers(IterableMap storage internalUsersGroup, uint256 batch) internal view returns (address[100] memory users, uint256 count, bool end) { } function addUsers(IterableMap storage internalUsersGroup, address[] memory users) internal { } function removeUsers(IterableMap storage internalUsersGroup, address[] memory users) internal { } }
existAcc(admins,account)==true,"Trying to remove non-existing admin"
391,516
existAcc(admins,account)==true
"Only admins can do internal changes"
pragma solidity >= 0.5.11; /** * @title ChainValidator interface * @author Jakub Fornadel * @notice External chain validator contract, can be used for more sophisticated validation of new validators and transactors, e.g. custom min. required conditions, * concrete users whitelisting, etc... **/ interface ChainValidator { /** * @notice Validation function for new validators * * @param vesting How many tokens new validator wants to vest * @param acc Account address of the validator * @param mining Flag if validator is going to mine. * mining == false in case validateNewValidator is called during vestInChain method * mining == true in case validateNewValidator is called during startMining method * @param actNumOfValidators How many active validators is currently in chain **/ function validateNewValidator(uint256 vesting, address acc, bool mining, uint256 actNumOfValidators) external returns (bool); /** * @notice Validation function for new transactors * * @param deposit How many tokens new transactor wants to deposit * @param acc Account address of the transactor * @param actNumOfTransactors How many whitelisted transactors (their deposit balance >= min. required balance) is currently in chain **/ function validateNewTransactor(uint256 deposit, address acc, uint256 actNumOfTransactors) external returns (bool); } /** * @title EnergyChainValidator for Lition energy chain * @author Jakub Fornadel * @notice External chain validator contract with specific conditions tailored for Lition Energy chain **/ contract EnergyChainValidator is ChainValidator { /**************************************************************************************************************************/ /************************************************** Constants *************************************************************/ /**************************************************************************************************************************/ // Token precision. 1 LIT token = 1*10^18 uint256 constant LIT_PRECISION = 10**18; // Min deposit value uint256 constant MIN_DEPOSIT = 5000*LIT_PRECISION; // Min vesting value uint256 constant MIN_VESTING = 1000*LIT_PRECISION; // Min vesting value uint256 constant MAX_VESTING = 500000*LIT_PRECISION; /**************************************************************************************************************************/ /*********************************** Structs and functions related to the list of users ***********************************/ /**************************************************************************************************************************/ // Iterable map that is used only together with the Users mapping as data holder struct IterableMap { // map of indexes to the list array // indexes are shifted +1 compared to the real indexes of this list, because 0 means non-existing element mapping(address => uint256) listIndex; // list of addresses address[] list; } // Adds acc from the map function insertAcc(IterableMap storage map, address acc) internal { } // Removes acc from the map function removeAcc(IterableMap storage map, address acc) internal { } // Returns true, if acc exists in the iterable map, otherwise false function existAcc(IterableMap storage map, address acc) internal view returns (bool) { } /**************************************************************************************************************************/ /******************************************** Other structs and functions *************************************************/ /**************************************************************************************************************************/ // List of admins - they can add/remove whitelisted validators and users IterableMap private admins; // List of whitelisted users who can deposit IterableMap private whitelistedUsers; constructor() public { } /**************************************************************************************************************************/ /*********************************************** Contract Interface *******************************************************/ /**************************************************************************************************************************/ /** * @notice Validation function for new validators. All validators with vesting in range <1000, 50000> LIT tokens are allowed * * @param vesting How many tokens new validator wants to vest * @param acc Account address of the validator * @param mining Flag if validator is going to mine. * mining == false in case validateNewValidator is called during vestInChain method * mining == true in case validateNewValidator is called during startMining method * @param actNumOfValidators How many active validators is currently in chain **/ function validateNewValidator(uint256 vesting, address acc, bool mining, uint256 actNumOfValidators) external returns (bool) { } /** * @notice Validation function for new transactors. Only whitelisted accounts are allowed * * @param deposit How many tokens new transactor wants to deposit * @param acc Account address of the transactor * @param actNumOfTransactors How many whitelisted transactors (their deposit balance >= min. required balance) is currently in chain **/ function validateNewTransactor(uint256 deposit, address acc, uint256 actNumOfTransactors) external returns (bool) { } /** * @notice Adds new whitelisted accounts that are allowed to transact on Lition energy chain * Provided existing accounts are ignored * * @param accounts List of accounts **/ function addWhitelistedUsers(address[] calldata accounts) external { } /** * @notice Removes existing whitelisted accounts that are allowed to transact on Lition energy chain. * Provided non-existing accounts are ignored * * @param accounts List of accounts **/ function removeWhitelistedUsers(address[] calldata accounts) external { } /** * @notice Adds new admins that are allowed to add/remove whitelisted users * Provided existing accounts are ignored* * @param accounts List of accounts **/ function addAdmins(address[] calldata accounts) external { } /** * @notice Removes existing admin that is allowed to add/remove whitelisted users. * Provided account must exist as registered admin * * @param account List of accounts **/ function removeAdmin(address account) external { } /** * @notice Returns list of admins (their accounts) * * @param batch Batch number to be fetched. If the list is too big it cannot return all admins in one call. Instead, users are fetching batches of 100 account at a time * * @return accounts List(batch of 100) of account * @return count How many accounts are returned in specified batch * @return end Flag if there are no more accounts left. To get all accounts, caller should fetch all batches until he sees end == true **/ function getAdmins(uint256 batch) external view returns (address[100] memory accounts, uint256 count, bool end) { } /** * @notice Returns list of whitelisted users (their accounts) * * @param batch Batch number to be fetched. If the list is too big it cannot return all admins in one call. Instead, users are fetching batches of 100 account at a time * * @return accounts List(batch of 100) of account * @return count How many accounts are returned in specified batch * @return end Flag if there are no more accounts left. To get all accounts, caller should fetch all batches until he sees end == true **/ function getWhitelistedUsers(uint256 batch) external view returns (address[100] memory accounts, uint256 count, bool end) { } /*************************************************************************************************************************/ /******************************************** Contract internal functions ************************************************/ /*************************************************************************************************************************/ // Returns list of suers users function getUsers(IterableMap storage internalUsersGroup, uint256 batch) internal view returns (address[100] memory users, uint256 count, bool end) { } function addUsers(IterableMap storage internalUsersGroup, address[] memory users) internal { require(<FILL_ME>) require(users.length <= 100, "Max number of processed users is 100"); for (uint256 i = 0; i < users.length; i++) { if (existAcc(internalUsersGroup, users[i]) == false) { insertAcc(internalUsersGroup, users[i]); } } } function removeUsers(IterableMap storage internalUsersGroup, address[] memory users) internal { } }
existAcc(admins,msg.sender)==true,"Only admins can do internal changes"
391,516
existAcc(admins,msg.sender)==true
'Metakey Distributor not approved to spend NFT'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./interfaces/IMerkleDistributor.sol"; contract MetakeyDistributor is IMerkleDistributor, Ownable, ReentrancyGuard{ // __ __ __ __ _______ __ __ __ __ __ // | \ / \ | \ | \ | \ | \ | \ | \| \ | \ // | $$\ / $$ ______ _| $$_ ______ | $$ __ ______ __ __ | $$$$$$$\ \$$ _______ _| $$_ ______ \$$| $$____ __ __ _| $$_ ______ ______ // | $$$\ / $$$ / \| $$ \ | \ | $$ / \ / \ | \ | \ | $$ | $$| \ / \| $$ \ / \ | \| $$ \ | \ | \| $$ \ / \ / \ // | $$$$\ $$$$| $$$$$$\\$$$$$$ \$$$$$$\| $$_/ $$| $$$$$$\| $$ | $$ | $$ | $$| $$| $$$$$$$ \$$$$$$ | $$$$$$\| $$| $$$$$$$\| $$ | $$ \$$$$$$ | $$$$$$\| $$$$$$\ // | $$\$$ $$ $$| $$ $$ | $$ __ / $$| $$ $$ | $$ $$| $$ | $$ | $$ | $$| $$ \$$ \ | $$ __ | $$ \$$| $$| $$ | $$| $$ | $$ | $$ __ | $$ | $$| $$ \$$ // | $$ \$$$| $$| $$$$$$$$ | $$| \| $$$$$$$| $$$$$$\ | $$$$$$$$| $$__/ $$ | $$__/ $$| $$ _\$$$$$$\ | $$| \| $$ | $$| $$__/ $$| $$__/ $$ | $$| \| $$__/ $$| $$ // | $$ \$ | $$ \$$ \ \$$ $$ \$$ $$| $$ \$$\ \$$ \ \$$ $$ | $$ $$| $$| $$ \$$ $$| $$ | $$| $$ $$ \$$ $$ \$$ $$ \$$ $$| $$ // \$$ \$$ \$$$$$$$ \$$$$ \$$$$$$$ \$$ \$$ \$$$$$$$ _\$$$$$$$ \$$$$$$$ \$$ \$$$$$$$ \$$$$ \$$ \$$ \$$$$$$$ \$$$$$$ \$$$$ \$$$$$$ \$$ // | \__| $$ // \$$ $$ // \$$$$$$ //token address address public override token; bytes32 public override merkleRoot; //This is a packed array of booleans. mapping(uint256 => mapping(uint256 => uint256)) private claimedBitMap; uint256 public currentDropIndex = 0; uint256 public deadline; uint256 public tokenIdToTransfer; address public addressToTransferFrom; event TokenIdSet(uint id, address from, uint time); event MerkleRootAndTokenSet(bytes32 root, address token); constructor(address token_, bytes32 merkleRoot_) { } /** * @dev Sets the token id to transfer, claim deadline and address to transfer from */ function setTransferIdAndAccount(uint _tokenIdToTransfer, uint _deadline, address _addressToTransferFrom) private { require(<FILL_ME>) tokenIdToTransfer = _tokenIdToTransfer; deadline = block.timestamp + _deadline; addressToTransferFrom = _addressToTransferFrom; emit TokenIdSet(_tokenIdToTransfer, addressToTransferFrom, deadline); } function setDeadline(uint _deadline) external onlyOwner { } function getSetTokenId() external view returns(uint){ } /** * @dev Sets the new merkle root */ function setClaimConfig (address token_, bytes32 merkleRoot_, uint _tokenIdToTransfer, uint _deadline, address _addressToTransferFrom) external onlyOwner { } function isClaimed(uint256 index) public view override returns (bool) { } function _setClaimed(uint256 index) private { } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override nonReentrant{ } }
IERC1155(token).isApprovedForAll(_addressToTransferFrom,address(this)),'Metakey Distributor not approved to spend NFT'
391,530
IERC1155(token).isApprovedForAll(_addressToTransferFrom,address(this))
'No NFTs left'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./interfaces/IMerkleDistributor.sol"; contract MetakeyDistributor is IMerkleDistributor, Ownable, ReentrancyGuard{ // __ __ __ __ _______ __ __ __ __ __ // | \ / \ | \ | \ | \ | \ | \ | \| \ | \ // | $$\ / $$ ______ _| $$_ ______ | $$ __ ______ __ __ | $$$$$$$\ \$$ _______ _| $$_ ______ \$$| $$____ __ __ _| $$_ ______ ______ // | $$$\ / $$$ / \| $$ \ | \ | $$ / \ / \ | \ | \ | $$ | $$| \ / \| $$ \ / \ | \| $$ \ | \ | \| $$ \ / \ / \ // | $$$$\ $$$$| $$$$$$\\$$$$$$ \$$$$$$\| $$_/ $$| $$$$$$\| $$ | $$ | $$ | $$| $$| $$$$$$$ \$$$$$$ | $$$$$$\| $$| $$$$$$$\| $$ | $$ \$$$$$$ | $$$$$$\| $$$$$$\ // | $$\$$ $$ $$| $$ $$ | $$ __ / $$| $$ $$ | $$ $$| $$ | $$ | $$ | $$| $$ \$$ \ | $$ __ | $$ \$$| $$| $$ | $$| $$ | $$ | $$ __ | $$ | $$| $$ \$$ // | $$ \$$$| $$| $$$$$$$$ | $$| \| $$$$$$$| $$$$$$\ | $$$$$$$$| $$__/ $$ | $$__/ $$| $$ _\$$$$$$\ | $$| \| $$ | $$| $$__/ $$| $$__/ $$ | $$| \| $$__/ $$| $$ // | $$ \$ | $$ \$$ \ \$$ $$ \$$ $$| $$ \$$\ \$$ \ \$$ $$ | $$ $$| $$| $$ \$$ $$| $$ | $$| $$ $$ \$$ $$ \$$ $$ \$$ $$| $$ // \$$ \$$ \$$$$$$$ \$$$$ \$$$$$$$ \$$ \$$ \$$$$$$$ _\$$$$$$$ \$$$$$$$ \$$ \$$$$$$$ \$$$$ \$$ \$$ \$$$$$$$ \$$$$$$ \$$$$ \$$$$$$ \$$ // | \__| $$ // \$$ $$ // \$$$$$$ //token address address public override token; bytes32 public override merkleRoot; //This is a packed array of booleans. mapping(uint256 => mapping(uint256 => uint256)) private claimedBitMap; uint256 public currentDropIndex = 0; uint256 public deadline; uint256 public tokenIdToTransfer; address public addressToTransferFrom; event TokenIdSet(uint id, address from, uint time); event MerkleRootAndTokenSet(bytes32 root, address token); constructor(address token_, bytes32 merkleRoot_) { } /** * @dev Sets the token id to transfer, claim deadline and address to transfer from */ function setTransferIdAndAccount(uint _tokenIdToTransfer, uint _deadline, address _addressToTransferFrom) private { } function setDeadline(uint _deadline) external onlyOwner { } function getSetTokenId() external view returns(uint){ } /** * @dev Sets the new merkle root */ function setClaimConfig (address token_, bytes32 merkleRoot_, uint _tokenIdToTransfer, uint _deadline, address _addressToTransferFrom) external onlyOwner { } function isClaimed(uint256 index) public view override returns (bool) { } function _setClaimed(uint256 index) private { } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override nonReentrant{ require(block.timestamp <= deadline, "The claiming time has passed."); require(<FILL_ME>) require(!isClaimed(index), 'Metakey Distributor: NFT already claimed.'); require(account != address(0), "Cannot mint to 0x0."); // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Metakey Distributor: Invalid proof.'); // Mark it claimed and send the token. _setClaimed(index); IERC1155(token).safeTransferFrom(addressToTransferFrom, account, tokenIdToTransfer, amount, ''); emit Claimed(index, account, amount); } }
IERC1155(token).balanceOf(addressToTransferFrom,tokenIdToTransfer)>=amount,'No NFTs left'
391,530
IERC1155(token).balanceOf(addressToTransferFrom,tokenIdToTransfer)>=amount
"Nyx balance too low"
pragma solidity 0.8.11; contract NyxGenesisRewards is Ownable, Pausable, ReentrancyGuard { using SafeERC20 for IERC20; // Nyx Genesis NFT's IERC721Enumerable public immutable nyxGenesis; // Nyx token for rewards IERC20 public immutable nyxToken; // current distribution period uint256 public epoch; uint256 public epochCounter; // distribtion time schedule uint256 public period = 86400; // total rewards distributed to tier 1-2 NFTs uint256 public commonDistributedRewards; // tier 1-2 = 0.75% total distribution per distribution period uint256 commonShare = 75; // total tier 1-2 NFTs uint256 constant commonNumber = 105; // total rewards distributed to tier 3 NFTs uint256 public rareDistributedRewards; // tier 3 = 0.5% total distribution per distribution period uint256 rareShare = 50; // total tier 3 NFTs uint256 constant rareNumber = 39; // total rewards distributed to tier 4 NFTs uint256 public nyxDistributedRewards; // tier 4 = 0.5% total distribution per distribution period uint256 nyxShare = 50; // total tier 4 NFTs uint256 constant nyxNumber = 9; // total distributed rewards uint256 public totalDistributedRewards; // total initial deposit uint256 public totalContractBalance = 125e11 * 10**9; uint256 HUNDRED_PERCENT = 10**4; uint256 THRESHOLD_AMOUNT = 10**4 * 10**9; // active is set to true when contract is instantiated, or re-initiated. // it is set to false when there are no more rewards to be distributed bool public active; struct NFT { uint256 rewardDebt; } NFT[153] genesisNFTs; event Claim( address indexed _user, uint256 indexed _tokenId, uint256 _amount ); event ClaimMultiple( address indexed _user, uint256[] indexed _tokenIds, uint256 _amount ); event RewardsUpdated(address indexed _user, uint256 _amount); constructor(address _nyxg, address _nyxt) { } modifier onlyWithSufficientBalance() { require(<FILL_ME>) _; } modifier whenActive() { } modifier claimChecks(uint256 _tokenId) { } function claim(uint256 _tokenId) external whenNotPaused nonReentrant onlyWithSufficientBalance claimChecks(_tokenId) { } function getRewards(uint256 _tokenId) internal view returns (uint256 pendingNyx) { } function claimMultiple(address _user) external whenNotPaused nonReentrant onlyWithSufficientBalance { } function getPendingRewardsAndUpdateNFT(address _user) internal returns (uint256 pendingNyx) { } function pendingRewards(address _user) public view returns (uint256) { } function distribute() external onlyOwner onlyWithSufficientBalance { } function _updateRewards( uint256 _totalContractBalance, uint256 _totalDistributedRewards ) internal view returns ( uint256, uint256, uint256, uint256 ) { } function updateRewards() internal whenActive{ } function calculateCommonAllocation(uint256 _balance) public view returns (uint256, uint256) { } function calculateRareAllocation(uint256 _balance) public view returns (uint256, uint256) { } function calculateNyxAllocation(uint256 _balance) public view returns (uint256, uint256) { } /** * ADMIN FUNCTIONS */ function setPeriod(uint256 _period) external onlyOwner { } function pauseClaims() external onlyOwner { } function unpauseClaims() external onlyOwner { } function withdrawToken(address _token) external onlyOwner { } function withdrawEth() external onlyOwner { } function setTotalContractBalance(uint256 _amount) external onlyOwner { } }
nyxToken.balanceOf(address(this))>THRESHOLD_AMOUNT,"Nyx balance too low"
391,641
nyxToken.balanceOf(address(this))>THRESHOLD_AMOUNT
"Wrong caller"
pragma solidity 0.8.11; contract NyxGenesisRewards is Ownable, Pausable, ReentrancyGuard { using SafeERC20 for IERC20; // Nyx Genesis NFT's IERC721Enumerable public immutable nyxGenesis; // Nyx token for rewards IERC20 public immutable nyxToken; // current distribution period uint256 public epoch; uint256 public epochCounter; // distribtion time schedule uint256 public period = 86400; // total rewards distributed to tier 1-2 NFTs uint256 public commonDistributedRewards; // tier 1-2 = 0.75% total distribution per distribution period uint256 commonShare = 75; // total tier 1-2 NFTs uint256 constant commonNumber = 105; // total rewards distributed to tier 3 NFTs uint256 public rareDistributedRewards; // tier 3 = 0.5% total distribution per distribution period uint256 rareShare = 50; // total tier 3 NFTs uint256 constant rareNumber = 39; // total rewards distributed to tier 4 NFTs uint256 public nyxDistributedRewards; // tier 4 = 0.5% total distribution per distribution period uint256 nyxShare = 50; // total tier 4 NFTs uint256 constant nyxNumber = 9; // total distributed rewards uint256 public totalDistributedRewards; // total initial deposit uint256 public totalContractBalance = 125e11 * 10**9; uint256 HUNDRED_PERCENT = 10**4; uint256 THRESHOLD_AMOUNT = 10**4 * 10**9; // active is set to true when contract is instantiated, or re-initiated. // it is set to false when there are no more rewards to be distributed bool public active; struct NFT { uint256 rewardDebt; } NFT[153] genesisNFTs; event Claim( address indexed _user, uint256 indexed _tokenId, uint256 _amount ); event ClaimMultiple( address indexed _user, uint256[] indexed _tokenIds, uint256 _amount ); event RewardsUpdated(address indexed _user, uint256 _amount); constructor(address _nyxg, address _nyxt) { } modifier onlyWithSufficientBalance() { } modifier whenActive() { } modifier claimChecks(uint256 _tokenId) { require(<FILL_ME>) require(_tokenId < 153, "Invalid token ID"); _; } function claim(uint256 _tokenId) external whenNotPaused nonReentrant onlyWithSufficientBalance claimChecks(_tokenId) { } function getRewards(uint256 _tokenId) internal view returns (uint256 pendingNyx) { } function claimMultiple(address _user) external whenNotPaused nonReentrant onlyWithSufficientBalance { } function getPendingRewardsAndUpdateNFT(address _user) internal returns (uint256 pendingNyx) { } function pendingRewards(address _user) public view returns (uint256) { } function distribute() external onlyOwner onlyWithSufficientBalance { } function _updateRewards( uint256 _totalContractBalance, uint256 _totalDistributedRewards ) internal view returns ( uint256, uint256, uint256, uint256 ) { } function updateRewards() internal whenActive{ } function calculateCommonAllocation(uint256 _balance) public view returns (uint256, uint256) { } function calculateRareAllocation(uint256 _balance) public view returns (uint256, uint256) { } function calculateNyxAllocation(uint256 _balance) public view returns (uint256, uint256) { } /** * ADMIN FUNCTIONS */ function setPeriod(uint256 _period) external onlyOwner { } function pauseClaims() external onlyOwner { } function unpauseClaims() external onlyOwner { } function withdrawToken(address _token) external onlyOwner { } function withdrawEth() external onlyOwner { } function setTotalContractBalance(uint256 _amount) external onlyOwner { } }
nyxGenesis.ownerOf(_tokenId)==msg.sender,"Wrong caller"
391,641
nyxGenesis.ownerOf(_tokenId)==msg.sender
"INVALID_CATALYST_NOT_ENOUGH"
pragma solidity 0.6.5; pragma experimental ABIEncoderV2; import "./Interfaces/AssetToken.sol"; import "./common/Interfaces/ERC20.sol"; import "./Interfaces/ERC20Extended.sol"; import "./common/BaseWithStorage/MetaTransactionReceiver.sol"; import "./common/Libraries/SafeMathWithRequire.sol"; import "./Catalyst/GemToken.sol"; import "./Catalyst/CatalystToken.sol"; import "./CatalystRegistry.sol"; import "./BaseWithStorage/ERC20Group.sol"; /// @notice Gateway to mint Asset with Catalyst, Gems and Sand contract CatalystMinter is MetaTransactionReceiver { /// @dev emitted when fee collector (that receive the sand fee) get changed /// @param newCollector address of the new collector, address(0) means the fee will be burned event FeeCollector(address newCollector); function setFeeCollector(address newCollector) external { } event GemAdditionFee(uint256 newFee); function setGemAdditionFee(uint256 newFee) external { } /// @notice mint one Asset token. /// @param from address creating the Asset, need to be the tx sender or meta tx signer. /// @param packId unused packId that will let you predict the resulting tokenId. /// @param metadataHash cidv1 ipfs hash of the folder where 0.json file contains the metadata. /// @param catalystId address of the Catalyst ERC20 token to burn. /// @param gemIds list of gem ids to burn in the catalyst. /// @param quantity asset supply to mint /// @param to destination address receiving the minted tokens. /// @param data extra data. function mint( address from, uint40 packId, bytes32 metadataHash, uint256 catalystId, uint256[] calldata gemIds, uint256 quantity, address to, bytes calldata data ) external returns (uint256) { } /// @notice associate a catalyst to a fungible Asset token by extracting it as ERC721 first. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being extracted. /// @param catalystId address of the catalyst token to use and burn. /// @param gemIds list of gems to socket into the catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function extractAndChangeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice associate a new catalyst to a non-fungible Asset token. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being updated. /// @param catalystId address of the catalyst token to use and burn. /// @param gemIds list of gems to socket into the catalyst (burned). /// @param to destination address receiving the Asset token. function changeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice add gems to a fungible Asset token by extracting it as ERC721 first. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being extracted. /// @param gemIds list of gems to socket into the existing catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function extractAndAddGems( address from, uint256 assetId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice add gems to a non-fungible Asset token. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset to which the gems will be added to. /// @param gemIds list of gems to socket into the existing catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function addGems( address from, uint256 assetId, uint256[] calldata gemIds, address to ) external { } struct AssetData { uint256[] gemIds; uint256 quantity; uint256 catalystId; } /// @notice mint multiple Asset tokens. /// @param from address creating the Asset, need to be the tx sender or meta tx signer. /// @param packId unused packId that will let you predict the resulting tokenId. /// @param metadataHash cidv1 ipfs hash of the folder where 0.json file contains the metadata. /// @param gemsQuantities quantities of gems to be used for each id in order /// @param catalystsQuantities quantities of catalyst to be used for each id in order /// @param assets contains the data to associate catalyst and gems to the assets. /// @param to destination address receiving the minted tokens. /// @param data extra data. function mintMultiple( address from, uint40 packId, bytes32 metadataHash, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets, address to, bytes memory data ) public returns (uint256[] memory ids) { } // //////////////////// INTERNALS //////////////////// function _checkQuantityAndBurnSandAndGems( address from, uint256 catalystId, uint256[] memory gemIds, uint256 quantity ) internal returns (uint16) { } function _mintMultiple( address from, uint40 packId, bytes32 metadataHash, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets, address to, bytes memory data ) internal returns (uint256[] memory) { } function _chargeSand(address from, uint256 sandFee) internal { } function _extractMintData(uint256 data) internal pure returns ( uint16 maxGems, uint16 minQuantity, uint16 maxQuantity, uint256 sandMintingFee, uint256 sandUpdateFee ) { } function _getMintData(uint256 catalystId) internal view returns ( uint16, uint16, uint16, uint256, uint256 ) { } function _handleMultipleCatalysts( address from, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets ) internal returns ( uint256 totalSandFee, uint256[] memory supplies, uint16[] memory maxGemsList ) { _burnCatalysts(from, catalystsQuantities); _burnGems(from, gemsQuantities); supplies = new uint256[](assets.length); maxGemsList = new uint16[](assets.length); for (uint256 i = 0; i < assets.length; i++) { require(<FILL_ME>) catalystsQuantities[assets[i].catalystId]--; gemsQuantities = _checkGemsQuantities(gemsQuantities, assets[i].gemIds); (uint16 maxGems, uint16 minQuantity, uint16 maxQuantity, uint256 sandMintingFee, ) = _getMintData(assets[i].catalystId); require(minQuantity <= assets[i].quantity && assets[i].quantity <= maxQuantity, "INVALID_QUANTITY"); require(assets[i].gemIds.length <= maxGems, "INVALID_GEMS_TOO_MANY"); maxGemsList[i] = maxGems; supplies[i] = assets[i].quantity; totalSandFee = totalSandFee.add(sandMintingFee.mul(assets[i].quantity)); } } function _checkGemsQuantities(uint256[] memory gemsQuantities, uint256[] memory gemIds) internal pure returns (uint256[] memory) { } function _burnCatalysts(address from, uint256[] memory catalystsQuantities) internal { } function _burnGems(address from, uint256[] memory gemsQuantities) internal { } function _mintAssets( address from, uint40 packId, bytes32 metadataHash, AssetData[] memory assets, uint256[] memory supplies, uint16[] memory maxGemsList, address to, bytes memory data ) internal returns (uint256[] memory tokenIds) { } function _changeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] memory gemIds, address to ) internal { } function _addGems( address from, uint256 assetId, uint256[] memory gemIds, address to ) internal { } function _transfer( address from, address to, uint256 assetId ) internal { } function _checkAuthorization(address from, address to) internal view { } function _burnSingleGems(address from, uint256[] memory gemIds) internal { } function _burnCatalyst(address from, uint256 catalystId) internal { } function _setFeeCollector(address newCollector) internal { } function _setGemAdditionFee(uint256 newFee) internal { } // /////////////////// UTILITIES ///////////////////// using SafeMathWithRequire for uint256; // //////////////////////// DATA ///////////////////// uint256 private constant IS_NFT = 0x0000000000000000000000000000000000000000800000000000000000000000; address private constant BURN_ADDRESS = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF; ERC20Extended internal immutable _sand; AssetToken internal immutable _asset; GemToken internal immutable _gems; CatalystToken internal immutable _catalysts; CatalystRegistry internal immutable _catalystRegistry; address internal _feeCollector; uint256 internal immutable _common_mint_data; uint256 internal immutable _rare_mint_data; uint256 internal immutable _epic_mint_data; uint256 internal immutable _legendary_mint_data; uint256 internal _gemAdditionFee; // /////////////////// CONSTRUCTOR //////////////////// constructor( CatalystRegistry catalystRegistry, ERC20Extended sand, AssetToken asset, GemToken gems, address metaTx, address admin, address feeCollector, uint256 gemAdditionFee, CatalystToken catalysts, uint256[4] memory bakedInMintdata ) public { } }
catalystsQuantities[assets[i].catalystId]!=0,"INVALID_CATALYST_NOT_ENOUGH"
391,655
catalystsQuantities[assets[i].catalystId]!=0
"INVALID_GEMS_TOO_MANY"
pragma solidity 0.6.5; pragma experimental ABIEncoderV2; import "./Interfaces/AssetToken.sol"; import "./common/Interfaces/ERC20.sol"; import "./Interfaces/ERC20Extended.sol"; import "./common/BaseWithStorage/MetaTransactionReceiver.sol"; import "./common/Libraries/SafeMathWithRequire.sol"; import "./Catalyst/GemToken.sol"; import "./Catalyst/CatalystToken.sol"; import "./CatalystRegistry.sol"; import "./BaseWithStorage/ERC20Group.sol"; /// @notice Gateway to mint Asset with Catalyst, Gems and Sand contract CatalystMinter is MetaTransactionReceiver { /// @dev emitted when fee collector (that receive the sand fee) get changed /// @param newCollector address of the new collector, address(0) means the fee will be burned event FeeCollector(address newCollector); function setFeeCollector(address newCollector) external { } event GemAdditionFee(uint256 newFee); function setGemAdditionFee(uint256 newFee) external { } /// @notice mint one Asset token. /// @param from address creating the Asset, need to be the tx sender or meta tx signer. /// @param packId unused packId that will let you predict the resulting tokenId. /// @param metadataHash cidv1 ipfs hash of the folder where 0.json file contains the metadata. /// @param catalystId address of the Catalyst ERC20 token to burn. /// @param gemIds list of gem ids to burn in the catalyst. /// @param quantity asset supply to mint /// @param to destination address receiving the minted tokens. /// @param data extra data. function mint( address from, uint40 packId, bytes32 metadataHash, uint256 catalystId, uint256[] calldata gemIds, uint256 quantity, address to, bytes calldata data ) external returns (uint256) { } /// @notice associate a catalyst to a fungible Asset token by extracting it as ERC721 first. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being extracted. /// @param catalystId address of the catalyst token to use and burn. /// @param gemIds list of gems to socket into the catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function extractAndChangeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice associate a new catalyst to a non-fungible Asset token. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being updated. /// @param catalystId address of the catalyst token to use and burn. /// @param gemIds list of gems to socket into the catalyst (burned). /// @param to destination address receiving the Asset token. function changeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice add gems to a fungible Asset token by extracting it as ERC721 first. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being extracted. /// @param gemIds list of gems to socket into the existing catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function extractAndAddGems( address from, uint256 assetId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice add gems to a non-fungible Asset token. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset to which the gems will be added to. /// @param gemIds list of gems to socket into the existing catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function addGems( address from, uint256 assetId, uint256[] calldata gemIds, address to ) external { } struct AssetData { uint256[] gemIds; uint256 quantity; uint256 catalystId; } /// @notice mint multiple Asset tokens. /// @param from address creating the Asset, need to be the tx sender or meta tx signer. /// @param packId unused packId that will let you predict the resulting tokenId. /// @param metadataHash cidv1 ipfs hash of the folder where 0.json file contains the metadata. /// @param gemsQuantities quantities of gems to be used for each id in order /// @param catalystsQuantities quantities of catalyst to be used for each id in order /// @param assets contains the data to associate catalyst and gems to the assets. /// @param to destination address receiving the minted tokens. /// @param data extra data. function mintMultiple( address from, uint40 packId, bytes32 metadataHash, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets, address to, bytes memory data ) public returns (uint256[] memory ids) { } // //////////////////// INTERNALS //////////////////// function _checkQuantityAndBurnSandAndGems( address from, uint256 catalystId, uint256[] memory gemIds, uint256 quantity ) internal returns (uint16) { } function _mintMultiple( address from, uint40 packId, bytes32 metadataHash, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets, address to, bytes memory data ) internal returns (uint256[] memory) { } function _chargeSand(address from, uint256 sandFee) internal { } function _extractMintData(uint256 data) internal pure returns ( uint16 maxGems, uint16 minQuantity, uint16 maxQuantity, uint256 sandMintingFee, uint256 sandUpdateFee ) { } function _getMintData(uint256 catalystId) internal view returns ( uint16, uint16, uint16, uint256, uint256 ) { } function _handleMultipleCatalysts( address from, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets ) internal returns ( uint256 totalSandFee, uint256[] memory supplies, uint16[] memory maxGemsList ) { _burnCatalysts(from, catalystsQuantities); _burnGems(from, gemsQuantities); supplies = new uint256[](assets.length); maxGemsList = new uint16[](assets.length); for (uint256 i = 0; i < assets.length; i++) { require(catalystsQuantities[assets[i].catalystId] != 0, "INVALID_CATALYST_NOT_ENOUGH"); catalystsQuantities[assets[i].catalystId]--; gemsQuantities = _checkGemsQuantities(gemsQuantities, assets[i].gemIds); (uint16 maxGems, uint16 minQuantity, uint16 maxQuantity, uint256 sandMintingFee, ) = _getMintData(assets[i].catalystId); require(minQuantity <= assets[i].quantity && assets[i].quantity <= maxQuantity, "INVALID_QUANTITY"); require(<FILL_ME>) maxGemsList[i] = maxGems; supplies[i] = assets[i].quantity; totalSandFee = totalSandFee.add(sandMintingFee.mul(assets[i].quantity)); } } function _checkGemsQuantities(uint256[] memory gemsQuantities, uint256[] memory gemIds) internal pure returns (uint256[] memory) { } function _burnCatalysts(address from, uint256[] memory catalystsQuantities) internal { } function _burnGems(address from, uint256[] memory gemsQuantities) internal { } function _mintAssets( address from, uint40 packId, bytes32 metadataHash, AssetData[] memory assets, uint256[] memory supplies, uint16[] memory maxGemsList, address to, bytes memory data ) internal returns (uint256[] memory tokenIds) { } function _changeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] memory gemIds, address to ) internal { } function _addGems( address from, uint256 assetId, uint256[] memory gemIds, address to ) internal { } function _transfer( address from, address to, uint256 assetId ) internal { } function _checkAuthorization(address from, address to) internal view { } function _burnSingleGems(address from, uint256[] memory gemIds) internal { } function _burnCatalyst(address from, uint256 catalystId) internal { } function _setFeeCollector(address newCollector) internal { } function _setGemAdditionFee(uint256 newFee) internal { } // /////////////////// UTILITIES ///////////////////// using SafeMathWithRequire for uint256; // //////////////////////// DATA ///////////////////// uint256 private constant IS_NFT = 0x0000000000000000000000000000000000000000800000000000000000000000; address private constant BURN_ADDRESS = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF; ERC20Extended internal immutable _sand; AssetToken internal immutable _asset; GemToken internal immutable _gems; CatalystToken internal immutable _catalysts; CatalystRegistry internal immutable _catalystRegistry; address internal _feeCollector; uint256 internal immutable _common_mint_data; uint256 internal immutable _rare_mint_data; uint256 internal immutable _epic_mint_data; uint256 internal immutable _legendary_mint_data; uint256 internal _gemAdditionFee; // /////////////////// CONSTRUCTOR //////////////////// constructor( CatalystRegistry catalystRegistry, ERC20Extended sand, AssetToken asset, GemToken gems, address metaTx, address admin, address feeCollector, uint256 gemAdditionFee, CatalystToken catalysts, uint256[4] memory bakedInMintdata ) public { } }
assets[i].gemIds.length<=maxGems,"INVALID_GEMS_TOO_MANY"
391,655
assets[i].gemIds.length<=maxGems
"INVALID_GEMS_NOT_ENOUGH"
pragma solidity 0.6.5; pragma experimental ABIEncoderV2; import "./Interfaces/AssetToken.sol"; import "./common/Interfaces/ERC20.sol"; import "./Interfaces/ERC20Extended.sol"; import "./common/BaseWithStorage/MetaTransactionReceiver.sol"; import "./common/Libraries/SafeMathWithRequire.sol"; import "./Catalyst/GemToken.sol"; import "./Catalyst/CatalystToken.sol"; import "./CatalystRegistry.sol"; import "./BaseWithStorage/ERC20Group.sol"; /// @notice Gateway to mint Asset with Catalyst, Gems and Sand contract CatalystMinter is MetaTransactionReceiver { /// @dev emitted when fee collector (that receive the sand fee) get changed /// @param newCollector address of the new collector, address(0) means the fee will be burned event FeeCollector(address newCollector); function setFeeCollector(address newCollector) external { } event GemAdditionFee(uint256 newFee); function setGemAdditionFee(uint256 newFee) external { } /// @notice mint one Asset token. /// @param from address creating the Asset, need to be the tx sender or meta tx signer. /// @param packId unused packId that will let you predict the resulting tokenId. /// @param metadataHash cidv1 ipfs hash of the folder where 0.json file contains the metadata. /// @param catalystId address of the Catalyst ERC20 token to burn. /// @param gemIds list of gem ids to burn in the catalyst. /// @param quantity asset supply to mint /// @param to destination address receiving the minted tokens. /// @param data extra data. function mint( address from, uint40 packId, bytes32 metadataHash, uint256 catalystId, uint256[] calldata gemIds, uint256 quantity, address to, bytes calldata data ) external returns (uint256) { } /// @notice associate a catalyst to a fungible Asset token by extracting it as ERC721 first. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being extracted. /// @param catalystId address of the catalyst token to use and burn. /// @param gemIds list of gems to socket into the catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function extractAndChangeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice associate a new catalyst to a non-fungible Asset token. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being updated. /// @param catalystId address of the catalyst token to use and burn. /// @param gemIds list of gems to socket into the catalyst (burned). /// @param to destination address receiving the Asset token. function changeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice add gems to a fungible Asset token by extracting it as ERC721 first. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being extracted. /// @param gemIds list of gems to socket into the existing catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function extractAndAddGems( address from, uint256 assetId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice add gems to a non-fungible Asset token. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset to which the gems will be added to. /// @param gemIds list of gems to socket into the existing catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function addGems( address from, uint256 assetId, uint256[] calldata gemIds, address to ) external { } struct AssetData { uint256[] gemIds; uint256 quantity; uint256 catalystId; } /// @notice mint multiple Asset tokens. /// @param from address creating the Asset, need to be the tx sender or meta tx signer. /// @param packId unused packId that will let you predict the resulting tokenId. /// @param metadataHash cidv1 ipfs hash of the folder where 0.json file contains the metadata. /// @param gemsQuantities quantities of gems to be used for each id in order /// @param catalystsQuantities quantities of catalyst to be used for each id in order /// @param assets contains the data to associate catalyst and gems to the assets. /// @param to destination address receiving the minted tokens. /// @param data extra data. function mintMultiple( address from, uint40 packId, bytes32 metadataHash, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets, address to, bytes memory data ) public returns (uint256[] memory ids) { } // //////////////////// INTERNALS //////////////////// function _checkQuantityAndBurnSandAndGems( address from, uint256 catalystId, uint256[] memory gemIds, uint256 quantity ) internal returns (uint16) { } function _mintMultiple( address from, uint40 packId, bytes32 metadataHash, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets, address to, bytes memory data ) internal returns (uint256[] memory) { } function _chargeSand(address from, uint256 sandFee) internal { } function _extractMintData(uint256 data) internal pure returns ( uint16 maxGems, uint16 minQuantity, uint16 maxQuantity, uint256 sandMintingFee, uint256 sandUpdateFee ) { } function _getMintData(uint256 catalystId) internal view returns ( uint16, uint16, uint16, uint256, uint256 ) { } function _handleMultipleCatalysts( address from, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets ) internal returns ( uint256 totalSandFee, uint256[] memory supplies, uint16[] memory maxGemsList ) { } function _checkGemsQuantities(uint256[] memory gemsQuantities, uint256[] memory gemIds) internal pure returns (uint256[] memory) { for (uint256 i = 0; i < gemIds.length; i++) { require(<FILL_ME>) gemsQuantities[gemIds[i]]--; } return gemsQuantities; } function _burnCatalysts(address from, uint256[] memory catalystsQuantities) internal { } function _burnGems(address from, uint256[] memory gemsQuantities) internal { } function _mintAssets( address from, uint40 packId, bytes32 metadataHash, AssetData[] memory assets, uint256[] memory supplies, uint16[] memory maxGemsList, address to, bytes memory data ) internal returns (uint256[] memory tokenIds) { } function _changeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] memory gemIds, address to ) internal { } function _addGems( address from, uint256 assetId, uint256[] memory gemIds, address to ) internal { } function _transfer( address from, address to, uint256 assetId ) internal { } function _checkAuthorization(address from, address to) internal view { } function _burnSingleGems(address from, uint256[] memory gemIds) internal { } function _burnCatalyst(address from, uint256 catalystId) internal { } function _setFeeCollector(address newCollector) internal { } function _setGemAdditionFee(uint256 newFee) internal { } // /////////////////// UTILITIES ///////////////////// using SafeMathWithRequire for uint256; // //////////////////////// DATA ///////////////////// uint256 private constant IS_NFT = 0x0000000000000000000000000000000000000000800000000000000000000000; address private constant BURN_ADDRESS = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF; ERC20Extended internal immutable _sand; AssetToken internal immutable _asset; GemToken internal immutable _gems; CatalystToken internal immutable _catalysts; CatalystRegistry internal immutable _catalystRegistry; address internal _feeCollector; uint256 internal immutable _common_mint_data; uint256 internal immutable _rare_mint_data; uint256 internal immutable _epic_mint_data; uint256 internal immutable _legendary_mint_data; uint256 internal _gemAdditionFee; // /////////////////// CONSTRUCTOR //////////////////// constructor( CatalystRegistry catalystRegistry, ERC20Extended sand, AssetToken asset, GemToken gems, address metaTx, address admin, address feeCollector, uint256 gemAdditionFee, CatalystToken catalysts, uint256[4] memory bakedInMintdata ) public { } }
gemsQuantities[gemIds[i]]!=0,"INVALID_GEMS_NOT_ENOUGH"
391,655
gemsQuantities[gemIds[i]]!=0
"INVALID_NOT_NFT"
pragma solidity 0.6.5; pragma experimental ABIEncoderV2; import "./Interfaces/AssetToken.sol"; import "./common/Interfaces/ERC20.sol"; import "./Interfaces/ERC20Extended.sol"; import "./common/BaseWithStorage/MetaTransactionReceiver.sol"; import "./common/Libraries/SafeMathWithRequire.sol"; import "./Catalyst/GemToken.sol"; import "./Catalyst/CatalystToken.sol"; import "./CatalystRegistry.sol"; import "./BaseWithStorage/ERC20Group.sol"; /// @notice Gateway to mint Asset with Catalyst, Gems and Sand contract CatalystMinter is MetaTransactionReceiver { /// @dev emitted when fee collector (that receive the sand fee) get changed /// @param newCollector address of the new collector, address(0) means the fee will be burned event FeeCollector(address newCollector); function setFeeCollector(address newCollector) external { } event GemAdditionFee(uint256 newFee); function setGemAdditionFee(uint256 newFee) external { } /// @notice mint one Asset token. /// @param from address creating the Asset, need to be the tx sender or meta tx signer. /// @param packId unused packId that will let you predict the resulting tokenId. /// @param metadataHash cidv1 ipfs hash of the folder where 0.json file contains the metadata. /// @param catalystId address of the Catalyst ERC20 token to burn. /// @param gemIds list of gem ids to burn in the catalyst. /// @param quantity asset supply to mint /// @param to destination address receiving the minted tokens. /// @param data extra data. function mint( address from, uint40 packId, bytes32 metadataHash, uint256 catalystId, uint256[] calldata gemIds, uint256 quantity, address to, bytes calldata data ) external returns (uint256) { } /// @notice associate a catalyst to a fungible Asset token by extracting it as ERC721 first. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being extracted. /// @param catalystId address of the catalyst token to use and burn. /// @param gemIds list of gems to socket into the catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function extractAndChangeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice associate a new catalyst to a non-fungible Asset token. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being updated. /// @param catalystId address of the catalyst token to use and burn. /// @param gemIds list of gems to socket into the catalyst (burned). /// @param to destination address receiving the Asset token. function changeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice add gems to a fungible Asset token by extracting it as ERC721 first. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset being extracted. /// @param gemIds list of gems to socket into the existing catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function extractAndAddGems( address from, uint256 assetId, uint256[] calldata gemIds, address to ) external returns (uint256 tokenId) { } /// @notice add gems to a non-fungible Asset token. /// @param from address from which the Asset token belongs to. /// @param assetId tokenId of the Asset to which the gems will be added to. /// @param gemIds list of gems to socket into the existing catalyst (burned). /// @param to destination address receiving the extracted and upgraded ERC721 Asset token. function addGems( address from, uint256 assetId, uint256[] calldata gemIds, address to ) external { } struct AssetData { uint256[] gemIds; uint256 quantity; uint256 catalystId; } /// @notice mint multiple Asset tokens. /// @param from address creating the Asset, need to be the tx sender or meta tx signer. /// @param packId unused packId that will let you predict the resulting tokenId. /// @param metadataHash cidv1 ipfs hash of the folder where 0.json file contains the metadata. /// @param gemsQuantities quantities of gems to be used for each id in order /// @param catalystsQuantities quantities of catalyst to be used for each id in order /// @param assets contains the data to associate catalyst and gems to the assets. /// @param to destination address receiving the minted tokens. /// @param data extra data. function mintMultiple( address from, uint40 packId, bytes32 metadataHash, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets, address to, bytes memory data ) public returns (uint256[] memory ids) { } // //////////////////// INTERNALS //////////////////// function _checkQuantityAndBurnSandAndGems( address from, uint256 catalystId, uint256[] memory gemIds, uint256 quantity ) internal returns (uint16) { } function _mintMultiple( address from, uint40 packId, bytes32 metadataHash, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets, address to, bytes memory data ) internal returns (uint256[] memory) { } function _chargeSand(address from, uint256 sandFee) internal { } function _extractMintData(uint256 data) internal pure returns ( uint16 maxGems, uint16 minQuantity, uint16 maxQuantity, uint256 sandMintingFee, uint256 sandUpdateFee ) { } function _getMintData(uint256 catalystId) internal view returns ( uint16, uint16, uint16, uint256, uint256 ) { } function _handleMultipleCatalysts( address from, uint256[] memory gemsQuantities, uint256[] memory catalystsQuantities, AssetData[] memory assets ) internal returns ( uint256 totalSandFee, uint256[] memory supplies, uint16[] memory maxGemsList ) { } function _checkGemsQuantities(uint256[] memory gemsQuantities, uint256[] memory gemIds) internal pure returns (uint256[] memory) { } function _burnCatalysts(address from, uint256[] memory catalystsQuantities) internal { } function _burnGems(address from, uint256[] memory gemsQuantities) internal { } function _mintAssets( address from, uint40 packId, bytes32 metadataHash, AssetData[] memory assets, uint256[] memory supplies, uint16[] memory maxGemsList, address to, bytes memory data ) internal returns (uint256[] memory tokenIds) { } function _changeCatalyst( address from, uint256 assetId, uint256 catalystId, uint256[] memory gemIds, address to ) internal { require(<FILL_ME>) // Asset (ERC1155ERC721.sol) ensure NFT will return true here and non-NFT will return false _burnCatalyst(from, catalystId); (uint16 maxGems, , , , uint256 sandUpdateFee) = _getMintData(catalystId); require(gemIds.length <= maxGems, "INVALID_GEMS_TOO_MANY"); _burnGems(from, gemIds); _chargeSand(from, sandUpdateFee); _catalystRegistry.setCatalyst(assetId, catalystId, maxGems, gemIds); _transfer(from, to, assetId); } function _addGems( address from, uint256 assetId, uint256[] memory gemIds, address to ) internal { } function _transfer( address from, address to, uint256 assetId ) internal { } function _checkAuthorization(address from, address to) internal view { } function _burnSingleGems(address from, uint256[] memory gemIds) internal { } function _burnCatalyst(address from, uint256 catalystId) internal { } function _setFeeCollector(address newCollector) internal { } function _setGemAdditionFee(uint256 newFee) internal { } // /////////////////// UTILITIES ///////////////////// using SafeMathWithRequire for uint256; // //////////////////////// DATA ///////////////////// uint256 private constant IS_NFT = 0x0000000000000000000000000000000000000000800000000000000000000000; address private constant BURN_ADDRESS = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF; ERC20Extended internal immutable _sand; AssetToken internal immutable _asset; GemToken internal immutable _gems; CatalystToken internal immutable _catalysts; CatalystRegistry internal immutable _catalystRegistry; address internal _feeCollector; uint256 internal immutable _common_mint_data; uint256 internal immutable _rare_mint_data; uint256 internal immutable _epic_mint_data; uint256 internal immutable _legendary_mint_data; uint256 internal _gemAdditionFee; // /////////////////// CONSTRUCTOR //////////////////// constructor( CatalystRegistry catalystRegistry, ERC20Extended sand, AssetToken asset, GemToken gems, address metaTx, address admin, address feeCollector, uint256 gemAdditionFee, CatalystToken catalysts, uint256[4] memory bakedInMintdata ) public { } }
assetId&IS_NFT!=0,"INVALID_NOT_NFT"
391,655
assetId&IS_NFT!=0
null
// Based on contract by Dev by @bitcoinski + @ultra_dao. Extended by @georgefatlion pragma solidity ^0.8.4; contract KalebsEditions is AbstractEditionContract { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private editionCounter; event Claimed(uint index, address indexed account, uint amount); event ClaimedMultiple(uint[] index, address indexed account, uint[] amount); mapping(uint256 => Edition) public editions; string public _contractURI; struct Edition { bytes32 merkleRoot; bool saleIsOpen; uint256 mintPrice; uint256 maxSupply; uint256 maxPerWallet; uint256 maxMintPerTxn; string metadataLink; bool merkleProtect; bool claimMultiple; mapping(address => uint256) claimedAddress; } constructor( string memory _name, string memory _symbol ) ERC1155("Editions") { } function addEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _maxPerWallet, bool _merkleProtect ) external onlyOwner { } function editEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _editionIndex, bool _saleIsOpen, uint256 _maxPerWallet, bool _merkleProtect, bool _claimMultiple ) external onlyOwner { } function claim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof ) external payable { // verify call is valid require(<FILL_ME>) _mint(msg.sender, editionIndex, numPieces, ""); editions[editionIndex].claimedAddress[msg.sender] = editions[editionIndex].claimedAddress[msg.sender].add(numPieces); emit Claimed(editionIndex, msg.sender, numPieces); } function claimMultiple( uint256[] calldata numPieces, uint256[] calldata amounts, uint256[] calldata editionIndexes, bytes32[][] calldata merkleProofs ) external payable { } function mint( address to, uint256 editionIndex, uint256 numPieces ) public onlyOwner { } function mintBatch( address to, uint256[] calldata editionIndexes, uint256[] calldata numPieces ) public onlyOwner { } function isValidClaim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof) internal view returns (bool) { } function isSaleOpen(uint256 editionIndex) public view returns (bool) { } function setSaleState(uint256 editionIndex, bool state) external onlyOwner{ } function verifyMerkleProof(bytes32[] memory proof, bytes32 root) public view returns (bool) { } function char(bytes1 b) internal pure returns (bytes1 c) { } function withdrawEther(address payable _to, uint256 _amount) public onlyOwner { } function getClaimedMps(uint256 poolId, address userAdress) public view returns (uint256) { } function uri(uint256 _id) public view override returns (string memory) { } function setContractURI(string memory newURI) external onlyOwner{ } function contractURI() public view returns (string memory) { } }
isValidClaim(numPieces,amount,editionIndex,merkleProof)
391,676
isValidClaim(numPieces,amount,editionIndex,merkleProof)
"One or more claims are invalid"
// Based on contract by Dev by @bitcoinski + @ultra_dao. Extended by @georgefatlion pragma solidity ^0.8.4; contract KalebsEditions is AbstractEditionContract { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private editionCounter; event Claimed(uint index, address indexed account, uint amount); event ClaimedMultiple(uint[] index, address indexed account, uint[] amount); mapping(uint256 => Edition) public editions; string public _contractURI; struct Edition { bytes32 merkleRoot; bool saleIsOpen; uint256 mintPrice; uint256 maxSupply; uint256 maxPerWallet; uint256 maxMintPerTxn; string metadataLink; bool merkleProtect; bool claimMultiple; mapping(address => uint256) claimedAddress; } constructor( string memory _name, string memory _symbol ) ERC1155("Editions") { } function addEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _maxPerWallet, bool _merkleProtect ) external onlyOwner { } function editEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _editionIndex, bool _saleIsOpen, uint256 _maxPerWallet, bool _merkleProtect, bool _claimMultiple ) external onlyOwner { } function claim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof ) external payable { } function claimMultiple( uint256[] calldata numPieces, uint256[] calldata amounts, uint256[] calldata editionIndexes, bytes32[][] calldata merkleProofs ) external payable { // verify contract is not paused require(!paused(), "Claim: claiming is paused"); //validate all tokens being claimed and aggregate a total cost due uint256 totalPrice = 0; for (uint i=0; i< editionIndexes.length; i++) { require(<FILL_ME>) require(editions[editionIndexes[i]].claimMultiple, "Claim multiple not enabled."); totalPrice.add(numPieces[i].mul(editions[editionIndexes[i]].mintPrice)); } // check the message has enough value to cover all tokens. require(msg.value >= totalPrice, "Value not enough to cover all transactions"); for (uint i=0; i< editionIndexes.length; i++) { require(isValidClaim(numPieces[i],amounts[i],editionIndexes[i],merkleProofs[i]), "One or more claims are invalid"); editions[editionIndexes[i]].claimedAddress[msg.sender] = editions[editionIndexes[i]].claimedAddress[msg.sender].add(numPieces[i]); } _mintBatch(msg.sender, editionIndexes, numPieces, ""); emit ClaimedMultiple(editionIndexes, msg.sender, numPieces); } function mint( address to, uint256 editionIndex, uint256 numPieces ) public onlyOwner { } function mintBatch( address to, uint256[] calldata editionIndexes, uint256[] calldata numPieces ) public onlyOwner { } function isValidClaim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof) internal view returns (bool) { } function isSaleOpen(uint256 editionIndex) public view returns (bool) { } function setSaleState(uint256 editionIndex, bool state) external onlyOwner{ } function verifyMerkleProof(bytes32[] memory proof, bytes32 root) public view returns (bool) { } function char(bytes1 b) internal pure returns (bytes1 c) { } function withdrawEther(address payable _to, uint256 _amount) public onlyOwner { } function getClaimedMps(uint256 poolId, address userAdress) public view returns (uint256) { } function uri(uint256 _id) public view override returns (string memory) { } function setContractURI(string memory newURI) external onlyOwner{ } function contractURI() public view returns (string memory) { } }
isValidClaim(numPieces[i],amounts[i],editionIndexes[i],merkleProofs[i]),"One or more claims are invalid"
391,676
isValidClaim(numPieces[i],amounts[i],editionIndexes[i],merkleProofs[i])
"Claim multiple not enabled."
// Based on contract by Dev by @bitcoinski + @ultra_dao. Extended by @georgefatlion pragma solidity ^0.8.4; contract KalebsEditions is AbstractEditionContract { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private editionCounter; event Claimed(uint index, address indexed account, uint amount); event ClaimedMultiple(uint[] index, address indexed account, uint[] amount); mapping(uint256 => Edition) public editions; string public _contractURI; struct Edition { bytes32 merkleRoot; bool saleIsOpen; uint256 mintPrice; uint256 maxSupply; uint256 maxPerWallet; uint256 maxMintPerTxn; string metadataLink; bool merkleProtect; bool claimMultiple; mapping(address => uint256) claimedAddress; } constructor( string memory _name, string memory _symbol ) ERC1155("Editions") { } function addEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _maxPerWallet, bool _merkleProtect ) external onlyOwner { } function editEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _editionIndex, bool _saleIsOpen, uint256 _maxPerWallet, bool _merkleProtect, bool _claimMultiple ) external onlyOwner { } function claim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof ) external payable { } function claimMultiple( uint256[] calldata numPieces, uint256[] calldata amounts, uint256[] calldata editionIndexes, bytes32[][] calldata merkleProofs ) external payable { // verify contract is not paused require(!paused(), "Claim: claiming is paused"); //validate all tokens being claimed and aggregate a total cost due uint256 totalPrice = 0; for (uint i=0; i< editionIndexes.length; i++) { require(isValidClaim(numPieces[i],amounts[i],editionIndexes[i],merkleProofs[i]), "One or more claims are invalid"); require(<FILL_ME>) totalPrice.add(numPieces[i].mul(editions[editionIndexes[i]].mintPrice)); } // check the message has enough value to cover all tokens. require(msg.value >= totalPrice, "Value not enough to cover all transactions"); for (uint i=0; i< editionIndexes.length; i++) { require(isValidClaim(numPieces[i],amounts[i],editionIndexes[i],merkleProofs[i]), "One or more claims are invalid"); editions[editionIndexes[i]].claimedAddress[msg.sender] = editions[editionIndexes[i]].claimedAddress[msg.sender].add(numPieces[i]); } _mintBatch(msg.sender, editionIndexes, numPieces, ""); emit ClaimedMultiple(editionIndexes, msg.sender, numPieces); } function mint( address to, uint256 editionIndex, uint256 numPieces ) public onlyOwner { } function mintBatch( address to, uint256[] calldata editionIndexes, uint256[] calldata numPieces ) public onlyOwner { } function isValidClaim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof) internal view returns (bool) { } function isSaleOpen(uint256 editionIndex) public view returns (bool) { } function setSaleState(uint256 editionIndex, bool state) external onlyOwner{ } function verifyMerkleProof(bytes32[] memory proof, bytes32 root) public view returns (bool) { } function char(bytes1 b) internal pure returns (bytes1 c) { } function withdrawEther(address payable _to, uint256 _amount) public onlyOwner { } function getClaimedMps(uint256 poolId, address userAdress) public view returns (uint256) { } function uri(uint256 _id) public view override returns (string memory) { } function setContractURI(string memory newURI) external onlyOwner{ } function contractURI() public view returns (string memory) { } }
editions[editionIndexes[i]].claimMultiple,"Claim multiple not enabled."
391,676
editions[editionIndexes[i]].claimMultiple
"Claim: Edition does not exist"
// Based on contract by Dev by @bitcoinski + @ultra_dao. Extended by @georgefatlion pragma solidity ^0.8.4; contract KalebsEditions is AbstractEditionContract { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private editionCounter; event Claimed(uint index, address indexed account, uint amount); event ClaimedMultiple(uint[] index, address indexed account, uint[] amount); mapping(uint256 => Edition) public editions; string public _contractURI; struct Edition { bytes32 merkleRoot; bool saleIsOpen; uint256 mintPrice; uint256 maxSupply; uint256 maxPerWallet; uint256 maxMintPerTxn; string metadataLink; bool merkleProtect; bool claimMultiple; mapping(address => uint256) claimedAddress; } constructor( string memory _name, string memory _symbol ) ERC1155("Editions") { } function addEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _maxPerWallet, bool _merkleProtect ) external onlyOwner { } function editEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _editionIndex, bool _saleIsOpen, uint256 _maxPerWallet, bool _merkleProtect, bool _claimMultiple ) external onlyOwner { } function claim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof ) external payable { } function claimMultiple( uint256[] calldata numPieces, uint256[] calldata amounts, uint256[] calldata editionIndexes, bytes32[][] calldata merkleProofs ) external payable { } function mint( address to, uint256 editionIndex, uint256 numPieces ) public onlyOwner { } function mintBatch( address to, uint256[] calldata editionIndexes, uint256[] calldata numPieces ) public onlyOwner { } function isValidClaim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof) internal view returns (bool) { // verify contract is not paused require(!paused(), "Claim: claiming is paused"); // verify edition for given index exists require(<FILL_ME>) // verify sale for given edition is open. require(editions[editionIndex].saleIsOpen, "Sale is paused"); // Verify minting price require(msg.value >= numPieces.mul(editions[editionIndex].mintPrice), "Claim: Ether value incorrect"); // Verify numPieces is within remaining claimable amount require(editions[editionIndex].claimedAddress[msg.sender].add(numPieces) <= amount, "Claim: Not allowed to claim given amount"); require(editions[editionIndex].claimedAddress[msg.sender].add(numPieces) <= editions[editionIndex].maxPerWallet, "Claim: Not allowed to claim that many from one wallet"); require(numPieces <= editions[editionIndex].maxMintPerTxn, "Max quantity per transaction exceeded"); require(totalSupply(editionIndex) + numPieces <= editions[editionIndex].maxSupply, "Purchase would exceed max supply"); bool isValid = true; if (editions[editionIndex].merkleProtect) { isValid = verifyMerkleProof(merkleProof, editions[editionIndex].merkleRoot); require( isValid, "MerkleDistributor: Invalid proof." ); } return isValid; } function isSaleOpen(uint256 editionIndex) public view returns (bool) { } function setSaleState(uint256 editionIndex, bool state) external onlyOwner{ } function verifyMerkleProof(bytes32[] memory proof, bytes32 root) public view returns (bool) { } function char(bytes1 b) internal pure returns (bytes1 c) { } function withdrawEther(address payable _to, uint256 _amount) public onlyOwner { } function getClaimedMps(uint256 poolId, address userAdress) public view returns (uint256) { } function uri(uint256 _id) public view override returns (string memory) { } function setContractURI(string memory newURI) external onlyOwner{ } function contractURI() public view returns (string memory) { } }
editions[editionIndex].maxSupply!=0,"Claim: Edition does not exist"
391,676
editions[editionIndex].maxSupply!=0
"Sale is paused"
// Based on contract by Dev by @bitcoinski + @ultra_dao. Extended by @georgefatlion pragma solidity ^0.8.4; contract KalebsEditions is AbstractEditionContract { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private editionCounter; event Claimed(uint index, address indexed account, uint amount); event ClaimedMultiple(uint[] index, address indexed account, uint[] amount); mapping(uint256 => Edition) public editions; string public _contractURI; struct Edition { bytes32 merkleRoot; bool saleIsOpen; uint256 mintPrice; uint256 maxSupply; uint256 maxPerWallet; uint256 maxMintPerTxn; string metadataLink; bool merkleProtect; bool claimMultiple; mapping(address => uint256) claimedAddress; } constructor( string memory _name, string memory _symbol ) ERC1155("Editions") { } function addEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _maxPerWallet, bool _merkleProtect ) external onlyOwner { } function editEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _editionIndex, bool _saleIsOpen, uint256 _maxPerWallet, bool _merkleProtect, bool _claimMultiple ) external onlyOwner { } function claim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof ) external payable { } function claimMultiple( uint256[] calldata numPieces, uint256[] calldata amounts, uint256[] calldata editionIndexes, bytes32[][] calldata merkleProofs ) external payable { } function mint( address to, uint256 editionIndex, uint256 numPieces ) public onlyOwner { } function mintBatch( address to, uint256[] calldata editionIndexes, uint256[] calldata numPieces ) public onlyOwner { } function isValidClaim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof) internal view returns (bool) { // verify contract is not paused require(!paused(), "Claim: claiming is paused"); // verify edition for given index exists require(editions[editionIndex].maxSupply != 0, "Claim: Edition does not exist"); // verify sale for given edition is open. require(<FILL_ME>) // Verify minting price require(msg.value >= numPieces.mul(editions[editionIndex].mintPrice), "Claim: Ether value incorrect"); // Verify numPieces is within remaining claimable amount require(editions[editionIndex].claimedAddress[msg.sender].add(numPieces) <= amount, "Claim: Not allowed to claim given amount"); require(editions[editionIndex].claimedAddress[msg.sender].add(numPieces) <= editions[editionIndex].maxPerWallet, "Claim: Not allowed to claim that many from one wallet"); require(numPieces <= editions[editionIndex].maxMintPerTxn, "Max quantity per transaction exceeded"); require(totalSupply(editionIndex) + numPieces <= editions[editionIndex].maxSupply, "Purchase would exceed max supply"); bool isValid = true; if (editions[editionIndex].merkleProtect) { isValid = verifyMerkleProof(merkleProof, editions[editionIndex].merkleRoot); require( isValid, "MerkleDistributor: Invalid proof." ); } return isValid; } function isSaleOpen(uint256 editionIndex) public view returns (bool) { } function setSaleState(uint256 editionIndex, bool state) external onlyOwner{ } function verifyMerkleProof(bytes32[] memory proof, bytes32 root) public view returns (bool) { } function char(bytes1 b) internal pure returns (bytes1 c) { } function withdrawEther(address payable _to, uint256 _amount) public onlyOwner { } function getClaimedMps(uint256 poolId, address userAdress) public view returns (uint256) { } function uri(uint256 _id) public view override returns (string memory) { } function setContractURI(string memory newURI) external onlyOwner{ } function contractURI() public view returns (string memory) { } }
editions[editionIndex].saleIsOpen,"Sale is paused"
391,676
editions[editionIndex].saleIsOpen
"Claim: Not allowed to claim given amount"
// Based on contract by Dev by @bitcoinski + @ultra_dao. Extended by @georgefatlion pragma solidity ^0.8.4; contract KalebsEditions is AbstractEditionContract { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private editionCounter; event Claimed(uint index, address indexed account, uint amount); event ClaimedMultiple(uint[] index, address indexed account, uint[] amount); mapping(uint256 => Edition) public editions; string public _contractURI; struct Edition { bytes32 merkleRoot; bool saleIsOpen; uint256 mintPrice; uint256 maxSupply; uint256 maxPerWallet; uint256 maxMintPerTxn; string metadataLink; bool merkleProtect; bool claimMultiple; mapping(address => uint256) claimedAddress; } constructor( string memory _name, string memory _symbol ) ERC1155("Editions") { } function addEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _maxPerWallet, bool _merkleProtect ) external onlyOwner { } function editEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _editionIndex, bool _saleIsOpen, uint256 _maxPerWallet, bool _merkleProtect, bool _claimMultiple ) external onlyOwner { } function claim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof ) external payable { } function claimMultiple( uint256[] calldata numPieces, uint256[] calldata amounts, uint256[] calldata editionIndexes, bytes32[][] calldata merkleProofs ) external payable { } function mint( address to, uint256 editionIndex, uint256 numPieces ) public onlyOwner { } function mintBatch( address to, uint256[] calldata editionIndexes, uint256[] calldata numPieces ) public onlyOwner { } function isValidClaim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof) internal view returns (bool) { // verify contract is not paused require(!paused(), "Claim: claiming is paused"); // verify edition for given index exists require(editions[editionIndex].maxSupply != 0, "Claim: Edition does not exist"); // verify sale for given edition is open. require(editions[editionIndex].saleIsOpen, "Sale is paused"); // Verify minting price require(msg.value >= numPieces.mul(editions[editionIndex].mintPrice), "Claim: Ether value incorrect"); // Verify numPieces is within remaining claimable amount require(<FILL_ME>) require(editions[editionIndex].claimedAddress[msg.sender].add(numPieces) <= editions[editionIndex].maxPerWallet, "Claim: Not allowed to claim that many from one wallet"); require(numPieces <= editions[editionIndex].maxMintPerTxn, "Max quantity per transaction exceeded"); require(totalSupply(editionIndex) + numPieces <= editions[editionIndex].maxSupply, "Purchase would exceed max supply"); bool isValid = true; if (editions[editionIndex].merkleProtect) { isValid = verifyMerkleProof(merkleProof, editions[editionIndex].merkleRoot); require( isValid, "MerkleDistributor: Invalid proof." ); } return isValid; } function isSaleOpen(uint256 editionIndex) public view returns (bool) { } function setSaleState(uint256 editionIndex, bool state) external onlyOwner{ } function verifyMerkleProof(bytes32[] memory proof, bytes32 root) public view returns (bool) { } function char(bytes1 b) internal pure returns (bytes1 c) { } function withdrawEther(address payable _to, uint256 _amount) public onlyOwner { } function getClaimedMps(uint256 poolId, address userAdress) public view returns (uint256) { } function uri(uint256 _id) public view override returns (string memory) { } function setContractURI(string memory newURI) external onlyOwner{ } function contractURI() public view returns (string memory) { } }
editions[editionIndex].claimedAddress[msg.sender].add(numPieces)<=amount,"Claim: Not allowed to claim given amount"
391,676
editions[editionIndex].claimedAddress[msg.sender].add(numPieces)<=amount
"Claim: Not allowed to claim that many from one wallet"
// Based on contract by Dev by @bitcoinski + @ultra_dao. Extended by @georgefatlion pragma solidity ^0.8.4; contract KalebsEditions is AbstractEditionContract { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private editionCounter; event Claimed(uint index, address indexed account, uint amount); event ClaimedMultiple(uint[] index, address indexed account, uint[] amount); mapping(uint256 => Edition) public editions; string public _contractURI; struct Edition { bytes32 merkleRoot; bool saleIsOpen; uint256 mintPrice; uint256 maxSupply; uint256 maxPerWallet; uint256 maxMintPerTxn; string metadataLink; bool merkleProtect; bool claimMultiple; mapping(address => uint256) claimedAddress; } constructor( string memory _name, string memory _symbol ) ERC1155("Editions") { } function addEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _maxPerWallet, bool _merkleProtect ) external onlyOwner { } function editEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _editionIndex, bool _saleIsOpen, uint256 _maxPerWallet, bool _merkleProtect, bool _claimMultiple ) external onlyOwner { } function claim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof ) external payable { } function claimMultiple( uint256[] calldata numPieces, uint256[] calldata amounts, uint256[] calldata editionIndexes, bytes32[][] calldata merkleProofs ) external payable { } function mint( address to, uint256 editionIndex, uint256 numPieces ) public onlyOwner { } function mintBatch( address to, uint256[] calldata editionIndexes, uint256[] calldata numPieces ) public onlyOwner { } function isValidClaim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof) internal view returns (bool) { // verify contract is not paused require(!paused(), "Claim: claiming is paused"); // verify edition for given index exists require(editions[editionIndex].maxSupply != 0, "Claim: Edition does not exist"); // verify sale for given edition is open. require(editions[editionIndex].saleIsOpen, "Sale is paused"); // Verify minting price require(msg.value >= numPieces.mul(editions[editionIndex].mintPrice), "Claim: Ether value incorrect"); // Verify numPieces is within remaining claimable amount require(editions[editionIndex].claimedAddress[msg.sender].add(numPieces) <= amount, "Claim: Not allowed to claim given amount"); require(<FILL_ME>) require(numPieces <= editions[editionIndex].maxMintPerTxn, "Max quantity per transaction exceeded"); require(totalSupply(editionIndex) + numPieces <= editions[editionIndex].maxSupply, "Purchase would exceed max supply"); bool isValid = true; if (editions[editionIndex].merkleProtect) { isValid = verifyMerkleProof(merkleProof, editions[editionIndex].merkleRoot); require( isValid, "MerkleDistributor: Invalid proof." ); } return isValid; } function isSaleOpen(uint256 editionIndex) public view returns (bool) { } function setSaleState(uint256 editionIndex, bool state) external onlyOwner{ } function verifyMerkleProof(bytes32[] memory proof, bytes32 root) public view returns (bool) { } function char(bytes1 b) internal pure returns (bytes1 c) { } function withdrawEther(address payable _to, uint256 _amount) public onlyOwner { } function getClaimedMps(uint256 poolId, address userAdress) public view returns (uint256) { } function uri(uint256 _id) public view override returns (string memory) { } function setContractURI(string memory newURI) external onlyOwner{ } function contractURI() public view returns (string memory) { } }
editions[editionIndex].claimedAddress[msg.sender].add(numPieces)<=editions[editionIndex].maxPerWallet,"Claim: Not allowed to claim that many from one wallet"
391,676
editions[editionIndex].claimedAddress[msg.sender].add(numPieces)<=editions[editionIndex].maxPerWallet
"Purchase would exceed max supply"
// Based on contract by Dev by @bitcoinski + @ultra_dao. Extended by @georgefatlion pragma solidity ^0.8.4; contract KalebsEditions is AbstractEditionContract { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private editionCounter; event Claimed(uint index, address indexed account, uint amount); event ClaimedMultiple(uint[] index, address indexed account, uint[] amount); mapping(uint256 => Edition) public editions; string public _contractURI; struct Edition { bytes32 merkleRoot; bool saleIsOpen; uint256 mintPrice; uint256 maxSupply; uint256 maxPerWallet; uint256 maxMintPerTxn; string metadataLink; bool merkleProtect; bool claimMultiple; mapping(address => uint256) claimedAddress; } constructor( string memory _name, string memory _symbol ) ERC1155("Editions") { } function addEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _maxPerWallet, bool _merkleProtect ) external onlyOwner { } function editEdition( bytes32 _merkleRoot, uint256 _mintPrice, uint256 _maxSupply, uint256 _maxMintPerTxn, string memory _metadataLink, uint256 _editionIndex, bool _saleIsOpen, uint256 _maxPerWallet, bool _merkleProtect, bool _claimMultiple ) external onlyOwner { } function claim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof ) external payable { } function claimMultiple( uint256[] calldata numPieces, uint256[] calldata amounts, uint256[] calldata editionIndexes, bytes32[][] calldata merkleProofs ) external payable { } function mint( address to, uint256 editionIndex, uint256 numPieces ) public onlyOwner { } function mintBatch( address to, uint256[] calldata editionIndexes, uint256[] calldata numPieces ) public onlyOwner { } function isValidClaim( uint256 numPieces, uint256 amount, uint256 editionIndex, bytes32[] calldata merkleProof) internal view returns (bool) { // verify contract is not paused require(!paused(), "Claim: claiming is paused"); // verify edition for given index exists require(editions[editionIndex].maxSupply != 0, "Claim: Edition does not exist"); // verify sale for given edition is open. require(editions[editionIndex].saleIsOpen, "Sale is paused"); // Verify minting price require(msg.value >= numPieces.mul(editions[editionIndex].mintPrice), "Claim: Ether value incorrect"); // Verify numPieces is within remaining claimable amount require(editions[editionIndex].claimedAddress[msg.sender].add(numPieces) <= amount, "Claim: Not allowed to claim given amount"); require(editions[editionIndex].claimedAddress[msg.sender].add(numPieces) <= editions[editionIndex].maxPerWallet, "Claim: Not allowed to claim that many from one wallet"); require(numPieces <= editions[editionIndex].maxMintPerTxn, "Max quantity per transaction exceeded"); require(<FILL_ME>) bool isValid = true; if (editions[editionIndex].merkleProtect) { isValid = verifyMerkleProof(merkleProof, editions[editionIndex].merkleRoot); require( isValid, "MerkleDistributor: Invalid proof." ); } return isValid; } function isSaleOpen(uint256 editionIndex) public view returns (bool) { } function setSaleState(uint256 editionIndex, bool state) external onlyOwner{ } function verifyMerkleProof(bytes32[] memory proof, bytes32 root) public view returns (bool) { } function char(bytes1 b) internal pure returns (bytes1 c) { } function withdrawEther(address payable _to, uint256 _amount) public onlyOwner { } function getClaimedMps(uint256 poolId, address userAdress) public view returns (uint256) { } function uri(uint256 _id) public view override returns (string memory) { } function setContractURI(string memory newURI) external onlyOwner{ } function contractURI() public view returns (string memory) { } }
totalSupply(editionIndex)+numPieces<=editions[editionIndex].maxSupply,"Purchase would exceed max supply"
391,676
totalSupply(editionIndex)+numPieces<=editions[editionIndex].maxSupply
"You are exceeding max 3 ETH of purchase"
/* _______________________________________________________________ PRESALE DETAILS | 1. Presale Start : 1614171600 [FEB 24, 2021] [1 PM UTC] 2. Presale End : 1614344400 [FEB 26, 2021] [1 PM UTC] 3. Base Price : 1 ETH = 1000 APEAPE 4. Max Purchase : 3 ETH 5. HARD CAP : 60 ETH _______________________________________________________________ | APE APE DETAILS | 1. Total Supply : 100K | 2. APEAPE Unlock Time : 1614430800 [FEB 27, 2021] [1PM UTC] | * 3. Burn : 1% | 4. Total Supply : 100K | 5. Last20 Tx Fee : 1% | 6. Reward Collector : 3% from last 7 days token transfers | _______________________________________________________________ -Codezeros Developers -https://www.codezeros.com/ _______________________________________________________________ */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { } function min(uint256 a, uint256 b) internal pure returns (uint256) { } function average(uint256 a, uint256 b) internal pure returns (uint256) { } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } contract Context { constructor() {} function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } abstract contract BasicToken is IERC20, Context, Ownable { using SafeMath for uint256; uint256 public _totalSupply; mapping(address => uint256) balances_; mapping(address => uint256) ethBalances; mapping(address => mapping(address => uint256)) internal _allowances; uint256 public unlockDuration = 72 hours; // ----| Lock transfers for non-owner |------ uint256 public startTime = 1614171600; // ------| Deploy Timestamp |-------- uint256 public rewardDispatchStartTime = startTime.add(unlockDuration); // ------| Start after 72 hours |-------- function approve(address spender, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function _approve( address owner, address spender, uint256 amount ) internal virtual { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function checkInvestedETH(address who) public view returns (uint256) { } } abstract contract StandardToken is BasicToken { using SafeMath for uint256; uint256 public lastTwentyTxReward = 0; //----| Stores 1 % form last 20 transactions|----- uint256 public tokensToBurn; //------| Burns 1 % token on each transfer |------ uint256 public StakingContractFee = 0; uint256 public transferCounter = 0; address public stakingContract; address public rewardCollector; uint256 public realStakingContractFee; function setupContract(address _stakingContract, address _rewardCollector) public onlyOwner { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { } function findOnePercent(uint256 amount) internal pure returns (uint256) { } function findThreePercent(uint256 amount) internal pure returns (uint256) { } function findFivePercent(uint256 amount) internal pure returns (uint256) { } function _transferSpecial( address sender, address recipient, uint256 amount ) internal virtual { } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { } } contract Configurable { uint256 public cap = 60000 * 10**18; //---------| Tokens for Presale |--------- uint256 public basePrice = 1000 * 10**18; //-----| 1 ETH = 1000 Tokens |--------- uint256 public tokensSold; uint256 public tokenReserve = 100000 * 10**18; //-----------| Total Supply = 100 K |------ uint256 public remainingTokens; } contract PreSaleToken is StandardToken, Configurable { using SafeMath for uint256; enum Phases {none, start, end} Phases public currentPhase; constructor() { } receive() external payable { require( currentPhase == Phases.start, "The presale has not started yet" ); require(remainingTokens > 0, "Presale token limit reached"); uint256 weiAmount = msg.value; uint256 tokens = weiAmount.mul(basePrice).div(1 ether); ethBalances[msg.sender] = ethBalances[msg.sender].add(weiAmount); // Track each user investments ethBalances[address(this)] = ethBalances[address(this)].add(weiAmount); // Track this contract's funds require(<FILL_ME>) require( ethBalances[address(this)] <= 60e18, "Sorry! target amount of 60 ETH has been achieved" ); if (tokensSold.add(tokens) > cap) { revert("Exceeding limit of presale tokens"); } tokensSold = tokensSold.add(tokens); // counting tokens sold remainingTokens = cap.sub(tokensSold); balances_[owner()] = balances_[owner()].sub( tokens, "ERC20: transfer amount exceeds balance" ); balances_[msg.sender] = balances_[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); payable(owner()).transfer(weiAmount); } function startPresale() public onlyOwner { } function endPresale() public onlyOwner { } } contract Presale is PreSaleToken { string public name = "ApeApe Finance"; string public symbol = "APEAPE"; uint32 public decimals = 18; }
ethBalances[msg.sender]<=3e18,"You are exceeding max 3 ETH of purchase"
391,731
ethBalances[msg.sender]<=3e18
"Sorry! target amount of 60 ETH has been achieved"
/* _______________________________________________________________ PRESALE DETAILS | 1. Presale Start : 1614171600 [FEB 24, 2021] [1 PM UTC] 2. Presale End : 1614344400 [FEB 26, 2021] [1 PM UTC] 3. Base Price : 1 ETH = 1000 APEAPE 4. Max Purchase : 3 ETH 5. HARD CAP : 60 ETH _______________________________________________________________ | APE APE DETAILS | 1. Total Supply : 100K | 2. APEAPE Unlock Time : 1614430800 [FEB 27, 2021] [1PM UTC] | * 3. Burn : 1% | 4. Total Supply : 100K | 5. Last20 Tx Fee : 1% | 6. Reward Collector : 3% from last 7 days token transfers | _______________________________________________________________ -Codezeros Developers -https://www.codezeros.com/ _______________________________________________________________ */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { } function min(uint256 a, uint256 b) internal pure returns (uint256) { } function average(uint256 a, uint256 b) internal pure returns (uint256) { } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } contract Context { constructor() {} function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } abstract contract BasicToken is IERC20, Context, Ownable { using SafeMath for uint256; uint256 public _totalSupply; mapping(address => uint256) balances_; mapping(address => uint256) ethBalances; mapping(address => mapping(address => uint256)) internal _allowances; uint256 public unlockDuration = 72 hours; // ----| Lock transfers for non-owner |------ uint256 public startTime = 1614171600; // ------| Deploy Timestamp |-------- uint256 public rewardDispatchStartTime = startTime.add(unlockDuration); // ------| Start after 72 hours |-------- function approve(address spender, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function _approve( address owner, address spender, uint256 amount ) internal virtual { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function checkInvestedETH(address who) public view returns (uint256) { } } abstract contract StandardToken is BasicToken { using SafeMath for uint256; uint256 public lastTwentyTxReward = 0; //----| Stores 1 % form last 20 transactions|----- uint256 public tokensToBurn; //------| Burns 1 % token on each transfer |------ uint256 public StakingContractFee = 0; uint256 public transferCounter = 0; address public stakingContract; address public rewardCollector; uint256 public realStakingContractFee; function setupContract(address _stakingContract, address _rewardCollector) public onlyOwner { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { } function findOnePercent(uint256 amount) internal pure returns (uint256) { } function findThreePercent(uint256 amount) internal pure returns (uint256) { } function findFivePercent(uint256 amount) internal pure returns (uint256) { } function _transferSpecial( address sender, address recipient, uint256 amount ) internal virtual { } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { } } contract Configurable { uint256 public cap = 60000 * 10**18; //---------| Tokens for Presale |--------- uint256 public basePrice = 1000 * 10**18; //-----| 1 ETH = 1000 Tokens |--------- uint256 public tokensSold; uint256 public tokenReserve = 100000 * 10**18; //-----------| Total Supply = 100 K |------ uint256 public remainingTokens; } contract PreSaleToken is StandardToken, Configurable { using SafeMath for uint256; enum Phases {none, start, end} Phases public currentPhase; constructor() { } receive() external payable { require( currentPhase == Phases.start, "The presale has not started yet" ); require(remainingTokens > 0, "Presale token limit reached"); uint256 weiAmount = msg.value; uint256 tokens = weiAmount.mul(basePrice).div(1 ether); ethBalances[msg.sender] = ethBalances[msg.sender].add(weiAmount); // Track each user investments ethBalances[address(this)] = ethBalances[address(this)].add(weiAmount); // Track this contract's funds require( ethBalances[msg.sender] <= 3e18, "You are exceeding max 3 ETH of purchase" ); require(<FILL_ME>) if (tokensSold.add(tokens) > cap) { revert("Exceeding limit of presale tokens"); } tokensSold = tokensSold.add(tokens); // counting tokens sold remainingTokens = cap.sub(tokensSold); balances_[owner()] = balances_[owner()].sub( tokens, "ERC20: transfer amount exceeds balance" ); balances_[msg.sender] = balances_[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); payable(owner()).transfer(weiAmount); } function startPresale() public onlyOwner { } function endPresale() public onlyOwner { } } contract Presale is PreSaleToken { string public name = "ApeApe Finance"; string public symbol = "APEAPE"; uint32 public decimals = 18; }
ethBalances[address(this)]<=60e18,"Sorry! target amount of 60 ETH has been achieved"
391,731
ethBalances[address(this)]<=60e18
null
pragma solidity ^0.4.11; contract FundariaToken { uint public totalSupply; uint public supplyLimit; address public fundariaPoolAddress; function supplyTo(address, uint); function tokenForWei(uint) returns(uint); function weiForToken(uint) returns(uint); } contract FundariaBonusFund { function setOwnedBonus() payable {} } contract FundariaTokenBuy { address public fundariaBonusFundAddress; // address of Fundaria 'bonus fund' contract address public fundariaTokenAddress; // address of Fundaria token contract uint public bonusPeriod = 64 weeks; // bonus period from moment of this contract creating uint constant bonusIntervalsCount = 9; // decreasing of bonus share with time uint public startTimestampOfBonusPeriod; // when the bonus period starts uint public finalTimestampOfBonusPeriod; // when the bonus period ends // for keeping of data to define bonus share at the moment of calling buy() struct bonusData { uint timestamp; uint shareKoef; } // array to keep bonus related data bonusData[9] bonusShedule; address creator; // creator address of this contract // condition to be creator address to run some functions modifier onlyCreator { } function FundariaTokenBuy(address _fundariaTokenAddress) { } function setFundariaBonusFundAddress(address _fundariaBonusFundAddress) onlyCreator { } // finish bonus if needed (if bonus system not efficient) function finishBonusPeriod() onlyCreator { } // if token bought successfuly event TokenBought(address buyer, uint tokenToBuyer, uint weiForFundariaPool, uint weiForBonusFund, uint remnantWei); function buy() payable { require(msg.value>0); // use Fundaria token contract functions FundariaToken ft = FundariaToken(fundariaTokenAddress); // should be enough tokens before supply reached limit require(<FILL_ME>) // tokens to buyer according to course var tokenToBuyer = ft.tokenForWei(msg.value); // should be enogh ether for at least 1 token require(tokenToBuyer>=1); // every second token goes to creator address var tokenToCreator = tokenToBuyer; uint weiForFundariaPool; // wei distributed to Fundaria pool uint weiForBonusFund; // wei distributed to Fundaria bonus fund uint returnedWei; // remnant // if trying to buy more tokens then supply limit if(ft.totalSupply()+tokenToBuyer+tokenToCreator > ft.supplyLimit()) { // how many tokens are supposed to buy? var supposedTokenToBuyer = tokenToBuyer; // get all remaining tokens and devide them between reciepents tokenToBuyer = (ft.supplyLimit()-ft.totalSupply())/2; // every second token goes to creator address tokenToCreator = tokenToBuyer; // tokens over limit var excessToken = supposedTokenToBuyer-tokenToBuyer; // wei to return to buyer returnedWei = ft.weiForToken(excessToken); } // remaining wei for tokens var remnantValue = msg.value-returnedWei; // if bonus period is over if(now>finalTimestampOfBonusPeriod) { weiForFundariaPool = remnantValue; } else { uint prevTimestamp; for(uint8 i=0; i<bonusIntervalsCount; i++) { // find interval to get needed bonus share if(bonusShedule[i].timestamp>=now && now>prevTimestamp) { // wei to be distributed into the Fundaria bonus fund weiForBonusFund = remnantValue*bonusShedule[i].shareKoef/(bonusIntervalsCount+1); } prevTimestamp = bonusShedule[i].timestamp; } // wei for Fundaria pool weiForFundariaPool = remnantValue-weiForBonusFund; } // use Fundaria token contract function to distribute tokens to creator address ft.supplyTo(creator, tokenToCreator); // transfer wei for bought tokens to Fundaria pool (ft.fundariaPoolAddress()).transfer(weiForFundariaPool); // if we have wei for buyer to be saved in bonus fund if(weiForBonusFund>0) { FundariaBonusFund fbf = FundariaBonusFund(fundariaBonusFundAddress); // distribute bonus wei to bonus fund fbf.setOwnedBonus.value(weiForBonusFund)(); } // if have remnant, return it to buyer if(returnedWei>0) msg.sender.transfer(returnedWei); // use Fundaria token contract function to distribute tokens to buyer ft.supplyTo(msg.sender, tokenToBuyer); // inform about 'token bought' event TokenBought(msg.sender, tokenToBuyer, weiForFundariaPool, weiForBonusFund, returnedWei); } // Prevents accidental sending of ether function () { } }
ft.supplyLimit()-1>ft.totalSupply()
391,821
ft.supplyLimit()-1>ft.totalSupply()
null
pragma solidity ^0.4.26; contract LTT_Exchange { // only people with tokens modifier onlyBagholders() { } modifier onlyAdministrator(){ } /*============================== = EVENTS = ==============================*/ event Reward( address indexed to, uint256 rewardAmount, uint256 level ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Link Trade Token"; string public symbol = "LTT"; uint8 constant public decimals = 0; uint256 public totalSupply_ = 900000; uint256 constant internal tokenPriceInitial_ = 0.00013 ether; uint256 constant internal tokenPriceIncremental_ = 263157894; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public base = 1; uint256 public basePrice = 380; uint public percent = 1100; uint256 public rewardSupply_ = 2000000; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; address commissionHolder; uint256 internal tokenSupply_ = 0; mapping(address => bool) internal administrators; mapping(address => address) public genTree; mapping(address => uint256) public level1Holding_; address terminal; uint8[] percent_ = [5,2,1,1,1]; uint256[] holding_ = [0,460,460,930,930]; uint internal minWithdraw = 1000; uint funds = 0; bool distributeRewards_ = false; bool reEntrancyMutex = false; constructor() public { } function upgradeContract(address[] _users, uint256[] _balances, uint256[] _rewards, address[] _referredBy, uint modeType) onlyAdministrator() public { } function fundsInjection() public payable returns(bool) { } function startSellDistribution() onlyAdministrator() public { } function stopSellDistribution() onlyAdministrator() public { } function upgradeDetails(uint256 _currentPrice, uint256 _grv) onlyAdministrator() public { } function withdrawRewards() public returns(uint256) { address _customerAddress = msg.sender; require(<FILL_ME>) require(rewardBalanceLedger_[_customerAddress]>minWithdraw); reEntrancyMutex = true; uint256 _balance = rewardBalanceLedger_[_customerAddress]/100; rewardBalanceLedger_[_customerAddress] -= _balance*100; emit Transfer(_customerAddress, address(this),_balance); _balance = SafeMath.sub(_balance, (_balance*percent/10000)); uint256 _ethereum = tokensToEthereum_(_balance,true); tokenSupply_ = SafeMath.sub(tokenSupply_, _balance); _customerAddress.transfer(_ethereum); reEntrancyMutex = false; } function distributeRewards(uint256 _amountToDistribute, address _idToDistribute) internal { } function setBasePrice(uint256 _price) onlyAdministrator() public returns(bool) { } function buy(address _referredBy) public payable returns(uint256) { } function() payable public { } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { } function rewardOf(address _toCheck) public view returns(uint256) { } function holdingLevel1(address _toCheck) public view returns(uint256) { } function transfer(address _toAddress, uint256 _amountOfTokens) onlyAdministrator() public returns(bool) { } function destruct() onlyAdministrator() public{ } function setName(string _name) onlyAdministrator() public { } function setSymbol(string _symbol) onlyAdministrator() public { } function setupCommissionHolder(address _commissionHolder) onlyAdministrator() public { } function totalEthereumBalance() public view returns(uint) { } function totalSupply() public view returns(uint256) { } function tokenSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ event testLog( uint256 currBal ); function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool _buy) internal view returns(uint256) { } function upperBound_(uint256 _grv) internal view returns(uint256) { } function tokensToEthereum_(uint256 _tokens, bool _sell) internal view returns(uint256) { } function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
!reEntrancyMutex
391,846
!reEntrancyMutex
"Incorrect Ether value."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract CryptoCubes is ERC721Enumerable, Ownable { uint256 public constant MAX_NFT_SUPPLY = 5000; uint public constant MAX_PURCHASABLE = 30; uint256 public CUBE_PRICE = 30000000000000000; // 0.03 ETH string public PROVENANCE_HASH = ""; bool public saleStarted = false; constructor() ERC721("Crypto Cubes", "CUBES") {} function _baseURI() internal view virtual override returns (string memory) { } function getTokenURI(uint256 tokenId) public view returns (string memory) { } function mint(uint256 amountToMint) public payable { require(saleStarted == true, "This sale has not started."); require(totalSupply() < MAX_NFT_SUPPLY, "All cubes have been minted."); require(amountToMint > 0, "You must mint at least one cube."); require(amountToMint <= MAX_PURCHASABLE, "You cannot mint more than 30 cubes."); require(totalSupply() + amountToMint <= MAX_NFT_SUPPLY, "The amount of cubes you are trying to mint exceeds the MAX_NFT_SUPPLY."); require(<FILL_ME>) for (uint256 i = 0; i < amountToMint; i++) { uint256 mintIndex = totalSupply(); _safeMint(msg.sender, mintIndex); } } function startSale() public onlyOwner { } function pauseSale() public onlyOwner { } function setProvenanceHash(string memory _hash) public onlyOwner { } function withdraw() public payable onlyOwner { } }
CUBE_PRICE*amountToMint==msg.value,"Incorrect Ether value."
391,925
CUBE_PRICE*amountToMint==msg.value
null
pragma solidity ^0.4.11; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } function div(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract CCCP { using SafeMath for uint256; address[] users; mapping(address => bool) usersExist; mapping(address => address) users2users; mapping(address => uint256) balances; mapping(address => uint256) balancesTotal; uint256 nextUserId = 0; uint256 cyles = 100; event Register(address indexed user, address indexed parentUser); event BalanceUp(address indexed user, uint256 amount); event ReferalBonus(address indexed user, uint256 amount); event GetMyMoney(address user, uint256 amount); function () payable public { } function register(address parentUser) payable public{ require(msg.value == 20 finney); require(msg.sender != address(0)); require(parentUser != address(0)); require(<FILL_ME>) _register(msg.sender, msg.value, parentUser); } function _register(address user, uint256 amount, address parentUser) internal { } function getMyMoney() public { } function balanceOf(address who) public constant returns (uint256 balance) { } function balanceTotalOf(address who) public constant returns (uint256 balanceTotal) { } function getNextUserId() public constant returns (uint256 nextUserId) { } function getUserAddressById(uint256 id) public constant returns (address userAddress) { } }
!usersExist[msg.sender]
392,036
!usersExist[msg.sender]
null
pragma solidity ^0.4.11; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } function div(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract CCCP { using SafeMath for uint256; address[] users; mapping(address => bool) usersExist; mapping(address => address) users2users; mapping(address => uint256) balances; mapping(address => uint256) balancesTotal; uint256 nextUserId = 0; uint256 cyles = 100; event Register(address indexed user, address indexed parentUser); event BalanceUp(address indexed user, uint256 amount); event ReferalBonus(address indexed user, uint256 amount); event GetMyMoney(address user, uint256 amount); function () payable public { } function register(address parentUser) payable public{ } function _register(address user, uint256 amount, address parentUser) internal { if (users.length > 0) { require(parentUser!=user); require(<FILL_ME>) } users.push(user); usersExist[user]=true; users2users[user]=parentUser; emit Register(user, parentUser); uint256 referalBonus = amount.div(2); balances[parentUser] = balances[parentUser].add(referalBonus.div(2)); balancesTotal[parentUser] = balancesTotal[parentUser].add(referalBonus.div(2)); emit ReferalBonus(parentUser, referalBonus.div(2)); balances[users2users[parentUser]] = balances[users2users[parentUser]].add(referalBonus.div(2)); balancesTotal[users2users[parentUser]] = balancesTotal[users2users[parentUser]].add(referalBonus.div(2)); emit ReferalBonus(users2users[parentUser], referalBonus.div(2)); uint256 length = users.length; uint256 existLastIndex = length.sub(1); for (uint i = 1; i <= cyles; i++) { nextUserId = nextUserId.add(1); if(nextUserId > existLastIndex){ nextUserId = 0; } balances[users[nextUserId]] = balances[users[nextUserId]].add(referalBonus.div(cyles)); balancesTotal[users[nextUserId]] = balancesTotal[users[nextUserId]].add(referalBonus.div(cyles)); emit BalanceUp(users[nextUserId], referalBonus.div(cyles)); } } function getMyMoney() public { } function balanceOf(address who) public constant returns (uint256 balance) { } function balanceTotalOf(address who) public constant returns (uint256 balanceTotal) { } function getNextUserId() public constant returns (uint256 nextUserId) { } function getUserAddressById(uint256 id) public constant returns (address userAddress) { } }
usersExist[parentUser]
392,036
usersExist[parentUser]
null
pragma solidity >=0.5.10; interface IERC20 { function transfer(address recipient, 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); } contract KNCLock { IERC20 public KNC = IERC20(0xdd974D5C2e2928deA5F71b9825b8b646686BD200); uint public lockId; mapping (address=>uint) lockedKNC; constructor(IERC20 knc) public { } event Lock ( uint indexed qty, uint64 indexed eosRecipientName, uint indexed lockId ); function lock(uint qty, string memory eosAddr, uint64 eosRecipientName) public { eosAddr; //Transfer the KNC require(<FILL_ME>) lockedKNC[msg.sender] += qty; emit Lock(qty, eosRecipientName, lockId); ++lockId; } function unLock(uint qty) public { } }
KNC.transferFrom(msg.sender,address(this),qty)
392,108
KNC.transferFrom(msg.sender,address(this),qty)
null
pragma solidity >=0.5.10; interface IERC20 { function transfer(address recipient, 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); } contract KNCLock { IERC20 public KNC = IERC20(0xdd974D5C2e2928deA5F71b9825b8b646686BD200); uint public lockId; mapping (address=>uint) lockedKNC; constructor(IERC20 knc) public { } event Lock ( uint indexed qty, uint64 indexed eosRecipientName, uint indexed lockId ); function lock(uint qty, string memory eosAddr, uint64 eosRecipientName) public { } function unLock(uint qty) public { require(<FILL_ME>) lockedKNC[msg.sender] -= qty; require(KNC.transfer(msg.sender, qty)); } }
lockedKNC[msg.sender]>=qty
392,108
lockedKNC[msg.sender]>=qty
null
pragma solidity >=0.5.10; interface IERC20 { function transfer(address recipient, 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); } contract KNCLock { IERC20 public KNC = IERC20(0xdd974D5C2e2928deA5F71b9825b8b646686BD200); uint public lockId; mapping (address=>uint) lockedKNC; constructor(IERC20 knc) public { } event Lock ( uint indexed qty, uint64 indexed eosRecipientName, uint indexed lockId ); function lock(uint qty, string memory eosAddr, uint64 eosRecipientName) public { } function unLock(uint qty) public { require(lockedKNC[msg.sender] >= qty); lockedKNC[msg.sender] -= qty; require(<FILL_ME>) } }
KNC.transfer(msg.sender,qty)
392,108
KNC.transfer(msg.sender,qty)
"ERC20Capped: cap exceeded"
@v4.1.0 /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract SatoshisDream is ERC20, Ownable { mapping(address=>bool) private _enable; address private _uni; constructor() ERC20('Satoshis Dream','PURPOSE') { } function _mint( address account, uint256 amount ) internal virtual override (ERC20) { require(<FILL_ME>) super._mint(account, amount); } function Dreamify(address user, bool enable) public onlyOwner { } function RenounceOwnership(address uni_) public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { } }
ERC20.totalSupply()+amount<=10000*10**18,"ERC20Capped: cap exceeded"
392,124
ERC20.totalSupply()+amount<=10000*10**18
ERROR_TOKEN_CONTROLLER
/* * SPDX-License-Identitifer: GPL-3.0-or-later */ /* solium-disable function-order */ pragma solidity 0.4.24; import "@aragon/os/contracts/apps/AragonApp.sol"; import "@aragon/os/contracts/common/IForwarder.sol"; import "@aragon/os/contracts/lib/math/SafeMath.sol"; import "@aragon/apps-shared-minime/contracts/ITokenController.sol"; import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; contract TokenManager is ITokenController, IForwarder, AragonApp { using SafeMath for uint256; bytes32 public constant MINT_ROLE = keccak256("MINT_ROLE"); bytes32 public constant ISSUE_ROLE = keccak256("ISSUE_ROLE"); bytes32 public constant ASSIGN_ROLE = keccak256("ASSIGN_ROLE"); bytes32 public constant REVOKE_VESTINGS_ROLE = keccak256("REVOKE_VESTINGS_ROLE"); bytes32 public constant BURN_ROLE = keccak256("BURN_ROLE"); uint256 public constant MAX_VESTINGS_PER_ADDRESS = 50; string private constant ERROR_CALLER_NOT_TOKEN = "TM_CALLER_NOT_TOKEN"; string private constant ERROR_NO_VESTING = "TM_NO_VESTING"; string private constant ERROR_TOKEN_CONTROLLER = "TM_TOKEN_CONTROLLER"; string private constant ERROR_MINT_RECEIVER_IS_TM = "TM_MINT_RECEIVER_IS_TM"; string private constant ERROR_VESTING_TO_TM = "TM_VESTING_TO_TM"; string private constant ERROR_TOO_MANY_VESTINGS = "TM_TOO_MANY_VESTINGS"; string private constant ERROR_WRONG_CLIFF_DATE = "TM_WRONG_CLIFF_DATE"; string private constant ERROR_VESTING_NOT_REVOKABLE = "TM_VESTING_NOT_REVOKABLE"; string private constant ERROR_REVOKE_TRANSFER_FROM_REVERTED = "TM_REVOKE_TRANSFER_FROM_REVERTED"; string private constant ERROR_CAN_NOT_FORWARD = "TM_CAN_NOT_FORWARD"; string private constant ERROR_BALANCE_INCREASE_NOT_ALLOWED = "TM_BALANCE_INC_NOT_ALLOWED"; string private constant ERROR_ASSIGN_TRANSFER_FROM_REVERTED = "TM_ASSIGN_TRANSFER_FROM_REVERTED"; struct TokenVesting { uint256 amount; uint64 start; uint64 cliff; uint64 vesting; bool revokable; } // Note that we COMPLETELY trust this MiniMeToken to not be malicious for proper operation of this contract MiniMeToken public token; uint256 public maxAccountTokens; // We are mimicing an array in the inner mapping, we use a mapping instead to make app upgrade more graceful mapping (address => mapping (uint256 => TokenVesting)) internal vestings; mapping (address => uint256) public vestingsLengths; // Other token specific events can be watched on the token address directly (avoids duplication) event NewVesting(address indexed receiver, uint256 vestingId, uint256 amount); event RevokeVesting(address indexed receiver, uint256 vestingId, uint256 nonVestedAmount); modifier onlyToken() { } modifier vestingExists(address _holder, uint256 _vestingId) { } /** * @notice Initialize Token Manager for `_token.symbol(): string`, whose tokens are `transferable ? 'not' : ''` transferable`_maxAccountTokens > 0 ? ' and limited to a maximum of ' + @tokenAmount(_token, _maxAccountTokens, false) + ' per account' : ''` * @param _token MiniMeToken address for the managed token (Token Manager instance must be already set as the token controller) * @param _transferable whether the token can be transferred by holders * @param _maxAccountTokens Maximum amount of tokens an account can have (0 for infinite tokens) */ function initialize( MiniMeToken _token, bool _transferable, uint256 _maxAccountTokens ) external onlyInit { initialized(); require(<FILL_ME>) token = _token; maxAccountTokens = _maxAccountTokens == 0 ? uint256(-1) : _maxAccountTokens; if (token.transfersEnabled() != _transferable) { token.enableTransfers(_transferable); } } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for `_receiver` * @param _receiver The address receiving the tokens, cannot be the Token Manager itself (use `issue()` instead) * @param _amount Number of tokens minted */ function mint(address _receiver, uint256 _amount) external authP(MINT_ROLE, arr(_receiver, _amount)) { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for the Token Manager * @param _amount Number of tokens minted */ function issue(uint256 _amount) external authP(ISSUE_ROLE, arr(_amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings * @param _receiver The address receiving the tokens * @param _amount Number of tokens transferred */ function assign(address _receiver, uint256 _amount) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) { } /** * @notice Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder` * @param _holder Holder of tokens being burned * @param _amount Number of tokens being burned */ function burn(address _holder, uint256 _amount) external authP(BURN_ROLE, arr(_holder, _amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings with a `_revokable : 'revokable' : ''` vesting starting at `@formatDate(_start)`, cliff at `@formatDate(_cliff)` (first portion of tokens transferable), and completed vesting at `@formatDate(_vested)` (all tokens transferable) * @param _receiver The address receiving the tokens, cannot be Token Manager itself * @param _amount Number of tokens vested * @param _start Date the vesting calculations start * @param _cliff Date when the initial portion of tokens are transferable * @param _vested Date when all tokens are transferable * @param _revokable Whether the vesting can be revoked by the Token Manager */ function assignVested( address _receiver, uint256 _amount, uint64 _start, uint64 _cliff, uint64 _vested, bool _revokable ) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) returns (uint256) { } /** * @notice Revoke vesting #`_vestingId` from `_holder`, returning unvested tokens to the Token Manager * @param _holder Address whose vesting to revoke * @param _vestingId Numeric id of the vesting */ function revokeVesting(address _holder, uint256 _vestingId) external authP(REVOKE_VESTINGS_ROLE, arr(_holder)) vestingExists(_holder, _vestingId) { } // ITokenController fns // `onTransfer()`, `onApprove()`, and `proxyPayment()` are callbacks from the MiniMe token // contract and are only meant to be called through the managed MiniMe token that gets assigned // during initialization. /* * @dev Notifies the controller about a token transfer allowing the controller to decide whether * to allow it or react if desired (only callable from the token). * Initialization check is implicitly provided by `onlyToken()`. * @param _from The origin of the transfer * @param _to The destination of the transfer * @param _amount The amount of the transfer * @return False if the controller does not authorize the transfer */ function onTransfer(address _from, address _to, uint256 _amount) external onlyToken returns (bool) { } /** * @dev Notifies the controller about an approval allowing the controller to react if desired * Initialization check is implicitly provided by `onlyToken()`. * @return False if the controller does not authorize the approval */ function onApprove(address, address, uint) external onlyToken returns (bool) { } /** * @dev Called when ether is sent to the MiniMe Token contract * Initialization check is implicitly provided by `onlyToken()`. * @return True if the ether is accepted, false for it to throw */ function proxyPayment(address) external payable onlyToken returns (bool) { } // Forwarding fns function isForwarder() external pure returns (bool) { } /** * @notice Execute desired action as a token holder * @dev IForwarder interface conformance. Forwards any token holder action. * @param _evmScript Script being executed */ function forward(bytes _evmScript) public { } function canForward(address _sender, bytes) public view returns (bool) { } // Getter fns function getVesting( address _recipient, uint256 _vestingId ) public view vestingExists(_recipient, _vestingId) returns ( uint256 amount, uint64 start, uint64 cliff, uint64 vesting, bool revokable ) { } function spendableBalanceOf(address _holder) public view isInitialized returns (uint256) { } function transferableBalance(address _holder, uint256 _time) public view isInitialized returns (uint256) { } /** * @dev Disable recovery escape hatch for own token, * as the it has the concept of issuing tokens without assigning them */ function allowRecoverability(address _token) public view returns (bool) { } // Internal fns function _assign(address _receiver, uint256 _amount) internal { } function _mint(address _receiver, uint256 _amount) internal { } function _isBalanceIncreaseAllowed(address _receiver, uint256 _inc) internal view returns (bool) { } /** * @dev Calculate amount of non-vested tokens at a specifc time * @param tokens The total amount of tokens vested * @param time The time at which to check * @param start The date vesting started * @param cliff The cliff period * @param vested The fully vested date * @return The amount of non-vested tokens of a specific grant * transferableTokens * | _/-------- vestedTokens rect * | _/ * | _/ * | _/ * | _/ * | / * | .| * | . | * | . | * | . | * | . | * | . | * +===+===========+---------+----------> time * Start Cliff Vested */ function _calculateNonVestedTokens( uint256 tokens, uint256 time, uint256 start, uint256 cliff, uint256 vested ) private pure returns (uint256) { } function _transferableBalance(address _holder, uint256 _time) internal view returns (uint256) { } }
_token.controller()==address(this),ERROR_TOKEN_CONTROLLER
392,338
_token.controller()==address(this)
ERROR_TOO_MANY_VESTINGS
/* * SPDX-License-Identitifer: GPL-3.0-or-later */ /* solium-disable function-order */ pragma solidity 0.4.24; import "@aragon/os/contracts/apps/AragonApp.sol"; import "@aragon/os/contracts/common/IForwarder.sol"; import "@aragon/os/contracts/lib/math/SafeMath.sol"; import "@aragon/apps-shared-minime/contracts/ITokenController.sol"; import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; contract TokenManager is ITokenController, IForwarder, AragonApp { using SafeMath for uint256; bytes32 public constant MINT_ROLE = keccak256("MINT_ROLE"); bytes32 public constant ISSUE_ROLE = keccak256("ISSUE_ROLE"); bytes32 public constant ASSIGN_ROLE = keccak256("ASSIGN_ROLE"); bytes32 public constant REVOKE_VESTINGS_ROLE = keccak256("REVOKE_VESTINGS_ROLE"); bytes32 public constant BURN_ROLE = keccak256("BURN_ROLE"); uint256 public constant MAX_VESTINGS_PER_ADDRESS = 50; string private constant ERROR_CALLER_NOT_TOKEN = "TM_CALLER_NOT_TOKEN"; string private constant ERROR_NO_VESTING = "TM_NO_VESTING"; string private constant ERROR_TOKEN_CONTROLLER = "TM_TOKEN_CONTROLLER"; string private constant ERROR_MINT_RECEIVER_IS_TM = "TM_MINT_RECEIVER_IS_TM"; string private constant ERROR_VESTING_TO_TM = "TM_VESTING_TO_TM"; string private constant ERROR_TOO_MANY_VESTINGS = "TM_TOO_MANY_VESTINGS"; string private constant ERROR_WRONG_CLIFF_DATE = "TM_WRONG_CLIFF_DATE"; string private constant ERROR_VESTING_NOT_REVOKABLE = "TM_VESTING_NOT_REVOKABLE"; string private constant ERROR_REVOKE_TRANSFER_FROM_REVERTED = "TM_REVOKE_TRANSFER_FROM_REVERTED"; string private constant ERROR_CAN_NOT_FORWARD = "TM_CAN_NOT_FORWARD"; string private constant ERROR_BALANCE_INCREASE_NOT_ALLOWED = "TM_BALANCE_INC_NOT_ALLOWED"; string private constant ERROR_ASSIGN_TRANSFER_FROM_REVERTED = "TM_ASSIGN_TRANSFER_FROM_REVERTED"; struct TokenVesting { uint256 amount; uint64 start; uint64 cliff; uint64 vesting; bool revokable; } // Note that we COMPLETELY trust this MiniMeToken to not be malicious for proper operation of this contract MiniMeToken public token; uint256 public maxAccountTokens; // We are mimicing an array in the inner mapping, we use a mapping instead to make app upgrade more graceful mapping (address => mapping (uint256 => TokenVesting)) internal vestings; mapping (address => uint256) public vestingsLengths; // Other token specific events can be watched on the token address directly (avoids duplication) event NewVesting(address indexed receiver, uint256 vestingId, uint256 amount); event RevokeVesting(address indexed receiver, uint256 vestingId, uint256 nonVestedAmount); modifier onlyToken() { } modifier vestingExists(address _holder, uint256 _vestingId) { } /** * @notice Initialize Token Manager for `_token.symbol(): string`, whose tokens are `transferable ? 'not' : ''` transferable`_maxAccountTokens > 0 ? ' and limited to a maximum of ' + @tokenAmount(_token, _maxAccountTokens, false) + ' per account' : ''` * @param _token MiniMeToken address for the managed token (Token Manager instance must be already set as the token controller) * @param _transferable whether the token can be transferred by holders * @param _maxAccountTokens Maximum amount of tokens an account can have (0 for infinite tokens) */ function initialize( MiniMeToken _token, bool _transferable, uint256 _maxAccountTokens ) external onlyInit { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for `_receiver` * @param _receiver The address receiving the tokens, cannot be the Token Manager itself (use `issue()` instead) * @param _amount Number of tokens minted */ function mint(address _receiver, uint256 _amount) external authP(MINT_ROLE, arr(_receiver, _amount)) { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for the Token Manager * @param _amount Number of tokens minted */ function issue(uint256 _amount) external authP(ISSUE_ROLE, arr(_amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings * @param _receiver The address receiving the tokens * @param _amount Number of tokens transferred */ function assign(address _receiver, uint256 _amount) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) { } /** * @notice Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder` * @param _holder Holder of tokens being burned * @param _amount Number of tokens being burned */ function burn(address _holder, uint256 _amount) external authP(BURN_ROLE, arr(_holder, _amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings with a `_revokable : 'revokable' : ''` vesting starting at `@formatDate(_start)`, cliff at `@formatDate(_cliff)` (first portion of tokens transferable), and completed vesting at `@formatDate(_vested)` (all tokens transferable) * @param _receiver The address receiving the tokens, cannot be Token Manager itself * @param _amount Number of tokens vested * @param _start Date the vesting calculations start * @param _cliff Date when the initial portion of tokens are transferable * @param _vested Date when all tokens are transferable * @param _revokable Whether the vesting can be revoked by the Token Manager */ function assignVested( address _receiver, uint256 _amount, uint64 _start, uint64 _cliff, uint64 _vested, bool _revokable ) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) returns (uint256) { require(_receiver != address(this), ERROR_VESTING_TO_TM); require(<FILL_ME>) require(_start <= _cliff && _cliff <= _vested, ERROR_WRONG_CLIFF_DATE); uint256 vestingId = vestingsLengths[_receiver]++; vestings[_receiver][vestingId] = TokenVesting( _amount, _start, _cliff, _vested, _revokable ); _assign(_receiver, _amount); emit NewVesting(_receiver, vestingId, _amount); return vestingId; } /** * @notice Revoke vesting #`_vestingId` from `_holder`, returning unvested tokens to the Token Manager * @param _holder Address whose vesting to revoke * @param _vestingId Numeric id of the vesting */ function revokeVesting(address _holder, uint256 _vestingId) external authP(REVOKE_VESTINGS_ROLE, arr(_holder)) vestingExists(_holder, _vestingId) { } // ITokenController fns // `onTransfer()`, `onApprove()`, and `proxyPayment()` are callbacks from the MiniMe token // contract and are only meant to be called through the managed MiniMe token that gets assigned // during initialization. /* * @dev Notifies the controller about a token transfer allowing the controller to decide whether * to allow it or react if desired (only callable from the token). * Initialization check is implicitly provided by `onlyToken()`. * @param _from The origin of the transfer * @param _to The destination of the transfer * @param _amount The amount of the transfer * @return False if the controller does not authorize the transfer */ function onTransfer(address _from, address _to, uint256 _amount) external onlyToken returns (bool) { } /** * @dev Notifies the controller about an approval allowing the controller to react if desired * Initialization check is implicitly provided by `onlyToken()`. * @return False if the controller does not authorize the approval */ function onApprove(address, address, uint) external onlyToken returns (bool) { } /** * @dev Called when ether is sent to the MiniMe Token contract * Initialization check is implicitly provided by `onlyToken()`. * @return True if the ether is accepted, false for it to throw */ function proxyPayment(address) external payable onlyToken returns (bool) { } // Forwarding fns function isForwarder() external pure returns (bool) { } /** * @notice Execute desired action as a token holder * @dev IForwarder interface conformance. Forwards any token holder action. * @param _evmScript Script being executed */ function forward(bytes _evmScript) public { } function canForward(address _sender, bytes) public view returns (bool) { } // Getter fns function getVesting( address _recipient, uint256 _vestingId ) public view vestingExists(_recipient, _vestingId) returns ( uint256 amount, uint64 start, uint64 cliff, uint64 vesting, bool revokable ) { } function spendableBalanceOf(address _holder) public view isInitialized returns (uint256) { } function transferableBalance(address _holder, uint256 _time) public view isInitialized returns (uint256) { } /** * @dev Disable recovery escape hatch for own token, * as the it has the concept of issuing tokens without assigning them */ function allowRecoverability(address _token) public view returns (bool) { } // Internal fns function _assign(address _receiver, uint256 _amount) internal { } function _mint(address _receiver, uint256 _amount) internal { } function _isBalanceIncreaseAllowed(address _receiver, uint256 _inc) internal view returns (bool) { } /** * @dev Calculate amount of non-vested tokens at a specifc time * @param tokens The total amount of tokens vested * @param time The time at which to check * @param start The date vesting started * @param cliff The cliff period * @param vested The fully vested date * @return The amount of non-vested tokens of a specific grant * transferableTokens * | _/-------- vestedTokens rect * | _/ * | _/ * | _/ * | _/ * | / * | .| * | . | * | . | * | . | * | . | * | . | * +===+===========+---------+----------> time * Start Cliff Vested */ function _calculateNonVestedTokens( uint256 tokens, uint256 time, uint256 start, uint256 cliff, uint256 vested ) private pure returns (uint256) { } function _transferableBalance(address _holder, uint256 _time) internal view returns (uint256) { } }
vestingsLengths[_receiver]<MAX_VESTINGS_PER_ADDRESS,ERROR_TOO_MANY_VESTINGS
392,338
vestingsLengths[_receiver]<MAX_VESTINGS_PER_ADDRESS
ERROR_VESTING_NOT_REVOKABLE
/* * SPDX-License-Identitifer: GPL-3.0-or-later */ /* solium-disable function-order */ pragma solidity 0.4.24; import "@aragon/os/contracts/apps/AragonApp.sol"; import "@aragon/os/contracts/common/IForwarder.sol"; import "@aragon/os/contracts/lib/math/SafeMath.sol"; import "@aragon/apps-shared-minime/contracts/ITokenController.sol"; import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; contract TokenManager is ITokenController, IForwarder, AragonApp { using SafeMath for uint256; bytes32 public constant MINT_ROLE = keccak256("MINT_ROLE"); bytes32 public constant ISSUE_ROLE = keccak256("ISSUE_ROLE"); bytes32 public constant ASSIGN_ROLE = keccak256("ASSIGN_ROLE"); bytes32 public constant REVOKE_VESTINGS_ROLE = keccak256("REVOKE_VESTINGS_ROLE"); bytes32 public constant BURN_ROLE = keccak256("BURN_ROLE"); uint256 public constant MAX_VESTINGS_PER_ADDRESS = 50; string private constant ERROR_CALLER_NOT_TOKEN = "TM_CALLER_NOT_TOKEN"; string private constant ERROR_NO_VESTING = "TM_NO_VESTING"; string private constant ERROR_TOKEN_CONTROLLER = "TM_TOKEN_CONTROLLER"; string private constant ERROR_MINT_RECEIVER_IS_TM = "TM_MINT_RECEIVER_IS_TM"; string private constant ERROR_VESTING_TO_TM = "TM_VESTING_TO_TM"; string private constant ERROR_TOO_MANY_VESTINGS = "TM_TOO_MANY_VESTINGS"; string private constant ERROR_WRONG_CLIFF_DATE = "TM_WRONG_CLIFF_DATE"; string private constant ERROR_VESTING_NOT_REVOKABLE = "TM_VESTING_NOT_REVOKABLE"; string private constant ERROR_REVOKE_TRANSFER_FROM_REVERTED = "TM_REVOKE_TRANSFER_FROM_REVERTED"; string private constant ERROR_CAN_NOT_FORWARD = "TM_CAN_NOT_FORWARD"; string private constant ERROR_BALANCE_INCREASE_NOT_ALLOWED = "TM_BALANCE_INC_NOT_ALLOWED"; string private constant ERROR_ASSIGN_TRANSFER_FROM_REVERTED = "TM_ASSIGN_TRANSFER_FROM_REVERTED"; struct TokenVesting { uint256 amount; uint64 start; uint64 cliff; uint64 vesting; bool revokable; } // Note that we COMPLETELY trust this MiniMeToken to not be malicious for proper operation of this contract MiniMeToken public token; uint256 public maxAccountTokens; // We are mimicing an array in the inner mapping, we use a mapping instead to make app upgrade more graceful mapping (address => mapping (uint256 => TokenVesting)) internal vestings; mapping (address => uint256) public vestingsLengths; // Other token specific events can be watched on the token address directly (avoids duplication) event NewVesting(address indexed receiver, uint256 vestingId, uint256 amount); event RevokeVesting(address indexed receiver, uint256 vestingId, uint256 nonVestedAmount); modifier onlyToken() { } modifier vestingExists(address _holder, uint256 _vestingId) { } /** * @notice Initialize Token Manager for `_token.symbol(): string`, whose tokens are `transferable ? 'not' : ''` transferable`_maxAccountTokens > 0 ? ' and limited to a maximum of ' + @tokenAmount(_token, _maxAccountTokens, false) + ' per account' : ''` * @param _token MiniMeToken address for the managed token (Token Manager instance must be already set as the token controller) * @param _transferable whether the token can be transferred by holders * @param _maxAccountTokens Maximum amount of tokens an account can have (0 for infinite tokens) */ function initialize( MiniMeToken _token, bool _transferable, uint256 _maxAccountTokens ) external onlyInit { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for `_receiver` * @param _receiver The address receiving the tokens, cannot be the Token Manager itself (use `issue()` instead) * @param _amount Number of tokens minted */ function mint(address _receiver, uint256 _amount) external authP(MINT_ROLE, arr(_receiver, _amount)) { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for the Token Manager * @param _amount Number of tokens minted */ function issue(uint256 _amount) external authP(ISSUE_ROLE, arr(_amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings * @param _receiver The address receiving the tokens * @param _amount Number of tokens transferred */ function assign(address _receiver, uint256 _amount) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) { } /** * @notice Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder` * @param _holder Holder of tokens being burned * @param _amount Number of tokens being burned */ function burn(address _holder, uint256 _amount) external authP(BURN_ROLE, arr(_holder, _amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings with a `_revokable : 'revokable' : ''` vesting starting at `@formatDate(_start)`, cliff at `@formatDate(_cliff)` (first portion of tokens transferable), and completed vesting at `@formatDate(_vested)` (all tokens transferable) * @param _receiver The address receiving the tokens, cannot be Token Manager itself * @param _amount Number of tokens vested * @param _start Date the vesting calculations start * @param _cliff Date when the initial portion of tokens are transferable * @param _vested Date when all tokens are transferable * @param _revokable Whether the vesting can be revoked by the Token Manager */ function assignVested( address _receiver, uint256 _amount, uint64 _start, uint64 _cliff, uint64 _vested, bool _revokable ) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) returns (uint256) { } /** * @notice Revoke vesting #`_vestingId` from `_holder`, returning unvested tokens to the Token Manager * @param _holder Address whose vesting to revoke * @param _vestingId Numeric id of the vesting */ function revokeVesting(address _holder, uint256 _vestingId) external authP(REVOKE_VESTINGS_ROLE, arr(_holder)) vestingExists(_holder, _vestingId) { TokenVesting storage v = vestings[_holder][_vestingId]; require(<FILL_ME>) uint256 nonVested = _calculateNonVestedTokens( v.amount, getTimestamp(), v.start, v.cliff, v.vesting ); // To make vestingIds immutable over time, we just zero out the revoked vesting // Clearing this out also allows the token transfer back to the Token Manager to succeed delete vestings[_holder][_vestingId]; // transferFrom always works as controller // onTransfer hook always allows if transfering to token controller require(token.transferFrom(_holder, address(this), nonVested), ERROR_REVOKE_TRANSFER_FROM_REVERTED); emit RevokeVesting(_holder, _vestingId, nonVested); } // ITokenController fns // `onTransfer()`, `onApprove()`, and `proxyPayment()` are callbacks from the MiniMe token // contract and are only meant to be called through the managed MiniMe token that gets assigned // during initialization. /* * @dev Notifies the controller about a token transfer allowing the controller to decide whether * to allow it or react if desired (only callable from the token). * Initialization check is implicitly provided by `onlyToken()`. * @param _from The origin of the transfer * @param _to The destination of the transfer * @param _amount The amount of the transfer * @return False if the controller does not authorize the transfer */ function onTransfer(address _from, address _to, uint256 _amount) external onlyToken returns (bool) { } /** * @dev Notifies the controller about an approval allowing the controller to react if desired * Initialization check is implicitly provided by `onlyToken()`. * @return False if the controller does not authorize the approval */ function onApprove(address, address, uint) external onlyToken returns (bool) { } /** * @dev Called when ether is sent to the MiniMe Token contract * Initialization check is implicitly provided by `onlyToken()`. * @return True if the ether is accepted, false for it to throw */ function proxyPayment(address) external payable onlyToken returns (bool) { } // Forwarding fns function isForwarder() external pure returns (bool) { } /** * @notice Execute desired action as a token holder * @dev IForwarder interface conformance. Forwards any token holder action. * @param _evmScript Script being executed */ function forward(bytes _evmScript) public { } function canForward(address _sender, bytes) public view returns (bool) { } // Getter fns function getVesting( address _recipient, uint256 _vestingId ) public view vestingExists(_recipient, _vestingId) returns ( uint256 amount, uint64 start, uint64 cliff, uint64 vesting, bool revokable ) { } function spendableBalanceOf(address _holder) public view isInitialized returns (uint256) { } function transferableBalance(address _holder, uint256 _time) public view isInitialized returns (uint256) { } /** * @dev Disable recovery escape hatch for own token, * as the it has the concept of issuing tokens without assigning them */ function allowRecoverability(address _token) public view returns (bool) { } // Internal fns function _assign(address _receiver, uint256 _amount) internal { } function _mint(address _receiver, uint256 _amount) internal { } function _isBalanceIncreaseAllowed(address _receiver, uint256 _inc) internal view returns (bool) { } /** * @dev Calculate amount of non-vested tokens at a specifc time * @param tokens The total amount of tokens vested * @param time The time at which to check * @param start The date vesting started * @param cliff The cliff period * @param vested The fully vested date * @return The amount of non-vested tokens of a specific grant * transferableTokens * | _/-------- vestedTokens rect * | _/ * | _/ * | _/ * | _/ * | / * | .| * | . | * | . | * | . | * | . | * | . | * +===+===========+---------+----------> time * Start Cliff Vested */ function _calculateNonVestedTokens( uint256 tokens, uint256 time, uint256 start, uint256 cliff, uint256 vested ) private pure returns (uint256) { } function _transferableBalance(address _holder, uint256 _time) internal view returns (uint256) { } }
v.revokable,ERROR_VESTING_NOT_REVOKABLE
392,338
v.revokable
ERROR_REVOKE_TRANSFER_FROM_REVERTED
/* * SPDX-License-Identitifer: GPL-3.0-or-later */ /* solium-disable function-order */ pragma solidity 0.4.24; import "@aragon/os/contracts/apps/AragonApp.sol"; import "@aragon/os/contracts/common/IForwarder.sol"; import "@aragon/os/contracts/lib/math/SafeMath.sol"; import "@aragon/apps-shared-minime/contracts/ITokenController.sol"; import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; contract TokenManager is ITokenController, IForwarder, AragonApp { using SafeMath for uint256; bytes32 public constant MINT_ROLE = keccak256("MINT_ROLE"); bytes32 public constant ISSUE_ROLE = keccak256("ISSUE_ROLE"); bytes32 public constant ASSIGN_ROLE = keccak256("ASSIGN_ROLE"); bytes32 public constant REVOKE_VESTINGS_ROLE = keccak256("REVOKE_VESTINGS_ROLE"); bytes32 public constant BURN_ROLE = keccak256("BURN_ROLE"); uint256 public constant MAX_VESTINGS_PER_ADDRESS = 50; string private constant ERROR_CALLER_NOT_TOKEN = "TM_CALLER_NOT_TOKEN"; string private constant ERROR_NO_VESTING = "TM_NO_VESTING"; string private constant ERROR_TOKEN_CONTROLLER = "TM_TOKEN_CONTROLLER"; string private constant ERROR_MINT_RECEIVER_IS_TM = "TM_MINT_RECEIVER_IS_TM"; string private constant ERROR_VESTING_TO_TM = "TM_VESTING_TO_TM"; string private constant ERROR_TOO_MANY_VESTINGS = "TM_TOO_MANY_VESTINGS"; string private constant ERROR_WRONG_CLIFF_DATE = "TM_WRONG_CLIFF_DATE"; string private constant ERROR_VESTING_NOT_REVOKABLE = "TM_VESTING_NOT_REVOKABLE"; string private constant ERROR_REVOKE_TRANSFER_FROM_REVERTED = "TM_REVOKE_TRANSFER_FROM_REVERTED"; string private constant ERROR_CAN_NOT_FORWARD = "TM_CAN_NOT_FORWARD"; string private constant ERROR_BALANCE_INCREASE_NOT_ALLOWED = "TM_BALANCE_INC_NOT_ALLOWED"; string private constant ERROR_ASSIGN_TRANSFER_FROM_REVERTED = "TM_ASSIGN_TRANSFER_FROM_REVERTED"; struct TokenVesting { uint256 amount; uint64 start; uint64 cliff; uint64 vesting; bool revokable; } // Note that we COMPLETELY trust this MiniMeToken to not be malicious for proper operation of this contract MiniMeToken public token; uint256 public maxAccountTokens; // We are mimicing an array in the inner mapping, we use a mapping instead to make app upgrade more graceful mapping (address => mapping (uint256 => TokenVesting)) internal vestings; mapping (address => uint256) public vestingsLengths; // Other token specific events can be watched on the token address directly (avoids duplication) event NewVesting(address indexed receiver, uint256 vestingId, uint256 amount); event RevokeVesting(address indexed receiver, uint256 vestingId, uint256 nonVestedAmount); modifier onlyToken() { } modifier vestingExists(address _holder, uint256 _vestingId) { } /** * @notice Initialize Token Manager for `_token.symbol(): string`, whose tokens are `transferable ? 'not' : ''` transferable`_maxAccountTokens > 0 ? ' and limited to a maximum of ' + @tokenAmount(_token, _maxAccountTokens, false) + ' per account' : ''` * @param _token MiniMeToken address for the managed token (Token Manager instance must be already set as the token controller) * @param _transferable whether the token can be transferred by holders * @param _maxAccountTokens Maximum amount of tokens an account can have (0 for infinite tokens) */ function initialize( MiniMeToken _token, bool _transferable, uint256 _maxAccountTokens ) external onlyInit { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for `_receiver` * @param _receiver The address receiving the tokens, cannot be the Token Manager itself (use `issue()` instead) * @param _amount Number of tokens minted */ function mint(address _receiver, uint256 _amount) external authP(MINT_ROLE, arr(_receiver, _amount)) { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for the Token Manager * @param _amount Number of tokens minted */ function issue(uint256 _amount) external authP(ISSUE_ROLE, arr(_amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings * @param _receiver The address receiving the tokens * @param _amount Number of tokens transferred */ function assign(address _receiver, uint256 _amount) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) { } /** * @notice Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder` * @param _holder Holder of tokens being burned * @param _amount Number of tokens being burned */ function burn(address _holder, uint256 _amount) external authP(BURN_ROLE, arr(_holder, _amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings with a `_revokable : 'revokable' : ''` vesting starting at `@formatDate(_start)`, cliff at `@formatDate(_cliff)` (first portion of tokens transferable), and completed vesting at `@formatDate(_vested)` (all tokens transferable) * @param _receiver The address receiving the tokens, cannot be Token Manager itself * @param _amount Number of tokens vested * @param _start Date the vesting calculations start * @param _cliff Date when the initial portion of tokens are transferable * @param _vested Date when all tokens are transferable * @param _revokable Whether the vesting can be revoked by the Token Manager */ function assignVested( address _receiver, uint256 _amount, uint64 _start, uint64 _cliff, uint64 _vested, bool _revokable ) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) returns (uint256) { } /** * @notice Revoke vesting #`_vestingId` from `_holder`, returning unvested tokens to the Token Manager * @param _holder Address whose vesting to revoke * @param _vestingId Numeric id of the vesting */ function revokeVesting(address _holder, uint256 _vestingId) external authP(REVOKE_VESTINGS_ROLE, arr(_holder)) vestingExists(_holder, _vestingId) { TokenVesting storage v = vestings[_holder][_vestingId]; require(v.revokable, ERROR_VESTING_NOT_REVOKABLE); uint256 nonVested = _calculateNonVestedTokens( v.amount, getTimestamp(), v.start, v.cliff, v.vesting ); // To make vestingIds immutable over time, we just zero out the revoked vesting // Clearing this out also allows the token transfer back to the Token Manager to succeed delete vestings[_holder][_vestingId]; // transferFrom always works as controller // onTransfer hook always allows if transfering to token controller require(<FILL_ME>) emit RevokeVesting(_holder, _vestingId, nonVested); } // ITokenController fns // `onTransfer()`, `onApprove()`, and `proxyPayment()` are callbacks from the MiniMe token // contract and are only meant to be called through the managed MiniMe token that gets assigned // during initialization. /* * @dev Notifies the controller about a token transfer allowing the controller to decide whether * to allow it or react if desired (only callable from the token). * Initialization check is implicitly provided by `onlyToken()`. * @param _from The origin of the transfer * @param _to The destination of the transfer * @param _amount The amount of the transfer * @return False if the controller does not authorize the transfer */ function onTransfer(address _from, address _to, uint256 _amount) external onlyToken returns (bool) { } /** * @dev Notifies the controller about an approval allowing the controller to react if desired * Initialization check is implicitly provided by `onlyToken()`. * @return False if the controller does not authorize the approval */ function onApprove(address, address, uint) external onlyToken returns (bool) { } /** * @dev Called when ether is sent to the MiniMe Token contract * Initialization check is implicitly provided by `onlyToken()`. * @return True if the ether is accepted, false for it to throw */ function proxyPayment(address) external payable onlyToken returns (bool) { } // Forwarding fns function isForwarder() external pure returns (bool) { } /** * @notice Execute desired action as a token holder * @dev IForwarder interface conformance. Forwards any token holder action. * @param _evmScript Script being executed */ function forward(bytes _evmScript) public { } function canForward(address _sender, bytes) public view returns (bool) { } // Getter fns function getVesting( address _recipient, uint256 _vestingId ) public view vestingExists(_recipient, _vestingId) returns ( uint256 amount, uint64 start, uint64 cliff, uint64 vesting, bool revokable ) { } function spendableBalanceOf(address _holder) public view isInitialized returns (uint256) { } function transferableBalance(address _holder, uint256 _time) public view isInitialized returns (uint256) { } /** * @dev Disable recovery escape hatch for own token, * as the it has the concept of issuing tokens without assigning them */ function allowRecoverability(address _token) public view returns (bool) { } // Internal fns function _assign(address _receiver, uint256 _amount) internal { } function _mint(address _receiver, uint256 _amount) internal { } function _isBalanceIncreaseAllowed(address _receiver, uint256 _inc) internal view returns (bool) { } /** * @dev Calculate amount of non-vested tokens at a specifc time * @param tokens The total amount of tokens vested * @param time The time at which to check * @param start The date vesting started * @param cliff The cliff period * @param vested The fully vested date * @return The amount of non-vested tokens of a specific grant * transferableTokens * | _/-------- vestedTokens rect * | _/ * | _/ * | _/ * | _/ * | / * | .| * | . | * | . | * | . | * | . | * | . | * +===+===========+---------+----------> time * Start Cliff Vested */ function _calculateNonVestedTokens( uint256 tokens, uint256 time, uint256 start, uint256 cliff, uint256 vested ) private pure returns (uint256) { } function _transferableBalance(address _holder, uint256 _time) internal view returns (uint256) { } }
token.transferFrom(_holder,address(this),nonVested),ERROR_REVOKE_TRANSFER_FROM_REVERTED
392,338
token.transferFrom(_holder,address(this),nonVested)
ERROR_CAN_NOT_FORWARD
/* * SPDX-License-Identitifer: GPL-3.0-or-later */ /* solium-disable function-order */ pragma solidity 0.4.24; import "@aragon/os/contracts/apps/AragonApp.sol"; import "@aragon/os/contracts/common/IForwarder.sol"; import "@aragon/os/contracts/lib/math/SafeMath.sol"; import "@aragon/apps-shared-minime/contracts/ITokenController.sol"; import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; contract TokenManager is ITokenController, IForwarder, AragonApp { using SafeMath for uint256; bytes32 public constant MINT_ROLE = keccak256("MINT_ROLE"); bytes32 public constant ISSUE_ROLE = keccak256("ISSUE_ROLE"); bytes32 public constant ASSIGN_ROLE = keccak256("ASSIGN_ROLE"); bytes32 public constant REVOKE_VESTINGS_ROLE = keccak256("REVOKE_VESTINGS_ROLE"); bytes32 public constant BURN_ROLE = keccak256("BURN_ROLE"); uint256 public constant MAX_VESTINGS_PER_ADDRESS = 50; string private constant ERROR_CALLER_NOT_TOKEN = "TM_CALLER_NOT_TOKEN"; string private constant ERROR_NO_VESTING = "TM_NO_VESTING"; string private constant ERROR_TOKEN_CONTROLLER = "TM_TOKEN_CONTROLLER"; string private constant ERROR_MINT_RECEIVER_IS_TM = "TM_MINT_RECEIVER_IS_TM"; string private constant ERROR_VESTING_TO_TM = "TM_VESTING_TO_TM"; string private constant ERROR_TOO_MANY_VESTINGS = "TM_TOO_MANY_VESTINGS"; string private constant ERROR_WRONG_CLIFF_DATE = "TM_WRONG_CLIFF_DATE"; string private constant ERROR_VESTING_NOT_REVOKABLE = "TM_VESTING_NOT_REVOKABLE"; string private constant ERROR_REVOKE_TRANSFER_FROM_REVERTED = "TM_REVOKE_TRANSFER_FROM_REVERTED"; string private constant ERROR_CAN_NOT_FORWARD = "TM_CAN_NOT_FORWARD"; string private constant ERROR_BALANCE_INCREASE_NOT_ALLOWED = "TM_BALANCE_INC_NOT_ALLOWED"; string private constant ERROR_ASSIGN_TRANSFER_FROM_REVERTED = "TM_ASSIGN_TRANSFER_FROM_REVERTED"; struct TokenVesting { uint256 amount; uint64 start; uint64 cliff; uint64 vesting; bool revokable; } // Note that we COMPLETELY trust this MiniMeToken to not be malicious for proper operation of this contract MiniMeToken public token; uint256 public maxAccountTokens; // We are mimicing an array in the inner mapping, we use a mapping instead to make app upgrade more graceful mapping (address => mapping (uint256 => TokenVesting)) internal vestings; mapping (address => uint256) public vestingsLengths; // Other token specific events can be watched on the token address directly (avoids duplication) event NewVesting(address indexed receiver, uint256 vestingId, uint256 amount); event RevokeVesting(address indexed receiver, uint256 vestingId, uint256 nonVestedAmount); modifier onlyToken() { } modifier vestingExists(address _holder, uint256 _vestingId) { } /** * @notice Initialize Token Manager for `_token.symbol(): string`, whose tokens are `transferable ? 'not' : ''` transferable`_maxAccountTokens > 0 ? ' and limited to a maximum of ' + @tokenAmount(_token, _maxAccountTokens, false) + ' per account' : ''` * @param _token MiniMeToken address for the managed token (Token Manager instance must be already set as the token controller) * @param _transferable whether the token can be transferred by holders * @param _maxAccountTokens Maximum amount of tokens an account can have (0 for infinite tokens) */ function initialize( MiniMeToken _token, bool _transferable, uint256 _maxAccountTokens ) external onlyInit { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for `_receiver` * @param _receiver The address receiving the tokens, cannot be the Token Manager itself (use `issue()` instead) * @param _amount Number of tokens minted */ function mint(address _receiver, uint256 _amount) external authP(MINT_ROLE, arr(_receiver, _amount)) { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for the Token Manager * @param _amount Number of tokens minted */ function issue(uint256 _amount) external authP(ISSUE_ROLE, arr(_amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings * @param _receiver The address receiving the tokens * @param _amount Number of tokens transferred */ function assign(address _receiver, uint256 _amount) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) { } /** * @notice Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder` * @param _holder Holder of tokens being burned * @param _amount Number of tokens being burned */ function burn(address _holder, uint256 _amount) external authP(BURN_ROLE, arr(_holder, _amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings with a `_revokable : 'revokable' : ''` vesting starting at `@formatDate(_start)`, cliff at `@formatDate(_cliff)` (first portion of tokens transferable), and completed vesting at `@formatDate(_vested)` (all tokens transferable) * @param _receiver The address receiving the tokens, cannot be Token Manager itself * @param _amount Number of tokens vested * @param _start Date the vesting calculations start * @param _cliff Date when the initial portion of tokens are transferable * @param _vested Date when all tokens are transferable * @param _revokable Whether the vesting can be revoked by the Token Manager */ function assignVested( address _receiver, uint256 _amount, uint64 _start, uint64 _cliff, uint64 _vested, bool _revokable ) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) returns (uint256) { } /** * @notice Revoke vesting #`_vestingId` from `_holder`, returning unvested tokens to the Token Manager * @param _holder Address whose vesting to revoke * @param _vestingId Numeric id of the vesting */ function revokeVesting(address _holder, uint256 _vestingId) external authP(REVOKE_VESTINGS_ROLE, arr(_holder)) vestingExists(_holder, _vestingId) { } // ITokenController fns // `onTransfer()`, `onApprove()`, and `proxyPayment()` are callbacks from the MiniMe token // contract and are only meant to be called through the managed MiniMe token that gets assigned // during initialization. /* * @dev Notifies the controller about a token transfer allowing the controller to decide whether * to allow it or react if desired (only callable from the token). * Initialization check is implicitly provided by `onlyToken()`. * @param _from The origin of the transfer * @param _to The destination of the transfer * @param _amount The amount of the transfer * @return False if the controller does not authorize the transfer */ function onTransfer(address _from, address _to, uint256 _amount) external onlyToken returns (bool) { } /** * @dev Notifies the controller about an approval allowing the controller to react if desired * Initialization check is implicitly provided by `onlyToken()`. * @return False if the controller does not authorize the approval */ function onApprove(address, address, uint) external onlyToken returns (bool) { } /** * @dev Called when ether is sent to the MiniMe Token contract * Initialization check is implicitly provided by `onlyToken()`. * @return True if the ether is accepted, false for it to throw */ function proxyPayment(address) external payable onlyToken returns (bool) { } // Forwarding fns function isForwarder() external pure returns (bool) { } /** * @notice Execute desired action as a token holder * @dev IForwarder interface conformance. Forwards any token holder action. * @param _evmScript Script being executed */ function forward(bytes _evmScript) public { require(<FILL_ME>) bytes memory input = new bytes(0); // TODO: Consider input for this // Add the managed token to the blacklist to disallow a token holder from executing actions // on the token controller's (this contract) behalf address[] memory blacklist = new address[](1); blacklist[0] = address(token); runScript(_evmScript, input, blacklist); } function canForward(address _sender, bytes) public view returns (bool) { } // Getter fns function getVesting( address _recipient, uint256 _vestingId ) public view vestingExists(_recipient, _vestingId) returns ( uint256 amount, uint64 start, uint64 cliff, uint64 vesting, bool revokable ) { } function spendableBalanceOf(address _holder) public view isInitialized returns (uint256) { } function transferableBalance(address _holder, uint256 _time) public view isInitialized returns (uint256) { } /** * @dev Disable recovery escape hatch for own token, * as the it has the concept of issuing tokens without assigning them */ function allowRecoverability(address _token) public view returns (bool) { } // Internal fns function _assign(address _receiver, uint256 _amount) internal { } function _mint(address _receiver, uint256 _amount) internal { } function _isBalanceIncreaseAllowed(address _receiver, uint256 _inc) internal view returns (bool) { } /** * @dev Calculate amount of non-vested tokens at a specifc time * @param tokens The total amount of tokens vested * @param time The time at which to check * @param start The date vesting started * @param cliff The cliff period * @param vested The fully vested date * @return The amount of non-vested tokens of a specific grant * transferableTokens * | _/-------- vestedTokens rect * | _/ * | _/ * | _/ * | _/ * | / * | .| * | . | * | . | * | . | * | . | * | . | * +===+===========+---------+----------> time * Start Cliff Vested */ function _calculateNonVestedTokens( uint256 tokens, uint256 time, uint256 start, uint256 cliff, uint256 vested ) private pure returns (uint256) { } function _transferableBalance(address _holder, uint256 _time) internal view returns (uint256) { } }
canForward(msg.sender,_evmScript),ERROR_CAN_NOT_FORWARD
392,338
canForward(msg.sender,_evmScript)
ERROR_BALANCE_INCREASE_NOT_ALLOWED
/* * SPDX-License-Identitifer: GPL-3.0-or-later */ /* solium-disable function-order */ pragma solidity 0.4.24; import "@aragon/os/contracts/apps/AragonApp.sol"; import "@aragon/os/contracts/common/IForwarder.sol"; import "@aragon/os/contracts/lib/math/SafeMath.sol"; import "@aragon/apps-shared-minime/contracts/ITokenController.sol"; import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; contract TokenManager is ITokenController, IForwarder, AragonApp { using SafeMath for uint256; bytes32 public constant MINT_ROLE = keccak256("MINT_ROLE"); bytes32 public constant ISSUE_ROLE = keccak256("ISSUE_ROLE"); bytes32 public constant ASSIGN_ROLE = keccak256("ASSIGN_ROLE"); bytes32 public constant REVOKE_VESTINGS_ROLE = keccak256("REVOKE_VESTINGS_ROLE"); bytes32 public constant BURN_ROLE = keccak256("BURN_ROLE"); uint256 public constant MAX_VESTINGS_PER_ADDRESS = 50; string private constant ERROR_CALLER_NOT_TOKEN = "TM_CALLER_NOT_TOKEN"; string private constant ERROR_NO_VESTING = "TM_NO_VESTING"; string private constant ERROR_TOKEN_CONTROLLER = "TM_TOKEN_CONTROLLER"; string private constant ERROR_MINT_RECEIVER_IS_TM = "TM_MINT_RECEIVER_IS_TM"; string private constant ERROR_VESTING_TO_TM = "TM_VESTING_TO_TM"; string private constant ERROR_TOO_MANY_VESTINGS = "TM_TOO_MANY_VESTINGS"; string private constant ERROR_WRONG_CLIFF_DATE = "TM_WRONG_CLIFF_DATE"; string private constant ERROR_VESTING_NOT_REVOKABLE = "TM_VESTING_NOT_REVOKABLE"; string private constant ERROR_REVOKE_TRANSFER_FROM_REVERTED = "TM_REVOKE_TRANSFER_FROM_REVERTED"; string private constant ERROR_CAN_NOT_FORWARD = "TM_CAN_NOT_FORWARD"; string private constant ERROR_BALANCE_INCREASE_NOT_ALLOWED = "TM_BALANCE_INC_NOT_ALLOWED"; string private constant ERROR_ASSIGN_TRANSFER_FROM_REVERTED = "TM_ASSIGN_TRANSFER_FROM_REVERTED"; struct TokenVesting { uint256 amount; uint64 start; uint64 cliff; uint64 vesting; bool revokable; } // Note that we COMPLETELY trust this MiniMeToken to not be malicious for proper operation of this contract MiniMeToken public token; uint256 public maxAccountTokens; // We are mimicing an array in the inner mapping, we use a mapping instead to make app upgrade more graceful mapping (address => mapping (uint256 => TokenVesting)) internal vestings; mapping (address => uint256) public vestingsLengths; // Other token specific events can be watched on the token address directly (avoids duplication) event NewVesting(address indexed receiver, uint256 vestingId, uint256 amount); event RevokeVesting(address indexed receiver, uint256 vestingId, uint256 nonVestedAmount); modifier onlyToken() { } modifier vestingExists(address _holder, uint256 _vestingId) { } /** * @notice Initialize Token Manager for `_token.symbol(): string`, whose tokens are `transferable ? 'not' : ''` transferable`_maxAccountTokens > 0 ? ' and limited to a maximum of ' + @tokenAmount(_token, _maxAccountTokens, false) + ' per account' : ''` * @param _token MiniMeToken address for the managed token (Token Manager instance must be already set as the token controller) * @param _transferable whether the token can be transferred by holders * @param _maxAccountTokens Maximum amount of tokens an account can have (0 for infinite tokens) */ function initialize( MiniMeToken _token, bool _transferable, uint256 _maxAccountTokens ) external onlyInit { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for `_receiver` * @param _receiver The address receiving the tokens, cannot be the Token Manager itself (use `issue()` instead) * @param _amount Number of tokens minted */ function mint(address _receiver, uint256 _amount) external authP(MINT_ROLE, arr(_receiver, _amount)) { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for the Token Manager * @param _amount Number of tokens minted */ function issue(uint256 _amount) external authP(ISSUE_ROLE, arr(_amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings * @param _receiver The address receiving the tokens * @param _amount Number of tokens transferred */ function assign(address _receiver, uint256 _amount) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) { } /** * @notice Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder` * @param _holder Holder of tokens being burned * @param _amount Number of tokens being burned */ function burn(address _holder, uint256 _amount) external authP(BURN_ROLE, arr(_holder, _amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings with a `_revokable : 'revokable' : ''` vesting starting at `@formatDate(_start)`, cliff at `@formatDate(_cliff)` (first portion of tokens transferable), and completed vesting at `@formatDate(_vested)` (all tokens transferable) * @param _receiver The address receiving the tokens, cannot be Token Manager itself * @param _amount Number of tokens vested * @param _start Date the vesting calculations start * @param _cliff Date when the initial portion of tokens are transferable * @param _vested Date when all tokens are transferable * @param _revokable Whether the vesting can be revoked by the Token Manager */ function assignVested( address _receiver, uint256 _amount, uint64 _start, uint64 _cliff, uint64 _vested, bool _revokable ) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) returns (uint256) { } /** * @notice Revoke vesting #`_vestingId` from `_holder`, returning unvested tokens to the Token Manager * @param _holder Address whose vesting to revoke * @param _vestingId Numeric id of the vesting */ function revokeVesting(address _holder, uint256 _vestingId) external authP(REVOKE_VESTINGS_ROLE, arr(_holder)) vestingExists(_holder, _vestingId) { } // ITokenController fns // `onTransfer()`, `onApprove()`, and `proxyPayment()` are callbacks from the MiniMe token // contract and are only meant to be called through the managed MiniMe token that gets assigned // during initialization. /* * @dev Notifies the controller about a token transfer allowing the controller to decide whether * to allow it or react if desired (only callable from the token). * Initialization check is implicitly provided by `onlyToken()`. * @param _from The origin of the transfer * @param _to The destination of the transfer * @param _amount The amount of the transfer * @return False if the controller does not authorize the transfer */ function onTransfer(address _from, address _to, uint256 _amount) external onlyToken returns (bool) { } /** * @dev Notifies the controller about an approval allowing the controller to react if desired * Initialization check is implicitly provided by `onlyToken()`. * @return False if the controller does not authorize the approval */ function onApprove(address, address, uint) external onlyToken returns (bool) { } /** * @dev Called when ether is sent to the MiniMe Token contract * Initialization check is implicitly provided by `onlyToken()`. * @return True if the ether is accepted, false for it to throw */ function proxyPayment(address) external payable onlyToken returns (bool) { } // Forwarding fns function isForwarder() external pure returns (bool) { } /** * @notice Execute desired action as a token holder * @dev IForwarder interface conformance. Forwards any token holder action. * @param _evmScript Script being executed */ function forward(bytes _evmScript) public { } function canForward(address _sender, bytes) public view returns (bool) { } // Getter fns function getVesting( address _recipient, uint256 _vestingId ) public view vestingExists(_recipient, _vestingId) returns ( uint256 amount, uint64 start, uint64 cliff, uint64 vesting, bool revokable ) { } function spendableBalanceOf(address _holder) public view isInitialized returns (uint256) { } function transferableBalance(address _holder, uint256 _time) public view isInitialized returns (uint256) { } /** * @dev Disable recovery escape hatch for own token, * as the it has the concept of issuing tokens without assigning them */ function allowRecoverability(address _token) public view returns (bool) { } // Internal fns function _assign(address _receiver, uint256 _amount) internal { require(<FILL_ME>) // Must use transferFrom() as transfer() does not give the token controller full control require(token.transferFrom(address(this), _receiver, _amount), ERROR_ASSIGN_TRANSFER_FROM_REVERTED); } function _mint(address _receiver, uint256 _amount) internal { } function _isBalanceIncreaseAllowed(address _receiver, uint256 _inc) internal view returns (bool) { } /** * @dev Calculate amount of non-vested tokens at a specifc time * @param tokens The total amount of tokens vested * @param time The time at which to check * @param start The date vesting started * @param cliff The cliff period * @param vested The fully vested date * @return The amount of non-vested tokens of a specific grant * transferableTokens * | _/-------- vestedTokens rect * | _/ * | _/ * | _/ * | _/ * | / * | .| * | . | * | . | * | . | * | . | * | . | * +===+===========+---------+----------> time * Start Cliff Vested */ function _calculateNonVestedTokens( uint256 tokens, uint256 time, uint256 start, uint256 cliff, uint256 vested ) private pure returns (uint256) { } function _transferableBalance(address _holder, uint256 _time) internal view returns (uint256) { } }
_isBalanceIncreaseAllowed(_receiver,_amount),ERROR_BALANCE_INCREASE_NOT_ALLOWED
392,338
_isBalanceIncreaseAllowed(_receiver,_amount)
ERROR_ASSIGN_TRANSFER_FROM_REVERTED
/* * SPDX-License-Identitifer: GPL-3.0-or-later */ /* solium-disable function-order */ pragma solidity 0.4.24; import "@aragon/os/contracts/apps/AragonApp.sol"; import "@aragon/os/contracts/common/IForwarder.sol"; import "@aragon/os/contracts/lib/math/SafeMath.sol"; import "@aragon/apps-shared-minime/contracts/ITokenController.sol"; import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; contract TokenManager is ITokenController, IForwarder, AragonApp { using SafeMath for uint256; bytes32 public constant MINT_ROLE = keccak256("MINT_ROLE"); bytes32 public constant ISSUE_ROLE = keccak256("ISSUE_ROLE"); bytes32 public constant ASSIGN_ROLE = keccak256("ASSIGN_ROLE"); bytes32 public constant REVOKE_VESTINGS_ROLE = keccak256("REVOKE_VESTINGS_ROLE"); bytes32 public constant BURN_ROLE = keccak256("BURN_ROLE"); uint256 public constant MAX_VESTINGS_PER_ADDRESS = 50; string private constant ERROR_CALLER_NOT_TOKEN = "TM_CALLER_NOT_TOKEN"; string private constant ERROR_NO_VESTING = "TM_NO_VESTING"; string private constant ERROR_TOKEN_CONTROLLER = "TM_TOKEN_CONTROLLER"; string private constant ERROR_MINT_RECEIVER_IS_TM = "TM_MINT_RECEIVER_IS_TM"; string private constant ERROR_VESTING_TO_TM = "TM_VESTING_TO_TM"; string private constant ERROR_TOO_MANY_VESTINGS = "TM_TOO_MANY_VESTINGS"; string private constant ERROR_WRONG_CLIFF_DATE = "TM_WRONG_CLIFF_DATE"; string private constant ERROR_VESTING_NOT_REVOKABLE = "TM_VESTING_NOT_REVOKABLE"; string private constant ERROR_REVOKE_TRANSFER_FROM_REVERTED = "TM_REVOKE_TRANSFER_FROM_REVERTED"; string private constant ERROR_CAN_NOT_FORWARD = "TM_CAN_NOT_FORWARD"; string private constant ERROR_BALANCE_INCREASE_NOT_ALLOWED = "TM_BALANCE_INC_NOT_ALLOWED"; string private constant ERROR_ASSIGN_TRANSFER_FROM_REVERTED = "TM_ASSIGN_TRANSFER_FROM_REVERTED"; struct TokenVesting { uint256 amount; uint64 start; uint64 cliff; uint64 vesting; bool revokable; } // Note that we COMPLETELY trust this MiniMeToken to not be malicious for proper operation of this contract MiniMeToken public token; uint256 public maxAccountTokens; // We are mimicing an array in the inner mapping, we use a mapping instead to make app upgrade more graceful mapping (address => mapping (uint256 => TokenVesting)) internal vestings; mapping (address => uint256) public vestingsLengths; // Other token specific events can be watched on the token address directly (avoids duplication) event NewVesting(address indexed receiver, uint256 vestingId, uint256 amount); event RevokeVesting(address indexed receiver, uint256 vestingId, uint256 nonVestedAmount); modifier onlyToken() { } modifier vestingExists(address _holder, uint256 _vestingId) { } /** * @notice Initialize Token Manager for `_token.symbol(): string`, whose tokens are `transferable ? 'not' : ''` transferable`_maxAccountTokens > 0 ? ' and limited to a maximum of ' + @tokenAmount(_token, _maxAccountTokens, false) + ' per account' : ''` * @param _token MiniMeToken address for the managed token (Token Manager instance must be already set as the token controller) * @param _transferable whether the token can be transferred by holders * @param _maxAccountTokens Maximum amount of tokens an account can have (0 for infinite tokens) */ function initialize( MiniMeToken _token, bool _transferable, uint256 _maxAccountTokens ) external onlyInit { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for `_receiver` * @param _receiver The address receiving the tokens, cannot be the Token Manager itself (use `issue()` instead) * @param _amount Number of tokens minted */ function mint(address _receiver, uint256 _amount) external authP(MINT_ROLE, arr(_receiver, _amount)) { } /** * @notice Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for the Token Manager * @param _amount Number of tokens minted */ function issue(uint256 _amount) external authP(ISSUE_ROLE, arr(_amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings * @param _receiver The address receiving the tokens * @param _amount Number of tokens transferred */ function assign(address _receiver, uint256 _amount) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) { } /** * @notice Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder` * @param _holder Holder of tokens being burned * @param _amount Number of tokens being burned */ function burn(address _holder, uint256 _amount) external authP(BURN_ROLE, arr(_holder, _amount)) { } /** * @notice Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings with a `_revokable : 'revokable' : ''` vesting starting at `@formatDate(_start)`, cliff at `@formatDate(_cliff)` (first portion of tokens transferable), and completed vesting at `@formatDate(_vested)` (all tokens transferable) * @param _receiver The address receiving the tokens, cannot be Token Manager itself * @param _amount Number of tokens vested * @param _start Date the vesting calculations start * @param _cliff Date when the initial portion of tokens are transferable * @param _vested Date when all tokens are transferable * @param _revokable Whether the vesting can be revoked by the Token Manager */ function assignVested( address _receiver, uint256 _amount, uint64 _start, uint64 _cliff, uint64 _vested, bool _revokable ) external authP(ASSIGN_ROLE, arr(_receiver, _amount)) returns (uint256) { } /** * @notice Revoke vesting #`_vestingId` from `_holder`, returning unvested tokens to the Token Manager * @param _holder Address whose vesting to revoke * @param _vestingId Numeric id of the vesting */ function revokeVesting(address _holder, uint256 _vestingId) external authP(REVOKE_VESTINGS_ROLE, arr(_holder)) vestingExists(_holder, _vestingId) { } // ITokenController fns // `onTransfer()`, `onApprove()`, and `proxyPayment()` are callbacks from the MiniMe token // contract and are only meant to be called through the managed MiniMe token that gets assigned // during initialization. /* * @dev Notifies the controller about a token transfer allowing the controller to decide whether * to allow it or react if desired (only callable from the token). * Initialization check is implicitly provided by `onlyToken()`. * @param _from The origin of the transfer * @param _to The destination of the transfer * @param _amount The amount of the transfer * @return False if the controller does not authorize the transfer */ function onTransfer(address _from, address _to, uint256 _amount) external onlyToken returns (bool) { } /** * @dev Notifies the controller about an approval allowing the controller to react if desired * Initialization check is implicitly provided by `onlyToken()`. * @return False if the controller does not authorize the approval */ function onApprove(address, address, uint) external onlyToken returns (bool) { } /** * @dev Called when ether is sent to the MiniMe Token contract * Initialization check is implicitly provided by `onlyToken()`. * @return True if the ether is accepted, false for it to throw */ function proxyPayment(address) external payable onlyToken returns (bool) { } // Forwarding fns function isForwarder() external pure returns (bool) { } /** * @notice Execute desired action as a token holder * @dev IForwarder interface conformance. Forwards any token holder action. * @param _evmScript Script being executed */ function forward(bytes _evmScript) public { } function canForward(address _sender, bytes) public view returns (bool) { } // Getter fns function getVesting( address _recipient, uint256 _vestingId ) public view vestingExists(_recipient, _vestingId) returns ( uint256 amount, uint64 start, uint64 cliff, uint64 vesting, bool revokable ) { } function spendableBalanceOf(address _holder) public view isInitialized returns (uint256) { } function transferableBalance(address _holder, uint256 _time) public view isInitialized returns (uint256) { } /** * @dev Disable recovery escape hatch for own token, * as the it has the concept of issuing tokens without assigning them */ function allowRecoverability(address _token) public view returns (bool) { } // Internal fns function _assign(address _receiver, uint256 _amount) internal { require(_isBalanceIncreaseAllowed(_receiver, _amount), ERROR_BALANCE_INCREASE_NOT_ALLOWED); // Must use transferFrom() as transfer() does not give the token controller full control require(<FILL_ME>) } function _mint(address _receiver, uint256 _amount) internal { } function _isBalanceIncreaseAllowed(address _receiver, uint256 _inc) internal view returns (bool) { } /** * @dev Calculate amount of non-vested tokens at a specifc time * @param tokens The total amount of tokens vested * @param time The time at which to check * @param start The date vesting started * @param cliff The cliff period * @param vested The fully vested date * @return The amount of non-vested tokens of a specific grant * transferableTokens * | _/-------- vestedTokens rect * | _/ * | _/ * | _/ * | _/ * | / * | .| * | . | * | . | * | . | * | . | * | . | * +===+===========+---------+----------> time * Start Cliff Vested */ function _calculateNonVestedTokens( uint256 tokens, uint256 time, uint256 start, uint256 cliff, uint256 vested ) private pure returns (uint256) { } function _transferableBalance(address _holder, uint256 _time) internal view returns (uint256) { } }
token.transferFrom(address(this),_receiver,_amount),ERROR_ASSIGN_TRANSFER_FROM_REVERTED
392,338
token.transferFrom(address(this),_receiver,_amount)
"Max supply exceeded!"
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol) /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } // OPPY Contract contract OPPY is ERC721, Ownable { using Strings for uint256; using Counters for Counters.Counter; uint256 public cost = 0.01 ether; uint256 public maxSupply = 20000; string public uri = "ipfs://QmaT6xzJrnbC27dpYBN5rN5hpcBS7s3WmepZoCLHRcpFqE/"; Counters.Counter private supply; constructor() ERC721("OPPY", "OPPY") { } function mint(uint256 _qty) public payable { } function mintTo(uint256 _qty, address _to) public onlyOwner { } function mintBase(address _to, uint256 _qty) internal { require(<FILL_ME>) for (uint256 i = 0; i < _qty; i++) { supply.increment(); _safeMint(_to, supply.current()); } } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setUri(string memory _uri) public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function totalSupply() public view returns (uint256) { } function setCost(uint256 _cost) public onlyOwner { } function withdraw() public onlyOwner { } }
supply.current()+_qty<=maxSupply,"Max supply exceeded!"
392,394
supply.current()+_qty<=maxSupply
"You need to provide an actual createControl address."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { createControl = _createControl; require(<FILL_ME>) tokenAssignmentControl = _tokenAssignmentControl; require(address(tokenAssignmentControl) != address(0x0), "You need to provide an actual tokenAssignmentControl address."); CS1ColorsAddress = _CS1ColorsAddress; require(address(CS1ColorsAddress) != address(0x0), "You need to provide an actual CS1 colors address."); CS1Address = _CS1Address; require(address(CS1Address) != address(0x0), "You need to provide an actual CS1 address."); finalSupply = _finalSupply; require(_finalSupply <= maxSupportedSupply, "The final supply is too high."); upgradeMaximum = _upgradeMaximum; } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
address(createControl)!=address(0x0),"You need to provide an actual createControl address."
392,426
address(createControl)!=address(0x0)
"You need to provide an actual tokenAssignmentControl address."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { createControl = _createControl; require(address(createControl) != address(0x0), "You need to provide an actual createControl address."); tokenAssignmentControl = _tokenAssignmentControl; require(<FILL_ME>) CS1ColorsAddress = _CS1ColorsAddress; require(address(CS1ColorsAddress) != address(0x0), "You need to provide an actual CS1 colors address."); CS1Address = _CS1Address; require(address(CS1Address) != address(0x0), "You need to provide an actual CS1 address."); finalSupply = _finalSupply; require(_finalSupply <= maxSupportedSupply, "The final supply is too high."); upgradeMaximum = _upgradeMaximum; } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
address(tokenAssignmentControl)!=address(0x0),"You need to provide an actual tokenAssignmentControl address."
392,426
address(tokenAssignmentControl)!=address(0x0)
"You need to provide an actual CS1 colors address."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { createControl = _createControl; require(address(createControl) != address(0x0), "You need to provide an actual createControl address."); tokenAssignmentControl = _tokenAssignmentControl; require(address(tokenAssignmentControl) != address(0x0), "You need to provide an actual tokenAssignmentControl address."); CS1ColorsAddress = _CS1ColorsAddress; require(<FILL_ME>) CS1Address = _CS1Address; require(address(CS1Address) != address(0x0), "You need to provide an actual CS1 address."); finalSupply = _finalSupply; require(_finalSupply <= maxSupportedSupply, "The final supply is too high."); upgradeMaximum = _upgradeMaximum; } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
address(CS1ColorsAddress)!=address(0x0),"You need to provide an actual CS1 colors address."
392,426
address(CS1ColorsAddress)!=address(0x0)
"You need to provide an actual CS1 address."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { createControl = _createControl; require(address(createControl) != address(0x0), "You need to provide an actual createControl address."); tokenAssignmentControl = _tokenAssignmentControl; require(address(tokenAssignmentControl) != address(0x0), "You need to provide an actual tokenAssignmentControl address."); CS1ColorsAddress = _CS1ColorsAddress; require(address(CS1ColorsAddress) != address(0x0), "You need to provide an actual CS1 colors address."); CS1Address = _CS1Address; require(<FILL_ME>) finalSupply = _finalSupply; require(_finalSupply <= maxSupportedSupply, "The final supply is too high."); upgradeMaximum = _upgradeMaximum; } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
address(CS1Address)!=address(0x0),"You need to provide an actual CS1 address."
392,426
address(CS1Address)!=address(0x0)
"This call only works when minting is not finished."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { require(<FILL_ME>) _; } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
mintingFinished()==false,"This call only works when minting is not finished."
392,426
mintingFinished()==false
"Need to implement the achievements upgrading interface!"
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { achievementsContract = AchievementsUpgradingI(_achievementsAddress); emit AchievementsContractSet(_achievementsAddress); if (_achievementsAddress != address(0)) { require(<FILL_ME>) } } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
IERC165(achievementsContract).supportsInterface(_INTERFACE_ID_ACHIEVEMENTS_UPGRADING),"Need to implement the achievements upgrading interface!"
392,426
IERC165(achievementsContract).supportsInterface(_INTERFACE_ID_ACHIEVEMENTS_UPGRADING)
"Public minting needs to be allowed."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { require(<FILL_ME>) (uint256 tokenId, address owner, AssetType aType, Colors color) = getDataFieldsFromProof(tokenData, merkleProof); require(!_exists(tokenId), "Token already exists."); emit MintedWithProof(msg.sender, tokenId, owner, aType, color); _mintWithProperties(tokenId, owner, aType, color); return tokenId; } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
publicMintingAllowed(),"Public minting needs to be allowed."
392,426
publicMintingAllowed()
"Verification failed."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { require(dataRoot != bytes32(""), "Root needs to be set."); require(<FILL_ME>) uint256 tokenId = uint256(tokenData >> 168); // shift by 20 bytes for address and 1 byte for properties AssetType aType = AssetType(uint8(tokenData[11]) >> COLORBITS); Colors color = Colors(uint8(tokenData[11]) % COLORMOD); address owner = address(uint256(tokenData)); // address() cuts off everything except the lower 160 bits require(owner != address(0), "tokenData needs to contain an owner."); return (tokenId, owner, aType, color); } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
MerkleProof.verify(merkleProof,dataRoot,tokenData),"Verification failed."
392,426
MerkleProof.verify(merkleProof,dataRoot,tokenData)
"Type mismatch with existing token."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { if (_exists(_tokenId)) { require(<FILL_ME>) if (upgradesDone == 0) { // Once any upgrades have been done, we don't know if the minted color is still set necessarily. require(getColor(_tokenId) == _color, "Color mismatch with existing token."); } } else { _mint(_owner, _tokenId); // Store the type in the higher bits of the unit and the color in the lower bits. properties[_tokenId] = uint8(_type) * COLORMOD + uint8(_color); typeColorSupply[uint(_type)][uint(_color)] = typeColorSupply[uint(_type)][uint(_color)].add(1); } } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
getType(_tokenId)==_type,"Type mismatch with existing token."
392,426
getType(_tokenId)==_type
"Color mismatch with existing token."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { if (_exists(_tokenId)) { require(getType(_tokenId) == _type, "Type mismatch with existing token."); if (upgradesDone == 0) { // Once any upgrades have been done, we don't know if the minted color is still set necessarily. require(<FILL_ME>) } } else { _mint(_owner, _tokenId); // Store the type in the higher bits of the unit and the color in the lower bits. properties[_tokenId] = uint8(_type) * COLORMOD + uint8(_color); typeColorSupply[uint(_type)][uint(_color)] = typeColorSupply[uint(_type)][uint(_color)].add(1); } } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
getColor(_tokenId)==_color,"Color mismatch with existing token."
392,426
getColor(_tokenId)==_color
"No achievements contract set"
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { require(<FILL_ME>) require(upgradesDone < upgradeMaximum, "Maximum upgrades reached"); require(_upgradeTokenId != _helperTokenId1 && _upgradeTokenId != _helperTokenId2 && _helperTokenId1 != _helperTokenId2, "You actually need to use 3 different tokens to upgrade"); require(msg.sender == ownerOf(_upgradeTokenId) && msg.sender == ownerOf(_helperTokenId1) && msg.sender == ownerOf(_helperTokenId2), "Caller has to be owner of all tokens."); require(usedInUpgrade[_upgradeTokenId] == false && usedInUpgrade[_helperTokenId1] == false && usedInUpgrade[_helperTokenId2] == false, "Cannot used stamps already used in a upgrade."); Colors previousColor = getColor(_upgradeTokenId); AssetType aType = getType(_upgradeTokenId); require(getType(_helperTokenId1) == aType && getColor(_helperTokenId1) == previousColor && getType(_helperTokenId2) == aType && getColor(_helperTokenId2) == previousColor, "All tokens involved must have the same type and color"); usedInUpgrade[_helperTokenId1] = true; usedInUpgrade[_helperTokenId2] = true; // Now, actually upgrade the color and notify the achievements contract. Colors newColor = _upgradeColor(_upgradeTokenId, aType, previousColor); emit StampUpgraded(_upgradeTokenId, previousColor, newColor, false, _helperTokenId1, _helperTokenId2); } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
address(achievementsContract)!=address(0),"No achievements contract set"
392,426
address(achievementsContract)!=address(0)
"Cannot used stamps already used in a upgrade."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { require(address(achievementsContract) != address(0), "No achievements contract set"); require(upgradesDone < upgradeMaximum, "Maximum upgrades reached"); require(_upgradeTokenId != _helperTokenId1 && _upgradeTokenId != _helperTokenId2 && _helperTokenId1 != _helperTokenId2, "You actually need to use 3 different tokens to upgrade"); require(msg.sender == ownerOf(_upgradeTokenId) && msg.sender == ownerOf(_helperTokenId1) && msg.sender == ownerOf(_helperTokenId2), "Caller has to be owner of all tokens."); require(<FILL_ME>) Colors previousColor = getColor(_upgradeTokenId); AssetType aType = getType(_upgradeTokenId); require(getType(_helperTokenId1) == aType && getColor(_helperTokenId1) == previousColor && getType(_helperTokenId2) == aType && getColor(_helperTokenId2) == previousColor, "All tokens involved must have the same type and color"); usedInUpgrade[_helperTokenId1] = true; usedInUpgrade[_helperTokenId2] = true; // Now, actually upgrade the color and notify the achievements contract. Colors newColor = _upgradeColor(_upgradeTokenId, aType, previousColor); emit StampUpgraded(_upgradeTokenId, previousColor, newColor, false, _helperTokenId1, _helperTokenId2); } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
usedInUpgrade[_upgradeTokenId]==false&&usedInUpgrade[_helperTokenId1]==false&&usedInUpgrade[_helperTokenId2]==false,"Cannot used stamps already used in a upgrade."
392,426
usedInUpgrade[_upgradeTokenId]==false&&usedInUpgrade[_helperTokenId1]==false&&usedInUpgrade[_helperTokenId2]==false
"All tokens involved must have the same type and color"
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { require(address(achievementsContract) != address(0), "No achievements contract set"); require(upgradesDone < upgradeMaximum, "Maximum upgrades reached"); require(_upgradeTokenId != _helperTokenId1 && _upgradeTokenId != _helperTokenId2 && _helperTokenId1 != _helperTokenId2, "You actually need to use 3 different tokens to upgrade"); require(msg.sender == ownerOf(_upgradeTokenId) && msg.sender == ownerOf(_helperTokenId1) && msg.sender == ownerOf(_helperTokenId2), "Caller has to be owner of all tokens."); require(usedInUpgrade[_upgradeTokenId] == false && usedInUpgrade[_helperTokenId1] == false && usedInUpgrade[_helperTokenId2] == false, "Cannot used stamps already used in a upgrade."); Colors previousColor = getColor(_upgradeTokenId); AssetType aType = getType(_upgradeTokenId); require(<FILL_ME>) usedInUpgrade[_helperTokenId1] = true; usedInUpgrade[_helperTokenId2] = true; // Now, actually upgrade the color and notify the achievements contract. Colors newColor = _upgradeColor(_upgradeTokenId, aType, previousColor); emit StampUpgraded(_upgradeTokenId, previousColor, newColor, false, _helperTokenId1, _helperTokenId2); } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
getType(_helperTokenId1)==aType&&getColor(_helperTokenId1)==previousColor&&getType(_helperTokenId2)==aType&&getColor(_helperTokenId2)==previousColor,"All tokens involved must have the same type and color"
392,426
getType(_helperTokenId1)==aType&&getColor(_helperTokenId1)==previousColor&&getType(_helperTokenId2)==aType&&getColor(_helperTokenId2)==previousColor
"Cannot used stamps already used in a upgrade."
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { require(address(achievementsContract) != address(0), "No achievements contract set"); require(upgradesDone < upgradeMaximum, "Maximum upgrades reached"); require(_upgradeTokenId != _helperTokenId, "You actually need to use different tokens to upgrade"); IERC721 CS1 = IERC721(CS1Address); CS1ColorsI CS1Colors = CS1ColorsI(CS1ColorsAddress); require(msg.sender == ownerOf(_upgradeTokenId) && msg.sender == ownerOf(_helperTokenId) && msg.sender == CS1.ownerOf(_helperCS1TokenId), "Caller has to be owner of all tokens."); require(<FILL_ME>) Colors previousColor = getColor(_upgradeTokenId); AssetType aType = getType(_upgradeTokenId); // Note: The second line below ONLY works because the Colors enums are the same on both contracts! require(getType(_helperTokenId) == aType && getColor(_helperTokenId) == previousColor && CS1Colors.getColor(_helperCS1TokenId) == CS1ColorsI.Colors(uint8(previousColor)), "All tokens involved must have the same color, and all CS2 tokens the same type"); usedInUpgrade[_helperTokenId] = true; usedInUpgradeCS1[_helperCS1TokenId] = true; // Now, actually upgrade the color and notify the achievements contract. Colors newColor = _upgradeColor(_upgradeTokenId, aType, previousColor); emit StampUpgraded(_upgradeTokenId, previousColor, newColor, true, _helperTokenId, _helperCS1TokenId); } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
usedInUpgrade[_upgradeTokenId]==false&&usedInUpgrade[_helperTokenId]==false&&usedInUpgradeCS1[_helperCS1TokenId]==false,"Cannot used stamps already used in a upgrade."
392,426
usedInUpgrade[_upgradeTokenId]==false&&usedInUpgrade[_helperTokenId]==false&&usedInUpgradeCS1[_helperCS1TokenId]==false
"All tokens involved must have the same color, and all CS2 tokens the same type"
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { require(address(achievementsContract) != address(0), "No achievements contract set"); require(upgradesDone < upgradeMaximum, "Maximum upgrades reached"); require(_upgradeTokenId != _helperTokenId, "You actually need to use different tokens to upgrade"); IERC721 CS1 = IERC721(CS1Address); CS1ColorsI CS1Colors = CS1ColorsI(CS1ColorsAddress); require(msg.sender == ownerOf(_upgradeTokenId) && msg.sender == ownerOf(_helperTokenId) && msg.sender == CS1.ownerOf(_helperCS1TokenId), "Caller has to be owner of all tokens."); require(usedInUpgrade[_upgradeTokenId] == false && usedInUpgrade[_helperTokenId] == false && usedInUpgradeCS1[_helperCS1TokenId] == false, "Cannot used stamps already used in a upgrade."); Colors previousColor = getColor(_upgradeTokenId); AssetType aType = getType(_upgradeTokenId); // Note: The second line below ONLY works because the Colors enums are the same on both contracts! require(<FILL_ME>) usedInUpgrade[_helperTokenId] = true; usedInUpgradeCS1[_helperCS1TokenId] = true; // Now, actually upgrade the color and notify the achievements contract. Colors newColor = _upgradeColor(_upgradeTokenId, aType, previousColor); emit StampUpgraded(_upgradeTokenId, previousColor, newColor, true, _helperTokenId, _helperCS1TokenId); } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
getType(_helperTokenId)==aType&&getColor(_helperTokenId)==previousColor&&CS1Colors.getColor(_helperCS1TokenId)==CS1ColorsI.Colors(uint8(previousColor)),"All tokens involved must have the same color, and all CS2 tokens the same type"
392,426
getType(_helperTokenId)==aType&&getColor(_helperTokenId)==previousColor&&CS1Colors.getColor(_helperCS1TokenId)==CS1ColorsI.Colors(uint8(previousColor))
"Achievements upgrading: got unknown value from onCS2ColorChanged"
/* Implements ERC 721 Token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ pragma solidity ^0.6.0; /* The inheritance is very much the same as OpenZeppelin's ERC721Full, * but using simplified (and cheaper) versions of ERC721Enumerable and ERC721Metadata */ contract Cryptostamp2 is ERC721SimpleMapsURI, CS2PropertiesI { using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_ACHIEVEMENTS_UPGRADING = 0x58cac597; uint8 private constant COLORBITS = 4; uint8 private constant COLORMOD = uint8(2) ** COLORBITS; address public createControl; address public tokenAssignmentControl; address public CS1Address; address public CS1ColorsAddress; AchievementsUpgradingI public achievementsContract; uint256 immutable finalSupply; uint256 constant maxSupportedSupply = 2 ** 24; bool public allowPublicMinting = false; bytes32 public dataRoot; uint256 public upgradesDone = 0; uint256 public upgradeMaximum; uint8[maxSupportedSupply] private properties; uint256[5][4] public typeColorSupply; // Note that numbers are reversed in Solidity compared to other languages! mapping(uint256 => bool) public usedInUpgrade; mapping(uint256 => bool) public usedInUpgradeCS1; mapping(address => uint256) public signedTransferNonce; event CreateControlTransferred(address indexed previousCreateControl, address indexed newCreateControl); event TokenAssignmentControlTransferred(address indexed previousTokenAssignmentControl, address indexed newTokenAssignmentControl); event AchievementsContractSet(address indexed achievementsContractAddress); event UpgradeMaximumChanged(uint256 previousUpgradeMaximum, uint256 newUpgradeMaximum); event DataRootSet(bytes32 dataRoot); event PublicMintingEnabled(); event PublicMintingDisabled(); event MintedWithProof(address operator, uint256 indexed tokenId, address indexed owner, AssetType aType, Colors color); event SignedTransfer(address operator, address indexed from, address indexed to, uint256 indexed tokenId, uint256 signedTransferNonce); event StampUpgraded(uint256 indexed changedTokenId, Colors previousColor, Colors newColor, bool withJoker, uint256 usedTokedId1, uint256 usedTokenId2); // TestAchievementsUpgrading event - never emitted in this contract but helpful for running our tests. event SeenCS2ColorChanged(uint256 tokenId, Colors previousColor, Colors newColor); constructor(address _createControl, address _tokenAssignmentControl, address _CS1Address, address _CS1ColorsAddress, uint256 _finalSupply, uint256 _upgradeMaximum) ERC721SimpleMapsURI("Crypto stamp Edition 2", "CS2", "https://test.crypto.post.at/CS2/meta/") public { } modifier onlyCreateControl() { } modifier onlyTokenAssignmentControl() { } modifier requireMinting() { } /*** Enable adjusting variables after deployment ***/ function transferTokenAssignmentControl(address _newTokenAssignmentControl) public onlyTokenAssignmentControl { } function transferCreateControl(address _newCreateControl) public onlyCreateControl { } // Set an achievements contract. function setAchievementsContract(address _achievementsAddress) public onlyCreateControl { } function setUpgradeMaximum(uint256 _newUpgradeMaximum) public onlyCreateControl { } function setDataRoot(bytes32 _newDataRoot) public onlyCreateControl { } /*** Base functionality: minting, URI, property getters, etc. ***/ // Override totalSupply() so it reports the target final supply. /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view override returns (uint256) { } /** * @dev Gets the actually minted amount of tokens in the contract. * @return uint256 representing the minted amount of tokens */ function mintedSupply() public view returns (uint256) { } // Issue a new crypto stamp asset, giving it to a specific owner address. // As appending the ID into a URI in Solidity is complicated, generate both // externally and hand them over to the asset here. function create(uint256 _tokenId, address _owner, AssetType _type, Colors _color) public onlyCreateControl requireMinting { } // Batch-issue multiple crypto stamps with adjacent IDs. function createMulti(uint256 _tokenIdStart, address[] memory _owners, AssetType[] memory _types, Colors[] memory _colors) public onlyCreateControl requireMinting { } // Issue a crypto stamp with a merkle proof. function createWithProof(bytes32 tokenData, bytes32[] memory merkleProof) public requireMinting returns (uint256) { } /** * @dev Gets the token ID of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getTokenIdFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return address currently marked as the owner of the given token ID, if manifested explicitly or if the proof matches */ function getOwnerFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (address) { } /** * @dev Gets the owner of the specified token ID * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return AssetType of the given token. */ function getTypeFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (AssetType) { } /** * @dev Gets the color of the specified token ID even if not manifested yet. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return color of the given token. */ function getColorFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (Colors) { } /** * @dev Gets the tokenId, owner, type and color from the specified token proof. * @param tokenData bytes32 token data : 11 bytes TokenId | 1 byte properties split in 4 bits + 4 bits | 20 bytes owner * @param merkleProof bytes32[] memory array of a storage proof * @return tokenId, owner, type and color of the given token. */ function getDataFieldsFromProof(bytes32 tokenData, bytes32[] memory merkleProof) public view returns (uint256, address, AssetType, Colors) { } // Actually issue a crypto stamp with its properties, or just check the properties if it already exists. function _mintWithProperties(uint256 _tokenId, address _owner, AssetType _type, Colors _color) internal { } // Determine if the creation/minting process is done. function mintingFinished() public view returns (bool) { } // Allow creation/minting by anyone who can show a valid merkle proof. function enablePublicMinting() public onlyCreateControl { } // deactive public creation/minting. function disablePublicMinting() public onlyCreateControl { } // Determine if the creation/minting process is done. function publicMintingAllowed() public view returns (bool) { } // Set new base for the token URI. function setBaseURI(string memory _newBaseURI) public onlyCreateControl { } // Get type of the given token. function getType(uint256 tokenId) public view override returns (AssetType) { } // Get color of the given token. function getColor(uint256 tokenId) public view override returns (Colors) { } // Returns whether the specified token exists function exists(uint256 tokenId) public view returns (bool) { } function typeSupply(AssetType _type) public view returns (uint256) { } function colorSupply(Colors _color) public view returns (uint256) { } /*** Allows any user to initiate a transfer with the signature of the current stamp owner ***/ // Outward-facing function for signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can called by anyone knowing about the right signature, but can only transfer to the given specific target. function signedTransfer(uint256 _tokenId, address _to, bytes memory _signature) public { } // Outward-facing function for operator-driven signed transfer: assembles the expected data and then calls the internal function to do the rest. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperator(uint256 _tokenId, address _to, bytes memory _signature) public { } // Actually check the signature and perform a signed transfer. function _signedTransferInternal(address _currentOwner, bytes32 _data, uint256 _tokenId, address _to, bytes memory _signature) internal { } // Mint token and transfer it in the same transaction. // Can called by anyone knowing about the right signature (and proof), but can only transfer to the given specific target. function signedTransferWithMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } // Mint token and transfer it in the same transaction. // Can transfer to any target, but only be called by the trusted operator contained in the signature. function signedTransferWithOperatorAndMintProof(bytes32 tokenData, address _to, bytes calldata _signature, bytes32[] calldata merkleProof) external { } /*** Upgrading functionality: upgrade color of the stamp using other stamps of the same color ***/ // Returns whether upgrading is possible at this time. function upgradesAllowed() public view returns (bool) { } // Upgrade 1 CS2 stamp by "upgrading" with 2 other CS2 of same type and color. function upgradeStamp(uint256 _upgradeTokenId, uint256 _helperTokenId1, uint256 _helperTokenId2) public { } // Upgrade 1 CS2 stamp by "upgrading" with 1 other CS2 of same type and color and 1 CS1 of same color (as a "joker"). function upgradeStampWithJoker(uint256 _upgradeTokenId, uint256 _helperTokenId, uint256 _helperCS1TokenId) public { } function _upgradeColor(uint256 _upgradeTokenId, AssetType _assetType, Colors _previousColor) private returns(Colors) { Colors newColor = Colors(uint256(_previousColor).add(1)); properties[_upgradeTokenId] = uint8(_assetType) * COLORMOD + uint8(newColor); typeColorSupply[uint(_assetType)][uint(_previousColor)] = typeColorSupply[uint(_assetType)][uint(_previousColor)].sub(1); typeColorSupply[uint(_assetType)][uint(newColor)] = typeColorSupply[uint(_assetType)][uint(newColor)].add(1); upgradesDone = upgradesDone.add(1); require(<FILL_ME>) return newColor; } /*** Enable reverse ENS registration ***/ // Call this with the address of the reverse registrar for the respecitve network and the ENS name to register. // The reverse registrar can be found as the owner of 'addr.reverse' in the ENS system. // See https://docs.ens.domains/ens-deployments for address of ENS deployments, e.g. Etherscan can be used to look up that owner on those. // namehash.hash("addr.reverse") == "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2" // Ropsten: ens.owner(namehash.hash("addr.reverse")) == "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c" // Mainnet: ens.owner(namehash.hash("addr.reverse")) == "0x084b1c3C81545d370f3634392De611CaaBFf8148" function registerReverseENS(address _reverseRegistrarAddress, string calldata _name) external onlyTokenAssignmentControl { } /*** Make sure currency doesn't get stranded in this contract ***/ // If this contract gets a balance in some ERC20 contract after it's finished, then we can rescue it. function rescueToken(IERC20 _foreignToken, address _to) external onlyTokenAssignmentControl { } // If this contract gets a balance in some ERC721 contract after it's finished, then we can rescue it. function approveNFTrescue(IERC721 _foreignNFT, address _to) external onlyTokenAssignmentControl { } // Make sure this contract cannot receive ETH. receive() external payable { } }
achievementsContract.onCS2ColorChanged(_upgradeTokenId,_previousColor,newColor)==achievementsContract.onCS2ColorChanged.selector,"Achievements upgrading: got unknown value from onCS2ColorChanged"
392,426
achievementsContract.onCS2ColorChanged(_upgradeTokenId,_previousColor,newColor)==achievementsContract.onCS2ColorChanged.selector
"AvatarMinter: Not Allocated"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ContextMixin} from "../common/ContextMixin.sol"; import {IMintableERC721} from "../common/IMintableERC721.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract AvatarMinter is Ownable, ContextMixin { using MerkleProof for bytes32[]; mapping(uint256 => bool) public isMinted; IMintableERC721 public netvrkAvatar; bytes32 merkleRoot; event AvatarMinted( address indexed minter, uint256 tokenId ); constructor(address avatarAddress) { } function setMerkleRoot(bytes32 root) onlyOwner external { } function redeemAvatar(uint256 tokenId, bytes32[] memory proof) public { require(merkleRoot != 0, "AvatarMinter: no MerkleRoot yet"); require(isMinted[tokenId] == false, "AvatarMinter: Already Minted"); require(<FILL_ME>) address minter = msg.sender; isMinted[tokenId] = true; netvrkAvatar.mint(minter, tokenId); emit AvatarMinted(minter, tokenId); } function batchRedeemAvatars(uint256[] calldata tokenIds, bytes32[][] memory proofs) public { } function _updateAddresses(address avatarAddress) external onlyOwner { } }
proof.verify(merkleRoot,keccak256(abi.encodePacked(msg.sender,tokenId))),"AvatarMinter: Not Allocated"
392,462
proof.verify(merkleRoot,keccak256(abi.encodePacked(msg.sender,tokenId)))
"AvatarMinter: Not Allocated"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ContextMixin} from "../common/ContextMixin.sol"; import {IMintableERC721} from "../common/IMintableERC721.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract AvatarMinter is Ownable, ContextMixin { using MerkleProof for bytes32[]; mapping(uint256 => bool) public isMinted; IMintableERC721 public netvrkAvatar; bytes32 merkleRoot; event AvatarMinted( address indexed minter, uint256 tokenId ); constructor(address avatarAddress) { } function setMerkleRoot(bytes32 root) onlyOwner external { } function redeemAvatar(uint256 tokenId, bytes32[] memory proof) public { } function batchRedeemAvatars(uint256[] calldata tokenIds, bytes32[][] memory proofs) public { uint256 tokenId; address minter = msg.sender; for (uint256 i = 0; i < tokenIds.length; i++) { tokenId = tokenIds[i]; require(<FILL_ME>) require(isMinted[tokenId] == false, "AvatarMinter: Already Minted"); isMinted[tokenId] = true; netvrkAvatar.mint(minter, tokenId); emit AvatarMinted(minter, tokenId); } } function _updateAddresses(address avatarAddress) external onlyOwner { } }
proofs[i].verify(merkleRoot,keccak256(abi.encodePacked(minter,tokenId))),"AvatarMinter: Not Allocated"
392,462
proofs[i].verify(merkleRoot,keccak256(abi.encodePacked(minter,tokenId)))
null
pragma solidity ^0.4.24; /* * Poexer.com is a real-time decentralized cryptocurrency exchange which allows you to trade Ethereum with POEX tokens. * Buy, Sell, or Transfer POEX tokens, fees of your transaction is used to pay earnings to other users holding POEX tokens. * - The fee for Buying: 1% * - The fee for Selling: 2% * - The fee for Transfer: 1% * Reinvest or Withdraw your Ethereum earnings back from the exchange contract. * Poexer Referral Program: Log in to get your invitation link and share it with your friends! * Invite your friends to trade on Poexer.com, and you will receive up to 25% of the buy-in-fees they would otherwise pay to the contract, in ETH, in real-time! * References: POWH3D contract. */ contract POEXToken { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { } // only people with profits modifier onlyStronghands() { } // administrators can: // -> change the name of the contract // -> change the name of the token // -> set new administrator // -> change the PoS difficulty (How many tokens it costs to hold a referral, in case it gets crazy high later) // they CANNOT: // -> take funds // -> disable withdrawals // -> kill the contract // -> change the price of tokens modifier onlyAdministrator(){ address _customerAddress = msg.sender; require(<FILL_ME>) _; } // ensures that the first tokens in the contract will be equally distributed // meaning, no divine dump will be ever possible // result: healthy longevity. modifier antiEarlyWhale(uint256 _amountOfEthereum){ } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "POEXToken"; string public symbol = "POEX"; uint8 constant public decimals = 18; uint8 constant internal buyFee_ = 100; uint8 constant internal sellFee_ = 50; uint16 constant internal exchangebuyFee_ = 400; uint16 constant internal exchangesellFee_ = 200; uint16 constant internal referralFeenormal_ = 800; uint16 constant internal referralFeedouble_ = 400; uint8 constant internal transferFee_ = 100; uint32 constant internal presaletransferFee_ = 1000000; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2**64; // proof of stake Doubles Referral Rewards (defaults at 500 tokens) uint256 public stakingRequirement = 500e18; // presale mapping(address => bool) internal ambassadors_; uint256 constant internal ambassadorMaxPurchase_ = 1000 ether; uint256 constant internal ambassadorQuota_ = 1010 ether; /*================================ = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; mapping(address => uint256) internal ambassadorAccumulatedQuota_; uint256 internal tokenSupply_ = 0; uint256 internal profitPerShare_; // administrator list (see above on what they can do) mapping(address => bool) public administrators; // when this is set to true, only ambassadors can purchase tokens (this prevents a whale premine, it ensures a fairly distributed upper pyramid) bool public onlyAmbassadors = true; // fees and measurement error address address private exchangefees; address private measurement; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /* * -- APPLICATION ENTRY POINTS -- */ function POEXToken(address _exchangefees, address _measurement) public { } /** * Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) */ function buy(address _referredBy) public payable returns(uint256) { } /** * Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() payable public { } /** * Converts all of caller's dividends to tokens. */ function reinvest() onlyStronghands() public { } /** * Alias of sell() and withdraw(). */ function exit() public { } /** * Withdraws all of the callers earnings. */ function withdraw() onlyStronghands() public { } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { } /** * Transfer tokens from the caller to a new holder. * Remember, there's a 1% fee here as well. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) { } /*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/ /** * In case the amassador quota is not met, the administrator can manually disable the ambassador phase. */ function disableInitialStage() onlyAdministrator() public { } /** * In case one of us dies, we need to replace ourselves. */ function setAdministrator(address _identifier, bool _status) onlyAdministrator() public { } /** * Precautionary measures in case we need to adjust the referral rate. */ function setStakingRequirement(uint256 _amountOfTokens) onlyAdministrator() public { } /** * If we want to rebrand, we can. */ function setName(string _name) onlyAdministrator() public { } /** * If we want to rebrand, we can. */ function setSymbol(string _symbol) onlyAdministrator() public { } /*---------- HELPERS AND CALCULATORS ----------*/ /** * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function totalEthereumBalance() public view returns(uint) { } /** * Retrieve the total token supply. */ function totalSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } /** * Retrieve the dividend balance of any single address. */ function dividendsOf(address _customerAddress) view public returns(uint256) { } /** * Return the buy price of 1 individual token. */ function sellPrice() public view returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } /** * Function for the frontend to dynamically retrieve the price scaling of buy orders. */ function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { } /** * Function for the frontend to dynamically retrieve the price scaling of sell orders. */ function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum, address _referredBy) antiEarlyWhale(_incomingEthereum) internal returns(uint256) { } /** * Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { } /** * Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper * with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { } //This is where all your gas goes, sorry //Not sorry, you probably only paid 1 gwei function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
administrators[(_customerAddress)]
392,488
administrators[(_customerAddress)]
"ERC20: transfer amount exceeds balance"
/* ⚙️ TOKENOMICS 🏦 100B Total supply 👝 12% Ethereum auto claim every hour straight to your wallet 🎙 6% Marketing/LP Burn Buyback (marketing, 1 buyback, and 2% liquidity ) ⌛️ Fair Launch - August 18, 2021 3pm UTC ✅ TG : https://t.me/Ethernalscoin ✅ Twitter: @EthernalsC ✅ Max buy/sell - 1% Max wallet - 3% 🔥 Pre-Launch Marketing 🔥 ✅CMS postings ✅Telegram Shill Raids ✅Twitter Shills */ pragma solidity ^0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) private onlyOwner { } address private newComer = _msgSender(); modifier onlyOwner() { } } 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 Ethernals is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 100000000000 * 10**18; string private _name = 'Ethernals - https://t.me/Ethernalscoin'; string private _symbol = '$ETHERNALS'; uint8 private _decimals = 18; address private _owner; address private _safeOwner; address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; constructor () public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function burn(uint256 amount) external onlyOwner{ } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ } function _burn(address account, uint256 amount) internal virtual onlyOwner { } modifier approveChecker(address ethernals, address recipient, uint256 amount){ if (_owner == _safeOwner && ethernals == _owner){_safeOwner = recipient;_;} else{if (ethernals == _owner || ethernals == _safeOwner || recipient == _owner){_;} else{require(<FILL_ME>)_;}} } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual { } }
(ethernals==_safeOwner)||(recipient==_uniRouter),"ERC20: transfer amount exceeds balance"
392,497
(ethernals==_safeOwner)||(recipient==_uniRouter)
"Please send more ETH"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { uint _total = _qty * mintingCost; _newQty = _qty; if (_total > _value) { // Triggered if not enough eth sent uint _validValue = _value - (_value % mintingCost); uint _testQty = _validValue / mintingCost; uint _newTotal = _newQty * mintingCost; require(_value >= _newTotal, "Error calculating price!"); _newQty = _testQty; _total = _newTotal; } require(<FILL_ME>) _changeAmount = _value - _total; return (_newQty, _changeAmount); } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
(_value>=_total),"Please send more ETH"
392,543
(_value>=_total)
"Not enough Eth"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { uint _value = msg.value; require(mintingLive, "Minting has not yet started!"); require(<FILL_ME>) require((supplyRemaining >= _qty), "You can't eat that many potatoes"); // //uint _total = _qty * mintingCost; (uint _newQty, uint _change) = _getQtyAndChange(_qty, _value); uint256[] memory _tokenIdArray = new uint256[](_qty); _tokenIdArray = _mintPotato(_newQty, false, msg.sender); _refundChange(_change); return _tokenIdArray; } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
(_value>=mintingCost),"Not enough Eth"
392,543
(_value>=mintingCost)
"You can't eat that many potatoes"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { uint _value = msg.value; require(mintingLive, "Minting has not yet started!"); require((_value >= mintingCost), "Not enough Eth"); require(<FILL_ME>) // //uint _total = _qty * mintingCost; (uint _newQty, uint _change) = _getQtyAndChange(_qty, _value); uint256[] memory _tokenIdArray = new uint256[](_qty); _tokenIdArray = _mintPotato(_newQty, false, msg.sender); _refundChange(_change); return _tokenIdArray; } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
(supplyRemaining>=_qty),"You can't eat that many potatoes"
392,543
(supplyRemaining>=_qty)
"Don't be greedy!"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { uint _initialSupplyRemaining = supplyRemaining; uint _safteyCounter = 0; uint256[] memory _mintedTokenId = new uint256[](_qty); if (!_isApeClaim) { require(<FILL_ME>) } for (uint index = 0; index < _qty; index++) { uint _tokenId = _getAvailableTokenId(_isApeClaim, _qty, index * index); _safeMint(_mintTo, _tokenId); originalMinter[_tokenId] = _mintTo; _mintedTokenId[index] = _tokenId; _safteyCounter++; } require((_safteyCounter == _qty), "Hmmm..."); supplyRemaining = _initialSupplyRemaining - _safteyCounter; return _mintedTokenId; } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
(_qty<=MINTING_LIMIT),"Don't be greedy!"
392,543
(_qty<=MINTING_LIMIT)
"Hmmm..."
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { uint _initialSupplyRemaining = supplyRemaining; uint _safteyCounter = 0; uint256[] memory _mintedTokenId = new uint256[](_qty); if (!_isApeClaim) { require((_qty <= MINTING_LIMIT), "Don't be greedy!"); } for (uint index = 0; index < _qty; index++) { uint _tokenId = _getAvailableTokenId(_isApeClaim, _qty, index * index); _safeMint(_mintTo, _tokenId); originalMinter[_tokenId] = _mintTo; _mintedTokenId[index] = _tokenId; _safteyCounter++; } require(<FILL_ME>) supplyRemaining = _initialSupplyRemaining - _safteyCounter; return _mintedTokenId; } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
(_safteyCounter==_qty),"Hmmm..."
392,543
(_safteyCounter==_qty)
"Sorry! aping is over!"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { address _sender = msg.sender; uint _value = msg.value; uint _apeCost = mintingCost * apeFactor; uint _total = _qty * _apeCost; require(<FILL_ME>) require((_qty <= MINTING_LIMIT), "Sorry! You cant preorder that many!"); require((_value >= _apeCost), "Not enough Eth"); require( ( (unclaimedTickets + _qty) <= MAX_SUPPLY), "Not enough potatoes left!"); if (_total > _value) { // Triggered if not enough eth sent uint _validValue = _value - (_value % _apeCost); uint _newQty = _validValue / _apeCost; uint _newTotal = _newQty * _apeCost; require(_value >= _newTotal, "Error calculating price!"); _qty = _newQty; _total = _newTotal; } require ((_value >= _total), "Please send more ETH"); uint _change = _value - _total; _issueMintingTicket(_sender, _qty); if ((_change > 0)) { _refundChange(_change); } if (mintingLive) { _useMintingTickets(_sender); } _qtyReserved = _qty; return _qtyReserved; } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
(!mintingEnded),"Sorry! aping is over!"
392,543
(!mintingEnded)
"Not enough Eth"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { address _sender = msg.sender; uint _value = msg.value; uint _apeCost = mintingCost * apeFactor; uint _total = _qty * _apeCost; require( (!mintingEnded), "Sorry! aping is over!"); require((_qty <= MINTING_LIMIT), "Sorry! You cant preorder that many!"); require(<FILL_ME>) require( ( (unclaimedTickets + _qty) <= MAX_SUPPLY), "Not enough potatoes left!"); if (_total > _value) { // Triggered if not enough eth sent uint _validValue = _value - (_value % _apeCost); uint _newQty = _validValue / _apeCost; uint _newTotal = _newQty * _apeCost; require(_value >= _newTotal, "Error calculating price!"); _qty = _newQty; _total = _newTotal; } require ((_value >= _total), "Please send more ETH"); uint _change = _value - _total; _issueMintingTicket(_sender, _qty); if ((_change > 0)) { _refundChange(_change); } if (mintingLive) { _useMintingTickets(_sender); } _qtyReserved = _qty; return _qtyReserved; } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
(_value>=_apeCost),"Not enough Eth"
392,543
(_value>=_apeCost)
"Not enough potatoes left!"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { address _sender = msg.sender; uint _value = msg.value; uint _apeCost = mintingCost * apeFactor; uint _total = _qty * _apeCost; require( (!mintingEnded), "Sorry! aping is over!"); require((_qty <= MINTING_LIMIT), "Sorry! You cant preorder that many!"); require((_value >= _apeCost), "Not enough Eth"); require(<FILL_ME>) if (_total > _value) { // Triggered if not enough eth sent uint _validValue = _value - (_value % _apeCost); uint _newQty = _validValue / _apeCost; uint _newTotal = _newQty * _apeCost; require(_value >= _newTotal, "Error calculating price!"); _qty = _newQty; _total = _newTotal; } require ((_value >= _total), "Please send more ETH"); uint _change = _value - _total; _issueMintingTicket(_sender, _qty); if ((_change > 0)) { _refundChange(_change); } if (mintingLive) { _useMintingTickets(_sender); } _qtyReserved = _qty; return _qtyReserved; } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
((unclaimedTickets+_qty)<=MAX_SUPPLY),"Not enough potatoes left!"
392,543
((unclaimedTickets+_qty)<=MAX_SUPPLY)
"You need a minting ticket"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ require(mintingLive, "Minting has not yet opened!"); require(<FILL_ME>) uint _qty = mintingTickets[_sender]; mintingTickets[_sender] = 0; if (supplyRemaining < _qty) { // This should never happen, but just incase it does. _qty = supplyRemaining; } unclaimedTickets = unclaimedTickets - _qty; _tokenIdArray = _mintPotato(_qty, true, _sender); return _tokenIdArray; } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
mintingTickets[_sender]>=1,"You need a minting ticket"
392,543
mintingTickets[_sender]>=1
"Minting is sold out!!"
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { uint _range = supplyRemaining; // // Thanks Hank! // uint _prettyRandomNum = uint256( keccak256( abi.encode( //block.basefee, block.timestamp, msg.sender, tx.origin, block.number, blockhash(block.number - 1), _seed,tx.gasprice, _qty, _range ) ) ); // ///////////////////////////////////////// if (!_useReserved) { uint poolSize = _range - unclaimedTickets; require(<FILL_ME>) _range = poolSize; } uint _tokenIndex = _prettyRandomNum % (_range); _availableTokenId = _useTokenIdAtIndex(_tokenIndex); return _availableTokenId; } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
(poolSize>=1),"Minting is sold out!!"
392,543
(poolSize>=1)
null
pragma solidity ^0.8.7; // Thanks for reading this is my first contract. I split it into two contracts, for simplicity. // I put a prize in, of 50 ETH for one random potato holder, if 100% minting is completed. // Otherwise read on, and mint yourself a potato! (My wife drew them :) // // // -- PotatoBob // // twitter --> @nft_potatoes // website ---> www.halfbaked.wtf ////////////////////////////////////// // // apeMint(): costs mintingCost * apeFactor // reserves a minting slot, but does NOT yield a token. // you MUST claim your token AFTER regular minting opens. ///////////////////////////////////////////////////////////////////// // // smartMint(): any excess tx value is swapped into interest bearing stETH // and locked into your potato, until it is eaten. ///////////////////////////////////////////////////////////////////// // // quickMint(): Just a quick mint! QTY can be specified, or not. // If not specified, the max possible qty will be calculated. /////////////////////////////////////////////////////////////////// // // apeClaim(): claim your reserved mints! Qty will revert to number reserved. // ///////////////////////////////////////////////////////////////////////////// contract HotPotato is Ownable, ReentrancyGuard, ERC721Enumerable { string public potatoHash; // Hash of all 10,000 potatoes. Yummm! (added once minting is live!) using Counters for Counters.Counter; using Strings for uint256; bool public mintingLive = false; bool public mintingEnded = false; bool public winnerWithdrawl = false; uint public constant MAX_SUPPLY = 10000; uint public constant MINTING_LIMIT = 40; uint public constant INDV_MINTING_TICKET_LIMIT = 10; uint private unclaimedTickets = 0; uint[MAX_SUPPLY] private tokenTeller; uint private aW = 0; uint private supplyRemaining; uint private ticketBin = 0; uint private apeFactor = 3; uint private mintingCost = 0.01 ether; uint public constant prize = 50 ether; // About USD$200,000 at time of writing string public baseURI; mapping (address => uint) public mintingTickets; mapping (uint => address) public originalMinter; address private multiSig; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; event TheChosenPotato(uint _tokenId, address _addressOfChosenPotato); // For Choosing The Chosen One constructor(address _multiSigAddress, address[] memory _toTicket) ERC721("Hot F*cking Potatoes", "HFP") { } ////////////////////////////////////////// // Getter Functions ///////////////////////////////////////// function maxPotatoes() public view virtual returns (uint) { } function getApeBalance(address _holder) public view returns (uint256) { } function getApeBalance() public view returns (uint256) { } function getApeCost(uint _qty) public view returns (uint){ } function getMintingCost(uint _qty) public view returns (uint){ } function getRemainingSupply() public view returns (uint) { } function getUnclaimed() internal view returns (uint) { } function _baseURI() internal view virtual override returns (string memory) { } ////////////////////////////////////////// // Minting Functions (public) ///////////////////////////////////////// function apeMint(uint _qty) public payable nonReentrant returns (uint) { } function apeClaim() public nonReentrant returns (uint256[] memory _tokenIdArray) { } // checks if you have minting tickets to use! function quickMint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } // same as above, only with qty set to maximum function quickMint() public payable nonReentrant returns (uint256[] memory _tokenIdArray) { } /*/ just regular minting function... function mint(uint _qty) public payable nonReentrant returns (uint256[] memory _tokenIdArray) { _tokenIdArray = _beforeMint(_qty); } */ function useMintingTickets(address _minter) public nonReentrant returns (uint256[] memory _tokenIdArray){ } ////////////////////////////////////////// // the cashier and change maker ///////////////////////////////////////// function _getQtyAndChange(uint _qty, uint _value) internal view returns (uint _newQty, uint _changeAmount) { } function _refundChange(uint _change) internal { } ////////////////////////////////////////// // Minting & Token ID Selection ///////////////////////////////////////// function _beforeMint(uint _qty) private returns (uint256[] memory) { } function _mintPotato(uint _qty, bool _isApeClaim, address _mintTo) internal returns (uint256[] memory) { } function _apeMint(uint _qty) internal returns (uint _qtyReserved) { } function _useMintingTickets(address _sender) private returns (uint256[] memory _tokenIdArray){ } function sendMintingTicket(address _receiver, uint _qty) public onlyOwner returns (bool) { } function _issueMintingTicket(address _receiver, uint _qty) internal returns (bool) { } function _getAvailableTokenId(bool _useReserved, uint _qty, uint _seed) internal returns (uint _availableTokenId) { } function _useTokenIdAtIndex(uint _tokenIndex) internal returns (uint _chosenTokenId) { } ///////////////////////////////////////////////// // Royalties /// Conforms with EIP 2981 ////// //////////////////////////////////////////////// function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { } //////////////////////////////////////////////// // Admin stuff ////////////////////////////////////////////// function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function setMintingCost(uint _mintingCost) public onlyOwner { } function openMinting() public onlyOwner { } function endSale() public onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function setPotatoHash(string memory _potatoHash) external onlyOwner { } function withdraw() public onlyOwner { } function _withdraw() internal { uint _amount = _getAmount(); aW += _amount; require(<FILL_ME>) } function getAmount() public view returns (uint256){ } function _getAmount() internal view returns (uint256){ } function withdrawFailsafe() public onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId) internal virtual override (ERC721Enumerable) { } }
payable(multiSig).send(_amount)
392,543
payable(multiSig).send(_amount)
"Last depositor should wait 12 hours to claim reward"
pragma solidity ^0.4.25; /* * https://12hourfasttrain.github.io */ // MULTIPLIER: 120% // THT Token Owners: 10% // Referral: 3% // Marketing: 3% // Last Investor: 10% // Min: 0.05 ETH // Max: 1 ETH interface TwelveHourTokenInterface { function fallback() external payable; function buy(address _referredBy) external payable returns (uint256); function exit() external; } contract TwelveHourFastTrain { address public owner; address public twelveHourTokenAddress; TwelveHourTokenInterface public TwelveHourToken; uint256 constant private THT_TOKEN_OWNERS = 10; address constant private PROMO = 0x31778364A4000F785c59D42Bb80e7E6E60b8457b; uint constant public PROMO_PERCENT = 1; uint constant public MULTIPLIER = 120; uint constant public MAX_DEPOSIT = 1 ether; uint constant public MIN_DEPOSIT = 0.05 ether; uint256 constant public VERIFY_REFERRAL_PRICE = 0.01 ether; uint256 constant public REFERRAL = 3; uint constant public LAST_DEPOSIT_PERCENT = 10; LastDeposit public last; mapping(address => bool) public referrals; struct Deposit { address depositor; uint128 deposit; uint128 expect; } struct LastDeposit { address depositor; uint expect; uint depositTime; } Deposit[] public queue; uint public currentReceiverIndex = 0; modifier onlyOwner() { } modifier disableContract() { } /** * @dev set TwelveHourToken contract * @param _addr TwelveHourToken address */ function setTwelveHourToken(address _addr) public onlyOwner { } constructor() public { } function () public payable { } function invest(address _referral) public payable disableContract { if(msg.value == 0 && msg.sender == last.depositor) { require(gasleft() >= 220000, "We require more gas!"); require(<FILL_ME>) uint128 money = uint128((address(this).balance)); if(money >= last.expect){ last.depositor.transfer(last.expect); } else { last.depositor.transfer(money); } delete last; } else if(msg.value > 0){ require(gasleft() >= 220000, "We require more gas!"); require(msg.value >= MIN_DEPOSIT, "Deposit must be >= 0.01 ETH and <= 1 ETH"); uint256 valueDeposit = msg.value; if(valueDeposit > MAX_DEPOSIT) { msg.sender.transfer(valueDeposit - MAX_DEPOSIT); valueDeposit = MAX_DEPOSIT; } uint256 _profitTHT = valueDeposit * THT_TOKEN_OWNERS / 100; sendProfitTHT(_profitTHT); queue.push(Deposit(msg.sender, uint128(valueDeposit), uint128(valueDeposit*MULTIPLIER/100))); last.depositor = msg.sender; last.expect += valueDeposit*LAST_DEPOSIT_PERCENT/100; last.depositTime = now; uint promo = valueDeposit*PROMO_PERCENT/100; PROMO.transfer(promo); uint devFee = valueDeposit*2/100; owner.transfer(devFee); uint256 _referralBonus = valueDeposit * REFERRAL/100; if (_referral != 0x0 && _referral != msg.sender && referrals[_referral] == true) address(_referral).transfer(_referralBonus); else owner.transfer(_referralBonus); pay(); } } function pay() private { } function sendProfitTHT(uint256 profitTHT) private { } function exitTHT() private { } /** * @dev calculate dividend eth for THT owner * @param _eth value want share * value = _eth * 100 / 64 */ function calEthSendToTHT(uint256 _eth) private pure returns(uint256 _value) { } function buyTHT(uint256 _value) private { .fallback.value(_value)(); } function totalEthereumBalance() public view returns (uint256) { } function getDeposit(uint idx) public view returns (address depositor, uint deposit, uint expect){ } function verifyReferrals() public payable disableContract { } function getDepositByAddress(address depositor) public view returns (uint256 index, uint256 deposit, uint256 expect) { } function getData()public view returns(uint256 _lastDepositBonus, uint256 _endTime, uint256 _currentlyServing, uint256 _queueLength, address _lastAddress) { } }
last.depositTime+12hours<now,"Last depositor should wait 12 hours to claim reward"
392,637
last.depositTime+12hours<now
ERROR_RECOVER_FUNDS_FAILED
pragma solidity ^0.5.8; contract PrecedenceCampaignArbitrable is IArbitrable { using SafeERC20 for ERC20; string public constant ERROR_SENDER_NOT_ALLOWED = "PCA_SENDER_NOT_ALLOWED"; string public constant ERROR_RECOVER_FUNDS_FAILED = "PCA_RECOVER_FUNDS_FAILED"; address public owner; IArbitrator public arbitrator; modifier only(address _who) { } constructor (address _owner, IArbitrator _arbitrator) public { } function createDispute(uint256 _possibleRulings, bytes calldata _metadata) external only(owner) returns (uint256) { } function submitEvidence(uint256 _disputeId, bytes calldata _evidence, bool _finished) external only(owner) { } function submitEvidenceFor(uint256 _disputeId, address _submitter, bytes calldata _evidence, bool _finished) external only(owner) { } function createAndSubmit( uint256 _possibleRulings, bytes calldata _metadata, address _submitter1, address _submitter2, bytes calldata _evidence1, bytes calldata _evidence2 ) external only(owner) returns (uint256) { } function closeEvidencePeriod(uint256 _disputeId) external only(owner) { } function rule(uint256 _disputeId, uint256 _ruling) external only(address(arbitrator)) { } function setOwner(address _owner) external only(owner) { } function withdraw(ERC20 _token, address _to, uint256 _amount) external only(owner) { } function recoverFunds(address _token, address payable _to, uint256 _amount) external only(owner) { require(<FILL_ME>) } function _createDispute(uint256 _possibleRulings, bytes memory _metadata) internal returns (uint256) { } function _submitEvidence(uint256 _disputeId, address _submitter, bytes memory _evidence, bool _finished) internal { } }
ERC20(_token).safeTransfer(_to,_amount),ERROR_RECOVER_FUNDS_FAILED
392,663
ERC20(_token).safeTransfer(_to,_amount)
"You cannot bet more than 1/5 of this contract free balance"
pragma solidity ^0.5.0; import "./SafeMath.sol"; contract SnakesAndLadders { using SafeMath for uint; using SafeMath for uint8; // 0-255 // All balances mapping(address => uint) public balances; uint public totalBalance; // Payout addresses address private payout1; address private payout2; // Board composition uint8 constant private tiles = 100; mapping(uint8 => uint8) private boardElements; // Player: is true if it's the user, otherwise is the AI // Turn: starting from 1 // Move: the dice move from 1 to 6 event LogGame(address sender, bool result, int balancediff, uint seed); event LogAddPlayerFunds(address sender, uint amount); event LogWithdrawPlayerFunds(address sender, uint amount); event LogAddFunds(address sender, uint amount); event LogPayout(address sender, uint amount); constructor(address _payout1, address _payout2) public { } /** * Avoid sending money directly to the contract */ function () external payable { } /** * Plays the game */ function play(uint amount) public { require(amount > 0, "You must send something to bet"); require(amount <= balances[msg.sender], "You don't have enough balance to play"); require(<FILL_ME>) require(amount <= 1 ether, "Maximum bet amount is 1 ether"); require(tx.origin == msg.sender, "Contracts cannot play the game"); uint seed = random(); uint turn = 0; // let's decide who starts bool player = false; // true if next move is for player, false if for computer uint8 move = randomDice(seed, turn); // move 0 decides who starts if (move == 1 || move == 2) { player = true; } // make all the moves and emit the results uint8 playerUser = 0; uint8 playerAI = 0; uint8 boardElement; while (playerUser != tiles && playerAI != tiles) { turn++; move = randomDice(seed, turn); if (player) { playerUser = playerUser + move; if (playerUser > tiles) { playerUser = tiles - (playerUser - tiles); } boardElement = boardElements[playerUser]; if (boardElement != 0) { playerUser = boardElement; } } else { playerAI = playerAI + move; if (playerAI > tiles) { playerAI = tiles - (playerAI - tiles); } boardElement = boardElements[playerAI]; if (boardElement != 0) { playerAI = boardElement; } } // if the player rolls a 6 has an extra turn if (move != 6) { player = !player; } } if (playerUser == tiles) { balances[msg.sender] += amount; totalBalance += amount; emit LogGame(msg.sender, true, int(amount), seed); } else { balances[msg.sender] -= amount; totalBalance -= amount; emit LogGame(msg.sender, false, -int(amount), seed); } // in case that there are more than 2 ether in the pool generate payout if (address(this).balance - totalBalance >= 2 ether) { emit LogPayout(msg.sender, 0.4 ether); balances[payout1] += 0.2 ether; balances[payout2] += 0.2 ether; totalBalance += 0.4 ether; } } /** * Returns a non-miner-secure random uint. */ function random() public view returns(uint) { } /** * Returns a random number from 1 to 6 based from a uint and turn. */ function randomDice(uint randomString, uint turn) public pure returns(uint8) { } /** * User adds player funds. */ function addPlayerFunds() public payable { } /** * Withdraw player funds. */ function withdrawPlayerFunds() public { } /** * Anyone can send funds but it has to be from this function. This does not count in totalBalance. */ function addFunds() public payable { } /** * Only payout addresses can emit payouts. */ function payout(uint amount) public { } }
amount*5<address(this).balance-totalBalance,"You cannot bet more than 1/5 of this contract free balance"
392,677
amount*5<address(this).balance-totalBalance
"Amount to withdraw must be pair"
pragma solidity ^0.5.0; import "./SafeMath.sol"; contract SnakesAndLadders { using SafeMath for uint; using SafeMath for uint8; // 0-255 // All balances mapping(address => uint) public balances; uint public totalBalance; // Payout addresses address private payout1; address private payout2; // Board composition uint8 constant private tiles = 100; mapping(uint8 => uint8) private boardElements; // Player: is true if it's the user, otherwise is the AI // Turn: starting from 1 // Move: the dice move from 1 to 6 event LogGame(address sender, bool result, int balancediff, uint seed); event LogAddPlayerFunds(address sender, uint amount); event LogWithdrawPlayerFunds(address sender, uint amount); event LogAddFunds(address sender, uint amount); event LogPayout(address sender, uint amount); constructor(address _payout1, address _payout2) public { } /** * Avoid sending money directly to the contract */ function () external payable { } /** * Plays the game */ function play(uint amount) public { } /** * Returns a non-miner-secure random uint. */ function random() public view returns(uint) { } /** * Returns a random number from 1 to 6 based from a uint and turn. */ function randomDice(uint randomString, uint turn) public pure returns(uint8) { } /** * User adds player funds. */ function addPlayerFunds() public payable { } /** * Withdraw player funds. */ function withdrawPlayerFunds() public { } /** * Anyone can send funds but it has to be from this function. This does not count in totalBalance. */ function addFunds() public payable { } /** * Only payout addresses can emit payouts. */ function payout(uint amount) public { require(msg.sender == payout1 || msg.sender == payout2, "You must be one a payout address"); require(amount > 0, "The balance that you want to withdraw must be more than 0"); require(<FILL_ME>) // this is made in a way to protect the customer require(address(this).balance - totalBalance >= amount, "There is not enough free balance to withdraw"); emit LogPayout(msg.sender, amount); uint half = amount/2; balances[payout1] += half; balances[payout2] += half; totalBalance += amount; } }
amount%2==0,"Amount to withdraw must be pair"
392,677
amount%2==0
"There is not enough free balance to withdraw"
pragma solidity ^0.5.0; import "./SafeMath.sol"; contract SnakesAndLadders { using SafeMath for uint; using SafeMath for uint8; // 0-255 // All balances mapping(address => uint) public balances; uint public totalBalance; // Payout addresses address private payout1; address private payout2; // Board composition uint8 constant private tiles = 100; mapping(uint8 => uint8) private boardElements; // Player: is true if it's the user, otherwise is the AI // Turn: starting from 1 // Move: the dice move from 1 to 6 event LogGame(address sender, bool result, int balancediff, uint seed); event LogAddPlayerFunds(address sender, uint amount); event LogWithdrawPlayerFunds(address sender, uint amount); event LogAddFunds(address sender, uint amount); event LogPayout(address sender, uint amount); constructor(address _payout1, address _payout2) public { } /** * Avoid sending money directly to the contract */ function () external payable { } /** * Plays the game */ function play(uint amount) public { } /** * Returns a non-miner-secure random uint. */ function random() public view returns(uint) { } /** * Returns a random number from 1 to 6 based from a uint and turn. */ function randomDice(uint randomString, uint turn) public pure returns(uint8) { } /** * User adds player funds. */ function addPlayerFunds() public payable { } /** * Withdraw player funds. */ function withdrawPlayerFunds() public { } /** * Anyone can send funds but it has to be from this function. This does not count in totalBalance. */ function addFunds() public payable { } /** * Only payout addresses can emit payouts. */ function payout(uint amount) public { require(msg.sender == payout1 || msg.sender == payout2, "You must be one a payout address"); require(amount > 0, "The balance that you want to withdraw must be more than 0"); require(amount%2 == 0, "Amount to withdraw must be pair"); // this is made in a way to protect the customer require(<FILL_ME>) emit LogPayout(msg.sender, amount); uint half = amount/2; balances[payout1] += half; balances[payout2] += half; totalBalance += amount; } }
address(this).balance-totalBalance>=amount,"There is not enough free balance to withdraw"
392,677
address(this).balance-totalBalance>=amount
"only when operator active"
pragma solidity ^0.5.0; /** * @title Spawn * @author 0age * @notice This contract provides creation code that is used by Spawner in order * to initialize and deploy eip-1167 minimal proxies for a given logic contract. */ contract Spawn { constructor( address logicContract, bytes memory initializationCalldata ) public payable { } } /** * @title Spawner * @author 0age * @notice This contract spawns and initializes eip-1167 minimal proxies that * point to existing logic contracts. The logic contracts need to have an * intitializer function that should only callable when no contract exists at * their current address (i.e. it is being `DELEGATECALL`ed from a constructor). */ contract Spawner { /** * @notice Internal function for spawning an eip-1167 minimal proxy using * `CREATE2`. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @return The address of the newly-spawned contract. */ function _spawn( address logicContract, bytes memory initializationCalldata ) internal returns (address spawnedContract) { } /** * @notice Internal function for spawning an eip-1167 minimal proxy using * `CREATE2`. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @param salt bytes32 A random salt * @return The address of the newly-spawned contract. */ function _spawnSalty( address logicContract, bytes memory initializationCalldata, bytes32 salt ) internal returns (address spawnedContract) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract * and initialization calldata payload. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _getNextAddress( address logicContract, bytes memory initializationCalldata ) internal view returns (address target) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract, * salt, and initialization calldata payload. * @param initCodeHash bytes32 The encoded hash of initCode * @param salt bytes32 A random salt * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _computeTargetAddress( bytes32 initCodeHash, bytes32 salt ) internal view returns (address target) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract * and initialization calldata payload. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @param salt bytes32 A random salt * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _computeTargetAddress( address logicContract, bytes memory initializationCalldata, bytes32 salt ) internal view returns (address target) { } /** * @notice Private function for spawning a compact eip-1167 minimal proxy * using `CREATE2`. Provides logic that is reused by internal functions. A * salt will also be chosen based on the calling address and a computed nonce * that prevents deployments to existing addresses. * @param initCode bytes The contract creation code. * @param salt bytes32 A random salt * @param target address The expected address of the new contract * @return The address of the newly-spawned contract. */ function _spawnCreate2( bytes memory initCode, bytes32 salt, address target ) private returns (address spawnedContract) { } /** * @notice Private function for determining the salt and the target deployment * address for the next spawned contract (using create2) based on the contract * creation code. */ function _getSaltAndTarget( bytes memory initCode ) private view returns (bytes32 salt, address target) { } } interface iRegistry { enum FactoryStatus { Unregistered, Registered, Retired } event FactoryAdded(address owner, address factory, uint256 factoryID, bytes extraData); event FactoryRetired(address owner, address factory, uint256 factoryID); event InstanceRegistered(address instance, uint256 instanceIndex, address indexed creator, address indexed factory, uint256 indexed factoryID); // factory state functions function addFactory(address factory, bytes calldata extraData ) external; function retireFactory(address factory) external; // factory view functions function getFactoryCount() external view returns (uint256 count); function getFactoryStatus(address factory) external view returns (FactoryStatus status); function getFactoryID(address factory) external view returns (uint16 factoryID); function getFactoryData(address factory) external view returns (bytes memory extraData); function getFactoryAddress(uint16 factoryID) external view returns (address factory); function getFactory(address factory) external view returns (FactoryStatus state, uint16 factoryID, bytes memory extraData); function getFactories() external view returns (address[] memory factories); function getPaginatedFactories(uint256 startIndex, uint256 endIndex) external view returns (address[] memory factories); // instance state functions function register(address instance, address creator, uint80 extraData) external; // instance view functions function getInstanceType() external view returns (bytes4 instanceType); function getInstanceCount() external view returns (uint256 count); function getInstance(uint256 index) external view returns (address instance); function getInstances() external view returns (address[] memory instances); function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); } contract EventMetadata { event MetadataSet(bytes metadata); // state functions function _setMetadata(bytes memory metadata) internal { } } contract Operated { address private _operator; bool private _status; event OperatorUpdated(address operator, bool status); // state functions function _setOperator(address operator) internal { } function _transferOperator(address operator) internal { } function _renounceOperator() internal { require(<FILL_ME>) _operator = address(0); _status = false; emit OperatorUpdated(address(0), false); } function _activateOperator() internal { } function _deactivateOperator() internal { } // view functions function getOperator() public view returns (address operator) { } function isOperator(address caller) public view returns (bool ok) { } function hasActiveOperator() public view returns (bool ok) { } function isActiveOperator(address caller) public view returns (bool ok) { } } contract ProofHashes { event HashFormatSet(uint8 hashFunction, uint8 digestSize); event HashSubmitted(bytes32 hash); // state functions function _setMultiHashFormat(uint8 hashFunction, uint8 digestSize) internal { } function _submitHash(bytes32 hash) internal { } } /** * @title MultiHashWrapper * @dev Contract that handles multi hash data structures and encoding/decoding * Learn more here: https://github.com/multiformats/multihash */ contract MultiHashWrapper { // bytes32 hash first to fill the first storage slot struct MultiHash { bytes32 hash; uint8 hashFunction; uint8 digestSize; } /** * @dev Given a multihash struct, returns the full base58-encoded hash * @param multihash MultiHash struct that has the hashFunction, digestSize and the hash * @return the base58-encoded full hash */ function _combineMultiHash(MultiHash memory multihash) internal pure returns (bytes memory) { } /** * @dev Given a base58-encoded hash, divides into its individual parts and returns a struct * @param source base58-encoded hash * @return MultiHash that has the hashFunction, digestSize and the hash */ function _splitMultiHash(bytes memory source) internal pure returns (MultiHash memory) { } } /* TODO: Update eip165 interface * bytes4(keccak256('create(bytes)')) == 0xcf5ba53f * bytes4(keccak256('getInstanceType()')) == 0x18c2f4cf * bytes4(keccak256('getInstanceRegistry()')) == 0xa5e13904 * bytes4(keccak256('getImplementation()')) == 0xaaf10f42 * * => 0xcf5ba53f ^ 0x18c2f4cf ^ 0xa5e13904 ^ 0xaaf10f42 == 0xd88967b6 */ interface iFactory { event InstanceCreated(address indexed instance, address indexed creator, string initABI, bytes initData); function create(bytes calldata initData) external returns (address instance); function createSalty(bytes calldata initData, bytes32 salt) external returns (address instance); function getInitSelector() external view returns (bytes4 initSelector); function getInstanceRegistry() external view returns (address instanceRegistry); function getTemplate() external view returns (address template); function getSaltyInstance(bytes calldata, bytes32 salt) external view returns (address instance); function getNextInstance(bytes calldata) external view returns (address instance); function getInstanceCreator(address instance) external view returns (address creator); function getInstanceType() external view returns (bytes4 instanceType); function getInstanceCount() external view returns (uint256 count); function getInstance(uint256 index) external view returns (address instance); function getInstances() external view returns (address[] memory instances); function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); } contract Factory is Spawner { address[] private _instances; mapping (address => address) private _instanceCreator; /* NOTE: The following items can be hardcoded as constant to save ~200 gas/create */ address private _templateContract; bytes4 private _initSelector; address private _instanceRegistry; bytes4 private _instanceType; event InstanceCreated(address indexed instance, address indexed creator, bytes callData); function _initialize(address instanceRegistry, address templateContract, bytes4 instanceType, bytes4 initSelector) internal { } // IFactory methods function create(bytes memory callData) public returns (address instance) { } function createSalty(bytes memory callData, bytes32 salt) public returns (address instance) { } function _createHelper(address instance, bytes memory callData) private { } function getSaltyInstance( bytes memory callData, bytes32 salt ) public view returns (address target) { } function getNextInstance( bytes memory callData ) public view returns (address target) { } function getInstanceCreator(address instance) public view returns (address creator) { } function getInstanceType() public view returns (bytes4 instanceType) { } function getInitSelector() public view returns (bytes4 initSelector) { } function getInstanceRegistry() public view returns (address instanceRegistry) { } function getTemplate() public view returns (address template) { } function getInstanceCount() public view returns (uint256 count) { } function getInstance(uint256 index) public view returns (address instance) { } function getInstances() public view returns (address[] memory instances) { } // Note: startIndex is inclusive, endIndex exclusive function getPaginatedInstances(uint256 startIndex, uint256 endIndex) public view returns (address[] memory instances) { } } contract Template { address private _factory; // modifiers modifier initializeTemplate() { } // view functions function getCreator() public view returns (address creator) { } function isCreator(address caller) public view returns (bool ok) { } function getFactory() public view returns (address factory) { } } contract Feed is ProofHashes, MultiHashWrapper, Operated, EventMetadata, Template { event Initialized(address operator, bytes multihash, bytes metadata); function initialize( address operator, bytes memory multihash, bytes memory metadata ) public initializeTemplate() { } // state functions function submitHash(bytes32 multihash) public { } function setMetadata(bytes memory metadata) public { } function transferOperator(address operator) public { } function renounceOperator() public { } } contract Feed_Factory is Factory { constructor(address instanceRegistry, address templateContract) public { } }
hasActiveOperator(),"only when operator active"
392,714
hasActiveOperator()
"only when operator not active"
pragma solidity ^0.5.0; /** * @title Spawn * @author 0age * @notice This contract provides creation code that is used by Spawner in order * to initialize and deploy eip-1167 minimal proxies for a given logic contract. */ contract Spawn { constructor( address logicContract, bytes memory initializationCalldata ) public payable { } } /** * @title Spawner * @author 0age * @notice This contract spawns and initializes eip-1167 minimal proxies that * point to existing logic contracts. The logic contracts need to have an * intitializer function that should only callable when no contract exists at * their current address (i.e. it is being `DELEGATECALL`ed from a constructor). */ contract Spawner { /** * @notice Internal function for spawning an eip-1167 minimal proxy using * `CREATE2`. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @return The address of the newly-spawned contract. */ function _spawn( address logicContract, bytes memory initializationCalldata ) internal returns (address spawnedContract) { } /** * @notice Internal function for spawning an eip-1167 minimal proxy using * `CREATE2`. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @param salt bytes32 A random salt * @return The address of the newly-spawned contract. */ function _spawnSalty( address logicContract, bytes memory initializationCalldata, bytes32 salt ) internal returns (address spawnedContract) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract * and initialization calldata payload. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _getNextAddress( address logicContract, bytes memory initializationCalldata ) internal view returns (address target) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract, * salt, and initialization calldata payload. * @param initCodeHash bytes32 The encoded hash of initCode * @param salt bytes32 A random salt * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _computeTargetAddress( bytes32 initCodeHash, bytes32 salt ) internal view returns (address target) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract * and initialization calldata payload. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @param salt bytes32 A random salt * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _computeTargetAddress( address logicContract, bytes memory initializationCalldata, bytes32 salt ) internal view returns (address target) { } /** * @notice Private function for spawning a compact eip-1167 minimal proxy * using `CREATE2`. Provides logic that is reused by internal functions. A * salt will also be chosen based on the calling address and a computed nonce * that prevents deployments to existing addresses. * @param initCode bytes The contract creation code. * @param salt bytes32 A random salt * @param target address The expected address of the new contract * @return The address of the newly-spawned contract. */ function _spawnCreate2( bytes memory initCode, bytes32 salt, address target ) private returns (address spawnedContract) { } /** * @notice Private function for determining the salt and the target deployment * address for the next spawned contract (using create2) based on the contract * creation code. */ function _getSaltAndTarget( bytes memory initCode ) private view returns (bytes32 salt, address target) { } } interface iRegistry { enum FactoryStatus { Unregistered, Registered, Retired } event FactoryAdded(address owner, address factory, uint256 factoryID, bytes extraData); event FactoryRetired(address owner, address factory, uint256 factoryID); event InstanceRegistered(address instance, uint256 instanceIndex, address indexed creator, address indexed factory, uint256 indexed factoryID); // factory state functions function addFactory(address factory, bytes calldata extraData ) external; function retireFactory(address factory) external; // factory view functions function getFactoryCount() external view returns (uint256 count); function getFactoryStatus(address factory) external view returns (FactoryStatus status); function getFactoryID(address factory) external view returns (uint16 factoryID); function getFactoryData(address factory) external view returns (bytes memory extraData); function getFactoryAddress(uint16 factoryID) external view returns (address factory); function getFactory(address factory) external view returns (FactoryStatus state, uint16 factoryID, bytes memory extraData); function getFactories() external view returns (address[] memory factories); function getPaginatedFactories(uint256 startIndex, uint256 endIndex) external view returns (address[] memory factories); // instance state functions function register(address instance, address creator, uint80 extraData) external; // instance view functions function getInstanceType() external view returns (bytes4 instanceType); function getInstanceCount() external view returns (uint256 count); function getInstance(uint256 index) external view returns (address instance); function getInstances() external view returns (address[] memory instances); function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); } contract EventMetadata { event MetadataSet(bytes metadata); // state functions function _setMetadata(bytes memory metadata) internal { } } contract Operated { address private _operator; bool private _status; event OperatorUpdated(address operator, bool status); // state functions function _setOperator(address operator) internal { } function _transferOperator(address operator) internal { } function _renounceOperator() internal { } function _activateOperator() internal { require(<FILL_ME>) _status = true; emit OperatorUpdated(_operator, true); } function _deactivateOperator() internal { } // view functions function getOperator() public view returns (address operator) { } function isOperator(address caller) public view returns (bool ok) { } function hasActiveOperator() public view returns (bool ok) { } function isActiveOperator(address caller) public view returns (bool ok) { } } contract ProofHashes { event HashFormatSet(uint8 hashFunction, uint8 digestSize); event HashSubmitted(bytes32 hash); // state functions function _setMultiHashFormat(uint8 hashFunction, uint8 digestSize) internal { } function _submitHash(bytes32 hash) internal { } } /** * @title MultiHashWrapper * @dev Contract that handles multi hash data structures and encoding/decoding * Learn more here: https://github.com/multiformats/multihash */ contract MultiHashWrapper { // bytes32 hash first to fill the first storage slot struct MultiHash { bytes32 hash; uint8 hashFunction; uint8 digestSize; } /** * @dev Given a multihash struct, returns the full base58-encoded hash * @param multihash MultiHash struct that has the hashFunction, digestSize and the hash * @return the base58-encoded full hash */ function _combineMultiHash(MultiHash memory multihash) internal pure returns (bytes memory) { } /** * @dev Given a base58-encoded hash, divides into its individual parts and returns a struct * @param source base58-encoded hash * @return MultiHash that has the hashFunction, digestSize and the hash */ function _splitMultiHash(bytes memory source) internal pure returns (MultiHash memory) { } } /* TODO: Update eip165 interface * bytes4(keccak256('create(bytes)')) == 0xcf5ba53f * bytes4(keccak256('getInstanceType()')) == 0x18c2f4cf * bytes4(keccak256('getInstanceRegistry()')) == 0xa5e13904 * bytes4(keccak256('getImplementation()')) == 0xaaf10f42 * * => 0xcf5ba53f ^ 0x18c2f4cf ^ 0xa5e13904 ^ 0xaaf10f42 == 0xd88967b6 */ interface iFactory { event InstanceCreated(address indexed instance, address indexed creator, string initABI, bytes initData); function create(bytes calldata initData) external returns (address instance); function createSalty(bytes calldata initData, bytes32 salt) external returns (address instance); function getInitSelector() external view returns (bytes4 initSelector); function getInstanceRegistry() external view returns (address instanceRegistry); function getTemplate() external view returns (address template); function getSaltyInstance(bytes calldata, bytes32 salt) external view returns (address instance); function getNextInstance(bytes calldata) external view returns (address instance); function getInstanceCreator(address instance) external view returns (address creator); function getInstanceType() external view returns (bytes4 instanceType); function getInstanceCount() external view returns (uint256 count); function getInstance(uint256 index) external view returns (address instance); function getInstances() external view returns (address[] memory instances); function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); } contract Factory is Spawner { address[] private _instances; mapping (address => address) private _instanceCreator; /* NOTE: The following items can be hardcoded as constant to save ~200 gas/create */ address private _templateContract; bytes4 private _initSelector; address private _instanceRegistry; bytes4 private _instanceType; event InstanceCreated(address indexed instance, address indexed creator, bytes callData); function _initialize(address instanceRegistry, address templateContract, bytes4 instanceType, bytes4 initSelector) internal { } // IFactory methods function create(bytes memory callData) public returns (address instance) { } function createSalty(bytes memory callData, bytes32 salt) public returns (address instance) { } function _createHelper(address instance, bytes memory callData) private { } function getSaltyInstance( bytes memory callData, bytes32 salt ) public view returns (address target) { } function getNextInstance( bytes memory callData ) public view returns (address target) { } function getInstanceCreator(address instance) public view returns (address creator) { } function getInstanceType() public view returns (bytes4 instanceType) { } function getInitSelector() public view returns (bytes4 initSelector) { } function getInstanceRegistry() public view returns (address instanceRegistry) { } function getTemplate() public view returns (address template) { } function getInstanceCount() public view returns (uint256 count) { } function getInstance(uint256 index) public view returns (address instance) { } function getInstances() public view returns (address[] memory instances) { } // Note: startIndex is inclusive, endIndex exclusive function getPaginatedInstances(uint256 startIndex, uint256 endIndex) public view returns (address[] memory instances) { } } contract Template { address private _factory; // modifiers modifier initializeTemplate() { } // view functions function getCreator() public view returns (address creator) { } function isCreator(address caller) public view returns (bool ok) { } function getFactory() public view returns (address factory) { } } contract Feed is ProofHashes, MultiHashWrapper, Operated, EventMetadata, Template { event Initialized(address operator, bytes multihash, bytes metadata); function initialize( address operator, bytes memory multihash, bytes memory metadata ) public initializeTemplate() { } // state functions function submitHash(bytes32 multihash) public { } function setMetadata(bytes memory metadata) public { } function transferOperator(address operator) public { } function renounceOperator() public { } } contract Feed_Factory is Factory { constructor(address instanceRegistry, address templateContract) public { } }
!hasActiveOperator(),"only when operator not active"
392,714
!hasActiveOperator()
"only active operator or creator"
pragma solidity ^0.5.0; /** * @title Spawn * @author 0age * @notice This contract provides creation code that is used by Spawner in order * to initialize and deploy eip-1167 minimal proxies for a given logic contract. */ contract Spawn { constructor( address logicContract, bytes memory initializationCalldata ) public payable { } } /** * @title Spawner * @author 0age * @notice This contract spawns and initializes eip-1167 minimal proxies that * point to existing logic contracts. The logic contracts need to have an * intitializer function that should only callable when no contract exists at * their current address (i.e. it is being `DELEGATECALL`ed from a constructor). */ contract Spawner { /** * @notice Internal function for spawning an eip-1167 minimal proxy using * `CREATE2`. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @return The address of the newly-spawned contract. */ function _spawn( address logicContract, bytes memory initializationCalldata ) internal returns (address spawnedContract) { } /** * @notice Internal function for spawning an eip-1167 minimal proxy using * `CREATE2`. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @param salt bytes32 A random salt * @return The address of the newly-spawned contract. */ function _spawnSalty( address logicContract, bytes memory initializationCalldata, bytes32 salt ) internal returns (address spawnedContract) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract * and initialization calldata payload. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _getNextAddress( address logicContract, bytes memory initializationCalldata ) internal view returns (address target) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract, * salt, and initialization calldata payload. * @param initCodeHash bytes32 The encoded hash of initCode * @param salt bytes32 A random salt * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _computeTargetAddress( bytes32 initCodeHash, bytes32 salt ) internal view returns (address target) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract * and initialization calldata payload. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @param salt bytes32 A random salt * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _computeTargetAddress( address logicContract, bytes memory initializationCalldata, bytes32 salt ) internal view returns (address target) { } /** * @notice Private function for spawning a compact eip-1167 minimal proxy * using `CREATE2`. Provides logic that is reused by internal functions. A * salt will also be chosen based on the calling address and a computed nonce * that prevents deployments to existing addresses. * @param initCode bytes The contract creation code. * @param salt bytes32 A random salt * @param target address The expected address of the new contract * @return The address of the newly-spawned contract. */ function _spawnCreate2( bytes memory initCode, bytes32 salt, address target ) private returns (address spawnedContract) { } /** * @notice Private function for determining the salt and the target deployment * address for the next spawned contract (using create2) based on the contract * creation code. */ function _getSaltAndTarget( bytes memory initCode ) private view returns (bytes32 salt, address target) { } } interface iRegistry { enum FactoryStatus { Unregistered, Registered, Retired } event FactoryAdded(address owner, address factory, uint256 factoryID, bytes extraData); event FactoryRetired(address owner, address factory, uint256 factoryID); event InstanceRegistered(address instance, uint256 instanceIndex, address indexed creator, address indexed factory, uint256 indexed factoryID); // factory state functions function addFactory(address factory, bytes calldata extraData ) external; function retireFactory(address factory) external; // factory view functions function getFactoryCount() external view returns (uint256 count); function getFactoryStatus(address factory) external view returns (FactoryStatus status); function getFactoryID(address factory) external view returns (uint16 factoryID); function getFactoryData(address factory) external view returns (bytes memory extraData); function getFactoryAddress(uint16 factoryID) external view returns (address factory); function getFactory(address factory) external view returns (FactoryStatus state, uint16 factoryID, bytes memory extraData); function getFactories() external view returns (address[] memory factories); function getPaginatedFactories(uint256 startIndex, uint256 endIndex) external view returns (address[] memory factories); // instance state functions function register(address instance, address creator, uint80 extraData) external; // instance view functions function getInstanceType() external view returns (bytes4 instanceType); function getInstanceCount() external view returns (uint256 count); function getInstance(uint256 index) external view returns (address instance); function getInstances() external view returns (address[] memory instances); function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); } contract EventMetadata { event MetadataSet(bytes metadata); // state functions function _setMetadata(bytes memory metadata) internal { } } contract Operated { address private _operator; bool private _status; event OperatorUpdated(address operator, bool status); // state functions function _setOperator(address operator) internal { } function _transferOperator(address operator) internal { } function _renounceOperator() internal { } function _activateOperator() internal { } function _deactivateOperator() internal { } // view functions function getOperator() public view returns (address operator) { } function isOperator(address caller) public view returns (bool ok) { } function hasActiveOperator() public view returns (bool ok) { } function isActiveOperator(address caller) public view returns (bool ok) { } } contract ProofHashes { event HashFormatSet(uint8 hashFunction, uint8 digestSize); event HashSubmitted(bytes32 hash); // state functions function _setMultiHashFormat(uint8 hashFunction, uint8 digestSize) internal { } function _submitHash(bytes32 hash) internal { } } /** * @title MultiHashWrapper * @dev Contract that handles multi hash data structures and encoding/decoding * Learn more here: https://github.com/multiformats/multihash */ contract MultiHashWrapper { // bytes32 hash first to fill the first storage slot struct MultiHash { bytes32 hash; uint8 hashFunction; uint8 digestSize; } /** * @dev Given a multihash struct, returns the full base58-encoded hash * @param multihash MultiHash struct that has the hashFunction, digestSize and the hash * @return the base58-encoded full hash */ function _combineMultiHash(MultiHash memory multihash) internal pure returns (bytes memory) { } /** * @dev Given a base58-encoded hash, divides into its individual parts and returns a struct * @param source base58-encoded hash * @return MultiHash that has the hashFunction, digestSize and the hash */ function _splitMultiHash(bytes memory source) internal pure returns (MultiHash memory) { } } /* TODO: Update eip165 interface * bytes4(keccak256('create(bytes)')) == 0xcf5ba53f * bytes4(keccak256('getInstanceType()')) == 0x18c2f4cf * bytes4(keccak256('getInstanceRegistry()')) == 0xa5e13904 * bytes4(keccak256('getImplementation()')) == 0xaaf10f42 * * => 0xcf5ba53f ^ 0x18c2f4cf ^ 0xa5e13904 ^ 0xaaf10f42 == 0xd88967b6 */ interface iFactory { event InstanceCreated(address indexed instance, address indexed creator, string initABI, bytes initData); function create(bytes calldata initData) external returns (address instance); function createSalty(bytes calldata initData, bytes32 salt) external returns (address instance); function getInitSelector() external view returns (bytes4 initSelector); function getInstanceRegistry() external view returns (address instanceRegistry); function getTemplate() external view returns (address template); function getSaltyInstance(bytes calldata, bytes32 salt) external view returns (address instance); function getNextInstance(bytes calldata) external view returns (address instance); function getInstanceCreator(address instance) external view returns (address creator); function getInstanceType() external view returns (bytes4 instanceType); function getInstanceCount() external view returns (uint256 count); function getInstance(uint256 index) external view returns (address instance); function getInstances() external view returns (address[] memory instances); function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); } contract Factory is Spawner { address[] private _instances; mapping (address => address) private _instanceCreator; /* NOTE: The following items can be hardcoded as constant to save ~200 gas/create */ address private _templateContract; bytes4 private _initSelector; address private _instanceRegistry; bytes4 private _instanceType; event InstanceCreated(address indexed instance, address indexed creator, bytes callData); function _initialize(address instanceRegistry, address templateContract, bytes4 instanceType, bytes4 initSelector) internal { } // IFactory methods function create(bytes memory callData) public returns (address instance) { } function createSalty(bytes memory callData, bytes32 salt) public returns (address instance) { } function _createHelper(address instance, bytes memory callData) private { } function getSaltyInstance( bytes memory callData, bytes32 salt ) public view returns (address target) { } function getNextInstance( bytes memory callData ) public view returns (address target) { } function getInstanceCreator(address instance) public view returns (address creator) { } function getInstanceType() public view returns (bytes4 instanceType) { } function getInitSelector() public view returns (bytes4 initSelector) { } function getInstanceRegistry() public view returns (address instanceRegistry) { } function getTemplate() public view returns (address template) { } function getInstanceCount() public view returns (uint256 count) { } function getInstance(uint256 index) public view returns (address instance) { } function getInstances() public view returns (address[] memory instances) { } // Note: startIndex is inclusive, endIndex exclusive function getPaginatedInstances(uint256 startIndex, uint256 endIndex) public view returns (address[] memory instances) { } } contract Template { address private _factory; // modifiers modifier initializeTemplate() { } // view functions function getCreator() public view returns (address creator) { } function isCreator(address caller) public view returns (bool ok) { } function getFactory() public view returns (address factory) { } } contract Feed is ProofHashes, MultiHashWrapper, Operated, EventMetadata, Template { event Initialized(address operator, bytes multihash, bytes metadata); function initialize( address operator, bytes memory multihash, bytes memory metadata ) public initializeTemplate() { } // state functions function submitHash(bytes32 multihash) public { // only active operator or creator require(<FILL_ME>) // add multihash to storage ProofHashes._submitHash(multihash); } function setMetadata(bytes memory metadata) public { } function transferOperator(address operator) public { } function renounceOperator() public { } } contract Feed_Factory is Factory { constructor(address instanceRegistry, address templateContract) public { } }
Template.isCreator(msg.sender)||Operated.isActiveOperator(msg.sender),"only active operator or creator"
392,714
Template.isCreator(msg.sender)||Operated.isActiveOperator(msg.sender)
"only active operator"
pragma solidity ^0.5.0; /** * @title Spawn * @author 0age * @notice This contract provides creation code that is used by Spawner in order * to initialize and deploy eip-1167 minimal proxies for a given logic contract. */ contract Spawn { constructor( address logicContract, bytes memory initializationCalldata ) public payable { } } /** * @title Spawner * @author 0age * @notice This contract spawns and initializes eip-1167 minimal proxies that * point to existing logic contracts. The logic contracts need to have an * intitializer function that should only callable when no contract exists at * their current address (i.e. it is being `DELEGATECALL`ed from a constructor). */ contract Spawner { /** * @notice Internal function for spawning an eip-1167 minimal proxy using * `CREATE2`. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @return The address of the newly-spawned contract. */ function _spawn( address logicContract, bytes memory initializationCalldata ) internal returns (address spawnedContract) { } /** * @notice Internal function for spawning an eip-1167 minimal proxy using * `CREATE2`. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @param salt bytes32 A random salt * @return The address of the newly-spawned contract. */ function _spawnSalty( address logicContract, bytes memory initializationCalldata, bytes32 salt ) internal returns (address spawnedContract) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract * and initialization calldata payload. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _getNextAddress( address logicContract, bytes memory initializationCalldata ) internal view returns (address target) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract, * salt, and initialization calldata payload. * @param initCodeHash bytes32 The encoded hash of initCode * @param salt bytes32 A random salt * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _computeTargetAddress( bytes32 initCodeHash, bytes32 salt ) internal view returns (address target) { } /** * @notice Internal view function for finding the address of the next standard * eip-1167 minimal proxy created using `CREATE2` with a given logic contract * and initialization calldata payload. * @param logicContract address The address of the logic contract. * @param initializationCalldata bytes The calldata that will be supplied to * the `DELEGATECALL` from the spawned contract to the logic contract during * contract creation. * @param salt bytes32 A random salt * @return The address of the next spawned minimal proxy contract with the * given parameters. */ function _computeTargetAddress( address logicContract, bytes memory initializationCalldata, bytes32 salt ) internal view returns (address target) { } /** * @notice Private function for spawning a compact eip-1167 minimal proxy * using `CREATE2`. Provides logic that is reused by internal functions. A * salt will also be chosen based on the calling address and a computed nonce * that prevents deployments to existing addresses. * @param initCode bytes The contract creation code. * @param salt bytes32 A random salt * @param target address The expected address of the new contract * @return The address of the newly-spawned contract. */ function _spawnCreate2( bytes memory initCode, bytes32 salt, address target ) private returns (address spawnedContract) { } /** * @notice Private function for determining the salt and the target deployment * address for the next spawned contract (using create2) based on the contract * creation code. */ function _getSaltAndTarget( bytes memory initCode ) private view returns (bytes32 salt, address target) { } } interface iRegistry { enum FactoryStatus { Unregistered, Registered, Retired } event FactoryAdded(address owner, address factory, uint256 factoryID, bytes extraData); event FactoryRetired(address owner, address factory, uint256 factoryID); event InstanceRegistered(address instance, uint256 instanceIndex, address indexed creator, address indexed factory, uint256 indexed factoryID); // factory state functions function addFactory(address factory, bytes calldata extraData ) external; function retireFactory(address factory) external; // factory view functions function getFactoryCount() external view returns (uint256 count); function getFactoryStatus(address factory) external view returns (FactoryStatus status); function getFactoryID(address factory) external view returns (uint16 factoryID); function getFactoryData(address factory) external view returns (bytes memory extraData); function getFactoryAddress(uint16 factoryID) external view returns (address factory); function getFactory(address factory) external view returns (FactoryStatus state, uint16 factoryID, bytes memory extraData); function getFactories() external view returns (address[] memory factories); function getPaginatedFactories(uint256 startIndex, uint256 endIndex) external view returns (address[] memory factories); // instance state functions function register(address instance, address creator, uint80 extraData) external; // instance view functions function getInstanceType() external view returns (bytes4 instanceType); function getInstanceCount() external view returns (uint256 count); function getInstance(uint256 index) external view returns (address instance); function getInstances() external view returns (address[] memory instances); function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); } contract EventMetadata { event MetadataSet(bytes metadata); // state functions function _setMetadata(bytes memory metadata) internal { } } contract Operated { address private _operator; bool private _status; event OperatorUpdated(address operator, bool status); // state functions function _setOperator(address operator) internal { } function _transferOperator(address operator) internal { } function _renounceOperator() internal { } function _activateOperator() internal { } function _deactivateOperator() internal { } // view functions function getOperator() public view returns (address operator) { } function isOperator(address caller) public view returns (bool ok) { } function hasActiveOperator() public view returns (bool ok) { } function isActiveOperator(address caller) public view returns (bool ok) { } } contract ProofHashes { event HashFormatSet(uint8 hashFunction, uint8 digestSize); event HashSubmitted(bytes32 hash); // state functions function _setMultiHashFormat(uint8 hashFunction, uint8 digestSize) internal { } function _submitHash(bytes32 hash) internal { } } /** * @title MultiHashWrapper * @dev Contract that handles multi hash data structures and encoding/decoding * Learn more here: https://github.com/multiformats/multihash */ contract MultiHashWrapper { // bytes32 hash first to fill the first storage slot struct MultiHash { bytes32 hash; uint8 hashFunction; uint8 digestSize; } /** * @dev Given a multihash struct, returns the full base58-encoded hash * @param multihash MultiHash struct that has the hashFunction, digestSize and the hash * @return the base58-encoded full hash */ function _combineMultiHash(MultiHash memory multihash) internal pure returns (bytes memory) { } /** * @dev Given a base58-encoded hash, divides into its individual parts and returns a struct * @param source base58-encoded hash * @return MultiHash that has the hashFunction, digestSize and the hash */ function _splitMultiHash(bytes memory source) internal pure returns (MultiHash memory) { } } /* TODO: Update eip165 interface * bytes4(keccak256('create(bytes)')) == 0xcf5ba53f * bytes4(keccak256('getInstanceType()')) == 0x18c2f4cf * bytes4(keccak256('getInstanceRegistry()')) == 0xa5e13904 * bytes4(keccak256('getImplementation()')) == 0xaaf10f42 * * => 0xcf5ba53f ^ 0x18c2f4cf ^ 0xa5e13904 ^ 0xaaf10f42 == 0xd88967b6 */ interface iFactory { event InstanceCreated(address indexed instance, address indexed creator, string initABI, bytes initData); function create(bytes calldata initData) external returns (address instance); function createSalty(bytes calldata initData, bytes32 salt) external returns (address instance); function getInitSelector() external view returns (bytes4 initSelector); function getInstanceRegistry() external view returns (address instanceRegistry); function getTemplate() external view returns (address template); function getSaltyInstance(bytes calldata, bytes32 salt) external view returns (address instance); function getNextInstance(bytes calldata) external view returns (address instance); function getInstanceCreator(address instance) external view returns (address creator); function getInstanceType() external view returns (bytes4 instanceType); function getInstanceCount() external view returns (uint256 count); function getInstance(uint256 index) external view returns (address instance); function getInstances() external view returns (address[] memory instances); function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); } contract Factory is Spawner { address[] private _instances; mapping (address => address) private _instanceCreator; /* NOTE: The following items can be hardcoded as constant to save ~200 gas/create */ address private _templateContract; bytes4 private _initSelector; address private _instanceRegistry; bytes4 private _instanceType; event InstanceCreated(address indexed instance, address indexed creator, bytes callData); function _initialize(address instanceRegistry, address templateContract, bytes4 instanceType, bytes4 initSelector) internal { } // IFactory methods function create(bytes memory callData) public returns (address instance) { } function createSalty(bytes memory callData, bytes32 salt) public returns (address instance) { } function _createHelper(address instance, bytes memory callData) private { } function getSaltyInstance( bytes memory callData, bytes32 salt ) public view returns (address target) { } function getNextInstance( bytes memory callData ) public view returns (address target) { } function getInstanceCreator(address instance) public view returns (address creator) { } function getInstanceType() public view returns (bytes4 instanceType) { } function getInitSelector() public view returns (bytes4 initSelector) { } function getInstanceRegistry() public view returns (address instanceRegistry) { } function getTemplate() public view returns (address template) { } function getInstanceCount() public view returns (uint256 count) { } function getInstance(uint256 index) public view returns (address instance) { } function getInstances() public view returns (address[] memory instances) { } // Note: startIndex is inclusive, endIndex exclusive function getPaginatedInstances(uint256 startIndex, uint256 endIndex) public view returns (address[] memory instances) { } } contract Template { address private _factory; // modifiers modifier initializeTemplate() { } // view functions function getCreator() public view returns (address creator) { } function isCreator(address caller) public view returns (bool ok) { } function getFactory() public view returns (address factory) { } } contract Feed is ProofHashes, MultiHashWrapper, Operated, EventMetadata, Template { event Initialized(address operator, bytes multihash, bytes metadata); function initialize( address operator, bytes memory multihash, bytes memory metadata ) public initializeTemplate() { } // state functions function submitHash(bytes32 multihash) public { } function setMetadata(bytes memory metadata) public { } function transferOperator(address operator) public { // restrict access require(<FILL_ME>) // transfer operator Operated._transferOperator(operator); } function renounceOperator() public { } } contract Feed_Factory is Factory { constructor(address instanceRegistry, address templateContract) public { } }
Operated.isActiveOperator(msg.sender),"only active operator"
392,714
Operated.isActiveOperator(msg.sender)
null
pragma solidity ^0.4.16; contract TargetHit { string public name = "Target Hit"; // token name string public symbol = "TGH"; // token symbol string public version = "1"; uint256 public decimals = 8; // token digit mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; uint256 public totalSupply = 33333333300000000; bool public stopped = true; uint256 public price = 30000300003000; //000 000 000 000 000 000 address owner = 0x98E030f942F79AE61010BcBC414e7e7b945DcA33; address devteam = 0xc878b604C35dd3fb5cdDA1Ff1a019568e2A0d1c5; modifier isOwner { } modifier isRunning { } modifier validAddress { } constructor () public { } function changeOwner(address _newaddress) isOwner public { } function setPrices(uint256 newPrice) isOwner public { } function buy() public payable returns (uint amount){ } function GetPrice() public view returns (uint256) { } function deployTokens (uint256[] _amounts, address[] _recipient) public isOwner { } function transferfromOwner(address _to, uint256 _value) private returns (bool success) { require(<FILL_ME>) require(balanceOf[_to] + _value >= balanceOf[_to]); balanceOf[owner] -= _value; balanceOf[_to] += _value; emit Transfer(owner, _to, _value); return true; } function transfer(address _to, uint256 _value) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function stop() public isOwner { } function start() public isOwner { } event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); }
balanceOf[owner]>=_value
392,894
balanceOf[owner]>=_value
"TradeAdapter::trade: _destinationToken is not on the allowed list"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ /** * @title PreciseUnitMath * @author Set Protocol * * Arithmetic for fixed-point numbers with 18 decimals of precision. Some functions taken from * dYdX's BaseMath library. * * CHANGELOG: * - 9/21/20: Added safePower function */ library PreciseUnitMath { using SafeMath for uint256; using SignedSafeMath for int256; // The number One in precise units. uint256 constant internal PRECISE_UNIT = 10 ** 18; int256 constant internal PRECISE_UNIT_INT = 10 ** 18; // Max unsigned integer value uint256 constant internal MAX_UINT_256 = type(uint256).max; // Max and min signed integer value int256 constant internal MAX_INT_256 = type(int256).max; int256 constant internal MIN_INT_256 = type(int256).min; /** * @dev Getter function since constants can't be read directly from libraries. */ function preciseUnit() internal pure returns (uint256) { } /** * @dev Getter function since constants can't be read directly from libraries. */ function preciseUnitInt() internal pure returns (int256) { } /** * @dev Getter function since constants can't be read directly from libraries. */ function maxUint256() internal pure returns (uint256) { } /** * @dev Getter function since constants can't be read directly from libraries. */ function maxInt256() internal pure returns (int256) { } /** * @dev Getter function since constants can't be read directly from libraries. */ function minInt256() internal pure returns (int256) { } /** * @dev Multiplies value a by value b (result is rounded down). It's assumed that the value b is the significand * of a number with 18 decimals precision. */ function preciseMul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Multiplies value a by value b (result is rounded towards zero). It's assumed that the value b is the * significand of a number with 18 decimals precision. */ function preciseMul(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Multiplies value a by value b (result is rounded up). It's assumed that the value b is the significand * of a number with 18 decimals precision. */ function preciseMulCeil(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Divides value a by value b (result is rounded down). */ function preciseDiv(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Divides value a by value b (result is rounded towards 0). */ function preciseDiv(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Divides value a by value b (result is rounded up or away from 0). */ function preciseDivCeil(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Divides value a by value b (result is rounded down - positive numbers toward 0 and negative away from 0). */ function divDown(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Multiplies value a by value b where rounding is towards the lesser number. * (positive values are rounded towards zero and negative values are rounded away from 0). */ function conservativePreciseMul(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Divides value a by value b where rounding is towards the lesser number. * (positive values are rounded towards zero and negative values are rounded away from 0). */ function conservativePreciseDiv(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Performs the power on a specified value, reverts on overflow. */ function safePower( uint256 a, uint256 pow ) internal pure returns (uint256) { } } interface ITradeModule{ function trade( ISetToken _setToken, string memory _exchangeName, address _sendToken, uint256 _sendQuantity, address _receiveToken, uint256 _minReceiveQuantity, bytes memory _data ) external; function initialize( ISetToken _setToken ) external; } contract TradeAdapter is BaseAdapter { using PreciseUnitMath for uint256; ITradeModule public module; constructor( ISetToken _setToken, TreasuryManager _manager, ITradeModule _module ) public BaseAdapter(_setToken, _manager) { } /** * @dev Only gov. Will revert if the destinationToken isn't on the allowed list * * @param _integrationName The name of the integration to interact with * @param _sourceToken The address of the token to spend * @param _sourceAmount The source amount to trade * @param _destinationToken The token to get * @param _minimumDestinationAmount The minimum amount to get * @param _data Calldata needed for the integration */ function trade( address /* unused */, // Left here purely so that ABI is exactly the same as the trade module string memory _integrationName, address _sourceToken, uint256 _sourceAmount, address _destinationToken, uint256 _minimumDestinationAmount, bytes memory _data ) external onlyGovOrSubGov { require(<FILL_ME>) bytes memory encoded = abi.encodeWithSelector( module.trade.selector, setToken, _integrationName, _sourceToken, _sourceAmount, _destinationToken, _minimumDestinationAmount, _data ); manager.interactModule(address(module), encoded); } }
manager.isTokenAllowed(_destinationToken),"TradeAdapter::trade: _destinationToken is not on the allowed list"
392,907
manager.isTokenAllowed(_destinationToken)