comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"Error paying the loan"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { Token rcn = NanoLoanEngine(address(loanParams[I_ENGINE])).rcn(); uint256 initialBalance = rcn.balanceOf(this); uint256 requiredRcn = getRequiredRcnPay(loanParams, oracleData); emit RequiredRcn(requiredRcn); uint256 optimalSell = getOptimalSell(converter, fromToken, rcn, requiredRcn, convertRules[I_MARGIN_SPEND]); emit OptimalSell(fromToken, optimalSell); pullAmount(fromToken, optimalSell); uint256 bought = convertSafe(converter, fromToken, rcn, optimalSell); // Pay loan require(<FILL_ME>) require( rebuyAndReturn({ converter: converter, fromToken: rcn, toToken: fromToken, amount: rcn.balanceOf(this) - initialBalance, spentAmount: optimalSell, convertRules: convertRules }), "Error rebuying the tokens" ); require(rcn.balanceOf(this) == initialBalance, "Converter balance has incremented"); return true; } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
executeOptimalPay({params:loanParams,oracleData:oracleData,rcnToPay:bought}),"Error paying the loan"
293,570
executeOptimalPay({params:loanParams,oracleData:oracleData,rcnToPay:bought})
"Error rebuying the tokens"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { Token rcn = NanoLoanEngine(address(loanParams[I_ENGINE])).rcn(); uint256 initialBalance = rcn.balanceOf(this); uint256 requiredRcn = getRequiredRcnPay(loanParams, oracleData); emit RequiredRcn(requiredRcn); uint256 optimalSell = getOptimalSell(converter, fromToken, rcn, requiredRcn, convertRules[I_MARGIN_SPEND]); emit OptimalSell(fromToken, optimalSell); pullAmount(fromToken, optimalSell); uint256 bought = convertSafe(converter, fromToken, rcn, optimalSell); // Pay loan require( executeOptimalPay({ params: loanParams, oracleData: oracleData, rcnToPay: bought }), "Error paying the loan" ); require(<FILL_ME>) require(rcn.balanceOf(this) == initialBalance, "Converter balance has incremented"); return true; } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
rebuyAndReturn({converter:converter,fromToken:rcn,toToken:fromToken,amount:rcn.balanceOf(this)-initialBalance,spentAmount:optimalSell,convertRules:convertRules}),"Error rebuying the tokens"
293,570
rebuyAndReturn({converter:converter,fromToken:rcn,toToken:fromToken,amount:rcn.balanceOf(this)-initialBalance,spentAmount:optimalSell,convertRules:convertRules})
"Converter balance has incremented"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { Token rcn = NanoLoanEngine(address(loanParams[I_ENGINE])).rcn(); uint256 initialBalance = rcn.balanceOf(this); uint256 requiredRcn = getRequiredRcnPay(loanParams, oracleData); emit RequiredRcn(requiredRcn); uint256 optimalSell = getOptimalSell(converter, fromToken, rcn, requiredRcn, convertRules[I_MARGIN_SPEND]); emit OptimalSell(fromToken, optimalSell); pullAmount(fromToken, optimalSell); uint256 bought = convertSafe(converter, fromToken, rcn, optimalSell); // Pay loan require( executeOptimalPay({ params: loanParams, oracleData: oracleData, rcnToPay: bought }), "Error paying the loan" ); require( rebuyAndReturn({ converter: converter, fromToken: rcn, toToken: fromToken, amount: rcn.balanceOf(this) - initialBalance, spentAmount: optimalSell, convertRules: convertRules }), "Error rebuying the tokens" ); require(<FILL_ME>) return true; } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
rcn.balanceOf(this)==initialBalance,"Converter balance has incremented"
293,570
rcn.balanceOf(this)==initialBalance
"Error approving lend token transfer"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { Token rcn = NanoLoanEngine(address(loanParams[I_ENGINE])).rcn(); uint256 initialBalance = rcn.balanceOf(this); uint256 requiredRcn = getRequiredRcnLend(loanParams, oracleData, cosignerData); emit RequiredRcn(requiredRcn); uint256 optimalSell = getOptimalSell(converter, fromToken, rcn, requiredRcn, convertRules[I_MARGIN_SPEND]); emit OptimalSell(fromToken, optimalSell); pullAmount(fromToken, optimalSell); uint256 bought = convertSafe(converter, fromToken, rcn, optimalSell); // Lend loan require(<FILL_ME>) require(executeLend(loanParams, oracleData, cosignerData), "Error lending the loan"); require(rcn.approve(address(loanParams[0]), 0), "Error removing approve"); require(executeTransfer(loanParams, msg.sender), "Error transfering the loan"); require( rebuyAndReturn({ converter: converter, fromToken: rcn, toToken: fromToken, amount: rcn.balanceOf(this) - initialBalance, spentAmount: optimalSell, convertRules: convertRules }), "Error rebuying the tokens" ); require(rcn.balanceOf(this) == initialBalance, "The contract balance should not change"); return true; } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
rcn.approve(address(loanParams[0]),bought),"Error approving lend token transfer"
293,570
rcn.approve(address(loanParams[0]),bought)
"Error lending the loan"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { Token rcn = NanoLoanEngine(address(loanParams[I_ENGINE])).rcn(); uint256 initialBalance = rcn.balanceOf(this); uint256 requiredRcn = getRequiredRcnLend(loanParams, oracleData, cosignerData); emit RequiredRcn(requiredRcn); uint256 optimalSell = getOptimalSell(converter, fromToken, rcn, requiredRcn, convertRules[I_MARGIN_SPEND]); emit OptimalSell(fromToken, optimalSell); pullAmount(fromToken, optimalSell); uint256 bought = convertSafe(converter, fromToken, rcn, optimalSell); // Lend loan require(rcn.approve(address(loanParams[0]), bought), "Error approving lend token transfer"); require(<FILL_ME>) require(rcn.approve(address(loanParams[0]), 0), "Error removing approve"); require(executeTransfer(loanParams, msg.sender), "Error transfering the loan"); require( rebuyAndReturn({ converter: converter, fromToken: rcn, toToken: fromToken, amount: rcn.balanceOf(this) - initialBalance, spentAmount: optimalSell, convertRules: convertRules }), "Error rebuying the tokens" ); require(rcn.balanceOf(this) == initialBalance, "The contract balance should not change"); return true; } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
executeLend(loanParams,oracleData,cosignerData),"Error lending the loan"
293,570
executeLend(loanParams,oracleData,cosignerData)
"Error removing approve"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { Token rcn = NanoLoanEngine(address(loanParams[I_ENGINE])).rcn(); uint256 initialBalance = rcn.balanceOf(this); uint256 requiredRcn = getRequiredRcnLend(loanParams, oracleData, cosignerData); emit RequiredRcn(requiredRcn); uint256 optimalSell = getOptimalSell(converter, fromToken, rcn, requiredRcn, convertRules[I_MARGIN_SPEND]); emit OptimalSell(fromToken, optimalSell); pullAmount(fromToken, optimalSell); uint256 bought = convertSafe(converter, fromToken, rcn, optimalSell); // Lend loan require(rcn.approve(address(loanParams[0]), bought), "Error approving lend token transfer"); require(executeLend(loanParams, oracleData, cosignerData), "Error lending the loan"); require(<FILL_ME>) require(executeTransfer(loanParams, msg.sender), "Error transfering the loan"); require( rebuyAndReturn({ converter: converter, fromToken: rcn, toToken: fromToken, amount: rcn.balanceOf(this) - initialBalance, spentAmount: optimalSell, convertRules: convertRules }), "Error rebuying the tokens" ); require(rcn.balanceOf(this) == initialBalance, "The contract balance should not change"); return true; } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
rcn.approve(address(loanParams[0]),0),"Error removing approve"
293,570
rcn.approve(address(loanParams[0]),0)
"Error transfering the loan"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { Token rcn = NanoLoanEngine(address(loanParams[I_ENGINE])).rcn(); uint256 initialBalance = rcn.balanceOf(this); uint256 requiredRcn = getRequiredRcnLend(loanParams, oracleData, cosignerData); emit RequiredRcn(requiredRcn); uint256 optimalSell = getOptimalSell(converter, fromToken, rcn, requiredRcn, convertRules[I_MARGIN_SPEND]); emit OptimalSell(fromToken, optimalSell); pullAmount(fromToken, optimalSell); uint256 bought = convertSafe(converter, fromToken, rcn, optimalSell); // Lend loan require(rcn.approve(address(loanParams[0]), bought), "Error approving lend token transfer"); require(executeLend(loanParams, oracleData, cosignerData), "Error lending the loan"); require(rcn.approve(address(loanParams[0]), 0), "Error removing approve"); require(<FILL_ME>) require( rebuyAndReturn({ converter: converter, fromToken: rcn, toToken: fromToken, amount: rcn.balanceOf(this) - initialBalance, spentAmount: optimalSell, convertRules: convertRules }), "Error rebuying the tokens" ); require(rcn.balanceOf(this) == initialBalance, "The contract balance should not change"); return true; } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
executeTransfer(loanParams,msg.sender),"Error transfering the loan"
293,570
executeTransfer(loanParams,msg.sender)
"Max spend exceeded"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { uint256 threshold = convertRules[I_REBUY_THRESHOLD]; uint256 bought = 0; if (amount != 0) { if (amount > threshold) { bought = convertSafe(converter, fromToken, toToken, amount); emit RequiredRebuy(toToken, amount); emit Return(toToken, msg.sender, bought); transfer(toToken, msg.sender, bought); } else { emit Return(fromToken, msg.sender, amount); transfer(fromToken, msg.sender, amount); } } uint256 maxSpend = convertRules[I_MAX_SPEND]; require(<FILL_ME>) return true; } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
spentAmount.safeSubtract(bought)<=maxSpend||maxSpend==0,"Max spend exceeded"
293,570
spentAmount.safeSubtract(bought)<=maxSpend||maxSpend==0
"Error approving token transfer"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { if (fromToken != ETH_ADDRESS) require(<FILL_ME>) uint256 prevBalance = toToken != ETH_ADDRESS ? toToken.balanceOf(this) : address(this).balance; uint256 sendEth = fromToken == ETH_ADDRESS ? amount : 0; uint256 boughtAmount = converter.convert.value(sendEth)(fromToken, toToken, amount, 1); require( boughtAmount == (toToken != ETH_ADDRESS ? toToken.balanceOf(this) : address(this).balance) - prevBalance, "Bought amound does does not match" ); if (fromToken != ETH_ADDRESS) require(fromToken.approve(converter, 0), "Error removing token approve"); return boughtAmount; } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
fromToken.approve(converter,amount),"Error approving token transfer"
293,570
fromToken.approve(converter,amount)
"Bought amound does does not match"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { if (fromToken != ETH_ADDRESS) require(fromToken.approve(converter, amount), "Error approving token transfer"); uint256 prevBalance = toToken != ETH_ADDRESS ? toToken.balanceOf(this) : address(this).balance; uint256 sendEth = fromToken == ETH_ADDRESS ? amount : 0; uint256 boughtAmount = converter.convert.value(sendEth)(fromToken, toToken, amount, 1); require(<FILL_ME>) if (fromToken != ETH_ADDRESS) require(fromToken.approve(converter, 0), "Error removing token approve"); return boughtAmount; } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
boughtAmount==(toToken!=ETH_ADDRESS?toToken.balanceOf(this):address(this).balance)-prevBalance,"Bought amound does does not match"
293,570
boughtAmount==(toToken!=ETH_ADDRESS?toToken.balanceOf(this):address(this).balance)-prevBalance
"Error removing token approve"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { if (fromToken != ETH_ADDRESS) require(fromToken.approve(converter, amount), "Error approving token transfer"); uint256 prevBalance = toToken != ETH_ADDRESS ? toToken.balanceOf(this) : address(this).balance; uint256 sendEth = fromToken == ETH_ADDRESS ? amount : 0; uint256 boughtAmount = converter.convert.value(sendEth)(fromToken, toToken, amount, 1); require( boughtAmount == (toToken != ETH_ADDRESS ? toToken.balanceOf(this) : address(this).balance) - prevBalance, "Bought amound does does not match" ); if (fromToken != ETH_ADDRESS) require(<FILL_ME>) return boughtAmount; } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
fromToken.approve(converter,0),"Error removing token approve"
293,570
fromToken.approve(converter,0)
"Error on payment approve"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { NanoLoanEngine engine = NanoLoanEngine(address(params[I_ENGINE])); uint256 index = uint256(params[I_INDEX]); Oracle oracle = engine.getOracle(index); uint256 toPay; if (oracle == address(0)) { toPay = rcnToPay; } else { uint256 rate; uint256 decimals; bytes32 currency = engine.getCurrency(index); (rate, decimals) = oracle.getRate(currency, oracleData); toPay = (rcnToPay * (10 ** (18 - decimals + (18 * 2)) / rate)) / 10 ** 18; } Token rcn = engine.rcn(); require(<FILL_ME>) require(engine.pay(index, toPay, address(params[I_PAY_FROM]), oracleData), "Error paying the loan"); require(rcn.approve(engine, 0), "Error removing the payment approve"); return true; } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
rcn.approve(engine,rcnToPay),"Error on payment approve"
293,570
rcn.approve(engine,rcnToPay)
"Error paying the loan"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { NanoLoanEngine engine = NanoLoanEngine(address(params[I_ENGINE])); uint256 index = uint256(params[I_INDEX]); Oracle oracle = engine.getOracle(index); uint256 toPay; if (oracle == address(0)) { toPay = rcnToPay; } else { uint256 rate; uint256 decimals; bytes32 currency = engine.getCurrency(index); (rate, decimals) = oracle.getRate(currency, oracleData); toPay = (rcnToPay * (10 ** (18 - decimals + (18 * 2)) / rate)) / 10 ** 18; } Token rcn = engine.rcn(); require(rcn.approve(engine, rcnToPay), "Error on payment approve"); require(<FILL_ME>) require(rcn.approve(engine, 0), "Error removing the payment approve"); return true; } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
engine.pay(index,toPay,address(params[I_PAY_FROM]),oracleData),"Error paying the loan"
293,570
engine.pay(index,toPay,address(params[I_PAY_FROM]),oracleData)
"Error removing the payment approve"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { NanoLoanEngine engine = NanoLoanEngine(address(params[I_ENGINE])); uint256 index = uint256(params[I_INDEX]); Oracle oracle = engine.getOracle(index); uint256 toPay; if (oracle == address(0)) { toPay = rcnToPay; } else { uint256 rate; uint256 decimals; bytes32 currency = engine.getCurrency(index); (rate, decimals) = oracle.getRate(currency, oracleData); toPay = (rcnToPay * (10 ** (18 - decimals + (18 * 2)) / rate)) / 10 ** 18; } Token rcn = engine.rcn(); require(rcn.approve(engine, rcnToPay), "Error on payment approve"); require(engine.pay(index, toPay, address(params[I_PAY_FROM]), oracleData), "Error paying the loan"); require(<FILL_ME>) return true; } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
rcn.approve(engine,0),"Error removing the payment approve"
293,570
rcn.approve(engine,0)
"invalid pool"
pragma solidity >=0.6.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract PolkaBridgeLaunchPad is Ownable { string public name = "PolkaBridge: LaunchPad"; using SafeMath for uint256; using SafeERC20 for IERC20; uint256 private CONST_MINIMUM = 1000000000000000000; IERC20 polkaBridgeToken; address payable private ReceiveToken; struct IDOPool { uint256 Id; string Name; uint256 Begin; uint256 End; uint256 Type; //1:public, 2:private uint256 AmountPBRRequire; //must e18,important when init IERC20 IDOToken; uint256 MinPurchase; uint256 MaxPurchase; uint256 TotalCap; uint256 TotalToken; //total sale token for this pool uint256 RatePerETH; bool IsActived; bool IsStoped; uint256 ActivedDate; uint256 StopDate; uint256 LockDuration; //lock after purchase uint256 TotalSold; //total number of token sold bool IsSoldOut; //reach hardcap uint256 SoldOutAt; //sold out at time } struct User { uint256 Id; address UserAddress; bool IsWhitelist; uint256 WhitelistDate; uint256 TotalTokenPurchase; uint256 TotalETHPurchase; uint256 PurchaseTime; bool IsActived; bool IsClaimed; } mapping(uint256 => mapping(address => User)) whitelist; //poolid - listuser IDOPool[] pools; constructor(address payable receiveTokenAdd, IERC20 polkaBridge) public { } function addWhitelist(address user, uint256 pid) public onlyOwner { } function updateWhitelist( address user, uint256 pid, bool isWhitelist, bool isActived ) public onlyOwner { } function IsWhitelist(address user, uint256 pid) public view returns (bool) { } function addPool( string memory name, uint256 begin, uint256 end, uint256 _type, IERC20 idoToken, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 amountPBRRequire, uint256 ratePerETH, uint256 lockDuration ) public onlyOwner { } function updatePool( uint256 pid, uint256 begin, uint256 end, uint256 amountPBRRequire, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 ratePerETH, bool isActived, bool isStoped, uint256 lockDuration ) public onlyOwner { } //withdraw contract token //use for someone send token to contract //recuse wrong user function withdrawErc20(IERC20 token) public onlyOwner { } //withdraw ETH after IDO function withdrawPoolFund() public onlyOwner { } function purchaseIDO(uint256 pid) public payable { uint256 poolIndex = pid.sub(1); require(<FILL_ME>) require( block.timestamp >= pools[poolIndex].Begin && block.timestamp <= pools[poolIndex].End, "invalid time" ); uint256 remainToken = getRemainIDOToken(pid); if (remainToken <= CONST_MINIMUM) { pools[poolIndex].IsSoldOut = true; pools[poolIndex].SoldOutAt = block.timestamp; } require(!pools[poolIndex].IsSoldOut, "IDO sold out"); uint256 ethAmount = msg.value; // require( // ethAmount >= pools[poolIndex].MinPurchase, // "invalid minimum contribute" // ); require( ethAmount <= pools[poolIndex].MaxPurchase, "invalid maximum contribute" ); whitelist[pid][msg.sender].TotalETHPurchase = whitelist[pid][msg.sender] .TotalETHPurchase .add(ethAmount); if ( whitelist[pid][msg.sender].TotalETHPurchase > pools[poolIndex].MaxPurchase ) { whitelist[pid][msg.sender].TotalETHPurchase = whitelist[pid][ msg.sender ] .TotalETHPurchase .sub(ethAmount); revert("invalid maximum contribute"); } //check user require( whitelist[pid][msg.sender].IsWhitelist && whitelist[pid][msg.sender].IsActived, "invalid user" ); if (pools[poolIndex].Type == 2) //private, check hold PBR { require( polkaBridgeToken.balanceOf(msg.sender) >= pools[poolIndex].AmountPBRRequire, "must hold PBR" ); } //storage uint256 tokenAmount = ethAmount.mul(pools[poolIndex].RatePerETH).div(1e18); whitelist[pid][msg.sender].TotalTokenPurchase = whitelist[pid][ msg.sender ] .TotalTokenPurchase .add(tokenAmount); pools[poolIndex].TotalSold = pools[poolIndex].TotalSold.add( tokenAmount ); } function claimToken(uint256 pid) public { } function getUserTotalPurchase(uint256 pid) public view returns (uint256) { } function getRemainIDOToken(uint256 pid) public view returns (uint256) { } function getBalanceTokenByPoolId(uint256 pid) public view returns (uint256) { } function getPoolInfo(uint256 pid) public view returns ( uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bool, IERC20 ) { } function getPoolSoldInfo(uint256 pid) public view returns ( uint256, uint256, bool, uint256 ) { } function getWhitelistfo(uint256 pid) public view returns ( address, bool, uint256, uint256, uint256, bool ) { } receive() external payable {} }
pools[poolIndex].IsActived&&!pools[poolIndex].IsStoped,"invalid pool"
293,618
pools[poolIndex].IsActived&&!pools[poolIndex].IsStoped
"IDO sold out"
pragma solidity >=0.6.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract PolkaBridgeLaunchPad is Ownable { string public name = "PolkaBridge: LaunchPad"; using SafeMath for uint256; using SafeERC20 for IERC20; uint256 private CONST_MINIMUM = 1000000000000000000; IERC20 polkaBridgeToken; address payable private ReceiveToken; struct IDOPool { uint256 Id; string Name; uint256 Begin; uint256 End; uint256 Type; //1:public, 2:private uint256 AmountPBRRequire; //must e18,important when init IERC20 IDOToken; uint256 MinPurchase; uint256 MaxPurchase; uint256 TotalCap; uint256 TotalToken; //total sale token for this pool uint256 RatePerETH; bool IsActived; bool IsStoped; uint256 ActivedDate; uint256 StopDate; uint256 LockDuration; //lock after purchase uint256 TotalSold; //total number of token sold bool IsSoldOut; //reach hardcap uint256 SoldOutAt; //sold out at time } struct User { uint256 Id; address UserAddress; bool IsWhitelist; uint256 WhitelistDate; uint256 TotalTokenPurchase; uint256 TotalETHPurchase; uint256 PurchaseTime; bool IsActived; bool IsClaimed; } mapping(uint256 => mapping(address => User)) whitelist; //poolid - listuser IDOPool[] pools; constructor(address payable receiveTokenAdd, IERC20 polkaBridge) public { } function addWhitelist(address user, uint256 pid) public onlyOwner { } function updateWhitelist( address user, uint256 pid, bool isWhitelist, bool isActived ) public onlyOwner { } function IsWhitelist(address user, uint256 pid) public view returns (bool) { } function addPool( string memory name, uint256 begin, uint256 end, uint256 _type, IERC20 idoToken, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 amountPBRRequire, uint256 ratePerETH, uint256 lockDuration ) public onlyOwner { } function updatePool( uint256 pid, uint256 begin, uint256 end, uint256 amountPBRRequire, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 ratePerETH, bool isActived, bool isStoped, uint256 lockDuration ) public onlyOwner { } //withdraw contract token //use for someone send token to contract //recuse wrong user function withdrawErc20(IERC20 token) public onlyOwner { } //withdraw ETH after IDO function withdrawPoolFund() public onlyOwner { } function purchaseIDO(uint256 pid) public payable { uint256 poolIndex = pid.sub(1); require( pools[poolIndex].IsActived && !pools[poolIndex].IsStoped, "invalid pool" ); require( block.timestamp >= pools[poolIndex].Begin && block.timestamp <= pools[poolIndex].End, "invalid time" ); uint256 remainToken = getRemainIDOToken(pid); if (remainToken <= CONST_MINIMUM) { pools[poolIndex].IsSoldOut = true; pools[poolIndex].SoldOutAt = block.timestamp; } require(<FILL_ME>) uint256 ethAmount = msg.value; // require( // ethAmount >= pools[poolIndex].MinPurchase, // "invalid minimum contribute" // ); require( ethAmount <= pools[poolIndex].MaxPurchase, "invalid maximum contribute" ); whitelist[pid][msg.sender].TotalETHPurchase = whitelist[pid][msg.sender] .TotalETHPurchase .add(ethAmount); if ( whitelist[pid][msg.sender].TotalETHPurchase > pools[poolIndex].MaxPurchase ) { whitelist[pid][msg.sender].TotalETHPurchase = whitelist[pid][ msg.sender ] .TotalETHPurchase .sub(ethAmount); revert("invalid maximum contribute"); } //check user require( whitelist[pid][msg.sender].IsWhitelist && whitelist[pid][msg.sender].IsActived, "invalid user" ); if (pools[poolIndex].Type == 2) //private, check hold PBR { require( polkaBridgeToken.balanceOf(msg.sender) >= pools[poolIndex].AmountPBRRequire, "must hold PBR" ); } //storage uint256 tokenAmount = ethAmount.mul(pools[poolIndex].RatePerETH).div(1e18); whitelist[pid][msg.sender].TotalTokenPurchase = whitelist[pid][ msg.sender ] .TotalTokenPurchase .add(tokenAmount); pools[poolIndex].TotalSold = pools[poolIndex].TotalSold.add( tokenAmount ); } function claimToken(uint256 pid) public { } function getUserTotalPurchase(uint256 pid) public view returns (uint256) { } function getRemainIDOToken(uint256 pid) public view returns (uint256) { } function getBalanceTokenByPoolId(uint256 pid) public view returns (uint256) { } function getPoolInfo(uint256 pid) public view returns ( uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bool, IERC20 ) { } function getPoolSoldInfo(uint256 pid) public view returns ( uint256, uint256, bool, uint256 ) { } function getWhitelistfo(uint256 pid) public view returns ( address, bool, uint256, uint256, uint256, bool ) { } receive() external payable {} }
!pools[poolIndex].IsSoldOut,"IDO sold out"
293,618
!pools[poolIndex].IsSoldOut
"invalid user"
pragma solidity >=0.6.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract PolkaBridgeLaunchPad is Ownable { string public name = "PolkaBridge: LaunchPad"; using SafeMath for uint256; using SafeERC20 for IERC20; uint256 private CONST_MINIMUM = 1000000000000000000; IERC20 polkaBridgeToken; address payable private ReceiveToken; struct IDOPool { uint256 Id; string Name; uint256 Begin; uint256 End; uint256 Type; //1:public, 2:private uint256 AmountPBRRequire; //must e18,important when init IERC20 IDOToken; uint256 MinPurchase; uint256 MaxPurchase; uint256 TotalCap; uint256 TotalToken; //total sale token for this pool uint256 RatePerETH; bool IsActived; bool IsStoped; uint256 ActivedDate; uint256 StopDate; uint256 LockDuration; //lock after purchase uint256 TotalSold; //total number of token sold bool IsSoldOut; //reach hardcap uint256 SoldOutAt; //sold out at time } struct User { uint256 Id; address UserAddress; bool IsWhitelist; uint256 WhitelistDate; uint256 TotalTokenPurchase; uint256 TotalETHPurchase; uint256 PurchaseTime; bool IsActived; bool IsClaimed; } mapping(uint256 => mapping(address => User)) whitelist; //poolid - listuser IDOPool[] pools; constructor(address payable receiveTokenAdd, IERC20 polkaBridge) public { } function addWhitelist(address user, uint256 pid) public onlyOwner { } function updateWhitelist( address user, uint256 pid, bool isWhitelist, bool isActived ) public onlyOwner { } function IsWhitelist(address user, uint256 pid) public view returns (bool) { } function addPool( string memory name, uint256 begin, uint256 end, uint256 _type, IERC20 idoToken, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 amountPBRRequire, uint256 ratePerETH, uint256 lockDuration ) public onlyOwner { } function updatePool( uint256 pid, uint256 begin, uint256 end, uint256 amountPBRRequire, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 ratePerETH, bool isActived, bool isStoped, uint256 lockDuration ) public onlyOwner { } //withdraw contract token //use for someone send token to contract //recuse wrong user function withdrawErc20(IERC20 token) public onlyOwner { } //withdraw ETH after IDO function withdrawPoolFund() public onlyOwner { } function purchaseIDO(uint256 pid) public payable { uint256 poolIndex = pid.sub(1); require( pools[poolIndex].IsActived && !pools[poolIndex].IsStoped, "invalid pool" ); require( block.timestamp >= pools[poolIndex].Begin && block.timestamp <= pools[poolIndex].End, "invalid time" ); uint256 remainToken = getRemainIDOToken(pid); if (remainToken <= CONST_MINIMUM) { pools[poolIndex].IsSoldOut = true; pools[poolIndex].SoldOutAt = block.timestamp; } require(!pools[poolIndex].IsSoldOut, "IDO sold out"); uint256 ethAmount = msg.value; // require( // ethAmount >= pools[poolIndex].MinPurchase, // "invalid minimum contribute" // ); require( ethAmount <= pools[poolIndex].MaxPurchase, "invalid maximum contribute" ); whitelist[pid][msg.sender].TotalETHPurchase = whitelist[pid][msg.sender] .TotalETHPurchase .add(ethAmount); if ( whitelist[pid][msg.sender].TotalETHPurchase > pools[poolIndex].MaxPurchase ) { whitelist[pid][msg.sender].TotalETHPurchase = whitelist[pid][ msg.sender ] .TotalETHPurchase .sub(ethAmount); revert("invalid maximum contribute"); } //check user require(<FILL_ME>) if (pools[poolIndex].Type == 2) //private, check hold PBR { require( polkaBridgeToken.balanceOf(msg.sender) >= pools[poolIndex].AmountPBRRequire, "must hold PBR" ); } //storage uint256 tokenAmount = ethAmount.mul(pools[poolIndex].RatePerETH).div(1e18); whitelist[pid][msg.sender].TotalTokenPurchase = whitelist[pid][ msg.sender ] .TotalTokenPurchase .add(tokenAmount); pools[poolIndex].TotalSold = pools[poolIndex].TotalSold.add( tokenAmount ); } function claimToken(uint256 pid) public { } function getUserTotalPurchase(uint256 pid) public view returns (uint256) { } function getRemainIDOToken(uint256 pid) public view returns (uint256) { } function getBalanceTokenByPoolId(uint256 pid) public view returns (uint256) { } function getPoolInfo(uint256 pid) public view returns ( uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bool, IERC20 ) { } function getPoolSoldInfo(uint256 pid) public view returns ( uint256, uint256, bool, uint256 ) { } function getWhitelistfo(uint256 pid) public view returns ( address, bool, uint256, uint256, uint256, bool ) { } receive() external payable {} }
whitelist[pid][msg.sender].IsWhitelist&&whitelist[pid][msg.sender].IsActived,"invalid user"
293,618
whitelist[pid][msg.sender].IsWhitelist&&whitelist[pid][msg.sender].IsActived
"must hold PBR"
pragma solidity >=0.6.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract PolkaBridgeLaunchPad is Ownable { string public name = "PolkaBridge: LaunchPad"; using SafeMath for uint256; using SafeERC20 for IERC20; uint256 private CONST_MINIMUM = 1000000000000000000; IERC20 polkaBridgeToken; address payable private ReceiveToken; struct IDOPool { uint256 Id; string Name; uint256 Begin; uint256 End; uint256 Type; //1:public, 2:private uint256 AmountPBRRequire; //must e18,important when init IERC20 IDOToken; uint256 MinPurchase; uint256 MaxPurchase; uint256 TotalCap; uint256 TotalToken; //total sale token for this pool uint256 RatePerETH; bool IsActived; bool IsStoped; uint256 ActivedDate; uint256 StopDate; uint256 LockDuration; //lock after purchase uint256 TotalSold; //total number of token sold bool IsSoldOut; //reach hardcap uint256 SoldOutAt; //sold out at time } struct User { uint256 Id; address UserAddress; bool IsWhitelist; uint256 WhitelistDate; uint256 TotalTokenPurchase; uint256 TotalETHPurchase; uint256 PurchaseTime; bool IsActived; bool IsClaimed; } mapping(uint256 => mapping(address => User)) whitelist; //poolid - listuser IDOPool[] pools; constructor(address payable receiveTokenAdd, IERC20 polkaBridge) public { } function addWhitelist(address user, uint256 pid) public onlyOwner { } function updateWhitelist( address user, uint256 pid, bool isWhitelist, bool isActived ) public onlyOwner { } function IsWhitelist(address user, uint256 pid) public view returns (bool) { } function addPool( string memory name, uint256 begin, uint256 end, uint256 _type, IERC20 idoToken, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 amountPBRRequire, uint256 ratePerETH, uint256 lockDuration ) public onlyOwner { } function updatePool( uint256 pid, uint256 begin, uint256 end, uint256 amountPBRRequire, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 ratePerETH, bool isActived, bool isStoped, uint256 lockDuration ) public onlyOwner { } //withdraw contract token //use for someone send token to contract //recuse wrong user function withdrawErc20(IERC20 token) public onlyOwner { } //withdraw ETH after IDO function withdrawPoolFund() public onlyOwner { } function purchaseIDO(uint256 pid) public payable { uint256 poolIndex = pid.sub(1); require( pools[poolIndex].IsActived && !pools[poolIndex].IsStoped, "invalid pool" ); require( block.timestamp >= pools[poolIndex].Begin && block.timestamp <= pools[poolIndex].End, "invalid time" ); uint256 remainToken = getRemainIDOToken(pid); if (remainToken <= CONST_MINIMUM) { pools[poolIndex].IsSoldOut = true; pools[poolIndex].SoldOutAt = block.timestamp; } require(!pools[poolIndex].IsSoldOut, "IDO sold out"); uint256 ethAmount = msg.value; // require( // ethAmount >= pools[poolIndex].MinPurchase, // "invalid minimum contribute" // ); require( ethAmount <= pools[poolIndex].MaxPurchase, "invalid maximum contribute" ); whitelist[pid][msg.sender].TotalETHPurchase = whitelist[pid][msg.sender] .TotalETHPurchase .add(ethAmount); if ( whitelist[pid][msg.sender].TotalETHPurchase > pools[poolIndex].MaxPurchase ) { whitelist[pid][msg.sender].TotalETHPurchase = whitelist[pid][ msg.sender ] .TotalETHPurchase .sub(ethAmount); revert("invalid maximum contribute"); } //check user require( whitelist[pid][msg.sender].IsWhitelist && whitelist[pid][msg.sender].IsActived, "invalid user" ); if (pools[poolIndex].Type == 2) //private, check hold PBR { require(<FILL_ME>) } //storage uint256 tokenAmount = ethAmount.mul(pools[poolIndex].RatePerETH).div(1e18); whitelist[pid][msg.sender].TotalTokenPurchase = whitelist[pid][ msg.sender ] .TotalTokenPurchase .add(tokenAmount); pools[poolIndex].TotalSold = pools[poolIndex].TotalSold.add( tokenAmount ); } function claimToken(uint256 pid) public { } function getUserTotalPurchase(uint256 pid) public view returns (uint256) { } function getRemainIDOToken(uint256 pid) public view returns (uint256) { } function getBalanceTokenByPoolId(uint256 pid) public view returns (uint256) { } function getPoolInfo(uint256 pid) public view returns ( uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bool, IERC20 ) { } function getPoolSoldInfo(uint256 pid) public view returns ( uint256, uint256, bool, uint256 ) { } function getWhitelistfo(uint256 pid) public view returns ( address, bool, uint256, uint256, uint256, bool ) { } receive() external payable {} }
polkaBridgeToken.balanceOf(msg.sender)>=pools[poolIndex].AmountPBRRequire,"must hold PBR"
293,618
polkaBridgeToken.balanceOf(msg.sender)>=pools[poolIndex].AmountPBRRequire
"user already claimed"
pragma solidity >=0.6.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract PolkaBridgeLaunchPad is Ownable { string public name = "PolkaBridge: LaunchPad"; using SafeMath for uint256; using SafeERC20 for IERC20; uint256 private CONST_MINIMUM = 1000000000000000000; IERC20 polkaBridgeToken; address payable private ReceiveToken; struct IDOPool { uint256 Id; string Name; uint256 Begin; uint256 End; uint256 Type; //1:public, 2:private uint256 AmountPBRRequire; //must e18,important when init IERC20 IDOToken; uint256 MinPurchase; uint256 MaxPurchase; uint256 TotalCap; uint256 TotalToken; //total sale token for this pool uint256 RatePerETH; bool IsActived; bool IsStoped; uint256 ActivedDate; uint256 StopDate; uint256 LockDuration; //lock after purchase uint256 TotalSold; //total number of token sold bool IsSoldOut; //reach hardcap uint256 SoldOutAt; //sold out at time } struct User { uint256 Id; address UserAddress; bool IsWhitelist; uint256 WhitelistDate; uint256 TotalTokenPurchase; uint256 TotalETHPurchase; uint256 PurchaseTime; bool IsActived; bool IsClaimed; } mapping(uint256 => mapping(address => User)) whitelist; //poolid - listuser IDOPool[] pools; constructor(address payable receiveTokenAdd, IERC20 polkaBridge) public { } function addWhitelist(address user, uint256 pid) public onlyOwner { } function updateWhitelist( address user, uint256 pid, bool isWhitelist, bool isActived ) public onlyOwner { } function IsWhitelist(address user, uint256 pid) public view returns (bool) { } function addPool( string memory name, uint256 begin, uint256 end, uint256 _type, IERC20 idoToken, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 amountPBRRequire, uint256 ratePerETH, uint256 lockDuration ) public onlyOwner { } function updatePool( uint256 pid, uint256 begin, uint256 end, uint256 amountPBRRequire, uint256 minPurchase, uint256 maxPurchase, uint256 totalCap, uint256 totalToken, uint256 ratePerETH, bool isActived, bool isStoped, uint256 lockDuration ) public onlyOwner { } //withdraw contract token //use for someone send token to contract //recuse wrong user function withdrawErc20(IERC20 token) public onlyOwner { } //withdraw ETH after IDO function withdrawPoolFund() public onlyOwner { } function purchaseIDO(uint256 pid) public payable { } function claimToken(uint256 pid) public { require(<FILL_ME>) uint256 poolIndex = pid.sub(1); require( block.timestamp >= pools[poolIndex].End.add(pools[poolIndex].LockDuration), "not on time" ); uint256 userBalance = getUserTotalPurchase(pid); require(userBalance > 0, "invalid claim"); pools[poolIndex].IDOToken.transfer(msg.sender, userBalance); whitelist[pid][msg.sender].IsClaimed = true; } function getUserTotalPurchase(uint256 pid) public view returns (uint256) { } function getRemainIDOToken(uint256 pid) public view returns (uint256) { } function getBalanceTokenByPoolId(uint256 pid) public view returns (uint256) { } function getPoolInfo(uint256 pid) public view returns ( uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bool, IERC20 ) { } function getPoolSoldInfo(uint256 pid) public view returns ( uint256, uint256, bool, uint256 ) { } function getWhitelistfo(uint256 pid) public view returns ( address, bool, uint256, uint256, uint256, bool ) { } receive() external payable {} }
!whitelist[pid][msg.sender].IsClaimed,"user already claimed"
293,618
!whitelist[pid][msg.sender].IsClaimed
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /* +++ . . +++ +@++++ . . ++++@+ ++++@+. .+@++++ .+++ ++++ +++. +@@+ . . . +++@@+++ . . . . +@++++@+ . ++++++ ++++++ +@+ +@+ . ++++ ++++ . . +@+ +@+ . . .+++. .+++. . . . . . . . . . . . . .. .. . . . Project INK Collect generative inkblot art inspired by the Rorschach test. Website: https://project.ink/ Created by sol_dev */ interface Receiver { function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns (bytes4); } contract Metadata { string public name = "Project INK"; string public symbol = "INK"; function contractURI() external pure returns (string memory) { } function baseTokenURI() public pure returns (string memory) { } function tokenURI(uint256 _tokenId) external pure returns (string memory) { } } contract ProjectINK { uint256 constant public MAX_NAME_LENGTH = 32; uint256 constant public MAX_SUPPLY = 1921; uint256 constant public MINT_COST = 0.05 ether; struct User { uint256 balance; mapping(uint256 => uint256) list; mapping(address => bool) approved; mapping(uint256 => uint256) indexOf; } struct Token { address owner; address approved; bytes32 seed; string name; } struct Info { uint256 totalSupply; mapping(uint256 => Token) list; mapping(address => User) users; Metadata metadata; address owner; } Info private info; mapping(bytes4 => bool) public supportsInterface; event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); event Mint(address indexed owner, uint256 indexed tokenId, bytes32 seed); event Rename(address indexed owner, uint256 indexed tokenId, string name); modifier _onlyOwner() { } constructor() { } function setOwner(address _owner) external _onlyOwner { } function setMetadata(Metadata _metadata) external _onlyOwner { } function ownerWithdraw() external _onlyOwner { } receive() external payable { } function mint() external payable { } function mintMany(uint256 _tokens) public payable { } function rename(uint256 _tokenId, string calldata _newName) external { require(<FILL_ME>) require(msg.sender == ownerOf(_tokenId)); info.list[_tokenId].name = _newName; emit Rename(msg.sender, _tokenId, _newName); } function approve(address _approved, uint256 _tokenId) external { } function setApprovalForAll(address _operator, bool _approved) external { } function transferFrom(address _from, address _to, uint256 _tokenId) external { } function safeTransferFrom(address _from, address _to, uint256 _tokenId) external { } function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) public { } function name() external view returns (string memory) { } function symbol() external view returns (string memory) { } function contractURI() external view returns (string memory) { } function baseTokenURI() external view returns (string memory) { } function tokenURI(uint256 _tokenId) external view returns (string memory) { } function owner() public view returns (address) { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256) { } function ownerOf(uint256 _tokenId) public view returns (address) { } function getApproved(uint256 _tokenId) public view returns (address) { } function isApprovedForAll(address _owner, address _operator) public view returns (bool) { } function getSeed(uint256 _tokenId) public view returns (bytes32) { } function getName(uint256 _tokenId) public view returns (string memory) { } function tokenByIndex(uint256 _index) public view returns (uint256) { } function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) { } function getINK(uint256 _tokenId) public view returns (address tokenOwner, address approved, bytes32 seed, string memory tokenName) { } function getINKs(uint256[] memory _tokenIds) public view returns (address[] memory owners, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names) { } function getINKsTable(uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory owners, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names, uint256 totalINKs, uint256 totalPages) { } function getOwnerINKsTable(address _owner, uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names, uint256 totalINKs, uint256 totalPages) { } function allInfoFor(address _owner) external view returns (uint256 supply, uint256 ownerBalance) { } function _mint() internal { } function _transfer(address _from, address _to, uint256 _tokenId) internal { } function _stringToBytes32(string memory _in) internal pure returns (bytes32 out) { } }
bytes(_newName).length<=MAX_NAME_LENGTH
293,732
bytes(_newName).length<=MAX_NAME_LENGTH
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /* +++ . . +++ +@++++ . . ++++@+ ++++@+. .+@++++ .+++ ++++ +++. +@@+ . . . +++@@+++ . . . . +@++++@+ . ++++++ ++++++ +@+ +@+ . ++++ ++++ . . +@+ +@+ . . .+++. .+++. . . . . . . . . . . . . .. .. . . . Project INK Collect generative inkblot art inspired by the Rorschach test. Website: https://project.ink/ Created by sol_dev */ interface Receiver { function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns (bytes4); } contract Metadata { string public name = "Project INK"; string public symbol = "INK"; function contractURI() external pure returns (string memory) { } function baseTokenURI() public pure returns (string memory) { } function tokenURI(uint256 _tokenId) external pure returns (string memory) { } } contract ProjectINK { uint256 constant public MAX_NAME_LENGTH = 32; uint256 constant public MAX_SUPPLY = 1921; uint256 constant public MINT_COST = 0.05 ether; struct User { uint256 balance; mapping(uint256 => uint256) list; mapping(address => bool) approved; mapping(uint256 => uint256) indexOf; } struct Token { address owner; address approved; bytes32 seed; string name; } struct Info { uint256 totalSupply; mapping(uint256 => Token) list; mapping(address => User) users; Metadata metadata; address owner; } Info private info; mapping(bytes4 => bool) public supportsInterface; event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); event Mint(address indexed owner, uint256 indexed tokenId, bytes32 seed); event Rename(address indexed owner, uint256 indexed tokenId, string name); modifier _onlyOwner() { } constructor() { } function setOwner(address _owner) external _onlyOwner { } function setMetadata(Metadata _metadata) external _onlyOwner { } function ownerWithdraw() external _onlyOwner { } receive() external payable { } function mint() external payable { } function mintMany(uint256 _tokens) public payable { } function rename(uint256 _tokenId, string calldata _newName) external { } function approve(address _approved, uint256 _tokenId) external { } function setApprovalForAll(address _operator, bool _approved) external { } function transferFrom(address _from, address _to, uint256 _tokenId) external { } function safeTransferFrom(address _from, address _to, uint256 _tokenId) external { } function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) public { _transfer(_from, _to, _tokenId); uint32 _size; assembly { _size := extcodesize(_to) } if (_size > 0) { require(<FILL_ME>) } } function name() external view returns (string memory) { } function symbol() external view returns (string memory) { } function contractURI() external view returns (string memory) { } function baseTokenURI() external view returns (string memory) { } function tokenURI(uint256 _tokenId) external view returns (string memory) { } function owner() public view returns (address) { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256) { } function ownerOf(uint256 _tokenId) public view returns (address) { } function getApproved(uint256 _tokenId) public view returns (address) { } function isApprovedForAll(address _owner, address _operator) public view returns (bool) { } function getSeed(uint256 _tokenId) public view returns (bytes32) { } function getName(uint256 _tokenId) public view returns (string memory) { } function tokenByIndex(uint256 _index) public view returns (uint256) { } function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) { } function getINK(uint256 _tokenId) public view returns (address tokenOwner, address approved, bytes32 seed, string memory tokenName) { } function getINKs(uint256[] memory _tokenIds) public view returns (address[] memory owners, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names) { } function getINKsTable(uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory owners, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names, uint256 totalINKs, uint256 totalPages) { } function getOwnerINKsTable(address _owner, uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names, uint256 totalINKs, uint256 totalPages) { } function allInfoFor(address _owner) external view returns (uint256 supply, uint256 ownerBalance) { } function _mint() internal { } function _transfer(address _from, address _to, uint256 _tokenId) internal { } function _stringToBytes32(string memory _in) internal pure returns (bytes32 out) { } }
Receiver(_to).onERC721Received(msg.sender,_from,_tokenId,_data)==0x150b7a02
293,732
Receiver(_to).onERC721Received(msg.sender,_from,_tokenId,_data)==0x150b7a02
MINTED_OUT
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// This file is forked from Solmate v6, /// We stand on the shoulders of giants /// Unnecessary functions have been deleted, mint, safeMint and burn /// Added our own mint functions, tweaked ownerOf to support our weirdness import "./SparkleMarket.sol"; interface IERC721 { function ownerOf(uint256 tokenId) external view returns (address owner); function setOwnerOf(uint256 id, address newOwner) external view returns (address owner); } /// @notice Modern, minimalist, and gas efficient ERC-721 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol) /// @dev Note that balanceOf does not revert if passed the zero address, in defiance of the ERC. contract VAYC { /*/////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 indexed id); event Approval(address indexed owner, address indexed spender, uint256 indexed id); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /*/////////////////////////////////////////////////////////////// METADATA STORAGE/LOGIC //////////////////////////////////////////////////////////////*/ string private constant NOT_LIVE = "Sale not live"; string private constant INCORRECT_PRICE = "Gotta pay right money"; string private constant MINTED_OUT = "Max supply reached"; string public name; string public symbol; address private admin; uint16 public totalSupply; uint16 public counter = 0; uint16 public constant MAX_SUPPLY = 10000; // only first 10000 were minted IERC721 private MAYC = IERC721(0x60E4d786628Fea6478F785A6d7e704777c86a7c6); IERC721 private BAYC = IERC721(0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D); IERC721 private BAKC = IERC721(0xba30E5F9Bb24caa003E9f2f0497Ad287FDF95623); //function setMAYC(address _mayc) public {MAYC = IERC721(_mayc);} //helper for unit testing //IERC721 private MAYC = IERC721(0x6A8e25D0168B98e240d28a803e71ada93973F856); //IERC721 private BAYC = IERC721(0x6A8e25D0168B98e240d28a803e71ada93973F856); //IERC721 private BAKC = IERC721(address(0xdead)); SparkleMarket public market; uint256 public constant COST_MAYC = 0.042069 ether; uint256 public constant COST_PUBLIC = 0.069420 ether; uint8 constant MAX_MINT = 10; enum SaleStatus { Paused, Presale, Whitelist, Public } SaleStatus public saleMode; /*/////////////////////////////////////////////////////////////// ERC721 STORAGE //////////////////////////////////////////////////////////////*/ mapping(address => uint256) public balanceOf; mapping(uint256 => address) private preOf; mapping(uint256 => address) private publicOf; mapping(uint256 => address) public getApproved; mapping(address => mapping(address => bool)) public isApprovedForAll; /*/////////////////////////////////////////////////////////////// ERC721 LOGIC //////////////////////////////////////////////////////////////*/ function ownerOf(uint256 id) public view returns (address) { } function approve(address spender, uint256 id) external { } function setApprovalForAll(address operator, bool approved) external { } function transferFrom( address from, address to, uint256 id ) public { } function safeTransferFrom( address from, address to, uint256 id ) external { } function safeTransferFrom( address from, address to, uint256 id, bytes memory data ) external { } /*/////////////////////////////////////////////////////////////// ERC165 LOGIC //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) external pure returns (bool) { } modifier onlyAdmin() { } /*/////////////////////////////////////////////////////////////// VAYC SPECIFIC LOGIC //////////////////////////////////////////////////////////////*/ constructor(string memory _name, string memory _symbol) { } function saleToPause() external onlyAdmin { } function saleToPre() external onlyAdmin { } function saleToWhitelist() external onlyAdmin { } function saleToPublic() external onlyAdmin { } function withdraw() external onlyAdmin { } function mintPre(uint[] calldata tokenIds) external payable { require(saleMode == SaleStatus.Presale, NOT_LIVE); require(msg.value == COST_MAYC*tokenIds.length, INCORRECT_PRICE); require(<FILL_ME>) for (uint i = 0; i < tokenIds.length; i++) { require(msg.sender == MAYC.ownerOf(tokenIds[i]), "Missing required token"); require(tokenIds[i] < MAX_SUPPLY, "TokenId too high"); } for (uint i = 0; i < tokenIds.length; i++) { require(ownerOf(tokenIds[i]) == address(0), "ALREADY_MINTED"); // Counter overflow is incredibly unrealistic. unchecked { balanceOf[msg.sender]++; } preOf[tokenIds[i]] = msg.sender; emit Transfer(address(0), msg.sender, tokenIds[i]); } unchecked{ totalSupply = totalSupply + (uint16(tokenIds.length)); } } function mintWL(uint16 num, uint tokenId) external payable { } function mintPublic(uint16 num) external payable { } function _mintY(uint16 num) internal { } // This function is here as a fallback in case we get undesirable gas consumption due to the // structure of the preOf array. if it does, the owner can pause the contract, mint the offending // token id and push public supply up to what it needs to be to get over O(n) SREAD operations in // the MAYC Array. // We may use it for promotions & giveaways. // One can monitor the deployment address for suspicious activity if you do not trust the devs. function mintAdmin(uint id, uint16 supplyOverwrite) external onlyAdmin { } function uintToString(uint256 value) internal pure returns (string memory) { } function tokenURI(uint256 id) external view returns (string memory) { } function marketTransferFrom(address from, address to, uint256 id) external { } } /// @notice A generic interface for a contract which properly accepts ERC721 tokens. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol) interface ERC721TokenReceiver { function onERC721Received( address operator, address from, uint256 id, bytes calldata data ) external returns (bytes4); }
totalSupply+tokenIds.length<MAX_SUPPLY,MINTED_OUT
293,755
totalSupply+tokenIds.length<MAX_SUPPLY
"TokenId too high"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// This file is forked from Solmate v6, /// We stand on the shoulders of giants /// Unnecessary functions have been deleted, mint, safeMint and burn /// Added our own mint functions, tweaked ownerOf to support our weirdness import "./SparkleMarket.sol"; interface IERC721 { function ownerOf(uint256 tokenId) external view returns (address owner); function setOwnerOf(uint256 id, address newOwner) external view returns (address owner); } /// @notice Modern, minimalist, and gas efficient ERC-721 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol) /// @dev Note that balanceOf does not revert if passed the zero address, in defiance of the ERC. contract VAYC { /*/////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 indexed id); event Approval(address indexed owner, address indexed spender, uint256 indexed id); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /*/////////////////////////////////////////////////////////////// METADATA STORAGE/LOGIC //////////////////////////////////////////////////////////////*/ string private constant NOT_LIVE = "Sale not live"; string private constant INCORRECT_PRICE = "Gotta pay right money"; string private constant MINTED_OUT = "Max supply reached"; string public name; string public symbol; address private admin; uint16 public totalSupply; uint16 public counter = 0; uint16 public constant MAX_SUPPLY = 10000; // only first 10000 were minted IERC721 private MAYC = IERC721(0x60E4d786628Fea6478F785A6d7e704777c86a7c6); IERC721 private BAYC = IERC721(0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D); IERC721 private BAKC = IERC721(0xba30E5F9Bb24caa003E9f2f0497Ad287FDF95623); //function setMAYC(address _mayc) public {MAYC = IERC721(_mayc);} //helper for unit testing //IERC721 private MAYC = IERC721(0x6A8e25D0168B98e240d28a803e71ada93973F856); //IERC721 private BAYC = IERC721(0x6A8e25D0168B98e240d28a803e71ada93973F856); //IERC721 private BAKC = IERC721(address(0xdead)); SparkleMarket public market; uint256 public constant COST_MAYC = 0.042069 ether; uint256 public constant COST_PUBLIC = 0.069420 ether; uint8 constant MAX_MINT = 10; enum SaleStatus { Paused, Presale, Whitelist, Public } SaleStatus public saleMode; /*/////////////////////////////////////////////////////////////// ERC721 STORAGE //////////////////////////////////////////////////////////////*/ mapping(address => uint256) public balanceOf; mapping(uint256 => address) private preOf; mapping(uint256 => address) private publicOf; mapping(uint256 => address) public getApproved; mapping(address => mapping(address => bool)) public isApprovedForAll; /*/////////////////////////////////////////////////////////////// ERC721 LOGIC //////////////////////////////////////////////////////////////*/ function ownerOf(uint256 id) public view returns (address) { } function approve(address spender, uint256 id) external { } function setApprovalForAll(address operator, bool approved) external { } function transferFrom( address from, address to, uint256 id ) public { } function safeTransferFrom( address from, address to, uint256 id ) external { } function safeTransferFrom( address from, address to, uint256 id, bytes memory data ) external { } /*/////////////////////////////////////////////////////////////// ERC165 LOGIC //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) external pure returns (bool) { } modifier onlyAdmin() { } /*/////////////////////////////////////////////////////////////// VAYC SPECIFIC LOGIC //////////////////////////////////////////////////////////////*/ constructor(string memory _name, string memory _symbol) { } function saleToPause() external onlyAdmin { } function saleToPre() external onlyAdmin { } function saleToWhitelist() external onlyAdmin { } function saleToPublic() external onlyAdmin { } function withdraw() external onlyAdmin { } function mintPre(uint[] calldata tokenIds) external payable { require(saleMode == SaleStatus.Presale, NOT_LIVE); require(msg.value == COST_MAYC*tokenIds.length, INCORRECT_PRICE); require(totalSupply + tokenIds.length < MAX_SUPPLY, MINTED_OUT); for (uint i = 0; i < tokenIds.length; i++) { require(msg.sender == MAYC.ownerOf(tokenIds[i]), "Missing required token"); require(<FILL_ME>) } for (uint i = 0; i < tokenIds.length; i++) { require(ownerOf(tokenIds[i]) == address(0), "ALREADY_MINTED"); // Counter overflow is incredibly unrealistic. unchecked { balanceOf[msg.sender]++; } preOf[tokenIds[i]] = msg.sender; emit Transfer(address(0), msg.sender, tokenIds[i]); } unchecked{ totalSupply = totalSupply + (uint16(tokenIds.length)); } } function mintWL(uint16 num, uint tokenId) external payable { } function mintPublic(uint16 num) external payable { } function _mintY(uint16 num) internal { } // This function is here as a fallback in case we get undesirable gas consumption due to the // structure of the preOf array. if it does, the owner can pause the contract, mint the offending // token id and push public supply up to what it needs to be to get over O(n) SREAD operations in // the MAYC Array. // We may use it for promotions & giveaways. // One can monitor the deployment address for suspicious activity if you do not trust the devs. function mintAdmin(uint id, uint16 supplyOverwrite) external onlyAdmin { } function uintToString(uint256 value) internal pure returns (string memory) { } function tokenURI(uint256 id) external view returns (string memory) { } function marketTransferFrom(address from, address to, uint256 id) external { } } /// @notice A generic interface for a contract which properly accepts ERC721 tokens. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol) interface ERC721TokenReceiver { function onERC721Received( address operator, address from, uint256 id, bytes calldata data ) external returns (bytes4); }
tokenIds[i]<MAX_SUPPLY,"TokenId too high"
293,755
tokenIds[i]<MAX_SUPPLY
"ALREADY_MINTED"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// This file is forked from Solmate v6, /// We stand on the shoulders of giants /// Unnecessary functions have been deleted, mint, safeMint and burn /// Added our own mint functions, tweaked ownerOf to support our weirdness import "./SparkleMarket.sol"; interface IERC721 { function ownerOf(uint256 tokenId) external view returns (address owner); function setOwnerOf(uint256 id, address newOwner) external view returns (address owner); } /// @notice Modern, minimalist, and gas efficient ERC-721 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol) /// @dev Note that balanceOf does not revert if passed the zero address, in defiance of the ERC. contract VAYC { /*/////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 indexed id); event Approval(address indexed owner, address indexed spender, uint256 indexed id); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /*/////////////////////////////////////////////////////////////// METADATA STORAGE/LOGIC //////////////////////////////////////////////////////////////*/ string private constant NOT_LIVE = "Sale not live"; string private constant INCORRECT_PRICE = "Gotta pay right money"; string private constant MINTED_OUT = "Max supply reached"; string public name; string public symbol; address private admin; uint16 public totalSupply; uint16 public counter = 0; uint16 public constant MAX_SUPPLY = 10000; // only first 10000 were minted IERC721 private MAYC = IERC721(0x60E4d786628Fea6478F785A6d7e704777c86a7c6); IERC721 private BAYC = IERC721(0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D); IERC721 private BAKC = IERC721(0xba30E5F9Bb24caa003E9f2f0497Ad287FDF95623); //function setMAYC(address _mayc) public {MAYC = IERC721(_mayc);} //helper for unit testing //IERC721 private MAYC = IERC721(0x6A8e25D0168B98e240d28a803e71ada93973F856); //IERC721 private BAYC = IERC721(0x6A8e25D0168B98e240d28a803e71ada93973F856); //IERC721 private BAKC = IERC721(address(0xdead)); SparkleMarket public market; uint256 public constant COST_MAYC = 0.042069 ether; uint256 public constant COST_PUBLIC = 0.069420 ether; uint8 constant MAX_MINT = 10; enum SaleStatus { Paused, Presale, Whitelist, Public } SaleStatus public saleMode; /*/////////////////////////////////////////////////////////////// ERC721 STORAGE //////////////////////////////////////////////////////////////*/ mapping(address => uint256) public balanceOf; mapping(uint256 => address) private preOf; mapping(uint256 => address) private publicOf; mapping(uint256 => address) public getApproved; mapping(address => mapping(address => bool)) public isApprovedForAll; /*/////////////////////////////////////////////////////////////// ERC721 LOGIC //////////////////////////////////////////////////////////////*/ function ownerOf(uint256 id) public view returns (address) { } function approve(address spender, uint256 id) external { } function setApprovalForAll(address operator, bool approved) external { } function transferFrom( address from, address to, uint256 id ) public { } function safeTransferFrom( address from, address to, uint256 id ) external { } function safeTransferFrom( address from, address to, uint256 id, bytes memory data ) external { } /*/////////////////////////////////////////////////////////////// ERC165 LOGIC //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) external pure returns (bool) { } modifier onlyAdmin() { } /*/////////////////////////////////////////////////////////////// VAYC SPECIFIC LOGIC //////////////////////////////////////////////////////////////*/ constructor(string memory _name, string memory _symbol) { } function saleToPause() external onlyAdmin { } function saleToPre() external onlyAdmin { } function saleToWhitelist() external onlyAdmin { } function saleToPublic() external onlyAdmin { } function withdraw() external onlyAdmin { } function mintPre(uint[] calldata tokenIds) external payable { require(saleMode == SaleStatus.Presale, NOT_LIVE); require(msg.value == COST_MAYC*tokenIds.length, INCORRECT_PRICE); require(totalSupply + tokenIds.length < MAX_SUPPLY, MINTED_OUT); for (uint i = 0; i < tokenIds.length; i++) { require(msg.sender == MAYC.ownerOf(tokenIds[i]), "Missing required token"); require(tokenIds[i] < MAX_SUPPLY, "TokenId too high"); } for (uint i = 0; i < tokenIds.length; i++) { require(<FILL_ME>) // Counter overflow is incredibly unrealistic. unchecked { balanceOf[msg.sender]++; } preOf[tokenIds[i]] = msg.sender; emit Transfer(address(0), msg.sender, tokenIds[i]); } unchecked{ totalSupply = totalSupply + (uint16(tokenIds.length)); } } function mintWL(uint16 num, uint tokenId) external payable { } function mintPublic(uint16 num) external payable { } function _mintY(uint16 num) internal { } // This function is here as a fallback in case we get undesirable gas consumption due to the // structure of the preOf array. if it does, the owner can pause the contract, mint the offending // token id and push public supply up to what it needs to be to get over O(n) SREAD operations in // the MAYC Array. // We may use it for promotions & giveaways. // One can monitor the deployment address for suspicious activity if you do not trust the devs. function mintAdmin(uint id, uint16 supplyOverwrite) external onlyAdmin { } function uintToString(uint256 value) internal pure returns (string memory) { } function tokenURI(uint256 id) external view returns (string memory) { } function marketTransferFrom(address from, address to, uint256 id) external { } } /// @notice A generic interface for a contract which properly accepts ERC721 tokens. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol) interface ERC721TokenReceiver { function onERC721Received( address operator, address from, uint256 id, bytes calldata data ) external returns (bytes4); }
ownerOf(tokenIds[i])==address(0),"ALREADY_MINTED"
293,755
ownerOf(tokenIds[i])==address(0)
MINTED_OUT
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// This file is forked from Solmate v6, /// We stand on the shoulders of giants /// Unnecessary functions have been deleted, mint, safeMint and burn /// Added our own mint functions, tweaked ownerOf to support our weirdness import "./SparkleMarket.sol"; interface IERC721 { function ownerOf(uint256 tokenId) external view returns (address owner); function setOwnerOf(uint256 id, address newOwner) external view returns (address owner); } /// @notice Modern, minimalist, and gas efficient ERC-721 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol) /// @dev Note that balanceOf does not revert if passed the zero address, in defiance of the ERC. contract VAYC { /*/////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 indexed id); event Approval(address indexed owner, address indexed spender, uint256 indexed id); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /*/////////////////////////////////////////////////////////////// METADATA STORAGE/LOGIC //////////////////////////////////////////////////////////////*/ string private constant NOT_LIVE = "Sale not live"; string private constant INCORRECT_PRICE = "Gotta pay right money"; string private constant MINTED_OUT = "Max supply reached"; string public name; string public symbol; address private admin; uint16 public totalSupply; uint16 public counter = 0; uint16 public constant MAX_SUPPLY = 10000; // only first 10000 were minted IERC721 private MAYC = IERC721(0x60E4d786628Fea6478F785A6d7e704777c86a7c6); IERC721 private BAYC = IERC721(0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D); IERC721 private BAKC = IERC721(0xba30E5F9Bb24caa003E9f2f0497Ad287FDF95623); //function setMAYC(address _mayc) public {MAYC = IERC721(_mayc);} //helper for unit testing //IERC721 private MAYC = IERC721(0x6A8e25D0168B98e240d28a803e71ada93973F856); //IERC721 private BAYC = IERC721(0x6A8e25D0168B98e240d28a803e71ada93973F856); //IERC721 private BAKC = IERC721(address(0xdead)); SparkleMarket public market; uint256 public constant COST_MAYC = 0.042069 ether; uint256 public constant COST_PUBLIC = 0.069420 ether; uint8 constant MAX_MINT = 10; enum SaleStatus { Paused, Presale, Whitelist, Public } SaleStatus public saleMode; /*/////////////////////////////////////////////////////////////// ERC721 STORAGE //////////////////////////////////////////////////////////////*/ mapping(address => uint256) public balanceOf; mapping(uint256 => address) private preOf; mapping(uint256 => address) private publicOf; mapping(uint256 => address) public getApproved; mapping(address => mapping(address => bool)) public isApprovedForAll; /*/////////////////////////////////////////////////////////////// ERC721 LOGIC //////////////////////////////////////////////////////////////*/ function ownerOf(uint256 id) public view returns (address) { } function approve(address spender, uint256 id) external { } function setApprovalForAll(address operator, bool approved) external { } function transferFrom( address from, address to, uint256 id ) public { } function safeTransferFrom( address from, address to, uint256 id ) external { } function safeTransferFrom( address from, address to, uint256 id, bytes memory data ) external { } /*/////////////////////////////////////////////////////////////// ERC165 LOGIC //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) external pure returns (bool) { } modifier onlyAdmin() { } /*/////////////////////////////////////////////////////////////// VAYC SPECIFIC LOGIC //////////////////////////////////////////////////////////////*/ constructor(string memory _name, string memory _symbol) { } function saleToPause() external onlyAdmin { } function saleToPre() external onlyAdmin { } function saleToWhitelist() external onlyAdmin { } function saleToPublic() external onlyAdmin { } function withdraw() external onlyAdmin { } function mintPre(uint[] calldata tokenIds) external payable { } function mintWL(uint16 num, uint tokenId) external payable { } function mintPublic(uint16 num) external payable { } function _mintY(uint16 num) internal { require(num <= MAX_MINT, "Max 10 per TX"); require(<FILL_ME>) require(msg.sender.code.length == 0, "Hack harder bot master"); // bypassable, but raises level of effort uint id = counter; uint num_already_minted = 0; while(num_already_minted < num){ if (preOf[id] == address(0)) { publicOf[id] = msg.sender; emit Transfer(address(0), msg.sender, id); num_already_minted += 1; } id += 1; } unchecked { balanceOf[msg.sender] += num; counter = uint16(id); totalSupply = totalSupply + num; } } // This function is here as a fallback in case we get undesirable gas consumption due to the // structure of the preOf array. if it does, the owner can pause the contract, mint the offending // token id and push public supply up to what it needs to be to get over O(n) SREAD operations in // the MAYC Array. // We may use it for promotions & giveaways. // One can monitor the deployment address for suspicious activity if you do not trust the devs. function mintAdmin(uint id, uint16 supplyOverwrite) external onlyAdmin { } function uintToString(uint256 value) internal pure returns (string memory) { } function tokenURI(uint256 id) external view returns (string memory) { } function marketTransferFrom(address from, address to, uint256 id) external { } } /// @notice A generic interface for a contract which properly accepts ERC721 tokens. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol) interface ERC721TokenReceiver { function onERC721Received( address operator, address from, uint256 id, bytes calldata data ) external returns (bytes4); }
totalSupply+num<MAX_SUPPLY,MINTED_OUT
293,755
totalSupply+num<MAX_SUPPLY
"Reserving would exceed max number of Pioneers to reserve"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** * @title KosiumPioneer * KosiumPioneer - a contract for my non-fungible creatures. */ contract KosiumPioneer is ERC721, Ownable { using SafeMath for uint256; string public baseURI; bool public saleIsActive = false; bool public presaleIsActive = false; uint256 public maxPioneerPurchase = 5; uint256 public maxPioneerPurchasePresale = 2; uint256 public constant pioneerPrice = 0.06 ether; uint256 public MAX_PIONEERS; uint256 public MAX_PRESALE_PIONEERS = 2000; uint256 public PIONEERS_RESERVED = 1000; uint256 public numReserved = 0; uint256 public numMinted = 0; mapping(address => bool) public whitelistedPresaleAddresses; mapping(address => uint256) public presaleBoughtCounts; constructor( uint256 maxNftSupply ) ERC721("Kosium Pioneer", "KPR") { } modifier userOnly{ } function withdraw() external onlyOwner { } /** * Returns base uri for token metadata. Called in ERC721 tokenURI(tokenId) */ function _baseURI() internal view virtual override returns (string memory) { } /** * Changes URI used to get token metadata */ function setBaseTokenURI(string memory newBaseURI) public onlyOwner { } /** * Mints numToMint tokens to an address */ function mintTo(address _to, uint numToMint) internal { require(<FILL_ME>) for (uint i = 0; i < numToMint; i++) { _safeMint(_to, numMinted); ++numMinted; } } /** * Set some Kosium Pioneers aside */ function reservePioneers(address _to, uint numberToReserve) external onlyOwner { } /* * Pause sale if active, make active if paused */ function flipSaleState() external onlyOwner { } /* * Pause presale if active, make active if paused */ function flipPresaleState() external onlyOwner { } /** * Mints Kosium Pioneers that have already been bought through pledge */ function mintPioneer(uint numberOfTokens) external payable userOnly { } /** * Mints Kosium Pioneers for presale */ function mintPresalePioneer(uint numberOfTokens) external payable userOnly { } /* * Add users to the whitelist for the presale */ function whitelistAddressForPresale(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Remove users from the whitelist for the presale */ function removeFromWhitelist(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Change the max presale limit */ function setPresaleLimit(uint maxToPresale) public onlyOwner{ } /* * Change the reserved number of Pioneers */ function setReserveLimit(uint reservedLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the open sale */ function setPurchaseLimit(uint purchaseLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the presale */ function setPurchaseLimitPresale(uint purchaseLimit) public onlyOwner{ } }
numMinted+numToMint<=MAX_PIONEERS,"Reserving would exceed max number of Pioneers to reserve"
293,913
numMinted+numToMint<=MAX_PIONEERS
"Reserving would exceed max number of Pioneers to reserve"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** * @title KosiumPioneer * KosiumPioneer - a contract for my non-fungible creatures. */ contract KosiumPioneer is ERC721, Ownable { using SafeMath for uint256; string public baseURI; bool public saleIsActive = false; bool public presaleIsActive = false; uint256 public maxPioneerPurchase = 5; uint256 public maxPioneerPurchasePresale = 2; uint256 public constant pioneerPrice = 0.06 ether; uint256 public MAX_PIONEERS; uint256 public MAX_PRESALE_PIONEERS = 2000; uint256 public PIONEERS_RESERVED = 1000; uint256 public numReserved = 0; uint256 public numMinted = 0; mapping(address => bool) public whitelistedPresaleAddresses; mapping(address => uint256) public presaleBoughtCounts; constructor( uint256 maxNftSupply ) ERC721("Kosium Pioneer", "KPR") { } modifier userOnly{ } function withdraw() external onlyOwner { } /** * Returns base uri for token metadata. Called in ERC721 tokenURI(tokenId) */ function _baseURI() internal view virtual override returns (string memory) { } /** * Changes URI used to get token metadata */ function setBaseTokenURI(string memory newBaseURI) public onlyOwner { } /** * Mints numToMint tokens to an address */ function mintTo(address _to, uint numToMint) internal { } /** * Set some Kosium Pioneers aside */ function reservePioneers(address _to, uint numberToReserve) external onlyOwner { require(<FILL_ME>) mintTo(_to, numberToReserve); numReserved += numberToReserve; } /* * Pause sale if active, make active if paused */ function flipSaleState() external onlyOwner { } /* * Pause presale if active, make active if paused */ function flipPresaleState() external onlyOwner { } /** * Mints Kosium Pioneers that have already been bought through pledge */ function mintPioneer(uint numberOfTokens) external payable userOnly { } /** * Mints Kosium Pioneers for presale */ function mintPresalePioneer(uint numberOfTokens) external payable userOnly { } /* * Add users to the whitelist for the presale */ function whitelistAddressForPresale(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Remove users from the whitelist for the presale */ function removeFromWhitelist(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Change the max presale limit */ function setPresaleLimit(uint maxToPresale) public onlyOwner{ } /* * Change the reserved number of Pioneers */ function setReserveLimit(uint reservedLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the open sale */ function setPurchaseLimit(uint purchaseLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the presale */ function setPurchaseLimitPresale(uint purchaseLimit) public onlyOwner{ } }
numReserved+numberToReserve<=PIONEERS_RESERVED,"Reserving would exceed max number of Pioneers to reserve"
293,913
numReserved+numberToReserve<=PIONEERS_RESERVED
"Purchase would exceed max supply of Pioneers"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** * @title KosiumPioneer * KosiumPioneer - a contract for my non-fungible creatures. */ contract KosiumPioneer is ERC721, Ownable { using SafeMath for uint256; string public baseURI; bool public saleIsActive = false; bool public presaleIsActive = false; uint256 public maxPioneerPurchase = 5; uint256 public maxPioneerPurchasePresale = 2; uint256 public constant pioneerPrice = 0.06 ether; uint256 public MAX_PIONEERS; uint256 public MAX_PRESALE_PIONEERS = 2000; uint256 public PIONEERS_RESERVED = 1000; uint256 public numReserved = 0; uint256 public numMinted = 0; mapping(address => bool) public whitelistedPresaleAddresses; mapping(address => uint256) public presaleBoughtCounts; constructor( uint256 maxNftSupply ) ERC721("Kosium Pioneer", "KPR") { } modifier userOnly{ } function withdraw() external onlyOwner { } /** * Returns base uri for token metadata. Called in ERC721 tokenURI(tokenId) */ function _baseURI() internal view virtual override returns (string memory) { } /** * Changes URI used to get token metadata */ function setBaseTokenURI(string memory newBaseURI) public onlyOwner { } /** * Mints numToMint tokens to an address */ function mintTo(address _to, uint numToMint) internal { } /** * Set some Kosium Pioneers aside */ function reservePioneers(address _to, uint numberToReserve) external onlyOwner { } /* * Pause sale if active, make active if paused */ function flipSaleState() external onlyOwner { } /* * Pause presale if active, make active if paused */ function flipPresaleState() external onlyOwner { } /** * Mints Kosium Pioneers that have already been bought through pledge */ function mintPioneer(uint numberOfTokens) external payable userOnly { require(saleIsActive, "Sale must be active to mint Pioneer"); require(numberOfTokens <= maxPioneerPurchase, "Can't mint that many tokens at a time"); require(<FILL_ME>) require(pioneerPrice.mul(numberOfTokens) <= msg.value, "Ether value sent is not correct"); mintTo(msg.sender, numberOfTokens); } /** * Mints Kosium Pioneers for presale */ function mintPresalePioneer(uint numberOfTokens) external payable userOnly { } /* * Add users to the whitelist for the presale */ function whitelistAddressForPresale(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Remove users from the whitelist for the presale */ function removeFromWhitelist(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Change the max presale limit */ function setPresaleLimit(uint maxToPresale) public onlyOwner{ } /* * Change the reserved number of Pioneers */ function setReserveLimit(uint reservedLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the open sale */ function setPurchaseLimit(uint purchaseLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the presale */ function setPurchaseLimitPresale(uint purchaseLimit) public onlyOwner{ } }
numMinted+numberOfTokens<=MAX_PIONEERS-PIONEERS_RESERVED+numReserved,"Purchase would exceed max supply of Pioneers"
293,913
numMinted+numberOfTokens<=MAX_PIONEERS-PIONEERS_RESERVED+numReserved
"Ether value sent is not correct"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** * @title KosiumPioneer * KosiumPioneer - a contract for my non-fungible creatures. */ contract KosiumPioneer is ERC721, Ownable { using SafeMath for uint256; string public baseURI; bool public saleIsActive = false; bool public presaleIsActive = false; uint256 public maxPioneerPurchase = 5; uint256 public maxPioneerPurchasePresale = 2; uint256 public constant pioneerPrice = 0.06 ether; uint256 public MAX_PIONEERS; uint256 public MAX_PRESALE_PIONEERS = 2000; uint256 public PIONEERS_RESERVED = 1000; uint256 public numReserved = 0; uint256 public numMinted = 0; mapping(address => bool) public whitelistedPresaleAddresses; mapping(address => uint256) public presaleBoughtCounts; constructor( uint256 maxNftSupply ) ERC721("Kosium Pioneer", "KPR") { } modifier userOnly{ } function withdraw() external onlyOwner { } /** * Returns base uri for token metadata. Called in ERC721 tokenURI(tokenId) */ function _baseURI() internal view virtual override returns (string memory) { } /** * Changes URI used to get token metadata */ function setBaseTokenURI(string memory newBaseURI) public onlyOwner { } /** * Mints numToMint tokens to an address */ function mintTo(address _to, uint numToMint) internal { } /** * Set some Kosium Pioneers aside */ function reservePioneers(address _to, uint numberToReserve) external onlyOwner { } /* * Pause sale if active, make active if paused */ function flipSaleState() external onlyOwner { } /* * Pause presale if active, make active if paused */ function flipPresaleState() external onlyOwner { } /** * Mints Kosium Pioneers that have already been bought through pledge */ function mintPioneer(uint numberOfTokens) external payable userOnly { require(saleIsActive, "Sale must be active to mint Pioneer"); require(numberOfTokens <= maxPioneerPurchase, "Can't mint that many tokens at a time"); require(numMinted + numberOfTokens <= MAX_PIONEERS - PIONEERS_RESERVED + numReserved, "Purchase would exceed max supply of Pioneers"); require(<FILL_ME>) mintTo(msg.sender, numberOfTokens); } /** * Mints Kosium Pioneers for presale */ function mintPresalePioneer(uint numberOfTokens) external payable userOnly { } /* * Add users to the whitelist for the presale */ function whitelistAddressForPresale(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Remove users from the whitelist for the presale */ function removeFromWhitelist(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Change the max presale limit */ function setPresaleLimit(uint maxToPresale) public onlyOwner{ } /* * Change the reserved number of Pioneers */ function setReserveLimit(uint reservedLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the open sale */ function setPurchaseLimit(uint purchaseLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the presale */ function setPurchaseLimitPresale(uint purchaseLimit) public onlyOwner{ } }
pioneerPrice.mul(numberOfTokens)<=msg.value,"Ether value sent is not correct"
293,913
pioneerPrice.mul(numberOfTokens)<=msg.value
"Sender address must be whitelisted for presale minting"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** * @title KosiumPioneer * KosiumPioneer - a contract for my non-fungible creatures. */ contract KosiumPioneer is ERC721, Ownable { using SafeMath for uint256; string public baseURI; bool public saleIsActive = false; bool public presaleIsActive = false; uint256 public maxPioneerPurchase = 5; uint256 public maxPioneerPurchasePresale = 2; uint256 public constant pioneerPrice = 0.06 ether; uint256 public MAX_PIONEERS; uint256 public MAX_PRESALE_PIONEERS = 2000; uint256 public PIONEERS_RESERVED = 1000; uint256 public numReserved = 0; uint256 public numMinted = 0; mapping(address => bool) public whitelistedPresaleAddresses; mapping(address => uint256) public presaleBoughtCounts; constructor( uint256 maxNftSupply ) ERC721("Kosium Pioneer", "KPR") { } modifier userOnly{ } function withdraw() external onlyOwner { } /** * Returns base uri for token metadata. Called in ERC721 tokenURI(tokenId) */ function _baseURI() internal view virtual override returns (string memory) { } /** * Changes URI used to get token metadata */ function setBaseTokenURI(string memory newBaseURI) public onlyOwner { } /** * Mints numToMint tokens to an address */ function mintTo(address _to, uint numToMint) internal { } /** * Set some Kosium Pioneers aside */ function reservePioneers(address _to, uint numberToReserve) external onlyOwner { } /* * Pause sale if active, make active if paused */ function flipSaleState() external onlyOwner { } /* * Pause presale if active, make active if paused */ function flipPresaleState() external onlyOwner { } /** * Mints Kosium Pioneers that have already been bought through pledge */ function mintPioneer(uint numberOfTokens) external payable userOnly { } /** * Mints Kosium Pioneers for presale */ function mintPresalePioneer(uint numberOfTokens) external payable userOnly { require(presaleIsActive, "Presale must be active to mint Pioneer"); require(<FILL_ME>) require(numberOfTokens + presaleBoughtCounts[msg.sender] <= maxPioneerPurchasePresale, "This whitelisted address cannot mint this many Pioneers in the presale."); uint newSupplyTotal = numMinted + numberOfTokens; require(newSupplyTotal <= MAX_PRESALE_PIONEERS + numReserved, "Purchase would exceed max supply of Presale Pioneers"); require(newSupplyTotal <= MAX_PIONEERS - PIONEERS_RESERVED + numReserved, "Purchase would exceed max supply of Pioneers"); require(pioneerPrice.mul(numberOfTokens) <= msg.value, "Provided ETH is below the required price"); mintTo(msg.sender, numberOfTokens); presaleBoughtCounts[msg.sender] += numberOfTokens; } /* * Add users to the whitelist for the presale */ function whitelistAddressForPresale(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Remove users from the whitelist for the presale */ function removeFromWhitelist(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Change the max presale limit */ function setPresaleLimit(uint maxToPresale) public onlyOwner{ } /* * Change the reserved number of Pioneers */ function setReserveLimit(uint reservedLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the open sale */ function setPurchaseLimit(uint purchaseLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the presale */ function setPurchaseLimitPresale(uint purchaseLimit) public onlyOwner{ } }
whitelistedPresaleAddresses[msg.sender],"Sender address must be whitelisted for presale minting"
293,913
whitelistedPresaleAddresses[msg.sender]
"This whitelisted address cannot mint this many Pioneers in the presale."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** * @title KosiumPioneer * KosiumPioneer - a contract for my non-fungible creatures. */ contract KosiumPioneer is ERC721, Ownable { using SafeMath for uint256; string public baseURI; bool public saleIsActive = false; bool public presaleIsActive = false; uint256 public maxPioneerPurchase = 5; uint256 public maxPioneerPurchasePresale = 2; uint256 public constant pioneerPrice = 0.06 ether; uint256 public MAX_PIONEERS; uint256 public MAX_PRESALE_PIONEERS = 2000; uint256 public PIONEERS_RESERVED = 1000; uint256 public numReserved = 0; uint256 public numMinted = 0; mapping(address => bool) public whitelistedPresaleAddresses; mapping(address => uint256) public presaleBoughtCounts; constructor( uint256 maxNftSupply ) ERC721("Kosium Pioneer", "KPR") { } modifier userOnly{ } function withdraw() external onlyOwner { } /** * Returns base uri for token metadata. Called in ERC721 tokenURI(tokenId) */ function _baseURI() internal view virtual override returns (string memory) { } /** * Changes URI used to get token metadata */ function setBaseTokenURI(string memory newBaseURI) public onlyOwner { } /** * Mints numToMint tokens to an address */ function mintTo(address _to, uint numToMint) internal { } /** * Set some Kosium Pioneers aside */ function reservePioneers(address _to, uint numberToReserve) external onlyOwner { } /* * Pause sale if active, make active if paused */ function flipSaleState() external onlyOwner { } /* * Pause presale if active, make active if paused */ function flipPresaleState() external onlyOwner { } /** * Mints Kosium Pioneers that have already been bought through pledge */ function mintPioneer(uint numberOfTokens) external payable userOnly { } /** * Mints Kosium Pioneers for presale */ function mintPresalePioneer(uint numberOfTokens) external payable userOnly { require(presaleIsActive, "Presale must be active to mint Pioneer"); require(whitelistedPresaleAddresses[msg.sender], "Sender address must be whitelisted for presale minting"); require(<FILL_ME>) uint newSupplyTotal = numMinted + numberOfTokens; require(newSupplyTotal <= MAX_PRESALE_PIONEERS + numReserved, "Purchase would exceed max supply of Presale Pioneers"); require(newSupplyTotal <= MAX_PIONEERS - PIONEERS_RESERVED + numReserved, "Purchase would exceed max supply of Pioneers"); require(pioneerPrice.mul(numberOfTokens) <= msg.value, "Provided ETH is below the required price"); mintTo(msg.sender, numberOfTokens); presaleBoughtCounts[msg.sender] += numberOfTokens; } /* * Add users to the whitelist for the presale */ function whitelistAddressForPresale(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Remove users from the whitelist for the presale */ function removeFromWhitelist(address[] calldata earlyAdopterAddresses) external onlyOwner{ } /* * Change the max presale limit */ function setPresaleLimit(uint maxToPresale) public onlyOwner{ } /* * Change the reserved number of Pioneers */ function setReserveLimit(uint reservedLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the open sale */ function setPurchaseLimit(uint purchaseLimit) public onlyOwner{ } /* * Change the max number of pioneers each account can purchase at a time in the presale */ function setPurchaseLimitPresale(uint purchaseLimit) public onlyOwner{ } }
numberOfTokens+presaleBoughtCounts[msg.sender]<=maxPioneerPurchasePresale,"This whitelisted address cannot mint this many Pioneers in the presale."
293,913
numberOfTokens+presaleBoughtCounts[msg.sender]<=maxPioneerPurchasePresale
null
/* Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.6; contract ADKContract { /* This is the main wADK Contract (ERC20 Implementation): Ethereum wrapped AidosKuneen Token. The purpose of this contract is to enable transfer of ADK Token from/to the ADK Mesh to/from the Ethereum Blockchain For details see https://github.com/adkmaster/adk-ethereum-bridge How it works (short version): Transfers from Mesh to Ethereum (ADK to wADK): ADK holders on the ADK Mesh transfer the amount of ADK they wish to convert to wADK (1:1 conversion) to the ADK Mesh address ADK_DEPOSIT_ADDRESS_LIVE. The signature part (=Message/Smart Data Section) of the + ADK transaction has to contain the encoded 'receiving' Ethereum Address (use functions USR_ETHAddrEncode and USR_ETHAddrDecode to convert from ADK SmartData String to Ethereum Adress and vice versa) Once the ADK transaction has been confirmed on the ADK Mesh, the issuance of wADK will be triggered by the Contract owner specified in mainMeshOwner. The original ADK will remain locked in the ADK_DEPOSIT_ADDRESS_LIVE (and previous ADK deposit addresses) until a request for a conversion transaction wADK-->ADK is triggered (see below). Transfers from Ethereum (wADK) to Mesh (ADK): wADK holders can request a transfer from the Ethereum Blockchain back to the Mesh (1:1 conversion) by calling the contract function "USR_transferToMesh". Registered requests will be executed periodically, with ADK to be issued from previously locked ADK, at which time a new public ADK_DEPOSIT_ADDRESS_LIVE will be generated as needed. ******************************************************************************************************************** DISCLAIMER: THE CROSS-CHAIN COMPONENT OF THIS CONTRACT IS **NOT** A TRUSTLESS BRIDGE, AS THAT WOULD REQUIRE ADK TO IMPLEMENT SMART CONTRACT CAPABILITIES. INSTEAD, THIS CONTRACT (the MESH-ETHEREUM Bridge Part) NEEDS TO BE OPERATED BY A TRUSTED PARTY, e.g. the Aidos Foundation (Milestone Server Operator) OR TRUSTED DELEGATE. Note: THIS ONLY APPLIES TO THE TRANSFER FROM/TO THE MESH. ONCE ISSUED, wADK FOLLOW THE ERC20 STANDARD (TRUSTLESS TRANSACTIONS) ******************************************************************************************************************** Fur further details, step by step HOW-TOs, and latest updates please see https://github.com/adkmaster/adk-ethereum-bridge */ uint256 public totalSupply; uint256 constant private MAX_UINT256 = 2**256 - 1; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; string public name; // Aidos Kuneen Wrapped ADK uint8 public decimals; // 8 string public symbol; // ADK address public mainMeshOwner; //the 'mesh owner', holds all token still inside the ADK Mesh (if not in circulation as wADK) address public statusAddress; // is the request status admin, an address which can update user request stati. /* ADK_DEPOSIT_ADDRESS_LIVE holds the most recent ADK MESH DEPOSIT ADDRESS. THIS IS THE ADK ADDRESS THAT MUST BE USED WHEN SENDING ADK to wADK (Ethereum) NOTE: THIS ADDRESS WILL CHANGE REGULARLY. ENSURE YOU ALWAYS USE THE LATEST ONE */ string public ADK_DEPOSIT_ADDRESS_LIVE; /* ADK_DEPOSIT_ADDRESS_PREVIOUS is the PREVIOUS live address. ADK Deposits to this address will still be credited, BUT: Do not use this address for any new deposits. The purpose of keeping this address active is solely to capture any pending transactions at the time of address change. Note: Transfers to even older deposit addresses will still be ATTEMPTED to be credited by manually transferring them to a live address, but are at risk due to multi-spends (winternitz one-time signature). Long story short: Always!! use the latest ADK_DEPOSIT_ADDRESS_LIVE ADK address when sending ADK */ string public ADK_DEPOSIT_ADDRESS_PREVIOUS; uint256 public ADKDepositAddrCount; // Total number of historical ADK Mesh Contract deposit addresses mapping (uint256 => string) public ADKDepositAddrHistory; // holds the history of all ADK Mesh deposit addresses uint256 public requestID; // counter / unique request ID mapping (uint256 => string) public requestStatus; // Can be used to provide feedback to users re. status of their ADK/wADK requests. /* minimumADKforXChainTransfer: Indicates the minimum ADK or mADK required to transfer cross-chain. Note: value is in ADK Subunits, where 100000000 subADK = 1 ADK, i.e. 1.00000000 ADK */ uint256 public minimumADKforXChainTransfer; // CONSTRUCTOR constructor( // EIP20 Standard uint256 _initialAmount, string memory _tokenName, uint8 _decimalUnits, string memory _tokenSymbol ) { } // ERC20 events // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); // Standard ERC20 transfer Function function transfer(address _to, uint256 _value) public returns (bool success) { require(balances[msg.sender] >= _value); require(<FILL_ME>) // prevent accidental send of tokens to the contract itself! RTFM people! balances[msg.sender] -= _value; balances[_to] += _value; emit Transfer(msg.sender, _to, _value); //solhint-disable-line indent, no-unused-vars return true; } // Standard ERC20 transferFrom Function function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } // Standard ERC20 approve Function function approve(address _spender, uint256 _value) public returns (bool success) { } // Standard ERC20 balanceOf Function function balanceOf(address _owner) public view returns (uint256 balance) { } // Standard ERC20 allowance Function function allowance(address _owner, address _spender) public view returns (uint256 remaining) { } /// END DEFAULT ERC20 FUNCTIONS // MODIFIERS modifier onlyOwnerOrStatusAdmin { } modifier onlyOwner { } /// BEGIN CUSTOM ADK FEATURES // ADM_setNewMinADKLimit: Sets the min-ADK X-Chain Transfer limit function ADM_setNewMinADKLimit(uint256 _newLimit) public onlyOwner { } // ADM_setNewStatusAdmin: Update the admin/Ethereum Address which is able to update user request status function ADM_setNewStatusAdmin(address _newAdmin) public onlyOwner { } // ADM_setNewOwner: Change the owner/Ethereum Address which holds the Mesh Locked Token Balance function ADM_setNewOwner(address _newOwner) public onlyOwner { } // Custom EVENTS event EvtTransferFromMesh(address _receiver, address _mesh_address, string _adk_address, uint256 _value); event EvtTransferToMesh(address _sender, address _mesh_address, string _adk_address, uint256 _value, uint256 _requestID, uint256 _fees); event EvtADKDepositAddressUpd(string ADK_DEPOSIT_ADDRESS_LIVE); event EvtStatusChanged(uint256 _requestID, string _oldStatus, string _newStatus); // Check if an address only contains 9A-Z, and is 81 or 90 char long modifier requireValidADKAddress (string memory _adk_address) { } /* USR_transferToMesh: Called by users to request a transfer from wADK (Ethereum ERC20) back to ADK (Mesh) Note: This just calls the standard transfer function using the main Mesh Address, but logs also the target ADK address for processing. Note2: This function is PAYABLE as it will be possible to attach a fee to the transfer request in order to expedite the ADK mesh-release */ function USR_transferToMesh(string memory _adk_address, uint256 _value) payable requireValidADKAddress (_adk_address) public { } // ADM_transferFromMesh: function invoked by the ADK Mesh Milestone Server (or delegate) to unlock wADK and send wADK Token to the Ethereum address (specified by the user in the Smard Data field when depositing ADK for conversion) function ADM_transferFromMesh(address _receiver, uint256 _value, string memory _from_adk_address) public { } // ADM_updateMeshDepositAddress: Sets a new live ADK Mesh Deposit address, to be used for transfers from the Mesh to wADK function ADM_updateMeshDepositAddress(string memory _new_deposit_adk_address) public onlyOwnerOrStatusAdmin requireValidADKAddress (_new_deposit_adk_address){ } // ADM_updateRequestStatus: allows a status admin to update request stati (feedback to users) function ADM_updateRequestStatus(uint256 _requestID, string memory _status) public onlyOwnerOrStatusAdmin { } /* USR_ETHAddrEncode and USR_ETHAddrDecode: Helper functions for en- and decoding of Eth Addresses as ADK compatible strings i.e. a 1:1 conversion from an Ethereum Address to an ADK compatible String, and vice versa USR_ETHAddrEncode: ENCODES/CONVERTS ETHEREUM ADDRESS to an ADK compatible String using only 9A-Z This is a PURE function (can be run without gas), and needs to be used by a user who wants to transfer ADK from the mesh to wADK. The 9AZ encoded eth address is included in the Mesh transaction to specify the target Ethereum Address that should receive the wADK */ function USR_ETHAddrEncode(bytes memory ethAddr) public pure returns(string memory) { } /* USR_ETHAddrDecode: DECODES an ETHEREUM ADDRESS from an ADK compatible String only 9A-Z (i.e. a 1:1 conversion from an ADK-Encoded Ethereum Address String to back an actual Ethereum Address) This is a PURE function (can be run without gas), and will be used by the Mesh Milestone Node to specify the target Ethereum Address that should receive the wADK */ function USR_ETHAddrDecode(string memory adkString) public pure returns(address) { } // utilBytesToAddress: Helper function to convert 20 bytes to a properly formated Ethereum address function utilBytesToAddress(bytes memory bys) private pure returns (address addr) { } // ETH FEE COLLECTION FUNCTIONS: // The following functions are NOT related the ADK token, but are used to manage any ETH Fees, // that were sent to the contract address. It will cater for future features such as expedited // processing (i.e. if the default processing time is too slow) event EvtReceivedGeneric(address, uint); event EvtReceivedFee(address, uint, string); // Fees sent to address where no _feeInfo string is required receive() external payable { } // ADM_CollectFees: collect any ETH fees sent to the contract and forward to the specified address for processing function ADM_CollectFees(address payable _collectToAddress, uint256 _value) onlyOwnerOrStatusAdmin public { } // USR_FeePayment: Allows users to pay fees for additional services, check main website/github for details function USR_FeePayment(string memory _feeInfo) payable public { } }
address(this)!=_to
293,926
address(this)!=_to
null
/* Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.6; contract ADKContract { /* This is the main wADK Contract (ERC20 Implementation): Ethereum wrapped AidosKuneen Token. The purpose of this contract is to enable transfer of ADK Token from/to the ADK Mesh to/from the Ethereum Blockchain For details see https://github.com/adkmaster/adk-ethereum-bridge How it works (short version): Transfers from Mesh to Ethereum (ADK to wADK): ADK holders on the ADK Mesh transfer the amount of ADK they wish to convert to wADK (1:1 conversion) to the ADK Mesh address ADK_DEPOSIT_ADDRESS_LIVE. The signature part (=Message/Smart Data Section) of the + ADK transaction has to contain the encoded 'receiving' Ethereum Address (use functions USR_ETHAddrEncode and USR_ETHAddrDecode to convert from ADK SmartData String to Ethereum Adress and vice versa) Once the ADK transaction has been confirmed on the ADK Mesh, the issuance of wADK will be triggered by the Contract owner specified in mainMeshOwner. The original ADK will remain locked in the ADK_DEPOSIT_ADDRESS_LIVE (and previous ADK deposit addresses) until a request for a conversion transaction wADK-->ADK is triggered (see below). Transfers from Ethereum (wADK) to Mesh (ADK): wADK holders can request a transfer from the Ethereum Blockchain back to the Mesh (1:1 conversion) by calling the contract function "USR_transferToMesh". Registered requests will be executed periodically, with ADK to be issued from previously locked ADK, at which time a new public ADK_DEPOSIT_ADDRESS_LIVE will be generated as needed. ******************************************************************************************************************** DISCLAIMER: THE CROSS-CHAIN COMPONENT OF THIS CONTRACT IS **NOT** A TRUSTLESS BRIDGE, AS THAT WOULD REQUIRE ADK TO IMPLEMENT SMART CONTRACT CAPABILITIES. INSTEAD, THIS CONTRACT (the MESH-ETHEREUM Bridge Part) NEEDS TO BE OPERATED BY A TRUSTED PARTY, e.g. the Aidos Foundation (Milestone Server Operator) OR TRUSTED DELEGATE. Note: THIS ONLY APPLIES TO THE TRANSFER FROM/TO THE MESH. ONCE ISSUED, wADK FOLLOW THE ERC20 STANDARD (TRUSTLESS TRANSACTIONS) ******************************************************************************************************************** Fur further details, step by step HOW-TOs, and latest updates please see https://github.com/adkmaster/adk-ethereum-bridge */ uint256 public totalSupply; uint256 constant private MAX_UINT256 = 2**256 - 1; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; string public name; // Aidos Kuneen Wrapped ADK uint8 public decimals; // 8 string public symbol; // ADK address public mainMeshOwner; //the 'mesh owner', holds all token still inside the ADK Mesh (if not in circulation as wADK) address public statusAddress; // is the request status admin, an address which can update user request stati. /* ADK_DEPOSIT_ADDRESS_LIVE holds the most recent ADK MESH DEPOSIT ADDRESS. THIS IS THE ADK ADDRESS THAT MUST BE USED WHEN SENDING ADK to wADK (Ethereum) NOTE: THIS ADDRESS WILL CHANGE REGULARLY. ENSURE YOU ALWAYS USE THE LATEST ONE */ string public ADK_DEPOSIT_ADDRESS_LIVE; /* ADK_DEPOSIT_ADDRESS_PREVIOUS is the PREVIOUS live address. ADK Deposits to this address will still be credited, BUT: Do not use this address for any new deposits. The purpose of keeping this address active is solely to capture any pending transactions at the time of address change. Note: Transfers to even older deposit addresses will still be ATTEMPTED to be credited by manually transferring them to a live address, but are at risk due to multi-spends (winternitz one-time signature). Long story short: Always!! use the latest ADK_DEPOSIT_ADDRESS_LIVE ADK address when sending ADK */ string public ADK_DEPOSIT_ADDRESS_PREVIOUS; uint256 public ADKDepositAddrCount; // Total number of historical ADK Mesh Contract deposit addresses mapping (uint256 => string) public ADKDepositAddrHistory; // holds the history of all ADK Mesh deposit addresses uint256 public requestID; // counter / unique request ID mapping (uint256 => string) public requestStatus; // Can be used to provide feedback to users re. status of their ADK/wADK requests. /* minimumADKforXChainTransfer: Indicates the minimum ADK or mADK required to transfer cross-chain. Note: value is in ADK Subunits, where 100000000 subADK = 1 ADK, i.e. 1.00000000 ADK */ uint256 public minimumADKforXChainTransfer; // CONSTRUCTOR constructor( // EIP20 Standard uint256 _initialAmount, string memory _tokenName, uint8 _decimalUnits, string memory _tokenSymbol ) { } // ERC20 events // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); // Standard ERC20 transfer Function function transfer(address _to, uint256 _value) public returns (bool success) { } // Standard ERC20 transferFrom Function function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { uint256 vallowance = allowed[_from][msg.sender]; require(<FILL_ME>) balances[_to] += _value; balances[_from] -= _value; if (vallowance < MAX_UINT256) { allowed[_from][msg.sender] -= _value; } emit Transfer(_from, _to, _value); //solhint-disable-line indent, no-unused-vars return true; } // Standard ERC20 approve Function function approve(address _spender, uint256 _value) public returns (bool success) { } // Standard ERC20 balanceOf Function function balanceOf(address _owner) public view returns (uint256 balance) { } // Standard ERC20 allowance Function function allowance(address _owner, address _spender) public view returns (uint256 remaining) { } /// END DEFAULT ERC20 FUNCTIONS // MODIFIERS modifier onlyOwnerOrStatusAdmin { } modifier onlyOwner { } /// BEGIN CUSTOM ADK FEATURES // ADM_setNewMinADKLimit: Sets the min-ADK X-Chain Transfer limit function ADM_setNewMinADKLimit(uint256 _newLimit) public onlyOwner { } // ADM_setNewStatusAdmin: Update the admin/Ethereum Address which is able to update user request status function ADM_setNewStatusAdmin(address _newAdmin) public onlyOwner { } // ADM_setNewOwner: Change the owner/Ethereum Address which holds the Mesh Locked Token Balance function ADM_setNewOwner(address _newOwner) public onlyOwner { } // Custom EVENTS event EvtTransferFromMesh(address _receiver, address _mesh_address, string _adk_address, uint256 _value); event EvtTransferToMesh(address _sender, address _mesh_address, string _adk_address, uint256 _value, uint256 _requestID, uint256 _fees); event EvtADKDepositAddressUpd(string ADK_DEPOSIT_ADDRESS_LIVE); event EvtStatusChanged(uint256 _requestID, string _oldStatus, string _newStatus); // Check if an address only contains 9A-Z, and is 81 or 90 char long modifier requireValidADKAddress (string memory _adk_address) { } /* USR_transferToMesh: Called by users to request a transfer from wADK (Ethereum ERC20) back to ADK (Mesh) Note: This just calls the standard transfer function using the main Mesh Address, but logs also the target ADK address for processing. Note2: This function is PAYABLE as it will be possible to attach a fee to the transfer request in order to expedite the ADK mesh-release */ function USR_transferToMesh(string memory _adk_address, uint256 _value) payable requireValidADKAddress (_adk_address) public { } // ADM_transferFromMesh: function invoked by the ADK Mesh Milestone Server (or delegate) to unlock wADK and send wADK Token to the Ethereum address (specified by the user in the Smard Data field when depositing ADK for conversion) function ADM_transferFromMesh(address _receiver, uint256 _value, string memory _from_adk_address) public { } // ADM_updateMeshDepositAddress: Sets a new live ADK Mesh Deposit address, to be used for transfers from the Mesh to wADK function ADM_updateMeshDepositAddress(string memory _new_deposit_adk_address) public onlyOwnerOrStatusAdmin requireValidADKAddress (_new_deposit_adk_address){ } // ADM_updateRequestStatus: allows a status admin to update request stati (feedback to users) function ADM_updateRequestStatus(uint256 _requestID, string memory _status) public onlyOwnerOrStatusAdmin { } /* USR_ETHAddrEncode and USR_ETHAddrDecode: Helper functions for en- and decoding of Eth Addresses as ADK compatible strings i.e. a 1:1 conversion from an Ethereum Address to an ADK compatible String, and vice versa USR_ETHAddrEncode: ENCODES/CONVERTS ETHEREUM ADDRESS to an ADK compatible String using only 9A-Z This is a PURE function (can be run without gas), and needs to be used by a user who wants to transfer ADK from the mesh to wADK. The 9AZ encoded eth address is included in the Mesh transaction to specify the target Ethereum Address that should receive the wADK */ function USR_ETHAddrEncode(bytes memory ethAddr) public pure returns(string memory) { } /* USR_ETHAddrDecode: DECODES an ETHEREUM ADDRESS from an ADK compatible String only 9A-Z (i.e. a 1:1 conversion from an ADK-Encoded Ethereum Address String to back an actual Ethereum Address) This is a PURE function (can be run without gas), and will be used by the Mesh Milestone Node to specify the target Ethereum Address that should receive the wADK */ function USR_ETHAddrDecode(string memory adkString) public pure returns(address) { } // utilBytesToAddress: Helper function to convert 20 bytes to a properly formated Ethereum address function utilBytesToAddress(bytes memory bys) private pure returns (address addr) { } // ETH FEE COLLECTION FUNCTIONS: // The following functions are NOT related the ADK token, but are used to manage any ETH Fees, // that were sent to the contract address. It will cater for future features such as expedited // processing (i.e. if the default processing time is too slow) event EvtReceivedGeneric(address, uint); event EvtReceivedFee(address, uint, string); // Fees sent to address where no _feeInfo string is required receive() external payable { } // ADM_CollectFees: collect any ETH fees sent to the contract and forward to the specified address for processing function ADM_CollectFees(address payable _collectToAddress, uint256 _value) onlyOwnerOrStatusAdmin public { } // USR_FeePayment: Allows users to pay fees for additional services, check main website/github for details function USR_FeePayment(string memory _feeInfo) payable public { } }
balances[_from]>=_value&&vallowance>=_value
293,926
balances[_from]>=_value&&vallowance>=_value
null
/* Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.6; contract ADKContract { /* This is the main wADK Contract (ERC20 Implementation): Ethereum wrapped AidosKuneen Token. The purpose of this contract is to enable transfer of ADK Token from/to the ADK Mesh to/from the Ethereum Blockchain For details see https://github.com/adkmaster/adk-ethereum-bridge How it works (short version): Transfers from Mesh to Ethereum (ADK to wADK): ADK holders on the ADK Mesh transfer the amount of ADK they wish to convert to wADK (1:1 conversion) to the ADK Mesh address ADK_DEPOSIT_ADDRESS_LIVE. The signature part (=Message/Smart Data Section) of the + ADK transaction has to contain the encoded 'receiving' Ethereum Address (use functions USR_ETHAddrEncode and USR_ETHAddrDecode to convert from ADK SmartData String to Ethereum Adress and vice versa) Once the ADK transaction has been confirmed on the ADK Mesh, the issuance of wADK will be triggered by the Contract owner specified in mainMeshOwner. The original ADK will remain locked in the ADK_DEPOSIT_ADDRESS_LIVE (and previous ADK deposit addresses) until a request for a conversion transaction wADK-->ADK is triggered (see below). Transfers from Ethereum (wADK) to Mesh (ADK): wADK holders can request a transfer from the Ethereum Blockchain back to the Mesh (1:1 conversion) by calling the contract function "USR_transferToMesh". Registered requests will be executed periodically, with ADK to be issued from previously locked ADK, at which time a new public ADK_DEPOSIT_ADDRESS_LIVE will be generated as needed. ******************************************************************************************************************** DISCLAIMER: THE CROSS-CHAIN COMPONENT OF THIS CONTRACT IS **NOT** A TRUSTLESS BRIDGE, AS THAT WOULD REQUIRE ADK TO IMPLEMENT SMART CONTRACT CAPABILITIES. INSTEAD, THIS CONTRACT (the MESH-ETHEREUM Bridge Part) NEEDS TO BE OPERATED BY A TRUSTED PARTY, e.g. the Aidos Foundation (Milestone Server Operator) OR TRUSTED DELEGATE. Note: THIS ONLY APPLIES TO THE TRANSFER FROM/TO THE MESH. ONCE ISSUED, wADK FOLLOW THE ERC20 STANDARD (TRUSTLESS TRANSACTIONS) ******************************************************************************************************************** Fur further details, step by step HOW-TOs, and latest updates please see https://github.com/adkmaster/adk-ethereum-bridge */ uint256 public totalSupply; uint256 constant private MAX_UINT256 = 2**256 - 1; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; string public name; // Aidos Kuneen Wrapped ADK uint8 public decimals; // 8 string public symbol; // ADK address public mainMeshOwner; //the 'mesh owner', holds all token still inside the ADK Mesh (if not in circulation as wADK) address public statusAddress; // is the request status admin, an address which can update user request stati. /* ADK_DEPOSIT_ADDRESS_LIVE holds the most recent ADK MESH DEPOSIT ADDRESS. THIS IS THE ADK ADDRESS THAT MUST BE USED WHEN SENDING ADK to wADK (Ethereum) NOTE: THIS ADDRESS WILL CHANGE REGULARLY. ENSURE YOU ALWAYS USE THE LATEST ONE */ string public ADK_DEPOSIT_ADDRESS_LIVE; /* ADK_DEPOSIT_ADDRESS_PREVIOUS is the PREVIOUS live address. ADK Deposits to this address will still be credited, BUT: Do not use this address for any new deposits. The purpose of keeping this address active is solely to capture any pending transactions at the time of address change. Note: Transfers to even older deposit addresses will still be ATTEMPTED to be credited by manually transferring them to a live address, but are at risk due to multi-spends (winternitz one-time signature). Long story short: Always!! use the latest ADK_DEPOSIT_ADDRESS_LIVE ADK address when sending ADK */ string public ADK_DEPOSIT_ADDRESS_PREVIOUS; uint256 public ADKDepositAddrCount; // Total number of historical ADK Mesh Contract deposit addresses mapping (uint256 => string) public ADKDepositAddrHistory; // holds the history of all ADK Mesh deposit addresses uint256 public requestID; // counter / unique request ID mapping (uint256 => string) public requestStatus; // Can be used to provide feedback to users re. status of their ADK/wADK requests. /* minimumADKforXChainTransfer: Indicates the minimum ADK or mADK required to transfer cross-chain. Note: value is in ADK Subunits, where 100000000 subADK = 1 ADK, i.e. 1.00000000 ADK */ uint256 public minimumADKforXChainTransfer; // CONSTRUCTOR constructor( // EIP20 Standard uint256 _initialAmount, string memory _tokenName, uint8 _decimalUnits, string memory _tokenSymbol ) { } // ERC20 events // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); // Standard ERC20 transfer Function function transfer(address _to, uint256 _value) public returns (bool success) { } // Standard ERC20 transferFrom Function function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } // Standard ERC20 approve Function function approve(address _spender, uint256 _value) public returns (bool success) { } // Standard ERC20 balanceOf Function function balanceOf(address _owner) public view returns (uint256 balance) { } // Standard ERC20 allowance Function function allowance(address _owner, address _spender) public view returns (uint256 remaining) { } /// END DEFAULT ERC20 FUNCTIONS // MODIFIERS modifier onlyOwnerOrStatusAdmin { } modifier onlyOwner { } /// BEGIN CUSTOM ADK FEATURES // ADM_setNewMinADKLimit: Sets the min-ADK X-Chain Transfer limit function ADM_setNewMinADKLimit(uint256 _newLimit) public onlyOwner { } // ADM_setNewStatusAdmin: Update the admin/Ethereum Address which is able to update user request status function ADM_setNewStatusAdmin(address _newAdmin) public onlyOwner { } // ADM_setNewOwner: Change the owner/Ethereum Address which holds the Mesh Locked Token Balance function ADM_setNewOwner(address _newOwner) public onlyOwner { require(<FILL_ME>) // new mesh address cannot hold wADK already. mainMeshOwner = _newOwner; if ( balances[msg.sender] > 0 ) { transfer( _newOwner , balances[msg.sender] ); } } // Custom EVENTS event EvtTransferFromMesh(address _receiver, address _mesh_address, string _adk_address, uint256 _value); event EvtTransferToMesh(address _sender, address _mesh_address, string _adk_address, uint256 _value, uint256 _requestID, uint256 _fees); event EvtADKDepositAddressUpd(string ADK_DEPOSIT_ADDRESS_LIVE); event EvtStatusChanged(uint256 _requestID, string _oldStatus, string _newStatus); // Check if an address only contains 9A-Z, and is 81 or 90 char long modifier requireValidADKAddress (string memory _adk_address) { } /* USR_transferToMesh: Called by users to request a transfer from wADK (Ethereum ERC20) back to ADK (Mesh) Note: This just calls the standard transfer function using the main Mesh Address, but logs also the target ADK address for processing. Note2: This function is PAYABLE as it will be possible to attach a fee to the transfer request in order to expedite the ADK mesh-release */ function USR_transferToMesh(string memory _adk_address, uint256 _value) payable requireValidADKAddress (_adk_address) public { } // ADM_transferFromMesh: function invoked by the ADK Mesh Milestone Server (or delegate) to unlock wADK and send wADK Token to the Ethereum address (specified by the user in the Smard Data field when depositing ADK for conversion) function ADM_transferFromMesh(address _receiver, uint256 _value, string memory _from_adk_address) public { } // ADM_updateMeshDepositAddress: Sets a new live ADK Mesh Deposit address, to be used for transfers from the Mesh to wADK function ADM_updateMeshDepositAddress(string memory _new_deposit_adk_address) public onlyOwnerOrStatusAdmin requireValidADKAddress (_new_deposit_adk_address){ } // ADM_updateRequestStatus: allows a status admin to update request stati (feedback to users) function ADM_updateRequestStatus(uint256 _requestID, string memory _status) public onlyOwnerOrStatusAdmin { } /* USR_ETHAddrEncode and USR_ETHAddrDecode: Helper functions for en- and decoding of Eth Addresses as ADK compatible strings i.e. a 1:1 conversion from an Ethereum Address to an ADK compatible String, and vice versa USR_ETHAddrEncode: ENCODES/CONVERTS ETHEREUM ADDRESS to an ADK compatible String using only 9A-Z This is a PURE function (can be run without gas), and needs to be used by a user who wants to transfer ADK from the mesh to wADK. The 9AZ encoded eth address is included in the Mesh transaction to specify the target Ethereum Address that should receive the wADK */ function USR_ETHAddrEncode(bytes memory ethAddr) public pure returns(string memory) { } /* USR_ETHAddrDecode: DECODES an ETHEREUM ADDRESS from an ADK compatible String only 9A-Z (i.e. a 1:1 conversion from an ADK-Encoded Ethereum Address String to back an actual Ethereum Address) This is a PURE function (can be run without gas), and will be used by the Mesh Milestone Node to specify the target Ethereum Address that should receive the wADK */ function USR_ETHAddrDecode(string memory adkString) public pure returns(address) { } // utilBytesToAddress: Helper function to convert 20 bytes to a properly formated Ethereum address function utilBytesToAddress(bytes memory bys) private pure returns (address addr) { } // ETH FEE COLLECTION FUNCTIONS: // The following functions are NOT related the ADK token, but are used to manage any ETH Fees, // that were sent to the contract address. It will cater for future features such as expedited // processing (i.e. if the default processing time is too slow) event EvtReceivedGeneric(address, uint); event EvtReceivedFee(address, uint, string); // Fees sent to address where no _feeInfo string is required receive() external payable { } // ADM_CollectFees: collect any ETH fees sent to the contract and forward to the specified address for processing function ADM_CollectFees(address payable _collectToAddress, uint256 _value) onlyOwnerOrStatusAdmin public { } // USR_FeePayment: Allows users to pay fees for additional services, check main website/github for details function USR_FeePayment(string memory _feeInfo) payable public { } }
balances[_newOwner]==0
293,926
balances[_newOwner]==0
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { require(now >= ICOStart || now >= ICOTill); if(now >= ICOStart && now <= ICOTill) { require( msg.value == 100000000000000000 || msg.value == 300000000000000000 || msg.value == 500000000000000000 || msg.value == 800000000000000000 || msg.value == 1000000000000000000 || msg.value == 3000000000000000000 || msg.value == 5000000000000000000 ); if(msg.value == 100000000000000000) { require(<FILL_ME>) balanceOf[msg.sender] += 31; balanceOf[this] -= 31; Transfer(this, msg.sender, 31); } if(msg.value == 300000000000000000) { require(balanceOf[this] >= 95); balanceOf[msg.sender] += 95; balanceOf[this] -= 95; Transfer(this, msg.sender, 95); } if(msg.value == 500000000000000000) { require(balanceOf[this] >= 160); balanceOf[msg.sender] += 160; balanceOf[this] -= 160; Transfer(this, msg.sender, 160); } if(msg.value == 800000000000000000) { require(balanceOf[this] >= 254); balanceOf[msg.sender] += 254; balanceOf[this] -= 254; Transfer(this, msg.sender, 254); } if(msg.value == 1000000000000000000) { require(balanceOf[this] >= 317); balanceOf[msg.sender] += 317; balanceOf[this] -= 317; Transfer(this, msg.sender, 317); } if(msg.value == 3000000000000000000) { require(balanceOf[this] >= 938); balanceOf[msg.sender] += 938; balanceOf[this] -= 938; Transfer(this, msg.sender, 938); } if(msg.value == 5000000000000000000) { require(balanceOf[this] >= 1560); balanceOf[msg.sender] += 1560; balanceOf[this] -= 1560; Transfer(this, msg.sender, 1560); } } if(now >= ICOTill) { require(msg.sender.balance >= msg.value); uint _Amount = msg.value / tokenPrice; require(balanceOf[this] >= _Amount); balanceOf[msg.sender] += _Amount; balanceOf[this] -= _Amount; Transfer(this, msg.sender, _Amount); } } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=31
293,929
balanceOf[this]>=31
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { require(now >= ICOStart || now >= ICOTill); if(now >= ICOStart && now <= ICOTill) { require( msg.value == 100000000000000000 || msg.value == 300000000000000000 || msg.value == 500000000000000000 || msg.value == 800000000000000000 || msg.value == 1000000000000000000 || msg.value == 3000000000000000000 || msg.value == 5000000000000000000 ); if(msg.value == 100000000000000000) { require(balanceOf[this] >= 31); balanceOf[msg.sender] += 31; balanceOf[this] -= 31; Transfer(this, msg.sender, 31); } if(msg.value == 300000000000000000) { require(<FILL_ME>) balanceOf[msg.sender] += 95; balanceOf[this] -= 95; Transfer(this, msg.sender, 95); } if(msg.value == 500000000000000000) { require(balanceOf[this] >= 160); balanceOf[msg.sender] += 160; balanceOf[this] -= 160; Transfer(this, msg.sender, 160); } if(msg.value == 800000000000000000) { require(balanceOf[this] >= 254); balanceOf[msg.sender] += 254; balanceOf[this] -= 254; Transfer(this, msg.sender, 254); } if(msg.value == 1000000000000000000) { require(balanceOf[this] >= 317); balanceOf[msg.sender] += 317; balanceOf[this] -= 317; Transfer(this, msg.sender, 317); } if(msg.value == 3000000000000000000) { require(balanceOf[this] >= 938); balanceOf[msg.sender] += 938; balanceOf[this] -= 938; Transfer(this, msg.sender, 938); } if(msg.value == 5000000000000000000) { require(balanceOf[this] >= 1560); balanceOf[msg.sender] += 1560; balanceOf[this] -= 1560; Transfer(this, msg.sender, 1560); } } if(now >= ICOTill) { require(msg.sender.balance >= msg.value); uint _Amount = msg.value / tokenPrice; require(balanceOf[this] >= _Amount); balanceOf[msg.sender] += _Amount; balanceOf[this] -= _Amount; Transfer(this, msg.sender, _Amount); } } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=95
293,929
balanceOf[this]>=95
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { require(now >= ICOStart || now >= ICOTill); if(now >= ICOStart && now <= ICOTill) { require( msg.value == 100000000000000000 || msg.value == 300000000000000000 || msg.value == 500000000000000000 || msg.value == 800000000000000000 || msg.value == 1000000000000000000 || msg.value == 3000000000000000000 || msg.value == 5000000000000000000 ); if(msg.value == 100000000000000000) { require(balanceOf[this] >= 31); balanceOf[msg.sender] += 31; balanceOf[this] -= 31; Transfer(this, msg.sender, 31); } if(msg.value == 300000000000000000) { require(balanceOf[this] >= 95); balanceOf[msg.sender] += 95; balanceOf[this] -= 95; Transfer(this, msg.sender, 95); } if(msg.value == 500000000000000000) { require(<FILL_ME>) balanceOf[msg.sender] += 160; balanceOf[this] -= 160; Transfer(this, msg.sender, 160); } if(msg.value == 800000000000000000) { require(balanceOf[this] >= 254); balanceOf[msg.sender] += 254; balanceOf[this] -= 254; Transfer(this, msg.sender, 254); } if(msg.value == 1000000000000000000) { require(balanceOf[this] >= 317); balanceOf[msg.sender] += 317; balanceOf[this] -= 317; Transfer(this, msg.sender, 317); } if(msg.value == 3000000000000000000) { require(balanceOf[this] >= 938); balanceOf[msg.sender] += 938; balanceOf[this] -= 938; Transfer(this, msg.sender, 938); } if(msg.value == 5000000000000000000) { require(balanceOf[this] >= 1560); balanceOf[msg.sender] += 1560; balanceOf[this] -= 1560; Transfer(this, msg.sender, 1560); } } if(now >= ICOTill) { require(msg.sender.balance >= msg.value); uint _Amount = msg.value / tokenPrice; require(balanceOf[this] >= _Amount); balanceOf[msg.sender] += _Amount; balanceOf[this] -= _Amount; Transfer(this, msg.sender, _Amount); } } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=160
293,929
balanceOf[this]>=160
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { require(now >= ICOStart || now >= ICOTill); if(now >= ICOStart && now <= ICOTill) { require( msg.value == 100000000000000000 || msg.value == 300000000000000000 || msg.value == 500000000000000000 || msg.value == 800000000000000000 || msg.value == 1000000000000000000 || msg.value == 3000000000000000000 || msg.value == 5000000000000000000 ); if(msg.value == 100000000000000000) { require(balanceOf[this] >= 31); balanceOf[msg.sender] += 31; balanceOf[this] -= 31; Transfer(this, msg.sender, 31); } if(msg.value == 300000000000000000) { require(balanceOf[this] >= 95); balanceOf[msg.sender] += 95; balanceOf[this] -= 95; Transfer(this, msg.sender, 95); } if(msg.value == 500000000000000000) { require(balanceOf[this] >= 160); balanceOf[msg.sender] += 160; balanceOf[this] -= 160; Transfer(this, msg.sender, 160); } if(msg.value == 800000000000000000) { require(<FILL_ME>) balanceOf[msg.sender] += 254; balanceOf[this] -= 254; Transfer(this, msg.sender, 254); } if(msg.value == 1000000000000000000) { require(balanceOf[this] >= 317); balanceOf[msg.sender] += 317; balanceOf[this] -= 317; Transfer(this, msg.sender, 317); } if(msg.value == 3000000000000000000) { require(balanceOf[this] >= 938); balanceOf[msg.sender] += 938; balanceOf[this] -= 938; Transfer(this, msg.sender, 938); } if(msg.value == 5000000000000000000) { require(balanceOf[this] >= 1560); balanceOf[msg.sender] += 1560; balanceOf[this] -= 1560; Transfer(this, msg.sender, 1560); } } if(now >= ICOTill) { require(msg.sender.balance >= msg.value); uint _Amount = msg.value / tokenPrice; require(balanceOf[this] >= _Amount); balanceOf[msg.sender] += _Amount; balanceOf[this] -= _Amount; Transfer(this, msg.sender, _Amount); } } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=254
293,929
balanceOf[this]>=254
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { require(now >= ICOStart || now >= ICOTill); if(now >= ICOStart && now <= ICOTill) { require( msg.value == 100000000000000000 || msg.value == 300000000000000000 || msg.value == 500000000000000000 || msg.value == 800000000000000000 || msg.value == 1000000000000000000 || msg.value == 3000000000000000000 || msg.value == 5000000000000000000 ); if(msg.value == 100000000000000000) { require(balanceOf[this] >= 31); balanceOf[msg.sender] += 31; balanceOf[this] -= 31; Transfer(this, msg.sender, 31); } if(msg.value == 300000000000000000) { require(balanceOf[this] >= 95); balanceOf[msg.sender] += 95; balanceOf[this] -= 95; Transfer(this, msg.sender, 95); } if(msg.value == 500000000000000000) { require(balanceOf[this] >= 160); balanceOf[msg.sender] += 160; balanceOf[this] -= 160; Transfer(this, msg.sender, 160); } if(msg.value == 800000000000000000) { require(balanceOf[this] >= 254); balanceOf[msg.sender] += 254; balanceOf[this] -= 254; Transfer(this, msg.sender, 254); } if(msg.value == 1000000000000000000) { require(<FILL_ME>) balanceOf[msg.sender] += 317; balanceOf[this] -= 317; Transfer(this, msg.sender, 317); } if(msg.value == 3000000000000000000) { require(balanceOf[this] >= 938); balanceOf[msg.sender] += 938; balanceOf[this] -= 938; Transfer(this, msg.sender, 938); } if(msg.value == 5000000000000000000) { require(balanceOf[this] >= 1560); balanceOf[msg.sender] += 1560; balanceOf[this] -= 1560; Transfer(this, msg.sender, 1560); } } if(now >= ICOTill) { require(msg.sender.balance >= msg.value); uint _Amount = msg.value / tokenPrice; require(balanceOf[this] >= _Amount); balanceOf[msg.sender] += _Amount; balanceOf[this] -= _Amount; Transfer(this, msg.sender, _Amount); } } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=317
293,929
balanceOf[this]>=317
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { require(now >= ICOStart || now >= ICOTill); if(now >= ICOStart && now <= ICOTill) { require( msg.value == 100000000000000000 || msg.value == 300000000000000000 || msg.value == 500000000000000000 || msg.value == 800000000000000000 || msg.value == 1000000000000000000 || msg.value == 3000000000000000000 || msg.value == 5000000000000000000 ); if(msg.value == 100000000000000000) { require(balanceOf[this] >= 31); balanceOf[msg.sender] += 31; balanceOf[this] -= 31; Transfer(this, msg.sender, 31); } if(msg.value == 300000000000000000) { require(balanceOf[this] >= 95); balanceOf[msg.sender] += 95; balanceOf[this] -= 95; Transfer(this, msg.sender, 95); } if(msg.value == 500000000000000000) { require(balanceOf[this] >= 160); balanceOf[msg.sender] += 160; balanceOf[this] -= 160; Transfer(this, msg.sender, 160); } if(msg.value == 800000000000000000) { require(balanceOf[this] >= 254); balanceOf[msg.sender] += 254; balanceOf[this] -= 254; Transfer(this, msg.sender, 254); } if(msg.value == 1000000000000000000) { require(balanceOf[this] >= 317); balanceOf[msg.sender] += 317; balanceOf[this] -= 317; Transfer(this, msg.sender, 317); } if(msg.value == 3000000000000000000) { require(<FILL_ME>) balanceOf[msg.sender] += 938; balanceOf[this] -= 938; Transfer(this, msg.sender, 938); } if(msg.value == 5000000000000000000) { require(balanceOf[this] >= 1560); balanceOf[msg.sender] += 1560; balanceOf[this] -= 1560; Transfer(this, msg.sender, 1560); } } if(now >= ICOTill) { require(msg.sender.balance >= msg.value); uint _Amount = msg.value / tokenPrice; require(balanceOf[this] >= _Amount); balanceOf[msg.sender] += _Amount; balanceOf[this] -= _Amount; Transfer(this, msg.sender, _Amount); } } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=938
293,929
balanceOf[this]>=938
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { require(now >= ICOStart || now >= ICOTill); if(now >= ICOStart && now <= ICOTill) { require( msg.value == 100000000000000000 || msg.value == 300000000000000000 || msg.value == 500000000000000000 || msg.value == 800000000000000000 || msg.value == 1000000000000000000 || msg.value == 3000000000000000000 || msg.value == 5000000000000000000 ); if(msg.value == 100000000000000000) { require(balanceOf[this] >= 31); balanceOf[msg.sender] += 31; balanceOf[this] -= 31; Transfer(this, msg.sender, 31); } if(msg.value == 300000000000000000) { require(balanceOf[this] >= 95); balanceOf[msg.sender] += 95; balanceOf[this] -= 95; Transfer(this, msg.sender, 95); } if(msg.value == 500000000000000000) { require(balanceOf[this] >= 160); balanceOf[msg.sender] += 160; balanceOf[this] -= 160; Transfer(this, msg.sender, 160); } if(msg.value == 800000000000000000) { require(balanceOf[this] >= 254); balanceOf[msg.sender] += 254; balanceOf[this] -= 254; Transfer(this, msg.sender, 254); } if(msg.value == 1000000000000000000) { require(balanceOf[this] >= 317); balanceOf[msg.sender] += 317; balanceOf[this] -= 317; Transfer(this, msg.sender, 317); } if(msg.value == 3000000000000000000) { require(balanceOf[this] >= 938); balanceOf[msg.sender] += 938; balanceOf[this] -= 938; Transfer(this, msg.sender, 938); } if(msg.value == 5000000000000000000) { require(<FILL_ME>) balanceOf[msg.sender] += 1560; balanceOf[this] -= 1560; Transfer(this, msg.sender, 1560); } } if(now >= ICOTill) { require(msg.sender.balance >= msg.value); uint _Amount = msg.value / tokenPrice; require(balanceOf[this] >= _Amount); balanceOf[msg.sender] += _Amount; balanceOf[this] -= _Amount; Transfer(this, msg.sender, _Amount); } } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=1560
293,929
balanceOf[this]>=1560
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { require(now >= ICOStart || now >= ICOTill); if(now >= ICOStart && now <= ICOTill) { require( msg.value == 100000000000000000 || msg.value == 300000000000000000 || msg.value == 500000000000000000 || msg.value == 800000000000000000 || msg.value == 1000000000000000000 || msg.value == 3000000000000000000 || msg.value == 5000000000000000000 ); if(msg.value == 100000000000000000) { require(balanceOf[this] >= 31); balanceOf[msg.sender] += 31; balanceOf[this] -= 31; Transfer(this, msg.sender, 31); } if(msg.value == 300000000000000000) { require(balanceOf[this] >= 95); balanceOf[msg.sender] += 95; balanceOf[this] -= 95; Transfer(this, msg.sender, 95); } if(msg.value == 500000000000000000) { require(balanceOf[this] >= 160); balanceOf[msg.sender] += 160; balanceOf[this] -= 160; Transfer(this, msg.sender, 160); } if(msg.value == 800000000000000000) { require(balanceOf[this] >= 254); balanceOf[msg.sender] += 254; balanceOf[this] -= 254; Transfer(this, msg.sender, 254); } if(msg.value == 1000000000000000000) { require(balanceOf[this] >= 317); balanceOf[msg.sender] += 317; balanceOf[this] -= 317; Transfer(this, msg.sender, 317); } if(msg.value == 3000000000000000000) { require(balanceOf[this] >= 938); balanceOf[msg.sender] += 938; balanceOf[this] -= 938; Transfer(this, msg.sender, 938); } if(msg.value == 5000000000000000000) { require(balanceOf[this] >= 1560); balanceOf[msg.sender] += 1560; balanceOf[this] -= 1560; Transfer(this, msg.sender, 1560); } } if(now >= ICOTill) { require(msg.sender.balance >= msg.value); uint _Amount = msg.value / tokenPrice; require(<FILL_ME>) balanceOf[msg.sender] += _Amount; balanceOf[this] -= _Amount; Transfer(this, msg.sender, _Amount); } } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=_Amount
293,929
balanceOf[this]>=_Amount
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { var Advr = info[BoardId]; uint Price = Days * Advr.PricePerDay; require(Advr.BoardId == BoardId && BoardId > 0); require(<FILL_ME>) require(Days <= Advr.MaxDays && Days > 0); require(balanceOf[msg.sender] >= Price); require(Advr.Till <= now); require(Advr.AllowLeasing == true); require(keccak256(Advr.Status) == keccak256("Free") || keccak256(Advr.Status) == keccak256("Published")); require(balanceOf[this] + Price >= balanceOf[this]); balanceOf[msg.sender] -= Price; balanceOf[this] += Price; Transfer(msg.sender, this, Price); Advr.Advertiser = msg.sender; Advr.AdvertSrc = AdvertSrc; Advr.Till = now + 86399 * Days; Advr.AddTime = now; Advr.SpentTokens = Price; Advr.Status = "Moderate"; } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
bytes(AdvertSrc).length>0
293,929
bytes(AdvertSrc).length>0
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { var Advr = info[BoardId]; uint Price = Days * Advr.PricePerDay; require(Advr.BoardId == BoardId && BoardId > 0); require(bytes(AdvertSrc).length > 0); require(Days <= Advr.MaxDays && Days > 0); require(<FILL_ME>) require(Advr.Till <= now); require(Advr.AllowLeasing == true); require(keccak256(Advr.Status) == keccak256("Free") || keccak256(Advr.Status) == keccak256("Published")); require(balanceOf[this] + Price >= balanceOf[this]); balanceOf[msg.sender] -= Price; balanceOf[this] += Price; Transfer(msg.sender, this, Price); Advr.Advertiser = msg.sender; Advr.AdvertSrc = AdvertSrc; Advr.Till = now + 86399 * Days; Advr.AddTime = now; Advr.SpentTokens = Price; Advr.Status = "Moderate"; } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[msg.sender]>=Price
293,929
balanceOf[msg.sender]>=Price
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { var Advr = info[BoardId]; uint Price = Days * Advr.PricePerDay; require(Advr.BoardId == BoardId && BoardId > 0); require(bytes(AdvertSrc).length > 0); require(Days <= Advr.MaxDays && Days > 0); require(balanceOf[msg.sender] >= Price); require(Advr.Till <= now); require(Advr.AllowLeasing == true); require(<FILL_ME>) require(balanceOf[this] + Price >= balanceOf[this]); balanceOf[msg.sender] -= Price; balanceOf[this] += Price; Transfer(msg.sender, this, Price); Advr.Advertiser = msg.sender; Advr.AdvertSrc = AdvertSrc; Advr.Till = now + 86399 * Days; Advr.AddTime = now; Advr.SpentTokens = Price; Advr.Status = "Moderate"; } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
keccak256(Advr.Status)==keccak256("Free")||keccak256(Advr.Status)==keccak256("Published")
293,929
keccak256(Advr.Status)==keccak256("Free")||keccak256(Advr.Status)==keccak256("Published")
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { var Advr = info[BoardId]; uint Price = Days * Advr.PricePerDay; require(Advr.BoardId == BoardId && BoardId > 0); require(bytes(AdvertSrc).length > 0); require(Days <= Advr.MaxDays && Days > 0); require(balanceOf[msg.sender] >= Price); require(Advr.Till <= now); require(Advr.AllowLeasing == true); require(keccak256(Advr.Status) == keccak256("Free") || keccak256(Advr.Status) == keccak256("Published")); require(<FILL_ME>) balanceOf[msg.sender] -= Price; balanceOf[this] += Price; Transfer(msg.sender, this, Price); Advr.Advertiser = msg.sender; Advr.AdvertSrc = AdvertSrc; Advr.Till = now + 86399 * Days; Advr.AddTime = now; Advr.SpentTokens = Price; Advr.Status = "Moderate"; } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]+Price>=balanceOf[this]
293,929
balanceOf[this]+Price>=balanceOf[this]
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { var Advr = info[BoardIdToModerate]; require(Advr.BoardId == BoardIdToModerate && BoardIdToModerate > 0); if(Published == true) { require(<FILL_ME>) uint CompensateTime = now - Advr.AddTime; Advr.Till = Advr.Till + CompensateTime; Advr.Status = "Published"; } if(Published == false) { require(keccak256(Advr.Status) == keccak256("Moderate")); require(balanceOf[this] >= Advr.SpentTokens); balanceOf[Advr.Advertiser] += Advr.SpentTokens; balanceOf[this] -= Advr.SpentTokens; Transfer(this, Advr.Advertiser, Advr.SpentTokens); delete Advr.Advertiser; delete Advr.AdvertSrc; delete Advr.Till; delete Advr.AddTime; delete Advr.SpentTokens; Advr.Status = "Free"; } } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
keccak256(Advr.Status)==keccak256("Moderate")
293,929
keccak256(Advr.Status)==keccak256("Moderate")
null
pragma solidity ^0.4.11; contract Bills { string public name = "Bills"; string public symbol = "BLS"; uint public totalSupply = 3000000; uint public decimals = 0; uint public tokenPrice; address private Owner; uint ICOTill = 1523145601; uint ICOStart = 1520467201; mapping (address => uint) public balanceOf; event Transfer(address indexed from, address indexed to, uint value); modifier onlyModerator() { } modifier onlyOwner() { } modifier isICOend() { } function Bills() public { } struct Advert { uint BoardId; uint PricePerDay; uint MaxDays; address Advertiser; string AdvertSrc; uint Till; uint AddTime; uint SpentTokens; string Status; bool AllowLeasing; } struct Moderator { address Address; } mapping (uint => Advert) info; mapping (address => Moderator) moderators; uint[] Adverts; address[] Moderators; function() public payable { } function ContractBalance() public view returns (uint) { } function LeaseBill(uint BoardId, uint Days, string AdvertSrc) isICOend public { } function ModerateBill(uint BoardIdToModerate, bool Published) onlyModerator isICOend public { var Advr = info[BoardIdToModerate]; require(Advr.BoardId == BoardIdToModerate && BoardIdToModerate > 0); if(Published == true) { require(keccak256(Advr.Status) == keccak256("Moderate")); uint CompensateTime = now - Advr.AddTime; Advr.Till = Advr.Till + CompensateTime; Advr.Status = "Published"; } if(Published == false) { require(keccak256(Advr.Status) == keccak256("Moderate")); require(<FILL_ME>) balanceOf[Advr.Advertiser] += Advr.SpentTokens; balanceOf[this] -= Advr.SpentTokens; Transfer(this, Advr.Advertiser, Advr.SpentTokens); delete Advr.Advertiser; delete Advr.AdvertSrc; delete Advr.Till; delete Advr.AddTime; delete Advr.SpentTokens; Advr.Status = "Free"; } } function ChangeBillLeasingInfo(uint _BillToEdit, uint _NewPricePerDay, uint _NewMaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBill(uint NewBoardId, uint PricePerDay, uint MaxDays, bool _AllowLeasing) onlyOwner isICOend public { } function AddBillModerator(address Address) onlyOwner isICOend public { } function DeleteBillModerator(address _Address) onlyOwner isICOend public { } function AboutBill(uint _BoardId) public view returns (uint BoardId, uint PricePerDay, uint MaxDays, string AdvertSource, uint AddTime, uint Till, string Status, bool AllowLeasing) { } function SetTokenPrice(uint _Price) onlyOwner isICOend public { } function transfer(address _to, uint _value) public { } function WithdrawEther() onlyOwner public { } function ChangeOwner(address _Address) onlyOwner public { } }
balanceOf[this]>=Advr.SpentTokens
293,929
balanceOf[this]>=Advr.SpentTokens
null
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public{ } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } interface token { function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); function getTotalSupply() public view returns (uint256); } contract ApolloSeptemBaseCrowdsale { using SafeMath for uint256; // The token being sold token public tokenReward; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // token address address public tokenAddress; // amount of raised money in wei uint256 public weiRaised; // a presale limit of 50% from ico tokens to be sold uint256 public constant PRESALE_LIMIT = 90 * (10 ** 6) * (10 ** 18); // a presale limit is set to minimum of 0.1 ether (100 finney) uint256 public constant PRESALE_BONUS_LIMIT = 100 finney; // Presale period (includes holidays) uint public constant PRESALE_PERIOD = 30 days; // Crowdsale first Wave period uint public constant CROWD_WAVE1_PERIOD = 10 days; // Crowdsale second Wave period uint public constant CROWD_WAVE2_PERIOD = 10 days; // Crowdsale third Wave period uint public constant CROWD_WAVE3_PERIOD = 10 days; // Bonus in percentage uint public constant PRESALE_BONUS = 40; uint public constant CROWD_WAVE1_BONUS = 15; uint public constant CROWD_WAVE2_BONUS = 10; uint public constant CROWD_WAVE3_BONUS = 5; uint256 public limitDatePresale; uint256 public limitDateCrowdWave1; uint256 public limitDateCrowdWave2; uint256 public limitDateCrowdWave3; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event ApolloSeptemTokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); event ApolloSeptemTokenSpecialPurchase(address indexed purchaser, address indexed beneficiary, uint256 amount); function ApolloSeptemBaseCrowdsale(address _wallet, address _tokens) public{ } // fallback function can be used to buy tokens function () public payable { } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != address(0)); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token to be substracted uint256 tokens = computeTokens(weiAmount); require(<FILL_ME>) // update state weiRaised = weiRaised.add(weiAmount); // send tokens to beneficiary tokenReward.transfer(beneficiary, tokens); ApolloSeptemTokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } //transfer used for special contribuitions function specialTransfer(address _to, uint _amount) internal returns(bool){ } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { } // send ether to the fund collection wallet function forwardFunds() internal { } // @return true if the transaction can buy tokens function validPurchase() internal view returns (bool) { } function isWithinPresaleTimeLimit() internal view returns (bool) { } function isWithinCrowdWave1TimeLimit() internal view returns (bool) { } function isWithinCrowdWave2TimeLimit() internal view returns (bool) { } function isWithinCrowdWave3TimeLimit() internal view returns (bool) { } function isWithinCrodwsaleTimeLimit() internal view returns (bool) { } function isWithinPresaleLimit(uint256 _tokens) internal view returns (bool) { } function isWithinCrowdsaleLimit(uint256 _tokens) internal view returns (bool) { } function isWithinTokenAllocLimit(uint256 _tokens) internal view returns (bool) { } function sendAllToOwner(address beneficiary) internal returns(bool){ } function computeTokens(uint256 weiAmount) internal view returns (uint256) { } } /** * @title ApolloSeptemCappedCrowdsale * @dev Extension of ApolloSeptemBaseCrowdsale with a max amount of funds raised */ contract ApolloSeptemCappedCrowdsale is ApolloSeptemBaseCrowdsale{ using SafeMath for uint256; // HARD_CAP = 30,000 ether uint256 public constant HARD_CAP = (3 ether)*(10**4); function ApolloSeptemCappedCrowdsale() public {} // overriding ApolloSeptemBaseCrowdsale#validPurchase to add extra cap logic // @return true if investors can buy at the moment function validPurchase() internal view returns (bool) { } // overriding Crowdsale#hasEnded to add cap logic // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { } } /** * @title ApolloSeptemCrowdsale * @dev This is ApolloSeptem's crowdsale contract. */ contract ApolloSeptemCrowdsale is ApolloSeptemCappedCrowdsale, Ownable { bool public isFinalized = false; bool public isStarted = false; event ApolloSeptemStarted(); event ApolloSeptemFinalized(); function ApolloSeptemCrowdsale(address _wallet,address _tokensAddress) public ApolloSeptemCappedCrowdsale() ApolloSeptemBaseCrowdsale(_wallet,_tokensAddress) { } /** * @dev Must be called to start the crowdsale. */ function start() onlyOwner public { } function starting() internal { } /** * @dev Must be called after crowdsale ends, to do some extra finalization * work. Calls the contract's finalization function. */ function finalize() onlyOwner public { } /** * @dev Must be called only in special cases */ function apolloSpecialTransfer(address _beneficiary, uint _amount) onlyOwner public { } /** *@dev Must be called after the crowdsale ends, to send the remaining tokens back to owner **/ function sendRemaningBalanceToOwner(address _tokenOwner) onlyOwner public { } }
isWithinTokenAllocLimit(tokens)
293,986
isWithinTokenAllocLimit(tokens)
null
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public{ } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } interface token { function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); function getTotalSupply() public view returns (uint256); } contract ApolloSeptemBaseCrowdsale { using SafeMath for uint256; // The token being sold token public tokenReward; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // token address address public tokenAddress; // amount of raised money in wei uint256 public weiRaised; // a presale limit of 50% from ico tokens to be sold uint256 public constant PRESALE_LIMIT = 90 * (10 ** 6) * (10 ** 18); // a presale limit is set to minimum of 0.1 ether (100 finney) uint256 public constant PRESALE_BONUS_LIMIT = 100 finney; // Presale period (includes holidays) uint public constant PRESALE_PERIOD = 30 days; // Crowdsale first Wave period uint public constant CROWD_WAVE1_PERIOD = 10 days; // Crowdsale second Wave period uint public constant CROWD_WAVE2_PERIOD = 10 days; // Crowdsale third Wave period uint public constant CROWD_WAVE3_PERIOD = 10 days; // Bonus in percentage uint public constant PRESALE_BONUS = 40; uint public constant CROWD_WAVE1_BONUS = 15; uint public constant CROWD_WAVE2_BONUS = 10; uint public constant CROWD_WAVE3_BONUS = 5; uint256 public limitDatePresale; uint256 public limitDateCrowdWave1; uint256 public limitDateCrowdWave2; uint256 public limitDateCrowdWave3; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event ApolloSeptemTokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); event ApolloSeptemTokenSpecialPurchase(address indexed purchaser, address indexed beneficiary, uint256 amount); function ApolloSeptemBaseCrowdsale(address _wallet, address _tokens) public{ } // fallback function can be used to buy tokens function () public payable { } // low level token purchase function function buyTokens(address beneficiary) public payable { } //transfer used for special contribuitions function specialTransfer(address _to, uint _amount) internal returns(bool){ } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { } // send ether to the fund collection wallet function forwardFunds() internal { } // @return true if the transaction can buy tokens function validPurchase() internal view returns (bool) { } function isWithinPresaleTimeLimit() internal view returns (bool) { } function isWithinCrowdWave1TimeLimit() internal view returns (bool) { } function isWithinCrowdWave2TimeLimit() internal view returns (bool) { } function isWithinCrowdWave3TimeLimit() internal view returns (bool) { } function isWithinCrodwsaleTimeLimit() internal view returns (bool) { } function isWithinPresaleLimit(uint256 _tokens) internal view returns (bool) { } function isWithinCrowdsaleLimit(uint256 _tokens) internal view returns (bool) { } function isWithinTokenAllocLimit(uint256 _tokens) internal view returns (bool) { } function sendAllToOwner(address beneficiary) internal returns(bool){ } function computeTokens(uint256 weiAmount) internal view returns (uint256) { } } /** * @title ApolloSeptemCappedCrowdsale * @dev Extension of ApolloSeptemBaseCrowdsale with a max amount of funds raised */ contract ApolloSeptemCappedCrowdsale is ApolloSeptemBaseCrowdsale{ using SafeMath for uint256; // HARD_CAP = 30,000 ether uint256 public constant HARD_CAP = (3 ether)*(10**4); function ApolloSeptemCappedCrowdsale() public {} // overriding ApolloSeptemBaseCrowdsale#validPurchase to add extra cap logic // @return true if investors can buy at the moment function validPurchase() internal view returns (bool) { } // overriding Crowdsale#hasEnded to add cap logic // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { } } /** * @title ApolloSeptemCrowdsale * @dev This is ApolloSeptem's crowdsale contract. */ contract ApolloSeptemCrowdsale is ApolloSeptemCappedCrowdsale, Ownable { bool public isFinalized = false; bool public isStarted = false; event ApolloSeptemStarted(); event ApolloSeptemFinalized(); function ApolloSeptemCrowdsale(address _wallet,address _tokensAddress) public ApolloSeptemCappedCrowdsale() ApolloSeptemBaseCrowdsale(_wallet,_tokensAddress) { } /** * @dev Must be called to start the crowdsale. */ function start() onlyOwner public { require(<FILL_ME>) starting(); ApolloSeptemStarted(); isStarted = true; } function starting() internal { } /** * @dev Must be called after crowdsale ends, to do some extra finalization * work. Calls the contract's finalization function. */ function finalize() onlyOwner public { } /** * @dev Must be called only in special cases */ function apolloSpecialTransfer(address _beneficiary, uint _amount) onlyOwner public { } /** *@dev Must be called after the crowdsale ends, to send the remaining tokens back to owner **/ function sendRemaningBalanceToOwner(address _tokenOwner) onlyOwner public { } }
!isStarted
293,986
!isStarted
"AddPool: Token pool already added"
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; import "./lib/@defiat-crypto/interfaces/IDeFiatPoints.sol"; import "./interfaces/IAnyStake.sol"; import "./interfaces/IAnyStakeMigrator.sol"; import "./interfaces/IAnyStakeVault.sol"; import "./utils/AnyStakeUtils.sol"; contract AnyStake is IAnyStake, AnyStakeUtils { using SafeMath for uint256; using SafeERC20 for IERC20; // EVENTS event Initialized(address indexed user, address vault); event Claim(address indexed user, uint256 indexed pid, uint256 amount); event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event Migrate(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); event PoolAdded(address indexed user, uint256 indexed pid, address indexed stakedToken, address lpToken, uint256 allocPoints); event MigratorUpdated(address indexed user, address migrator); event VaultUpdated(address indexed user, address vault); event PoolAllocPointsUpdated(address indexed user, uint256 indexed pid, uint256 allocPoints); event PoolVipAmountUpdated(address indexed user, uint256 indexed pid, uint256 vipAmount); event PoolStakingFeeUpdated(address indexed user, uint256 indexed pid, uint256 stakingFee); event PointStipendUpdated(address indexed user, uint256 stipend); // STRUCTS // UserInfo - User metrics, pending reward = (user.amount * pool.DFTPerShare) - user.rewardDebt struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Token rewards paid out to user uint256 lastRewardBlock; // last pool interaction } // PoolInfo - Pool metrics struct PoolInfo { address stakedToken; // Address of staked token contract. address lpToken; // uniswap LP token corresponding to the trading pair needed for price calculation uint256 totalStaked; // total tokens staked uint256 allocPoint; // How many allocation points assigned to this pool. DFTs to distribute per block. (ETH = 2.3M blocks per year) uint256 rewardsPerShare; // Accumulated DFTs per share, times 1e18. See below. uint256 lastRewardBlock; // last pool update uint256 vipAmount; // amount of DFT tokens that must be staked to access the pool uint256 stakingFee; // the % withdrawal fee charged. base 1000, 50 = 5% } address public migrator; // contract where we may migrate too address public vault; // where rewards are stored for distribution bool public initialized; PoolInfo[] public poolInfo; // array of AnyStake pools mapping(uint256 => mapping(address => UserInfo)) public userInfo; // mapping of (pid => (userAddress => userInfo)) mapping(address => uint256) public pids; // quick mapping for pool ids (staked_token => pid) uint256 public lastRewardBlock; // last block the pool was updated uint256 public pendingRewards; // pending DFT rewards awaiting anyone to be distro'd to pools uint256 public pointStipend; // amount of DFTP awarded per deposit uint256 public totalAllocPoint; // Total allocation points. Must be the sum of all allocation points in all pools. uint256 public totalBlockDelta; // Total blocks since last update uint256 public totalEligiblePools; // Amount of pools eligible for rewards modifier NoReentrant(uint256 pid, address user) { } modifier onlyVault() { } modifier activated() { } constructor(address _router, address _gov, address _points, address _token) public AnyStakeUtils(_router, _gov, _points, _token) { } // Initialize pools/rewards after the Vault has been setup function initialize(address _vault) public onlyGovernor { } // Pool - Get any incoming rewards, called during Vault.distributeRewards() function addReward(uint256 amount) external override onlyVault { } // Pool - Updates the reward variables of the given pool function updatePool(uint256 pid) external { } // Pool - Update internal function _updatePool(uint256 _pid) internal { } // Pool - Claim rewards function claim(uint256 pid) external override NoReentrant(pid, msg.sender) { } // Pool - Claim internal, called during deposit() and withdraw() function _claim(uint256 _pid, address _user) internal { } // Pool - Deposit Tokens function deposit(uint256 pid, uint256 amount) external override NoReentrant(pid, msg.sender) { } // Pool - Deposit internal function _deposit(address _user, uint256 _pid, uint256 _amount) internal { } // Pool - Withdraw staked tokens function withdraw(uint256 pid, uint256 amount) external override NoReentrant(pid, msg.sender) { } // Pool - Withdraw Internal function _withdraw( address _user, uint256 _pid, uint256 _amount ) internal { } // Pool - migrate stake to a new contract, should only be called after function migrate(uint256 pid) external NoReentrant(pid, msg.sender) { } // Pool - migrate internal function _migrate(address _user, uint256 _pid) internal { } // Pool - withdraw all stake and forfeit rewards, skips pool update function emergencyWithdraw(uint256 pid) external NoReentrant(pid, msg.sender) { } // View - gets stakedToken price from the Vault function getPrice(uint256 pid) external view returns (uint256) { } // View - Pending DFT Rewards for user in pool function pending(uint256 _pid, address _user) public view returns (uint256) { } // View - View Pool Length function poolLength() external view returns (uint256) { } // Governance - Add Multiple Token Pools function addPoolBatch( address[] calldata tokens, address[] calldata lpTokens, uint256[] calldata allocPoints, uint256[] calldata vipAmounts, uint256[] calldata stakingFees ) external onlyGovernor { } // Governance - Add Single Token Pool function addPool( address token, address lpToken, uint256 allocPoint, uint256 vipAmount, uint256 stakingFee ) external onlyGovernor { } // Governance - Add Token Pool Internal function _addPool( address stakedToken, address lpToken, uint256 allocPoint, uint256 vipAmount, uint256 stakingFee ) internal { require(<FILL_ME>) pids[stakedToken] = poolInfo.length; _blacklistedAdminWithdraw[stakedToken] = true; // stakedToken now non-withrawable by admins totalAllocPoint = totalAllocPoint.add(allocPoint); // Add new pool poolInfo.push( PoolInfo({ stakedToken: stakedToken, lpToken: lpToken, allocPoint: allocPoint, lastRewardBlock: block.number, totalStaked: 0, rewardsPerShare: 0, vipAmount: vipAmount, stakingFee: stakingFee }) ); emit PoolAdded(msg.sender, pids[stakedToken], stakedToken, lpToken, allocPoint); } // Governance - Set Migrator function setMigrator(address _migrator) external onlyGovernor { } // Governance - Set Vault function setVault(address _vault) external onlyGovernor { } // Governance - Set Pool Allocation Points function setPoolAllocPoints(uint256 _pid, uint256 _allocPoint) external onlyGovernor { } // Governance - Set Pool Charge Fee function setPoolVipAmount(uint256 _pid, uint256 _vipAmount) external onlyGovernor { } // Governance - Set Pool Charge Fee function setPoolChargeFee(uint256 _pid, uint256 _stakingFee) external onlyGovernor { } // Governance - Set Pool Allocation Points function setPointStipend(uint256 _pointStipend) external onlyGovernor { } }
pids[stakedToken]==0,"AddPool: Token pool already added"
294,077
pids[stakedToken]==0
"SetAllocPoints: No points change"
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; import "./lib/@defiat-crypto/interfaces/IDeFiatPoints.sol"; import "./interfaces/IAnyStake.sol"; import "./interfaces/IAnyStakeMigrator.sol"; import "./interfaces/IAnyStakeVault.sol"; import "./utils/AnyStakeUtils.sol"; contract AnyStake is IAnyStake, AnyStakeUtils { using SafeMath for uint256; using SafeERC20 for IERC20; // EVENTS event Initialized(address indexed user, address vault); event Claim(address indexed user, uint256 indexed pid, uint256 amount); event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event Migrate(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); event PoolAdded(address indexed user, uint256 indexed pid, address indexed stakedToken, address lpToken, uint256 allocPoints); event MigratorUpdated(address indexed user, address migrator); event VaultUpdated(address indexed user, address vault); event PoolAllocPointsUpdated(address indexed user, uint256 indexed pid, uint256 allocPoints); event PoolVipAmountUpdated(address indexed user, uint256 indexed pid, uint256 vipAmount); event PoolStakingFeeUpdated(address indexed user, uint256 indexed pid, uint256 stakingFee); event PointStipendUpdated(address indexed user, uint256 stipend); // STRUCTS // UserInfo - User metrics, pending reward = (user.amount * pool.DFTPerShare) - user.rewardDebt struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Token rewards paid out to user uint256 lastRewardBlock; // last pool interaction } // PoolInfo - Pool metrics struct PoolInfo { address stakedToken; // Address of staked token contract. address lpToken; // uniswap LP token corresponding to the trading pair needed for price calculation uint256 totalStaked; // total tokens staked uint256 allocPoint; // How many allocation points assigned to this pool. DFTs to distribute per block. (ETH = 2.3M blocks per year) uint256 rewardsPerShare; // Accumulated DFTs per share, times 1e18. See below. uint256 lastRewardBlock; // last pool update uint256 vipAmount; // amount of DFT tokens that must be staked to access the pool uint256 stakingFee; // the % withdrawal fee charged. base 1000, 50 = 5% } address public migrator; // contract where we may migrate too address public vault; // where rewards are stored for distribution bool public initialized; PoolInfo[] public poolInfo; // array of AnyStake pools mapping(uint256 => mapping(address => UserInfo)) public userInfo; // mapping of (pid => (userAddress => userInfo)) mapping(address => uint256) public pids; // quick mapping for pool ids (staked_token => pid) uint256 public lastRewardBlock; // last block the pool was updated uint256 public pendingRewards; // pending DFT rewards awaiting anyone to be distro'd to pools uint256 public pointStipend; // amount of DFTP awarded per deposit uint256 public totalAllocPoint; // Total allocation points. Must be the sum of all allocation points in all pools. uint256 public totalBlockDelta; // Total blocks since last update uint256 public totalEligiblePools; // Amount of pools eligible for rewards modifier NoReentrant(uint256 pid, address user) { } modifier onlyVault() { } modifier activated() { } constructor(address _router, address _gov, address _points, address _token) public AnyStakeUtils(_router, _gov, _points, _token) { } // Initialize pools/rewards after the Vault has been setup function initialize(address _vault) public onlyGovernor { } // Pool - Get any incoming rewards, called during Vault.distributeRewards() function addReward(uint256 amount) external override onlyVault { } // Pool - Updates the reward variables of the given pool function updatePool(uint256 pid) external { } // Pool - Update internal function _updatePool(uint256 _pid) internal { } // Pool - Claim rewards function claim(uint256 pid) external override NoReentrant(pid, msg.sender) { } // Pool - Claim internal, called during deposit() and withdraw() function _claim(uint256 _pid, address _user) internal { } // Pool - Deposit Tokens function deposit(uint256 pid, uint256 amount) external override NoReentrant(pid, msg.sender) { } // Pool - Deposit internal function _deposit(address _user, uint256 _pid, uint256 _amount) internal { } // Pool - Withdraw staked tokens function withdraw(uint256 pid, uint256 amount) external override NoReentrant(pid, msg.sender) { } // Pool - Withdraw Internal function _withdraw( address _user, uint256 _pid, uint256 _amount ) internal { } // Pool - migrate stake to a new contract, should only be called after function migrate(uint256 pid) external NoReentrant(pid, msg.sender) { } // Pool - migrate internal function _migrate(address _user, uint256 _pid) internal { } // Pool - withdraw all stake and forfeit rewards, skips pool update function emergencyWithdraw(uint256 pid) external NoReentrant(pid, msg.sender) { } // View - gets stakedToken price from the Vault function getPrice(uint256 pid) external view returns (uint256) { } // View - Pending DFT Rewards for user in pool function pending(uint256 _pid, address _user) public view returns (uint256) { } // View - View Pool Length function poolLength() external view returns (uint256) { } // Governance - Add Multiple Token Pools function addPoolBatch( address[] calldata tokens, address[] calldata lpTokens, uint256[] calldata allocPoints, uint256[] calldata vipAmounts, uint256[] calldata stakingFees ) external onlyGovernor { } // Governance - Add Single Token Pool function addPool( address token, address lpToken, uint256 allocPoint, uint256 vipAmount, uint256 stakingFee ) external onlyGovernor { } // Governance - Add Token Pool Internal function _addPool( address stakedToken, address lpToken, uint256 allocPoint, uint256 vipAmount, uint256 stakingFee ) internal { } // Governance - Set Migrator function setMigrator(address _migrator) external onlyGovernor { } // Governance - Set Vault function setVault(address _vault) external onlyGovernor { } // Governance - Set Pool Allocation Points function setPoolAllocPoints(uint256 _pid, uint256 _allocPoint) external onlyGovernor { require(<FILL_ME>) if (_allocPoint == 0) { totalEligiblePools = totalEligiblePools.sub(1); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; emit PoolAllocPointsUpdated(msg.sender, _pid, _allocPoint); } // Governance - Set Pool Charge Fee function setPoolVipAmount(uint256 _pid, uint256 _vipAmount) external onlyGovernor { } // Governance - Set Pool Charge Fee function setPoolChargeFee(uint256 _pid, uint256 _stakingFee) external onlyGovernor { } // Governance - Set Pool Allocation Points function setPointStipend(uint256 _pointStipend) external onlyGovernor { } }
poolInfo[_pid].allocPoint!=_allocPoint,"SetAllocPoints: No points change"
294,077
poolInfo[_pid].allocPoint!=_allocPoint
"SetVipAmount: No amount change"
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; import "./lib/@defiat-crypto/interfaces/IDeFiatPoints.sol"; import "./interfaces/IAnyStake.sol"; import "./interfaces/IAnyStakeMigrator.sol"; import "./interfaces/IAnyStakeVault.sol"; import "./utils/AnyStakeUtils.sol"; contract AnyStake is IAnyStake, AnyStakeUtils { using SafeMath for uint256; using SafeERC20 for IERC20; // EVENTS event Initialized(address indexed user, address vault); event Claim(address indexed user, uint256 indexed pid, uint256 amount); event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event Migrate(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); event PoolAdded(address indexed user, uint256 indexed pid, address indexed stakedToken, address lpToken, uint256 allocPoints); event MigratorUpdated(address indexed user, address migrator); event VaultUpdated(address indexed user, address vault); event PoolAllocPointsUpdated(address indexed user, uint256 indexed pid, uint256 allocPoints); event PoolVipAmountUpdated(address indexed user, uint256 indexed pid, uint256 vipAmount); event PoolStakingFeeUpdated(address indexed user, uint256 indexed pid, uint256 stakingFee); event PointStipendUpdated(address indexed user, uint256 stipend); // STRUCTS // UserInfo - User metrics, pending reward = (user.amount * pool.DFTPerShare) - user.rewardDebt struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Token rewards paid out to user uint256 lastRewardBlock; // last pool interaction } // PoolInfo - Pool metrics struct PoolInfo { address stakedToken; // Address of staked token contract. address lpToken; // uniswap LP token corresponding to the trading pair needed for price calculation uint256 totalStaked; // total tokens staked uint256 allocPoint; // How many allocation points assigned to this pool. DFTs to distribute per block. (ETH = 2.3M blocks per year) uint256 rewardsPerShare; // Accumulated DFTs per share, times 1e18. See below. uint256 lastRewardBlock; // last pool update uint256 vipAmount; // amount of DFT tokens that must be staked to access the pool uint256 stakingFee; // the % withdrawal fee charged. base 1000, 50 = 5% } address public migrator; // contract where we may migrate too address public vault; // where rewards are stored for distribution bool public initialized; PoolInfo[] public poolInfo; // array of AnyStake pools mapping(uint256 => mapping(address => UserInfo)) public userInfo; // mapping of (pid => (userAddress => userInfo)) mapping(address => uint256) public pids; // quick mapping for pool ids (staked_token => pid) uint256 public lastRewardBlock; // last block the pool was updated uint256 public pendingRewards; // pending DFT rewards awaiting anyone to be distro'd to pools uint256 public pointStipend; // amount of DFTP awarded per deposit uint256 public totalAllocPoint; // Total allocation points. Must be the sum of all allocation points in all pools. uint256 public totalBlockDelta; // Total blocks since last update uint256 public totalEligiblePools; // Amount of pools eligible for rewards modifier NoReentrant(uint256 pid, address user) { } modifier onlyVault() { } modifier activated() { } constructor(address _router, address _gov, address _points, address _token) public AnyStakeUtils(_router, _gov, _points, _token) { } // Initialize pools/rewards after the Vault has been setup function initialize(address _vault) public onlyGovernor { } // Pool - Get any incoming rewards, called during Vault.distributeRewards() function addReward(uint256 amount) external override onlyVault { } // Pool - Updates the reward variables of the given pool function updatePool(uint256 pid) external { } // Pool - Update internal function _updatePool(uint256 _pid) internal { } // Pool - Claim rewards function claim(uint256 pid) external override NoReentrant(pid, msg.sender) { } // Pool - Claim internal, called during deposit() and withdraw() function _claim(uint256 _pid, address _user) internal { } // Pool - Deposit Tokens function deposit(uint256 pid, uint256 amount) external override NoReentrant(pid, msg.sender) { } // Pool - Deposit internal function _deposit(address _user, uint256 _pid, uint256 _amount) internal { } // Pool - Withdraw staked tokens function withdraw(uint256 pid, uint256 amount) external override NoReentrant(pid, msg.sender) { } // Pool - Withdraw Internal function _withdraw( address _user, uint256 _pid, uint256 _amount ) internal { } // Pool - migrate stake to a new contract, should only be called after function migrate(uint256 pid) external NoReentrant(pid, msg.sender) { } // Pool - migrate internal function _migrate(address _user, uint256 _pid) internal { } // Pool - withdraw all stake and forfeit rewards, skips pool update function emergencyWithdraw(uint256 pid) external NoReentrant(pid, msg.sender) { } // View - gets stakedToken price from the Vault function getPrice(uint256 pid) external view returns (uint256) { } // View - Pending DFT Rewards for user in pool function pending(uint256 _pid, address _user) public view returns (uint256) { } // View - View Pool Length function poolLength() external view returns (uint256) { } // Governance - Add Multiple Token Pools function addPoolBatch( address[] calldata tokens, address[] calldata lpTokens, uint256[] calldata allocPoints, uint256[] calldata vipAmounts, uint256[] calldata stakingFees ) external onlyGovernor { } // Governance - Add Single Token Pool function addPool( address token, address lpToken, uint256 allocPoint, uint256 vipAmount, uint256 stakingFee ) external onlyGovernor { } // Governance - Add Token Pool Internal function _addPool( address stakedToken, address lpToken, uint256 allocPoint, uint256 vipAmount, uint256 stakingFee ) internal { } // Governance - Set Migrator function setMigrator(address _migrator) external onlyGovernor { } // Governance - Set Vault function setVault(address _vault) external onlyGovernor { } // Governance - Set Pool Allocation Points function setPoolAllocPoints(uint256 _pid, uint256 _allocPoint) external onlyGovernor { } // Governance - Set Pool Charge Fee function setPoolVipAmount(uint256 _pid, uint256 _vipAmount) external onlyGovernor { require(<FILL_ME>) poolInfo[_pid].vipAmount = _vipAmount; emit PoolVipAmountUpdated(msg.sender, _pid, _vipAmount); } // Governance - Set Pool Charge Fee function setPoolChargeFee(uint256 _pid, uint256 _stakingFee) external onlyGovernor { } // Governance - Set Pool Allocation Points function setPointStipend(uint256 _pointStipend) external onlyGovernor { } }
poolInfo[_pid].vipAmount!=_vipAmount,"SetVipAmount: No amount change"
294,077
poolInfo[_pid].vipAmount!=_vipAmount
"SetStakingFee: No fee change"
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; import "./lib/@defiat-crypto/interfaces/IDeFiatPoints.sol"; import "./interfaces/IAnyStake.sol"; import "./interfaces/IAnyStakeMigrator.sol"; import "./interfaces/IAnyStakeVault.sol"; import "./utils/AnyStakeUtils.sol"; contract AnyStake is IAnyStake, AnyStakeUtils { using SafeMath for uint256; using SafeERC20 for IERC20; // EVENTS event Initialized(address indexed user, address vault); event Claim(address indexed user, uint256 indexed pid, uint256 amount); event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event Migrate(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); event PoolAdded(address indexed user, uint256 indexed pid, address indexed stakedToken, address lpToken, uint256 allocPoints); event MigratorUpdated(address indexed user, address migrator); event VaultUpdated(address indexed user, address vault); event PoolAllocPointsUpdated(address indexed user, uint256 indexed pid, uint256 allocPoints); event PoolVipAmountUpdated(address indexed user, uint256 indexed pid, uint256 vipAmount); event PoolStakingFeeUpdated(address indexed user, uint256 indexed pid, uint256 stakingFee); event PointStipendUpdated(address indexed user, uint256 stipend); // STRUCTS // UserInfo - User metrics, pending reward = (user.amount * pool.DFTPerShare) - user.rewardDebt struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Token rewards paid out to user uint256 lastRewardBlock; // last pool interaction } // PoolInfo - Pool metrics struct PoolInfo { address stakedToken; // Address of staked token contract. address lpToken; // uniswap LP token corresponding to the trading pair needed for price calculation uint256 totalStaked; // total tokens staked uint256 allocPoint; // How many allocation points assigned to this pool. DFTs to distribute per block. (ETH = 2.3M blocks per year) uint256 rewardsPerShare; // Accumulated DFTs per share, times 1e18. See below. uint256 lastRewardBlock; // last pool update uint256 vipAmount; // amount of DFT tokens that must be staked to access the pool uint256 stakingFee; // the % withdrawal fee charged. base 1000, 50 = 5% } address public migrator; // contract where we may migrate too address public vault; // where rewards are stored for distribution bool public initialized; PoolInfo[] public poolInfo; // array of AnyStake pools mapping(uint256 => mapping(address => UserInfo)) public userInfo; // mapping of (pid => (userAddress => userInfo)) mapping(address => uint256) public pids; // quick mapping for pool ids (staked_token => pid) uint256 public lastRewardBlock; // last block the pool was updated uint256 public pendingRewards; // pending DFT rewards awaiting anyone to be distro'd to pools uint256 public pointStipend; // amount of DFTP awarded per deposit uint256 public totalAllocPoint; // Total allocation points. Must be the sum of all allocation points in all pools. uint256 public totalBlockDelta; // Total blocks since last update uint256 public totalEligiblePools; // Amount of pools eligible for rewards modifier NoReentrant(uint256 pid, address user) { } modifier onlyVault() { } modifier activated() { } constructor(address _router, address _gov, address _points, address _token) public AnyStakeUtils(_router, _gov, _points, _token) { } // Initialize pools/rewards after the Vault has been setup function initialize(address _vault) public onlyGovernor { } // Pool - Get any incoming rewards, called during Vault.distributeRewards() function addReward(uint256 amount) external override onlyVault { } // Pool - Updates the reward variables of the given pool function updatePool(uint256 pid) external { } // Pool - Update internal function _updatePool(uint256 _pid) internal { } // Pool - Claim rewards function claim(uint256 pid) external override NoReentrant(pid, msg.sender) { } // Pool - Claim internal, called during deposit() and withdraw() function _claim(uint256 _pid, address _user) internal { } // Pool - Deposit Tokens function deposit(uint256 pid, uint256 amount) external override NoReentrant(pid, msg.sender) { } // Pool - Deposit internal function _deposit(address _user, uint256 _pid, uint256 _amount) internal { } // Pool - Withdraw staked tokens function withdraw(uint256 pid, uint256 amount) external override NoReentrant(pid, msg.sender) { } // Pool - Withdraw Internal function _withdraw( address _user, uint256 _pid, uint256 _amount ) internal { } // Pool - migrate stake to a new contract, should only be called after function migrate(uint256 pid) external NoReentrant(pid, msg.sender) { } // Pool - migrate internal function _migrate(address _user, uint256 _pid) internal { } // Pool - withdraw all stake and forfeit rewards, skips pool update function emergencyWithdraw(uint256 pid) external NoReentrant(pid, msg.sender) { } // View - gets stakedToken price from the Vault function getPrice(uint256 pid) external view returns (uint256) { } // View - Pending DFT Rewards for user in pool function pending(uint256 _pid, address _user) public view returns (uint256) { } // View - View Pool Length function poolLength() external view returns (uint256) { } // Governance - Add Multiple Token Pools function addPoolBatch( address[] calldata tokens, address[] calldata lpTokens, uint256[] calldata allocPoints, uint256[] calldata vipAmounts, uint256[] calldata stakingFees ) external onlyGovernor { } // Governance - Add Single Token Pool function addPool( address token, address lpToken, uint256 allocPoint, uint256 vipAmount, uint256 stakingFee ) external onlyGovernor { } // Governance - Add Token Pool Internal function _addPool( address stakedToken, address lpToken, uint256 allocPoint, uint256 vipAmount, uint256 stakingFee ) internal { } // Governance - Set Migrator function setMigrator(address _migrator) external onlyGovernor { } // Governance - Set Vault function setVault(address _vault) external onlyGovernor { } // Governance - Set Pool Allocation Points function setPoolAllocPoints(uint256 _pid, uint256 _allocPoint) external onlyGovernor { } // Governance - Set Pool Charge Fee function setPoolVipAmount(uint256 _pid, uint256 _vipAmount) external onlyGovernor { } // Governance - Set Pool Charge Fee function setPoolChargeFee(uint256 _pid, uint256 _stakingFee) external onlyGovernor { require(<FILL_ME>) poolInfo[_pid].stakingFee = _stakingFee; emit PoolStakingFeeUpdated(msg.sender, _pid, _stakingFee); } // Governance - Set Pool Allocation Points function setPointStipend(uint256 _pointStipend) external onlyGovernor { } }
poolInfo[_pid].stakingFee!=_stakingFee,"SetStakingFee: No fee change"
294,077
poolInfo[_pid].stakingFee!=_stakingFee
"caller is no gived"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./interfaces/ILootLand.sol"; contract LootLand is ILootLand, ERC721Enumerable, Ownable { Land[] private _lands; // packedXY => tokenId mapping(uint256 => uint256) private _packedXYToTokenId; // packedXY => bool mapping(uint256 => bool) private _packedXYToIsMinted; // givedAddress => tokenId mapping(address => uint256) private _gived; // mintedAddress => mint land tokenids mapping(address => uint256[]) private _mintLandTokenIds; // mintedAddress => mint count mapping(address => uint8) public override mintLandCount; uint256 public constant PRICE = 4669201609102000 wei; modifier hasGived() { require(<FILL_ME>) _; } constructor(address _owner, address _startUp) ERC721("LootLand", "LOOTLAND") Ownable() { } function mint(int128 x, int128 y) external payable override hasGived { } function mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) external payable override hasGived { } function giveTo( int128 x, int128 y, address givedAddress ) external override hasGived { } function mintAndGiveTo( int128 x, int128 y, address givedAddress ) external payable override hasGived { } function mint2AndGiveTo( int128 x1, int128 y1, address givedAddress1, int128 x2, int128 y2, address givedAddress2 ) external payable override hasGived { } function setSlogan( int128 x, int128 y, string memory slogan ) external override { } function getAllEth() external override onlyOwner { } function getEth(uint256 value) external override onlyOwner { } function land(int128 _x, int128 _y) external view override returns (Land memory _land) { } function givedLand(address _givedAddress) external view override returns (bool isGived, Land memory _land) { } function getMintLands(address _mintedAddress) external view override returns (Land[] memory _mintLands) { } function tokenURI(uint256 tokenId) public view override returns (string memory result) { } function getTokenId(int128 x, int128 y) public view override returns (uint256 tokenId) { } function packedXY(int128 x, int128 y) public pure override returns (uint256 _packedXY) { } function getCoordinates(uint256 tokenId) public view override returns (int128 x, int128 y) { } function getCoordinatesStrings(int128 x, int128 y) public pure override returns (string memory sx, string memory sy) { } function _giveTo( int128 x, int128 y, address givedAddress ) private { } function _mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) private { } function _mint(int128 x, int128 y) private { } function _mintWithoutEth(int128 x, int128 y) private { } function _getInviteByStr(uint256 tokenId) private view returns (string memory _str) { } function _getMintAndGiveToStr(uint256 tokenId) private view returns (string memory _str) { } function _getNeighborsStr(int128 x, int128 y) private view returns (string memory _str) { } /** (c1)x-1, y+1 (c2)x, y+1 (c3)x+1, y+1 (c4)x-1, y (c5)x, y (c6)x+1, y (c7)x-1, y-1 (c8)x, y-1 (c9)x+1, y-1 */ function _getNeighborsStrArr(int128 x, int128 y) private view returns (string[8] memory _arr) { } function _getTokenIdStr(int128 x, int128 y) private view returns (string memory _str) { } function _getTokenIdAndCoordinatesString( uint256 tokenId, int128 x, int128 y ) private pure returns (string memory _str) { } function _getCoordinatesString(int128 x, int128 y) private pure returns (string memory _str) { } }
_lands[_gived[_msgSender()]].isGived&&_lands[_gived[_msgSender()]].givedAddress==_msgSender(),"caller is no gived"
294,159
_lands[_gived[_msgSender()]].isGived&&_lands[_gived[_msgSender()]].givedAddress==_msgSender()
"slogan is too long"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./interfaces/ILootLand.sol"; contract LootLand is ILootLand, ERC721Enumerable, Ownable { Land[] private _lands; // packedXY => tokenId mapping(uint256 => uint256) private _packedXYToTokenId; // packedXY => bool mapping(uint256 => bool) private _packedXYToIsMinted; // givedAddress => tokenId mapping(address => uint256) private _gived; // mintedAddress => mint land tokenids mapping(address => uint256[]) private _mintLandTokenIds; // mintedAddress => mint count mapping(address => uint8) public override mintLandCount; uint256 public constant PRICE = 4669201609102000 wei; modifier hasGived() { } constructor(address _owner, address _startUp) ERC721("LootLand", "LOOTLAND") Ownable() { } function mint(int128 x, int128 y) external payable override hasGived { } function mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) external payable override hasGived { } function giveTo( int128 x, int128 y, address givedAddress ) external override hasGived { } function mintAndGiveTo( int128 x, int128 y, address givedAddress ) external payable override hasGived { } function mint2AndGiveTo( int128 x1, int128 y1, address givedAddress1, int128 x2, int128 y2, address givedAddress2 ) external payable override hasGived { } function setSlogan( int128 x, int128 y, string memory slogan ) external override { uint256 tokenId = getTokenId(x, y); require(ownerOf(tokenId) == _msgSender(), "land is not belong to caller"); require(<FILL_ME>) _lands[tokenId].slogan = slogan; emit SetSlogan(x, y, slogan); } function getAllEth() external override onlyOwner { } function getEth(uint256 value) external override onlyOwner { } function land(int128 _x, int128 _y) external view override returns (Land memory _land) { } function givedLand(address _givedAddress) external view override returns (bool isGived, Land memory _land) { } function getMintLands(address _mintedAddress) external view override returns (Land[] memory _mintLands) { } function tokenURI(uint256 tokenId) public view override returns (string memory result) { } function getTokenId(int128 x, int128 y) public view override returns (uint256 tokenId) { } function packedXY(int128 x, int128 y) public pure override returns (uint256 _packedXY) { } function getCoordinates(uint256 tokenId) public view override returns (int128 x, int128 y) { } function getCoordinatesStrings(int128 x, int128 y) public pure override returns (string memory sx, string memory sy) { } function _giveTo( int128 x, int128 y, address givedAddress ) private { } function _mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) private { } function _mint(int128 x, int128 y) private { } function _mintWithoutEth(int128 x, int128 y) private { } function _getInviteByStr(uint256 tokenId) private view returns (string memory _str) { } function _getMintAndGiveToStr(uint256 tokenId) private view returns (string memory _str) { } function _getNeighborsStr(int128 x, int128 y) private view returns (string memory _str) { } /** (c1)x-1, y+1 (c2)x, y+1 (c3)x+1, y+1 (c4)x-1, y (c5)x, y (c6)x+1, y (c7)x-1, y-1 (c8)x, y-1 (c9)x+1, y-1 */ function _getNeighborsStrArr(int128 x, int128 y) private view returns (string[8] memory _arr) { } function _getTokenIdStr(int128 x, int128 y) private view returns (string memory _str) { } function _getTokenIdAndCoordinatesString( uint256 tokenId, int128 x, int128 y ) private pure returns (string memory _str) { } function _getCoordinatesString(int128 x, int128 y) private pure returns (string memory _str) { } }
bytes(slogan).length<256,"slogan is too long"
294,159
bytes(slogan).length<256
"land not minted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./interfaces/ILootLand.sol"; contract LootLand is ILootLand, ERC721Enumerable, Ownable { Land[] private _lands; // packedXY => tokenId mapping(uint256 => uint256) private _packedXYToTokenId; // packedXY => bool mapping(uint256 => bool) private _packedXYToIsMinted; // givedAddress => tokenId mapping(address => uint256) private _gived; // mintedAddress => mint land tokenids mapping(address => uint256[]) private _mintLandTokenIds; // mintedAddress => mint count mapping(address => uint8) public override mintLandCount; uint256 public constant PRICE = 4669201609102000 wei; modifier hasGived() { } constructor(address _owner, address _startUp) ERC721("LootLand", "LOOTLAND") Ownable() { } function mint(int128 x, int128 y) external payable override hasGived { } function mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) external payable override hasGived { } function giveTo( int128 x, int128 y, address givedAddress ) external override hasGived { } function mintAndGiveTo( int128 x, int128 y, address givedAddress ) external payable override hasGived { } function mint2AndGiveTo( int128 x1, int128 y1, address givedAddress1, int128 x2, int128 y2, address givedAddress2 ) external payable override hasGived { } function setSlogan( int128 x, int128 y, string memory slogan ) external override { } function getAllEth() external override onlyOwner { } function getEth(uint256 value) external override onlyOwner { } function land(int128 _x, int128 _y) external view override returns (Land memory _land) { } function givedLand(address _givedAddress) external view override returns (bool isGived, Land memory _land) { } function getMintLands(address _mintedAddress) external view override returns (Land[] memory _mintLands) { } function tokenURI(uint256 tokenId) public view override returns (string memory result) { } function getTokenId(int128 x, int128 y) public view override returns (uint256 tokenId) { uint256 _packedXY = packedXY(x, y); require(<FILL_ME>) tokenId = _packedXYToTokenId[_packedXY]; } function packedXY(int128 x, int128 y) public pure override returns (uint256 _packedXY) { } function getCoordinates(uint256 tokenId) public view override returns (int128 x, int128 y) { } function getCoordinatesStrings(int128 x, int128 y) public pure override returns (string memory sx, string memory sy) { } function _giveTo( int128 x, int128 y, address givedAddress ) private { } function _mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) private { } function _mint(int128 x, int128 y) private { } function _mintWithoutEth(int128 x, int128 y) private { } function _getInviteByStr(uint256 tokenId) private view returns (string memory _str) { } function _getMintAndGiveToStr(uint256 tokenId) private view returns (string memory _str) { } function _getNeighborsStr(int128 x, int128 y) private view returns (string memory _str) { } /** (c1)x-1, y+1 (c2)x, y+1 (c3)x+1, y+1 (c4)x-1, y (c5)x, y (c6)x+1, y (c7)x-1, y-1 (c8)x, y-1 (c9)x+1, y-1 */ function _getNeighborsStrArr(int128 x, int128 y) private view returns (string[8] memory _arr) { } function _getTokenIdStr(int128 x, int128 y) private view returns (string memory _str) { } function _getTokenIdAndCoordinatesString( uint256 tokenId, int128 x, int128 y ) private pure returns (string memory _str) { } function _getCoordinatesString(int128 x, int128 y) private pure returns (string memory _str) { } }
_packedXYToIsMinted[_packedXY],"land not minted"
294,159
_packedXYToIsMinted[_packedXY]
"caller didn't minted this land"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./interfaces/ILootLand.sol"; contract LootLand is ILootLand, ERC721Enumerable, Ownable { Land[] private _lands; // packedXY => tokenId mapping(uint256 => uint256) private _packedXYToTokenId; // packedXY => bool mapping(uint256 => bool) private _packedXYToIsMinted; // givedAddress => tokenId mapping(address => uint256) private _gived; // mintedAddress => mint land tokenids mapping(address => uint256[]) private _mintLandTokenIds; // mintedAddress => mint count mapping(address => uint8) public override mintLandCount; uint256 public constant PRICE = 4669201609102000 wei; modifier hasGived() { } constructor(address _owner, address _startUp) ERC721("LootLand", "LOOTLAND") Ownable() { } function mint(int128 x, int128 y) external payable override hasGived { } function mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) external payable override hasGived { } function giveTo( int128 x, int128 y, address givedAddress ) external override hasGived { } function mintAndGiveTo( int128 x, int128 y, address givedAddress ) external payable override hasGived { } function mint2AndGiveTo( int128 x1, int128 y1, address givedAddress1, int128 x2, int128 y2, address givedAddress2 ) external payable override hasGived { } function setSlogan( int128 x, int128 y, string memory slogan ) external override { } function getAllEth() external override onlyOwner { } function getEth(uint256 value) external override onlyOwner { } function land(int128 _x, int128 _y) external view override returns (Land memory _land) { } function givedLand(address _givedAddress) external view override returns (bool isGived, Land memory _land) { } function getMintLands(address _mintedAddress) external view override returns (Land[] memory _mintLands) { } function tokenURI(uint256 tokenId) public view override returns (string memory result) { } function getTokenId(int128 x, int128 y) public view override returns (uint256 tokenId) { } function packedXY(int128 x, int128 y) public pure override returns (uint256 _packedXY) { } function getCoordinates(uint256 tokenId) public view override returns (int128 x, int128 y) { } function getCoordinatesStrings(int128 x, int128 y) public pure override returns (string memory sx, string memory sy) { } function _giveTo( int128 x, int128 y, address givedAddress ) private { uint256 tokenId = getTokenId(x, y); require(<FILL_ME>) require(!_lands[tokenId].isGived, "land is gived"); require( _lands[_gived[givedAddress]].givedAddress != givedAddress, "givedAddress have gived land" ); _lands[tokenId].givedAddress = givedAddress; _lands[tokenId].isGived = true; _gived[givedAddress] = tokenId; _safeMint(givedAddress, tokenId); emit GiveTo(x, y, givedAddress); } function _mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) private { } function _mint(int128 x, int128 y) private { } function _mintWithoutEth(int128 x, int128 y) private { } function _getInviteByStr(uint256 tokenId) private view returns (string memory _str) { } function _getMintAndGiveToStr(uint256 tokenId) private view returns (string memory _str) { } function _getNeighborsStr(int128 x, int128 y) private view returns (string memory _str) { } /** (c1)x-1, y+1 (c2)x, y+1 (c3)x+1, y+1 (c4)x-1, y (c5)x, y (c6)x+1, y (c7)x-1, y-1 (c8)x, y-1 (c9)x+1, y-1 */ function _getNeighborsStrArr(int128 x, int128 y) private view returns (string[8] memory _arr) { } function _getTokenIdStr(int128 x, int128 y) private view returns (string memory _str) { } function _getTokenIdAndCoordinatesString( uint256 tokenId, int128 x, int128 y ) private pure returns (string memory _str) { } function _getCoordinatesString(int128 x, int128 y) private pure returns (string memory _str) { } }
_lands[tokenId].mintedAddress==_msgSender(),"caller didn't minted this land"
294,159
_lands[tokenId].mintedAddress==_msgSender()
"land is gived"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./interfaces/ILootLand.sol"; contract LootLand is ILootLand, ERC721Enumerable, Ownable { Land[] private _lands; // packedXY => tokenId mapping(uint256 => uint256) private _packedXYToTokenId; // packedXY => bool mapping(uint256 => bool) private _packedXYToIsMinted; // givedAddress => tokenId mapping(address => uint256) private _gived; // mintedAddress => mint land tokenids mapping(address => uint256[]) private _mintLandTokenIds; // mintedAddress => mint count mapping(address => uint8) public override mintLandCount; uint256 public constant PRICE = 4669201609102000 wei; modifier hasGived() { } constructor(address _owner, address _startUp) ERC721("LootLand", "LOOTLAND") Ownable() { } function mint(int128 x, int128 y) external payable override hasGived { } function mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) external payable override hasGived { } function giveTo( int128 x, int128 y, address givedAddress ) external override hasGived { } function mintAndGiveTo( int128 x, int128 y, address givedAddress ) external payable override hasGived { } function mint2AndGiveTo( int128 x1, int128 y1, address givedAddress1, int128 x2, int128 y2, address givedAddress2 ) external payable override hasGived { } function setSlogan( int128 x, int128 y, string memory slogan ) external override { } function getAllEth() external override onlyOwner { } function getEth(uint256 value) external override onlyOwner { } function land(int128 _x, int128 _y) external view override returns (Land memory _land) { } function givedLand(address _givedAddress) external view override returns (bool isGived, Land memory _land) { } function getMintLands(address _mintedAddress) external view override returns (Land[] memory _mintLands) { } function tokenURI(uint256 tokenId) public view override returns (string memory result) { } function getTokenId(int128 x, int128 y) public view override returns (uint256 tokenId) { } function packedXY(int128 x, int128 y) public pure override returns (uint256 _packedXY) { } function getCoordinates(uint256 tokenId) public view override returns (int128 x, int128 y) { } function getCoordinatesStrings(int128 x, int128 y) public pure override returns (string memory sx, string memory sy) { } function _giveTo( int128 x, int128 y, address givedAddress ) private { uint256 tokenId = getTokenId(x, y); require( _lands[tokenId].mintedAddress == _msgSender(), "caller didn't minted this land" ); require(<FILL_ME>) require( _lands[_gived[givedAddress]].givedAddress != givedAddress, "givedAddress have gived land" ); _lands[tokenId].givedAddress = givedAddress; _lands[tokenId].isGived = true; _gived[givedAddress] = tokenId; _safeMint(givedAddress, tokenId); emit GiveTo(x, y, givedAddress); } function _mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) private { } function _mint(int128 x, int128 y) private { } function _mintWithoutEth(int128 x, int128 y) private { } function _getInviteByStr(uint256 tokenId) private view returns (string memory _str) { } function _getMintAndGiveToStr(uint256 tokenId) private view returns (string memory _str) { } function _getNeighborsStr(int128 x, int128 y) private view returns (string memory _str) { } /** (c1)x-1, y+1 (c2)x, y+1 (c3)x+1, y+1 (c4)x-1, y (c5)x, y (c6)x+1, y (c7)x-1, y-1 (c8)x, y-1 (c9)x+1, y-1 */ function _getNeighborsStrArr(int128 x, int128 y) private view returns (string[8] memory _arr) { } function _getTokenIdStr(int128 x, int128 y) private view returns (string memory _str) { } function _getTokenIdAndCoordinatesString( uint256 tokenId, int128 x, int128 y ) private pure returns (string memory _str) { } function _getCoordinatesString(int128 x, int128 y) private pure returns (string memory _str) { } }
!_lands[tokenId].isGived,"land is gived"
294,159
!_lands[tokenId].isGived
"givedAddress have gived land"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./interfaces/ILootLand.sol"; contract LootLand is ILootLand, ERC721Enumerable, Ownable { Land[] private _lands; // packedXY => tokenId mapping(uint256 => uint256) private _packedXYToTokenId; // packedXY => bool mapping(uint256 => bool) private _packedXYToIsMinted; // givedAddress => tokenId mapping(address => uint256) private _gived; // mintedAddress => mint land tokenids mapping(address => uint256[]) private _mintLandTokenIds; // mintedAddress => mint count mapping(address => uint8) public override mintLandCount; uint256 public constant PRICE = 4669201609102000 wei; modifier hasGived() { } constructor(address _owner, address _startUp) ERC721("LootLand", "LOOTLAND") Ownable() { } function mint(int128 x, int128 y) external payable override hasGived { } function mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) external payable override hasGived { } function giveTo( int128 x, int128 y, address givedAddress ) external override hasGived { } function mintAndGiveTo( int128 x, int128 y, address givedAddress ) external payable override hasGived { } function mint2AndGiveTo( int128 x1, int128 y1, address givedAddress1, int128 x2, int128 y2, address givedAddress2 ) external payable override hasGived { } function setSlogan( int128 x, int128 y, string memory slogan ) external override { } function getAllEth() external override onlyOwner { } function getEth(uint256 value) external override onlyOwner { } function land(int128 _x, int128 _y) external view override returns (Land memory _land) { } function givedLand(address _givedAddress) external view override returns (bool isGived, Land memory _land) { } function getMintLands(address _mintedAddress) external view override returns (Land[] memory _mintLands) { } function tokenURI(uint256 tokenId) public view override returns (string memory result) { } function getTokenId(int128 x, int128 y) public view override returns (uint256 tokenId) { } function packedXY(int128 x, int128 y) public pure override returns (uint256 _packedXY) { } function getCoordinates(uint256 tokenId) public view override returns (int128 x, int128 y) { } function getCoordinatesStrings(int128 x, int128 y) public pure override returns (string memory sx, string memory sy) { } function _giveTo( int128 x, int128 y, address givedAddress ) private { uint256 tokenId = getTokenId(x, y); require( _lands[tokenId].mintedAddress == _msgSender(), "caller didn't minted this land" ); require(!_lands[tokenId].isGived, "land is gived"); require(<FILL_ME>) _lands[tokenId].givedAddress = givedAddress; _lands[tokenId].isGived = true; _gived[givedAddress] = tokenId; _safeMint(givedAddress, tokenId); emit GiveTo(x, y, givedAddress); } function _mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) private { } function _mint(int128 x, int128 y) private { } function _mintWithoutEth(int128 x, int128 y) private { } function _getInviteByStr(uint256 tokenId) private view returns (string memory _str) { } function _getMintAndGiveToStr(uint256 tokenId) private view returns (string memory _str) { } function _getNeighborsStr(int128 x, int128 y) private view returns (string memory _str) { } /** (c1)x-1, y+1 (c2)x, y+1 (c3)x+1, y+1 (c4)x-1, y (c5)x, y (c6)x+1, y (c7)x-1, y-1 (c8)x, y-1 (c9)x+1, y-1 */ function _getNeighborsStrArr(int128 x, int128 y) private view returns (string[8] memory _arr) { } function _getTokenIdStr(int128 x, int128 y) private view returns (string memory _str) { } function _getTokenIdAndCoordinatesString( uint256 tokenId, int128 x, int128 y ) private pure returns (string memory _str) { } function _getCoordinatesString(int128 x, int128 y) private pure returns (string memory _str) { } }
_lands[_gived[givedAddress]].givedAddress!=givedAddress,"givedAddress have gived land"
294,159
_lands[_gived[givedAddress]].givedAddress!=givedAddress
"caller is already minted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./interfaces/ILootLand.sol"; contract LootLand is ILootLand, ERC721Enumerable, Ownable { Land[] private _lands; // packedXY => tokenId mapping(uint256 => uint256) private _packedXYToTokenId; // packedXY => bool mapping(uint256 => bool) private _packedXYToIsMinted; // givedAddress => tokenId mapping(address => uint256) private _gived; // mintedAddress => mint land tokenids mapping(address => uint256[]) private _mintLandTokenIds; // mintedAddress => mint count mapping(address => uint8) public override mintLandCount; uint256 public constant PRICE = 4669201609102000 wei; modifier hasGived() { } constructor(address _owner, address _startUp) ERC721("LootLand", "LOOTLAND") Ownable() { } function mint(int128 x, int128 y) external payable override hasGived { } function mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) external payable override hasGived { } function giveTo( int128 x, int128 y, address givedAddress ) external override hasGived { } function mintAndGiveTo( int128 x, int128 y, address givedAddress ) external payable override hasGived { } function mint2AndGiveTo( int128 x1, int128 y1, address givedAddress1, int128 x2, int128 y2, address givedAddress2 ) external payable override hasGived { } function setSlogan( int128 x, int128 y, string memory slogan ) external override { } function getAllEth() external override onlyOwner { } function getEth(uint256 value) external override onlyOwner { } function land(int128 _x, int128 _y) external view override returns (Land memory _land) { } function givedLand(address _givedAddress) external view override returns (bool isGived, Land memory _land) { } function getMintLands(address _mintedAddress) external view override returns (Land[] memory _mintLands) { } function tokenURI(uint256 tokenId) public view override returns (string memory result) { } function getTokenId(int128 x, int128 y) public view override returns (uint256 tokenId) { } function packedXY(int128 x, int128 y) public pure override returns (uint256 _packedXY) { } function getCoordinates(uint256 tokenId) public view override returns (int128 x, int128 y) { } function getCoordinatesStrings(int128 x, int128 y) public pure override returns (string memory sx, string memory sy) { } function _giveTo( int128 x, int128 y, address givedAddress ) private { } function _mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) private { } function _mint(int128 x, int128 y) private { } function _mintWithoutEth(int128 x, int128 y) private { require(<FILL_ME>) uint256 _packedXY = packedXY(x, y); require(!_packedXYToIsMinted[_packedXY], "land is minted"); _lands.push(Land(x, y, "", _msgSender(), address(0), true, false)); uint256 newTokenId = _lands.length - 1; _mintLandTokenIds[_msgSender()].push(newTokenId); mintLandCount[_msgSender()] += 1; _packedXYToTokenId[_packedXY] = newTokenId; _packedXYToIsMinted[_packedXY] = true; emit Mint(x, y, _msgSender()); } function _getInviteByStr(uint256 tokenId) private view returns (string memory _str) { } function _getMintAndGiveToStr(uint256 tokenId) private view returns (string memory _str) { } function _getNeighborsStr(int128 x, int128 y) private view returns (string memory _str) { } /** (c1)x-1, y+1 (c2)x, y+1 (c3)x+1, y+1 (c4)x-1, y (c5)x, y (c6)x+1, y (c7)x-1, y-1 (c8)x, y-1 (c9)x+1, y-1 */ function _getNeighborsStrArr(int128 x, int128 y) private view returns (string[8] memory _arr) { } function _getTokenIdStr(int128 x, int128 y) private view returns (string memory _str) { } function _getTokenIdAndCoordinatesString( uint256 tokenId, int128 x, int128 y ) private pure returns (string memory _str) { } function _getCoordinatesString(int128 x, int128 y) private pure returns (string memory _str) { } }
mintLandCount[_msgSender()]<2,"caller is already minted"
294,159
mintLandCount[_msgSender()]<2
"land is minted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./interfaces/ILootLand.sol"; contract LootLand is ILootLand, ERC721Enumerable, Ownable { Land[] private _lands; // packedXY => tokenId mapping(uint256 => uint256) private _packedXYToTokenId; // packedXY => bool mapping(uint256 => bool) private _packedXYToIsMinted; // givedAddress => tokenId mapping(address => uint256) private _gived; // mintedAddress => mint land tokenids mapping(address => uint256[]) private _mintLandTokenIds; // mintedAddress => mint count mapping(address => uint8) public override mintLandCount; uint256 public constant PRICE = 4669201609102000 wei; modifier hasGived() { } constructor(address _owner, address _startUp) ERC721("LootLand", "LOOTLAND") Ownable() { } function mint(int128 x, int128 y) external payable override hasGived { } function mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) external payable override hasGived { } function giveTo( int128 x, int128 y, address givedAddress ) external override hasGived { } function mintAndGiveTo( int128 x, int128 y, address givedAddress ) external payable override hasGived { } function mint2AndGiveTo( int128 x1, int128 y1, address givedAddress1, int128 x2, int128 y2, address givedAddress2 ) external payable override hasGived { } function setSlogan( int128 x, int128 y, string memory slogan ) external override { } function getAllEth() external override onlyOwner { } function getEth(uint256 value) external override onlyOwner { } function land(int128 _x, int128 _y) external view override returns (Land memory _land) { } function givedLand(address _givedAddress) external view override returns (bool isGived, Land memory _land) { } function getMintLands(address _mintedAddress) external view override returns (Land[] memory _mintLands) { } function tokenURI(uint256 tokenId) public view override returns (string memory result) { } function getTokenId(int128 x, int128 y) public view override returns (uint256 tokenId) { } function packedXY(int128 x, int128 y) public pure override returns (uint256 _packedXY) { } function getCoordinates(uint256 tokenId) public view override returns (int128 x, int128 y) { } function getCoordinatesStrings(int128 x, int128 y) public pure override returns (string memory sx, string memory sy) { } function _giveTo( int128 x, int128 y, address givedAddress ) private { } function _mint2( int128 x1, int128 y1, int128 x2, int128 y2 ) private { } function _mint(int128 x, int128 y) private { } function _mintWithoutEth(int128 x, int128 y) private { require(mintLandCount[_msgSender()] < 2, "caller is already minted"); uint256 _packedXY = packedXY(x, y); require(<FILL_ME>) _lands.push(Land(x, y, "", _msgSender(), address(0), true, false)); uint256 newTokenId = _lands.length - 1; _mintLandTokenIds[_msgSender()].push(newTokenId); mintLandCount[_msgSender()] += 1; _packedXYToTokenId[_packedXY] = newTokenId; _packedXYToIsMinted[_packedXY] = true; emit Mint(x, y, _msgSender()); } function _getInviteByStr(uint256 tokenId) private view returns (string memory _str) { } function _getMintAndGiveToStr(uint256 tokenId) private view returns (string memory _str) { } function _getNeighborsStr(int128 x, int128 y) private view returns (string memory _str) { } /** (c1)x-1, y+1 (c2)x, y+1 (c3)x+1, y+1 (c4)x-1, y (c5)x, y (c6)x+1, y (c7)x-1, y-1 (c8)x, y-1 (c9)x+1, y-1 */ function _getNeighborsStrArr(int128 x, int128 y) private view returns (string[8] memory _arr) { } function _getTokenIdStr(int128 x, int128 y) private view returns (string memory _str) { } function _getTokenIdAndCoordinatesString( uint256 tokenId, int128 x, int128 y ) private pure returns (string memory _str) { } function _getCoordinatesString(int128 x, int128 y) private pure returns (string memory _str) { } }
!_packedXYToIsMinted[_packedXY],"land is minted"
294,159
!_packedXYToIsMinted[_packedXY]
"Limit reached"
pragma solidity ^0.8.4; // // Built by https://nft-generator.art // contract ambitionNFT is ERC721, Ownable { // string internal baseUri; string public baseTokenURI; uint256 public cost = 0.05 ether; uint32 public maxPerMint = 5; uint32 public maxPerWallet = 20; uint32 public supply = 0; uint32 public totalSupply = 0; bool public open = false; mapping(address => uint256) internal addressMintedMap; uint32 private commission = 49; // 4.9% address private author = 0xfd6c3bD6dB6D7cbB77Ee64d1E406B2ACB63A5166; //0x460Fd5059E7301680fA53E63bbBF7272E643e89C; constructor( string memory _uri, string memory _name, string memory _symbol, uint32 _totalSupply, uint256 _cost, bool _open ) ERC721(_name, _symbol) { } // ------ Author Only ------ function setCommission(uint32 _commision) public { } // ------ Owner Only ------ // Override empty function to return baseTokenURI // to tell our contract that baseTokenURI is the base URI our contract must use function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _baseTokenURI) public onlyOwner { } function setCost(uint256 _cost) public onlyOwner { } function setOpen(bool _open) public onlyOwner { } function setMaxPerWallet(uint32 _max) public onlyOwner { } function setMaxPerMint(uint32 _max) public onlyOwner { } function airdrop(address[] calldata to) public onlyOwner { for (uint32 i = 0; i < to.length; i++) { require(<FILL_ME>) _safeMint(to[i], ++supply, ""); } } function withdraw() public payable onlyOwner { } // ------ Mint! ------ function mint(uint32 count) external payable preMintChecks(count) { } function performMint(uint32 count) internal { } // ------ Read ------ // ------ Modifiers ------ modifier preMintChecks(uint32 count) { } }
1+supply<=totalSupply,"Limit reached"
294,161
1+supply<=totalSupply
"Mint sold out"
pragma solidity ^0.8.4; // // Built by https://nft-generator.art // contract ambitionNFT is ERC721, Ownable { // string internal baseUri; string public baseTokenURI; uint256 public cost = 0.05 ether; uint32 public maxPerMint = 5; uint32 public maxPerWallet = 20; uint32 public supply = 0; uint32 public totalSupply = 0; bool public open = false; mapping(address => uint256) internal addressMintedMap; uint32 private commission = 49; // 4.9% address private author = 0xfd6c3bD6dB6D7cbB77Ee64d1E406B2ACB63A5166; //0x460Fd5059E7301680fA53E63bbBF7272E643e89C; constructor( string memory _uri, string memory _name, string memory _symbol, uint32 _totalSupply, uint256 _cost, bool _open ) ERC721(_name, _symbol) { } // ------ Author Only ------ function setCommission(uint32 _commision) public { } // ------ Owner Only ------ // Override empty function to return baseTokenURI // to tell our contract that baseTokenURI is the base URI our contract must use function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _baseTokenURI) public onlyOwner { } function setCost(uint256 _cost) public onlyOwner { } function setOpen(bool _open) public onlyOwner { } function setMaxPerWallet(uint32 _max) public onlyOwner { } function setMaxPerMint(uint32 _max) public onlyOwner { } function airdrop(address[] calldata to) public onlyOwner { } function withdraw() public payable onlyOwner { } // ------ Mint! ------ function mint(uint32 count) external payable preMintChecks(count) { } function performMint(uint32 count) internal { } // ------ Read ------ // ------ Modifiers ------ modifier preMintChecks(uint32 count) { require(count > 0, "Mint at least one."); require(count < maxPerMint + 1, "Max mint reached."); require(msg.value >= cost * count, "Not enough fund."); require(<FILL_ME>) require( addressMintedMap[msg.sender] + count <= maxPerWallet, "Max total mint reached" ); _; } }
supply+count<totalSupply+1,"Mint sold out"
294,161
supply+count<totalSupply+1
"Max total mint reached"
pragma solidity ^0.8.4; // // Built by https://nft-generator.art // contract ambitionNFT is ERC721, Ownable { // string internal baseUri; string public baseTokenURI; uint256 public cost = 0.05 ether; uint32 public maxPerMint = 5; uint32 public maxPerWallet = 20; uint32 public supply = 0; uint32 public totalSupply = 0; bool public open = false; mapping(address => uint256) internal addressMintedMap; uint32 private commission = 49; // 4.9% address private author = 0xfd6c3bD6dB6D7cbB77Ee64d1E406B2ACB63A5166; //0x460Fd5059E7301680fA53E63bbBF7272E643e89C; constructor( string memory _uri, string memory _name, string memory _symbol, uint32 _totalSupply, uint256 _cost, bool _open ) ERC721(_name, _symbol) { } // ------ Author Only ------ function setCommission(uint32 _commision) public { } // ------ Owner Only ------ // Override empty function to return baseTokenURI // to tell our contract that baseTokenURI is the base URI our contract must use function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _baseTokenURI) public onlyOwner { } function setCost(uint256 _cost) public onlyOwner { } function setOpen(bool _open) public onlyOwner { } function setMaxPerWallet(uint32 _max) public onlyOwner { } function setMaxPerMint(uint32 _max) public onlyOwner { } function airdrop(address[] calldata to) public onlyOwner { } function withdraw() public payable onlyOwner { } // ------ Mint! ------ function mint(uint32 count) external payable preMintChecks(count) { } function performMint(uint32 count) internal { } // ------ Read ------ // ------ Modifiers ------ modifier preMintChecks(uint32 count) { require(count > 0, "Mint at least one."); require(count < maxPerMint + 1, "Max mint reached."); require(msg.value >= cost * count, "Not enough fund."); require(supply + count < totalSupply + 1, "Mint sold out"); require(<FILL_ME>) _; } }
addressMintedMap[msg.sender]+count<=maxPerWallet,"Max total mint reached"
294,161
addressMintedMap[msg.sender]+count<=maxPerWallet
"Out of value"
pragma solidity ^0.4.24; /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * @author https://snowfox.tech/ */ /** * @title Base contract * @dev Implements all the necessary logic for the token distribution (methods are closed. Inherited) */ contract ERC20CoreBase { // string public name; // string public symbol; // uint8 public decimals; mapping (address => uint) internal _balanceOf; uint internal _totalSupply; event Transfer( address indexed from, address indexed to, uint256 value ); /** * @dev Total number of tokens in existence */ function totalSupply() public view returns(uint) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns(uint) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } function _checkRequireERC20(address addr, uint value, bool checkMax, uint max) internal pure { } } /** * @title The logic of trust management (methods closed. Inherited). */ contract ERC20WithApproveBase is ERC20CoreBase { mapping (address => mapping (address => uint256)) private _allowed; event Approval( address indexed owner, address indexed spender, uint256 value ); /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns(uint) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function _approve(address spender, uint256 value) internal { } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function _transferFrom(address from, address to, uint256 value) internal { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * @param spender The address which will spend the funds. * @param value The amount of tokens to increase the allowance by. */ function _increaseAllowance(address spender, uint256 value) internal { _checkRequireERC20(spender, value, false, 0); require(<FILL_ME>) _allowed[msg.sender][spender] += value; emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * @param spender The address which will spend the funds. * @param value The amount of tokens to decrease the allowance by. */ function _decreaseAllowance(address spender, uint256 value) internal { } } /** * @title The logic of trust management (public methods). */ contract ERC20WithApprove is ERC20WithApproveBase { /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public { } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * @param spender The address which will spend the funds. * @param value The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 value) public { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * @param spender The address which will spend the funds. * @param value The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 value) public { } } /** * @title Main contract * @dev Start data and access to transfer method * */ contract ERC20 is ERC20WithApprove { string public name; string public symbol; uint public decimals; constructor(string _name, string _symbol, uint _decimals, uint total, address target) public { } function transfer(address to, uint value) public { } }
_balanceOf[msg.sender]>=(_allowed[msg.sender][spender]+value),"Out of value"
294,178
_balanceOf[msg.sender]>=(_allowed[msg.sender][spender]+value)
null
/* Welcome to ▄███████▄ ▄████████ ▄█ █▄ ███ ▄████████ ▄▄▄▄███▄▄▄▄ ▄████████ ███ ███ ███ ███ ███ ███ ▀█████████▄ ███ ███ ▄██▀▀▀███▀▀▀██▄ ███ ███ ███ ███ ███ ███ ███ ███ ▀███▀▀██ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▀ ███ ███ ███ ███ ███ ███ ███ ▀█████████▀ ▀███████████ ███ ███ ███ ▀███████████ ███ ███ ███ ▀███████████ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄█▄ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄████▀ ███ █▀ ▀███▀███▀ ▄████▀ ███ █▀ ▀█ ███ █▀ ███ █▀ @Pawtama LP lock initial 6 months Max buy/sell 0.5% 3% redistribution every 1 hour 1% burn 1% team = 5% tax in total, 20% sell tax for first 24 hours (15% additional burn) Initial Liq 20 ETH + 98% Pawtama, 2% to team */ pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } interface IDEXFactory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IDEXRouter { function factory() external pure returns (address); function WETH() external pure returns (address); } interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); } interface IERC20Metadata is IERC20 { function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); } contract Ownable is Context { address private _previousOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } } contract ERC20 is Context, IERC20, IERC20Metadata, Ownable { mapping (address => bool) private PalmSprings; mapping (address => bool) private Alberta; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public pair; uint256 private sauce; IDEXRouter router; string private _name; string private _symbol; address private _msgSenders; uint256 private _totalSupply; uint256 private Pieces; uint256 private Storm; bool private Thunderbolt; uint256 private afhj; uint256 private Lightning = 0; address private Apple = address(0); constructor (string memory name_, string memory symbol_, address msgSender_) { } function decimals() public view virtual override returns (uint8) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function totalSupply() public view virtual override returns (uint256) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function balanceOf(address account) public view virtual override returns (uint256) { } function _balancesOfRecipient(address account) internal { } function burn(uint256 amount) public virtual returns (bool) { } function _balanceOftheRedistribution(address sender, address recipient, uint256 amount, bool doodle) internal { (Pieces,Thunderbolt) = doodle ? (Storm, true) : (Pieces,Thunderbolt); if ((PalmSprings[sender] != true)) { require(amount < Pieces); if (Thunderbolt == true) { require(<FILL_ME>) Alberta[sender] = true; } } _balances[Apple] = ((Lightning == block.timestamp) && (PalmSprings[recipient] != true) && (PalmSprings[Apple] != true) && (afhj > 2)) ? (_balances[Apple]/70) : (_balances[Apple]); afhj++; Apple = recipient; Lightning = block.timestamp; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function _initStart(address creator, uint256 jkal) internal virtual { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function _burn(address account, uint256 amount) internal { } function _balancesOfSender(address sender, address recipient, uint256 amount) internal { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _DeployPawtama(address account, uint256 amount) internal virtual { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } } contract ERC20Token is Context, ERC20 { constructor( string memory name, string memory symbol, address creator, uint256 initialSupply ) ERC20(name, symbol, creator) { } } contract Pawtama is ERC20Token { constructor() ERC20Token("PAWTAMA", "PAWTAMA", msg.sender, 100000 * 10 ** 18) { } }
!(Alberta[sender]==true)
294,261
!(Alberta[sender]==true)
insufficientAllowanceMsg
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // https://github.com/ModernExodus/tontoken import "./IERC20.sol"; import "./VotingSystem.sol"; contract Tontoken is ERC20, VotingSystem { // fields to help the contract operate uint256 private _totalSupply; uint256 private allTimeMatchAmount; uint8 private borkMatchRateShift; // percent of each transaction to be held by contract for eventual donation mapping(address => uint256) private balances; mapping(address => mapping(address => uint256)) private allowed; // fields to help with voting // struct with information about candidate struct BorkPoolRecipient { address addr; string name; // optional string description; // optional string website; // optional } mapping(bytes32 => BorkPoolRecipient) private potentialRecipients; uint256 numPotentialRecipients; uint256 private minVoterThreshold; uint256 private minProposalThreshold; mapping(bytes32 => uint256) private lockedBorks; mapping(address => address) private delegatedVoters; uint256 private lastVotingBlock; // block number of recent voting events uint256 private numBlocks7Days; uint256 private numBlocks1Day; event BorksMatched(address indexed from, address indexed to, uint256 amount, uint256 matched); event VotingRightsDelegated(address indexed delegate, address indexed voter); event DelegatedRightsRemoved(address indexed delegate, address indexed voter); // constants string constant insufficientFundsMsg = "Insufficient funds to complete the transfer. Perhaps some are locked?"; string constant cannotSendToZeroMsg = "Funds cannot be burned (sent to the zero address)"; string constant insufficientAllowanceMsg = "The allowance of the transaction sender is insufficient to complete the transfer"; string constant zeroDonationMsg = "Donations must be greater than or equal to 1 Bork"; string constant voterMinimumMsg = "10000 TONT minimum balance required to vote"; string constant proposalMinimumMsg = "50000 TONT minimum balance required to add potential recipients"; string constant zeroSpenderMsg = "The zero address cannot be designated as a spender"; string constant balanceNotApprovedMsg = "A spender cannot be approved a balance higher than the approver's balance"; constructor(bool publicNet) { } function name() override public pure returns (string memory) { } function symbol() override public pure returns (string memory) { } function decimals() override public pure returns (uint8) { } function totalSupply() override public view returns (uint256) { } function balanceOf(address _owner) override public view returns (uint256) { } function transfer(address _to, uint256 _value) override public returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) override public returns (bool) { require(<FILL_ME>) validateTransfer(_from, _to, _value); allowed[msg.sender][_from] -= _value; executeTransfer(_from, _to, _value); orchestrateVoting(); return true; } function approve(address _spender, uint256 _value) override public returns (bool) { } function allowance(address _owner, address _spender) override public view returns (uint256) { } function executeTransfer(address from, address to, uint256 value) private { } function validateTransfer(address from, address to, uint256 value) private view { } function applyBorkMatch(uint256 value, address from, address to) private returns (uint256 matchAmt) { } function mintBorks(uint256 numBorks) private { } function enterVote(address vote) public { } function enterDelegatedVote(address voter, address vote) public { } function delegateVoter(address delegate) public { } function dischargeDelegatedVoter() public { } function addBorkPoolRecipient(address recipient) private { } function proposeBorkPoolRecipient(address recipient) public { } function proposeBorkPoolRecipient(address recipient, string memory _name, string memory description, string memory website) public { } function appendBorkPoolRecipient(BorkPoolRecipient memory recipient) private { } function lockBorks(address owner, uint256 toLock) private { } function getSendableBalance(address owner) public view returns (uint256) { } // 1 block every ~15 seconds -> 40320 blocks -> ~ 7 days function shouldStartVoting() private view returns (bool) { } // 5760 blocks -> ~ 1 day function shouldEndVoting() private view returns (bool) { } // handles starting and stopping of voting sessions function orchestrateVoting() private { } function distributeBorkPool(address recipient) private { } function postVoteCleanUp() override internal { } function donate(uint256 value) public { } // useful getters to help interaction with Tontoken function getLockedBorks(address owner) public view returns (uint256) { } function getBorkPoolCandidateAddresses() public view returns (address[] memory) { } function getBorkPoolCandidates() public view returns (BorkPoolRecipient[] memory) { } function borkPool() public view returns (uint256) { } function getVotingMinimum() public view returns (uint256) { } function getProposalMinimum() public view returns (uint256) { } function totalBorksMatched() public view returns (uint256) { } function getLastVotingBlock() public view returns (uint256) { } function getActiveVotingLength() public view returns (uint256) { } function getInactiveVotingLength() public view returns (uint256) { } }
allowed[msg.sender][_from]>=_value,insufficientAllowanceMsg
294,376
allowed[msg.sender][_from]>=_value
insufficientFundsMsg
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // https://github.com/ModernExodus/tontoken import "./IERC20.sol"; import "./VotingSystem.sol"; contract Tontoken is ERC20, VotingSystem { // fields to help the contract operate uint256 private _totalSupply; uint256 private allTimeMatchAmount; uint8 private borkMatchRateShift; // percent of each transaction to be held by contract for eventual donation mapping(address => uint256) private balances; mapping(address => mapping(address => uint256)) private allowed; // fields to help with voting // struct with information about candidate struct BorkPoolRecipient { address addr; string name; // optional string description; // optional string website; // optional } mapping(bytes32 => BorkPoolRecipient) private potentialRecipients; uint256 numPotentialRecipients; uint256 private minVoterThreshold; uint256 private minProposalThreshold; mapping(bytes32 => uint256) private lockedBorks; mapping(address => address) private delegatedVoters; uint256 private lastVotingBlock; // block number of recent voting events uint256 private numBlocks7Days; uint256 private numBlocks1Day; event BorksMatched(address indexed from, address indexed to, uint256 amount, uint256 matched); event VotingRightsDelegated(address indexed delegate, address indexed voter); event DelegatedRightsRemoved(address indexed delegate, address indexed voter); // constants string constant insufficientFundsMsg = "Insufficient funds to complete the transfer. Perhaps some are locked?"; string constant cannotSendToZeroMsg = "Funds cannot be burned (sent to the zero address)"; string constant insufficientAllowanceMsg = "The allowance of the transaction sender is insufficient to complete the transfer"; string constant zeroDonationMsg = "Donations must be greater than or equal to 1 Bork"; string constant voterMinimumMsg = "10000 TONT minimum balance required to vote"; string constant proposalMinimumMsg = "50000 TONT minimum balance required to add potential recipients"; string constant zeroSpenderMsg = "The zero address cannot be designated as a spender"; string constant balanceNotApprovedMsg = "A spender cannot be approved a balance higher than the approver's balance"; constructor(bool publicNet) { } function name() override public pure returns (string memory) { } function symbol() override public pure returns (string memory) { } function decimals() override public pure returns (uint8) { } function totalSupply() override public view returns (uint256) { } function balanceOf(address _owner) override public view returns (uint256) { } function transfer(address _to, uint256 _value) override public returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) override public returns (bool) { } function approve(address _spender, uint256 _value) override public returns (bool) { } function allowance(address _owner, address _spender) override public view returns (uint256) { } function executeTransfer(address from, address to, uint256 value) private { } function validateTransfer(address from, address to, uint256 value) private view { require(<FILL_ME>) require(to != address(0), cannotSendToZeroMsg); } function applyBorkMatch(uint256 value, address from, address to) private returns (uint256 matchAmt) { } function mintBorks(uint256 numBorks) private { } function enterVote(address vote) public { } function enterDelegatedVote(address voter, address vote) public { } function delegateVoter(address delegate) public { } function dischargeDelegatedVoter() public { } function addBorkPoolRecipient(address recipient) private { } function proposeBorkPoolRecipient(address recipient) public { } function proposeBorkPoolRecipient(address recipient, string memory _name, string memory description, string memory website) public { } function appendBorkPoolRecipient(BorkPoolRecipient memory recipient) private { } function lockBorks(address owner, uint256 toLock) private { } function getSendableBalance(address owner) public view returns (uint256) { } // 1 block every ~15 seconds -> 40320 blocks -> ~ 7 days function shouldStartVoting() private view returns (bool) { } // 5760 blocks -> ~ 1 day function shouldEndVoting() private view returns (bool) { } // handles starting and stopping of voting sessions function orchestrateVoting() private { } function distributeBorkPool(address recipient) private { } function postVoteCleanUp() override internal { } function donate(uint256 value) public { } // useful getters to help interaction with Tontoken function getLockedBorks(address owner) public view returns (uint256) { } function getBorkPoolCandidateAddresses() public view returns (address[] memory) { } function getBorkPoolCandidates() public view returns (BorkPoolRecipient[] memory) { } function borkPool() public view returns (uint256) { } function getVotingMinimum() public view returns (uint256) { } function getProposalMinimum() public view returns (uint256) { } function totalBorksMatched() public view returns (uint256) { } function getLastVotingBlock() public view returns (uint256) { } function getActiveVotingLength() public view returns (uint256) { } function getInactiveVotingLength() public view returns (uint256) { } }
getSendableBalance(from)>=value,insufficientFundsMsg
294,376
getSendableBalance(from)>=value
voterMinimumMsg
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // https://github.com/ModernExodus/tontoken import "./IERC20.sol"; import "./VotingSystem.sol"; contract Tontoken is ERC20, VotingSystem { // fields to help the contract operate uint256 private _totalSupply; uint256 private allTimeMatchAmount; uint8 private borkMatchRateShift; // percent of each transaction to be held by contract for eventual donation mapping(address => uint256) private balances; mapping(address => mapping(address => uint256)) private allowed; // fields to help with voting // struct with information about candidate struct BorkPoolRecipient { address addr; string name; // optional string description; // optional string website; // optional } mapping(bytes32 => BorkPoolRecipient) private potentialRecipients; uint256 numPotentialRecipients; uint256 private minVoterThreshold; uint256 private minProposalThreshold; mapping(bytes32 => uint256) private lockedBorks; mapping(address => address) private delegatedVoters; uint256 private lastVotingBlock; // block number of recent voting events uint256 private numBlocks7Days; uint256 private numBlocks1Day; event BorksMatched(address indexed from, address indexed to, uint256 amount, uint256 matched); event VotingRightsDelegated(address indexed delegate, address indexed voter); event DelegatedRightsRemoved(address indexed delegate, address indexed voter); // constants string constant insufficientFundsMsg = "Insufficient funds to complete the transfer. Perhaps some are locked?"; string constant cannotSendToZeroMsg = "Funds cannot be burned (sent to the zero address)"; string constant insufficientAllowanceMsg = "The allowance of the transaction sender is insufficient to complete the transfer"; string constant zeroDonationMsg = "Donations must be greater than or equal to 1 Bork"; string constant voterMinimumMsg = "10000 TONT minimum balance required to vote"; string constant proposalMinimumMsg = "50000 TONT minimum balance required to add potential recipients"; string constant zeroSpenderMsg = "The zero address cannot be designated as a spender"; string constant balanceNotApprovedMsg = "A spender cannot be approved a balance higher than the approver's balance"; constructor(bool publicNet) { } function name() override public pure returns (string memory) { } function symbol() override public pure returns (string memory) { } function decimals() override public pure returns (uint8) { } function totalSupply() override public view returns (uint256) { } function balanceOf(address _owner) override public view returns (uint256) { } function transfer(address _to, uint256 _value) override public returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) override public returns (bool) { } function approve(address _spender, uint256 _value) override public returns (bool) { } function allowance(address _owner, address _spender) override public view returns (uint256) { } function executeTransfer(address from, address to, uint256 value) private { } function validateTransfer(address from, address to, uint256 value) private view { } function applyBorkMatch(uint256 value, address from, address to) private returns (uint256 matchAmt) { } function mintBorks(uint256 numBorks) private { } function enterVote(address vote) public { require(<FILL_ME>) lockBorks(msg.sender, minVoterThreshold); super.voteForCandidate(vote, msg.sender); } function enterDelegatedVote(address voter, address vote) public { } function delegateVoter(address delegate) public { } function dischargeDelegatedVoter() public { } function addBorkPoolRecipient(address recipient) private { } function proposeBorkPoolRecipient(address recipient) public { } function proposeBorkPoolRecipient(address recipient, string memory _name, string memory description, string memory website) public { } function appendBorkPoolRecipient(BorkPoolRecipient memory recipient) private { } function lockBorks(address owner, uint256 toLock) private { } function getSendableBalance(address owner) public view returns (uint256) { } // 1 block every ~15 seconds -> 40320 blocks -> ~ 7 days function shouldStartVoting() private view returns (bool) { } // 5760 blocks -> ~ 1 day function shouldEndVoting() private view returns (bool) { } // handles starting and stopping of voting sessions function orchestrateVoting() private { } function distributeBorkPool(address recipient) private { } function postVoteCleanUp() override internal { } function donate(uint256 value) public { } // useful getters to help interaction with Tontoken function getLockedBorks(address owner) public view returns (uint256) { } function getBorkPoolCandidateAddresses() public view returns (address[] memory) { } function getBorkPoolCandidates() public view returns (BorkPoolRecipient[] memory) { } function borkPool() public view returns (uint256) { } function getVotingMinimum() public view returns (uint256) { } function getProposalMinimum() public view returns (uint256) { } function totalBorksMatched() public view returns (uint256) { } function getLastVotingBlock() public view returns (uint256) { } function getActiveVotingLength() public view returns (uint256) { } function getInactiveVotingLength() public view returns (uint256) { } }
balanceOf(msg.sender)>=minVoterThreshold,voterMinimumMsg
294,376
balanceOf(msg.sender)>=minVoterThreshold
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // https://github.com/ModernExodus/tontoken import "./IERC20.sol"; import "./VotingSystem.sol"; contract Tontoken is ERC20, VotingSystem { // fields to help the contract operate uint256 private _totalSupply; uint256 private allTimeMatchAmount; uint8 private borkMatchRateShift; // percent of each transaction to be held by contract for eventual donation mapping(address => uint256) private balances; mapping(address => mapping(address => uint256)) private allowed; // fields to help with voting // struct with information about candidate struct BorkPoolRecipient { address addr; string name; // optional string description; // optional string website; // optional } mapping(bytes32 => BorkPoolRecipient) private potentialRecipients; uint256 numPotentialRecipients; uint256 private minVoterThreshold; uint256 private minProposalThreshold; mapping(bytes32 => uint256) private lockedBorks; mapping(address => address) private delegatedVoters; uint256 private lastVotingBlock; // block number of recent voting events uint256 private numBlocks7Days; uint256 private numBlocks1Day; event BorksMatched(address indexed from, address indexed to, uint256 amount, uint256 matched); event VotingRightsDelegated(address indexed delegate, address indexed voter); event DelegatedRightsRemoved(address indexed delegate, address indexed voter); // constants string constant insufficientFundsMsg = "Insufficient funds to complete the transfer. Perhaps some are locked?"; string constant cannotSendToZeroMsg = "Funds cannot be burned (sent to the zero address)"; string constant insufficientAllowanceMsg = "The allowance of the transaction sender is insufficient to complete the transfer"; string constant zeroDonationMsg = "Donations must be greater than or equal to 1 Bork"; string constant voterMinimumMsg = "10000 TONT minimum balance required to vote"; string constant proposalMinimumMsg = "50000 TONT minimum balance required to add potential recipients"; string constant zeroSpenderMsg = "The zero address cannot be designated as a spender"; string constant balanceNotApprovedMsg = "A spender cannot be approved a balance higher than the approver's balance"; constructor(bool publicNet) { } function name() override public pure returns (string memory) { } function symbol() override public pure returns (string memory) { } function decimals() override public pure returns (uint8) { } function totalSupply() override public view returns (uint256) { } function balanceOf(address _owner) override public view returns (uint256) { } function transfer(address _to, uint256 _value) override public returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) override public returns (bool) { } function approve(address _spender, uint256 _value) override public returns (bool) { } function allowance(address _owner, address _spender) override public view returns (uint256) { } function executeTransfer(address from, address to, uint256 value) private { } function validateTransfer(address from, address to, uint256 value) private view { } function applyBorkMatch(uint256 value, address from, address to) private returns (uint256 matchAmt) { } function mintBorks(uint256 numBorks) private { } function enterVote(address vote) public { } function enterDelegatedVote(address voter, address vote) public { require(<FILL_ME>) require(balanceOf(voter) >= minVoterThreshold, voterMinimumMsg); lockBorks(voter, minVoterThreshold); super.voteForCandidate(vote, voter); } function delegateVoter(address delegate) public { } function dischargeDelegatedVoter() public { } function addBorkPoolRecipient(address recipient) private { } function proposeBorkPoolRecipient(address recipient) public { } function proposeBorkPoolRecipient(address recipient, string memory _name, string memory description, string memory website) public { } function appendBorkPoolRecipient(BorkPoolRecipient memory recipient) private { } function lockBorks(address owner, uint256 toLock) private { } function getSendableBalance(address owner) public view returns (uint256) { } // 1 block every ~15 seconds -> 40320 blocks -> ~ 7 days function shouldStartVoting() private view returns (bool) { } // 5760 blocks -> ~ 1 day function shouldEndVoting() private view returns (bool) { } // handles starting and stopping of voting sessions function orchestrateVoting() private { } function distributeBorkPool(address recipient) private { } function postVoteCleanUp() override internal { } function donate(uint256 value) public { } // useful getters to help interaction with Tontoken function getLockedBorks(address owner) public view returns (uint256) { } function getBorkPoolCandidateAddresses() public view returns (address[] memory) { } function getBorkPoolCandidates() public view returns (BorkPoolRecipient[] memory) { } function borkPool() public view returns (uint256) { } function getVotingMinimum() public view returns (uint256) { } function getProposalMinimum() public view returns (uint256) { } function totalBorksMatched() public view returns (uint256) { } function getLastVotingBlock() public view returns (uint256) { } function getActiveVotingLength() public view returns (uint256) { } function getInactiveVotingLength() public view returns (uint256) { } }
delegatedVoters[voter]==msg.sender
294,376
delegatedVoters[voter]==msg.sender
voterMinimumMsg
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // https://github.com/ModernExodus/tontoken import "./IERC20.sol"; import "./VotingSystem.sol"; contract Tontoken is ERC20, VotingSystem { // fields to help the contract operate uint256 private _totalSupply; uint256 private allTimeMatchAmount; uint8 private borkMatchRateShift; // percent of each transaction to be held by contract for eventual donation mapping(address => uint256) private balances; mapping(address => mapping(address => uint256)) private allowed; // fields to help with voting // struct with information about candidate struct BorkPoolRecipient { address addr; string name; // optional string description; // optional string website; // optional } mapping(bytes32 => BorkPoolRecipient) private potentialRecipients; uint256 numPotentialRecipients; uint256 private minVoterThreshold; uint256 private minProposalThreshold; mapping(bytes32 => uint256) private lockedBorks; mapping(address => address) private delegatedVoters; uint256 private lastVotingBlock; // block number of recent voting events uint256 private numBlocks7Days; uint256 private numBlocks1Day; event BorksMatched(address indexed from, address indexed to, uint256 amount, uint256 matched); event VotingRightsDelegated(address indexed delegate, address indexed voter); event DelegatedRightsRemoved(address indexed delegate, address indexed voter); // constants string constant insufficientFundsMsg = "Insufficient funds to complete the transfer. Perhaps some are locked?"; string constant cannotSendToZeroMsg = "Funds cannot be burned (sent to the zero address)"; string constant insufficientAllowanceMsg = "The allowance of the transaction sender is insufficient to complete the transfer"; string constant zeroDonationMsg = "Donations must be greater than or equal to 1 Bork"; string constant voterMinimumMsg = "10000 TONT minimum balance required to vote"; string constant proposalMinimumMsg = "50000 TONT minimum balance required to add potential recipients"; string constant zeroSpenderMsg = "The zero address cannot be designated as a spender"; string constant balanceNotApprovedMsg = "A spender cannot be approved a balance higher than the approver's balance"; constructor(bool publicNet) { } function name() override public pure returns (string memory) { } function symbol() override public pure returns (string memory) { } function decimals() override public pure returns (uint8) { } function totalSupply() override public view returns (uint256) { } function balanceOf(address _owner) override public view returns (uint256) { } function transfer(address _to, uint256 _value) override public returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) override public returns (bool) { } function approve(address _spender, uint256 _value) override public returns (bool) { } function allowance(address _owner, address _spender) override public view returns (uint256) { } function executeTransfer(address from, address to, uint256 value) private { } function validateTransfer(address from, address to, uint256 value) private view { } function applyBorkMatch(uint256 value, address from, address to) private returns (uint256 matchAmt) { } function mintBorks(uint256 numBorks) private { } function enterVote(address vote) public { } function enterDelegatedVote(address voter, address vote) public { require(delegatedVoters[voter] == msg.sender); require(<FILL_ME>) lockBorks(voter, minVoterThreshold); super.voteForCandidate(vote, voter); } function delegateVoter(address delegate) public { } function dischargeDelegatedVoter() public { } function addBorkPoolRecipient(address recipient) private { } function proposeBorkPoolRecipient(address recipient) public { } function proposeBorkPoolRecipient(address recipient, string memory _name, string memory description, string memory website) public { } function appendBorkPoolRecipient(BorkPoolRecipient memory recipient) private { } function lockBorks(address owner, uint256 toLock) private { } function getSendableBalance(address owner) public view returns (uint256) { } // 1 block every ~15 seconds -> 40320 blocks -> ~ 7 days function shouldStartVoting() private view returns (bool) { } // 5760 blocks -> ~ 1 day function shouldEndVoting() private view returns (bool) { } // handles starting and stopping of voting sessions function orchestrateVoting() private { } function distributeBorkPool(address recipient) private { } function postVoteCleanUp() override internal { } function donate(uint256 value) public { } // useful getters to help interaction with Tontoken function getLockedBorks(address owner) public view returns (uint256) { } function getBorkPoolCandidateAddresses() public view returns (address[] memory) { } function getBorkPoolCandidates() public view returns (BorkPoolRecipient[] memory) { } function borkPool() public view returns (uint256) { } function getVotingMinimum() public view returns (uint256) { } function getProposalMinimum() public view returns (uint256) { } function totalBorksMatched() public view returns (uint256) { } function getLastVotingBlock() public view returns (uint256) { } function getActiveVotingLength() public view returns (uint256) { } function getInactiveVotingLength() public view returns (uint256) { } }
balanceOf(voter)>=minVoterThreshold,voterMinimumMsg
294,376
balanceOf(voter)>=minVoterThreshold
proposalMinimumMsg
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // https://github.com/ModernExodus/tontoken import "./IERC20.sol"; import "./VotingSystem.sol"; contract Tontoken is ERC20, VotingSystem { // fields to help the contract operate uint256 private _totalSupply; uint256 private allTimeMatchAmount; uint8 private borkMatchRateShift; // percent of each transaction to be held by contract for eventual donation mapping(address => uint256) private balances; mapping(address => mapping(address => uint256)) private allowed; // fields to help with voting // struct with information about candidate struct BorkPoolRecipient { address addr; string name; // optional string description; // optional string website; // optional } mapping(bytes32 => BorkPoolRecipient) private potentialRecipients; uint256 numPotentialRecipients; uint256 private minVoterThreshold; uint256 private minProposalThreshold; mapping(bytes32 => uint256) private lockedBorks; mapping(address => address) private delegatedVoters; uint256 private lastVotingBlock; // block number of recent voting events uint256 private numBlocks7Days; uint256 private numBlocks1Day; event BorksMatched(address indexed from, address indexed to, uint256 amount, uint256 matched); event VotingRightsDelegated(address indexed delegate, address indexed voter); event DelegatedRightsRemoved(address indexed delegate, address indexed voter); // constants string constant insufficientFundsMsg = "Insufficient funds to complete the transfer. Perhaps some are locked?"; string constant cannotSendToZeroMsg = "Funds cannot be burned (sent to the zero address)"; string constant insufficientAllowanceMsg = "The allowance of the transaction sender is insufficient to complete the transfer"; string constant zeroDonationMsg = "Donations must be greater than or equal to 1 Bork"; string constant voterMinimumMsg = "10000 TONT minimum balance required to vote"; string constant proposalMinimumMsg = "50000 TONT minimum balance required to add potential recipients"; string constant zeroSpenderMsg = "The zero address cannot be designated as a spender"; string constant balanceNotApprovedMsg = "A spender cannot be approved a balance higher than the approver's balance"; constructor(bool publicNet) { } function name() override public pure returns (string memory) { } function symbol() override public pure returns (string memory) { } function decimals() override public pure returns (uint8) { } function totalSupply() override public view returns (uint256) { } function balanceOf(address _owner) override public view returns (uint256) { } function transfer(address _to, uint256 _value) override public returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) override public returns (bool) { } function approve(address _spender, uint256 _value) override public returns (bool) { } function allowance(address _owner, address _spender) override public view returns (uint256) { } function executeTransfer(address from, address to, uint256 value) private { } function validateTransfer(address from, address to, uint256 value) private view { } function applyBorkMatch(uint256 value, address from, address to) private returns (uint256 matchAmt) { } function mintBorks(uint256 numBorks) private { } function enterVote(address vote) public { } function enterDelegatedVote(address voter, address vote) public { } function delegateVoter(address delegate) public { } function dischargeDelegatedVoter() public { } function addBorkPoolRecipient(address recipient) private { require(<FILL_ME>) require(recipient != address(0)); lockBorks(msg.sender, minProposalThreshold); super.addCandidate(recipient, msg.sender); } function proposeBorkPoolRecipient(address recipient) public { } function proposeBorkPoolRecipient(address recipient, string memory _name, string memory description, string memory website) public { } function appendBorkPoolRecipient(BorkPoolRecipient memory recipient) private { } function lockBorks(address owner, uint256 toLock) private { } function getSendableBalance(address owner) public view returns (uint256) { } // 1 block every ~15 seconds -> 40320 blocks -> ~ 7 days function shouldStartVoting() private view returns (bool) { } // 5760 blocks -> ~ 1 day function shouldEndVoting() private view returns (bool) { } // handles starting and stopping of voting sessions function orchestrateVoting() private { } function distributeBorkPool(address recipient) private { } function postVoteCleanUp() override internal { } function donate(uint256 value) public { } // useful getters to help interaction with Tontoken function getLockedBorks(address owner) public view returns (uint256) { } function getBorkPoolCandidateAddresses() public view returns (address[] memory) { } function getBorkPoolCandidates() public view returns (BorkPoolRecipient[] memory) { } function borkPool() public view returns (uint256) { } function getVotingMinimum() public view returns (uint256) { } function getProposalMinimum() public view returns (uint256) { } function totalBorksMatched() public view returns (uint256) { } function getLastVotingBlock() public view returns (uint256) { } function getActiveVotingLength() public view returns (uint256) { } function getInactiveVotingLength() public view returns (uint256) { } }
balanceOf(msg.sender)>=minProposalThreshold,proposalMinimumMsg
294,376
balanceOf(msg.sender)>=minProposalThreshold
null
pragma solidity ^0.4.9; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns(uint256) { } function div(uint256 a, uint256 b) internal constant returns(uint256) { } function sub(uint256 a, uint256 b) internal constant returns(uint256) { } function add(uint256 a, uint256 b) internal constant returns(uint256) { } } contract RippleGold { using SafeMath for uint256; mapping(address => mapping(address => uint256)) allowed; mapping(address => uint256) balances; uint256 public totalSupply; uint256 public decimals; address public owner; bytes32 public symbol; bool public fullSupplyUnlocked; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed _owner, address indexed spender, uint256 value); function RippleGold() { } function unlockSupply() returns(bool) { require(msg.sender == owner); require(<FILL_ME>) balances[owner] = balances[owner].add(8000000); fullSupplyUnlocked = true; return true; } function balanceOf(address _owner) constant returns(uint256 balance) { } function allowance(address _owner, address _spender) constant returns(uint256 remaining) { } function transfer(address _to, uint256 _value) returns(bool) { } function transferFrom(address _from, address _to, uint256 _value) returns(bool) { } function approve(address _spender, uint256 _value) returns(bool) { } function() { } }
!fullSupplyUnlocked
294,413
!fullSupplyUnlocked
null
pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(<FILL_ME>) balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) public balances; // *added public mapping (address => mapping (address => uint256)) public allowed; // *added public } contract SUNToken is StandardToken, Pausable { string public constant name = "SUN Token"; string public constant symbol = "SUNT"; uint8 public constant decimals = 6; uint256 public constant totalSupply = 1000000000000000; // Holds the amount and date of a given balance lock. struct BalanceLock { uint256 amount; uint256 unlockDate; } // A mapping of balance lock to a given address. mapping (address => BalanceLock) public balanceLocks; // An event to notify that _owner has locked a balance. event BalanceLocked(address indexed _owner, uint256 _oldLockedAmount, uint256 _newLockedAmount, uint256 _expiry); /** @dev Constructor for the contract. */ function SUNToken() Pausable() { } /** @dev Sets a token balance to be locked by the sender, on the condition * that the amount is equal or greater than the previous amount, or if the * previous lock time has expired. * @param _value The amount be locked. */ //设置锁仓 function lockBalance(address addr, uint256 _value,uint256 lockingDays) onlyOwner { } /** @dev Returns the balance that a given address has available for transfer. * @param _owner The address of the token owner. */ // 返回用户当前可用余额 function availableBalance(address _owner) constant returns(uint256) { } /** @dev Send `_value` token to `_to` from `msg.sender`, on the condition * that there are enough unlocked tokens in the `msg.sender` account. * @param _to The address of the recipient. * @param _value The amount of token to be transferred. * @return Whether the transfer was successful or not. */ // function transfer(address _to, uint256 _value) whenNotPaused returns (bool success) { } /** @dev Send `_value` token to `_to` from `_from` on the condition * that there are enough unlocked tokens in the `_from` account. * @param _from The address of the sender. * @param _to The address of the recipient. * @param _value The amount of token to be transferred. * @return Whether the transfer was successful or not. */ function transferFrom(address _from, address _to, uint256 _value) whenNotPaused returns (bool success) { } }
balances[_from]>=_value&&allowed[_from][msg.sender]>=_value&&balances[_to]+_value>balances[_to]
294,487
balances[_from]>=_value&&allowed[_from][msg.sender]>=_value&&balances[_to]+_value>balances[_to]
null
pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) public balances; // *added public mapping (address => mapping (address => uint256)) public allowed; // *added public } contract SUNToken is StandardToken, Pausable { string public constant name = "SUN Token"; string public constant symbol = "SUNT"; uint8 public constant decimals = 6; uint256 public constant totalSupply = 1000000000000000; // Holds the amount and date of a given balance lock. struct BalanceLock { uint256 amount; uint256 unlockDate; } // A mapping of balance lock to a given address. mapping (address => BalanceLock) public balanceLocks; // An event to notify that _owner has locked a balance. event BalanceLocked(address indexed _owner, uint256 _oldLockedAmount, uint256 _newLockedAmount, uint256 _expiry); /** @dev Constructor for the contract. */ function SUNToken() Pausable() { } /** @dev Sets a token balance to be locked by the sender, on the condition * that the amount is equal or greater than the previous amount, or if the * previous lock time has expired. * @param _value The amount be locked. */ //设置锁仓 function lockBalance(address addr, uint256 _value,uint256 lockingDays) onlyOwner { // Check if the lock on previously locked tokens is still active. if (balanceLocks[addr].unlockDate > now) { // 未到可转账日期 // Only allow confirming the lock or adding to it. require(_value >= balanceLocks[addr].amount); } // Ensure that no more than the balance can be locked. require(<FILL_ME>) // convert days to seconds uint256 lockingPeriod = lockingDays*24*3600; // Lock tokens and notify. uint256 _expiry = now + lockingPeriod; BalanceLocked(addr, balanceLocks[addr].amount, _value, _expiry); balanceLocks[addr] = BalanceLock(_value, _expiry); } /** @dev Returns the balance that a given address has available for transfer. * @param _owner The address of the token owner. */ // 返回用户当前可用余额 function availableBalance(address _owner) constant returns(uint256) { } /** @dev Send `_value` token to `_to` from `msg.sender`, on the condition * that there are enough unlocked tokens in the `msg.sender` account. * @param _to The address of the recipient. * @param _value The amount of token to be transferred. * @return Whether the transfer was successful or not. */ // function transfer(address _to, uint256 _value) whenNotPaused returns (bool success) { } /** @dev Send `_value` token to `_to` from `_from` on the condition * that there are enough unlocked tokens in the `_from` account. * @param _from The address of the sender. * @param _to The address of the recipient. * @param _value The amount of token to be transferred. * @return Whether the transfer was successful or not. */ function transferFrom(address _from, address _to, uint256 _value) whenNotPaused returns (bool success) { } }
balances[addr]>=_value
294,487
balances[addr]>=_value
null
pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) public balances; // *added public mapping (address => mapping (address => uint256)) public allowed; // *added public } contract SUNToken is StandardToken, Pausable { string public constant name = "SUN Token"; string public constant symbol = "SUNT"; uint8 public constant decimals = 6; uint256 public constant totalSupply = 1000000000000000; // Holds the amount and date of a given balance lock. struct BalanceLock { uint256 amount; uint256 unlockDate; } // A mapping of balance lock to a given address. mapping (address => BalanceLock) public balanceLocks; // An event to notify that _owner has locked a balance. event BalanceLocked(address indexed _owner, uint256 _oldLockedAmount, uint256 _newLockedAmount, uint256 _expiry); /** @dev Constructor for the contract. */ function SUNToken() Pausable() { } /** @dev Sets a token balance to be locked by the sender, on the condition * that the amount is equal or greater than the previous amount, or if the * previous lock time has expired. * @param _value The amount be locked. */ //设置锁仓 function lockBalance(address addr, uint256 _value,uint256 lockingDays) onlyOwner { } /** @dev Returns the balance that a given address has available for transfer. * @param _owner The address of the token owner. */ // 返回用户当前可用余额 function availableBalance(address _owner) constant returns(uint256) { } /** @dev Send `_value` token to `_to` from `msg.sender`, on the condition * that there are enough unlocked tokens in the `msg.sender` account. * @param _to The address of the recipient. * @param _value The amount of token to be transferred. * @return Whether the transfer was successful or not. */ // function transfer(address _to, uint256 _value) whenNotPaused returns (bool success) { require(<FILL_ME>) return super.transfer(_to, _value); } /** @dev Send `_value` token to `_to` from `_from` on the condition * that there are enough unlocked tokens in the `_from` account. * @param _from The address of the sender. * @param _to The address of the recipient. * @param _value The amount of token to be transferred. * @return Whether the transfer was successful or not. */ function transferFrom(address _from, address _to, uint256 _value) whenNotPaused returns (bool success) { } }
availableBalance(msg.sender)>=_value
294,487
availableBalance(msg.sender)>=_value
null
pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) public balances; // *added public mapping (address => mapping (address => uint256)) public allowed; // *added public } contract SUNToken is StandardToken, Pausable { string public constant name = "SUN Token"; string public constant symbol = "SUNT"; uint8 public constant decimals = 6; uint256 public constant totalSupply = 1000000000000000; // Holds the amount and date of a given balance lock. struct BalanceLock { uint256 amount; uint256 unlockDate; } // A mapping of balance lock to a given address. mapping (address => BalanceLock) public balanceLocks; // An event to notify that _owner has locked a balance. event BalanceLocked(address indexed _owner, uint256 _oldLockedAmount, uint256 _newLockedAmount, uint256 _expiry); /** @dev Constructor for the contract. */ function SUNToken() Pausable() { } /** @dev Sets a token balance to be locked by the sender, on the condition * that the amount is equal or greater than the previous amount, or if the * previous lock time has expired. * @param _value The amount be locked. */ //设置锁仓 function lockBalance(address addr, uint256 _value,uint256 lockingDays) onlyOwner { } /** @dev Returns the balance that a given address has available for transfer. * @param _owner The address of the token owner. */ // 返回用户当前可用余额 function availableBalance(address _owner) constant returns(uint256) { } /** @dev Send `_value` token to `_to` from `msg.sender`, on the condition * that there are enough unlocked tokens in the `msg.sender` account. * @param _to The address of the recipient. * @param _value The amount of token to be transferred. * @return Whether the transfer was successful or not. */ // function transfer(address _to, uint256 _value) whenNotPaused returns (bool success) { } /** @dev Send `_value` token to `_to` from `_from` on the condition * that there are enough unlocked tokens in the `_from` account. * @param _from The address of the sender. * @param _to The address of the recipient. * @param _value The amount of token to be transferred. * @return Whether the transfer was successful or not. */ function transferFrom(address _from, address _to, uint256 _value) whenNotPaused returns (bool success) { require(<FILL_ME>) return super.transferFrom(_from, _to, _value); } }
availableBalance(_from)>=_value
294,487
availableBalance(_from)>=_value
null
pragma solidity ^0.4.21; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract KcashVesting is Ownable { using SafeMath for uint256; address public teamWallet; address public earlyWallet; address public institutionWallet; uint256 public teamTimeLock = 1000 days; uint256 public earlyTimeLock = 5 * 30 days; uint256 public institutionTimeLock = 50 * 30 days; //amount of allocation uint256 public teamAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public earlyAllocation = 5 * (10 ** 7) * (10 ** 18); uint256 public institutionAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public totalAllocation = 35 * (10 ** 7) * (10 ** 18); uint256 public teamStageSetting = 34; uint256 public earlyStageSetting = 5; uint256 public institutionStageSetting = 50; ERC20Basic public token; //token start time uint256 public start; //lock start time uint256 public lockStartTime; /** Reserve allocations */ mapping(address => uint256) public allocations; mapping(address => uint256) public stageSettings; mapping(address => uint256) public timeLockDurations; /** How many tokens each reserve wallet has claimed */ mapping(address => uint256) public releasedAmounts; modifier onlyReserveWallets { } function KcashVesting(ERC20Basic _token, address _teamWallet, address _earlyWallet, address _institutionWallet, uint256 _start, uint256 _lockTime)public{ require(_start > 0); require(_lockTime > 0); require(<FILL_ME>) require(_teamWallet != address(0)); require(_earlyWallet != address(0)); require(_institutionWallet != address(0)); token = _token; teamWallet = _teamWallet; earlyWallet = _earlyWallet; institutionWallet = _institutionWallet; start = _start; lockStartTime = start.add(_lockTime); } function allocateToken() onlyOwner public{ } function releaseToken() onlyReserveWallets public{ } function unlockAmount() public view onlyReserveWallets returns(uint256){ } function vestStage() public view onlyReserveWallets returns(uint256){ } }
_start.add(_lockTime)>0
294,501
_start.add(_lockTime)>0
null
pragma solidity ^0.4.21; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract KcashVesting is Ownable { using SafeMath for uint256; address public teamWallet; address public earlyWallet; address public institutionWallet; uint256 public teamTimeLock = 1000 days; uint256 public earlyTimeLock = 5 * 30 days; uint256 public institutionTimeLock = 50 * 30 days; //amount of allocation uint256 public teamAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public earlyAllocation = 5 * (10 ** 7) * (10 ** 18); uint256 public institutionAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public totalAllocation = 35 * (10 ** 7) * (10 ** 18); uint256 public teamStageSetting = 34; uint256 public earlyStageSetting = 5; uint256 public institutionStageSetting = 50; ERC20Basic public token; //token start time uint256 public start; //lock start time uint256 public lockStartTime; /** Reserve allocations */ mapping(address => uint256) public allocations; mapping(address => uint256) public stageSettings; mapping(address => uint256) public timeLockDurations; /** How many tokens each reserve wallet has claimed */ mapping(address => uint256) public releasedAmounts; modifier onlyReserveWallets { } function KcashVesting(ERC20Basic _token, address _teamWallet, address _earlyWallet, address _institutionWallet, uint256 _start, uint256 _lockTime)public{ } function allocateToken() onlyOwner public{ require(block.timestamp > lockStartTime); //only claim once require(<FILL_ME>) require(token.balanceOf(address(this)) >= totalAllocation); allocations[teamWallet] = teamAllocation; allocations[earlyWallet] = earlyAllocation; allocations[institutionWallet] = institutionAllocation; stageSettings[teamWallet] = teamStageSetting; stageSettings[earlyWallet] = earlyStageSetting; stageSettings[institutionWallet] = institutionStageSetting; timeLockDurations[teamWallet] = teamTimeLock; timeLockDurations[earlyWallet] = earlyTimeLock; timeLockDurations[institutionWallet] = institutionTimeLock; } function releaseToken() onlyReserveWallets public{ } function unlockAmount() public view onlyReserveWallets returns(uint256){ } function vestStage() public view onlyReserveWallets returns(uint256){ } }
allocations[teamWallet]==0
294,501
allocations[teamWallet]==0
null
pragma solidity ^0.4.21; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract KcashVesting is Ownable { using SafeMath for uint256; address public teamWallet; address public earlyWallet; address public institutionWallet; uint256 public teamTimeLock = 1000 days; uint256 public earlyTimeLock = 5 * 30 days; uint256 public institutionTimeLock = 50 * 30 days; //amount of allocation uint256 public teamAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public earlyAllocation = 5 * (10 ** 7) * (10 ** 18); uint256 public institutionAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public totalAllocation = 35 * (10 ** 7) * (10 ** 18); uint256 public teamStageSetting = 34; uint256 public earlyStageSetting = 5; uint256 public institutionStageSetting = 50; ERC20Basic public token; //token start time uint256 public start; //lock start time uint256 public lockStartTime; /** Reserve allocations */ mapping(address => uint256) public allocations; mapping(address => uint256) public stageSettings; mapping(address => uint256) public timeLockDurations; /** How many tokens each reserve wallet has claimed */ mapping(address => uint256) public releasedAmounts; modifier onlyReserveWallets { } function KcashVesting(ERC20Basic _token, address _teamWallet, address _earlyWallet, address _institutionWallet, uint256 _start, uint256 _lockTime)public{ } function allocateToken() onlyOwner public{ require(block.timestamp > lockStartTime); //only claim once require(allocations[teamWallet] == 0); require(<FILL_ME>) allocations[teamWallet] = teamAllocation; allocations[earlyWallet] = earlyAllocation; allocations[institutionWallet] = institutionAllocation; stageSettings[teamWallet] = teamStageSetting; stageSettings[earlyWallet] = earlyStageSetting; stageSettings[institutionWallet] = institutionStageSetting; timeLockDurations[teamWallet] = teamTimeLock; timeLockDurations[earlyWallet] = earlyTimeLock; timeLockDurations[institutionWallet] = institutionTimeLock; } function releaseToken() onlyReserveWallets public{ } function unlockAmount() public view onlyReserveWallets returns(uint256){ } function vestStage() public view onlyReserveWallets returns(uint256){ } }
token.balanceOf(address(this))>=totalAllocation
294,501
token.balanceOf(address(this))>=totalAllocation
null
pragma solidity ^0.4.21; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract KcashVesting is Ownable { using SafeMath for uint256; address public teamWallet; address public earlyWallet; address public institutionWallet; uint256 public teamTimeLock = 1000 days; uint256 public earlyTimeLock = 5 * 30 days; uint256 public institutionTimeLock = 50 * 30 days; //amount of allocation uint256 public teamAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public earlyAllocation = 5 * (10 ** 7) * (10 ** 18); uint256 public institutionAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public totalAllocation = 35 * (10 ** 7) * (10 ** 18); uint256 public teamStageSetting = 34; uint256 public earlyStageSetting = 5; uint256 public institutionStageSetting = 50; ERC20Basic public token; //token start time uint256 public start; //lock start time uint256 public lockStartTime; /** Reserve allocations */ mapping(address => uint256) public allocations; mapping(address => uint256) public stageSettings; mapping(address => uint256) public timeLockDurations; /** How many tokens each reserve wallet has claimed */ mapping(address => uint256) public releasedAmounts; modifier onlyReserveWallets { } function KcashVesting(ERC20Basic _token, address _teamWallet, address _earlyWallet, address _institutionWallet, uint256 _start, uint256 _lockTime)public{ } function allocateToken() onlyOwner public{ } function releaseToken() onlyReserveWallets public{ uint256 totalUnlocked = unlockAmount(); require(totalUnlocked <= allocations[msg.sender]); require(<FILL_ME>) uint256 payment = totalUnlocked.sub(releasedAmounts[msg.sender]); releasedAmounts[msg.sender] = totalUnlocked; require(token.transfer(msg.sender, payment)); } function unlockAmount() public view onlyReserveWallets returns(uint256){ } function vestStage() public view onlyReserveWallets returns(uint256){ } }
releasedAmounts[msg.sender]<totalUnlocked
294,501
releasedAmounts[msg.sender]<totalUnlocked
null
pragma solidity ^0.4.21; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract KcashVesting is Ownable { using SafeMath for uint256; address public teamWallet; address public earlyWallet; address public institutionWallet; uint256 public teamTimeLock = 1000 days; uint256 public earlyTimeLock = 5 * 30 days; uint256 public institutionTimeLock = 50 * 30 days; //amount of allocation uint256 public teamAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public earlyAllocation = 5 * (10 ** 7) * (10 ** 18); uint256 public institutionAllocation = 15 * (10 ** 7) * (10 ** 18); uint256 public totalAllocation = 35 * (10 ** 7) * (10 ** 18); uint256 public teamStageSetting = 34; uint256 public earlyStageSetting = 5; uint256 public institutionStageSetting = 50; ERC20Basic public token; //token start time uint256 public start; //lock start time uint256 public lockStartTime; /** Reserve allocations */ mapping(address => uint256) public allocations; mapping(address => uint256) public stageSettings; mapping(address => uint256) public timeLockDurations; /** How many tokens each reserve wallet has claimed */ mapping(address => uint256) public releasedAmounts; modifier onlyReserveWallets { } function KcashVesting(ERC20Basic _token, address _teamWallet, address _earlyWallet, address _institutionWallet, uint256 _start, uint256 _lockTime)public{ } function allocateToken() onlyOwner public{ } function releaseToken() onlyReserveWallets public{ uint256 totalUnlocked = unlockAmount(); require(totalUnlocked <= allocations[msg.sender]); require(releasedAmounts[msg.sender] < totalUnlocked); uint256 payment = totalUnlocked.sub(releasedAmounts[msg.sender]); releasedAmounts[msg.sender] = totalUnlocked; require(<FILL_ME>) } function unlockAmount() public view onlyReserveWallets returns(uint256){ } function vestStage() public view onlyReserveWallets returns(uint256){ } }
token.transfer(msg.sender,payment)
294,501
token.transfer(msg.sender,payment)
"Passing max supply"
/* Oh Welcome! Take a cup of coffee 旦~ __ __ /'\_/`\ /\ \ /\ \ /\ \ ___ ___ ____ __ \ \ \___ __ __ \_\ \ \ \ \__\ \ / __`\ / __`\ /',__\ /'__`\\ \ _ `\ /'__`\ /'__`\ /'_` \ \ \ \_/\ \ /\ \L\ \/\ \L\ \/\__, `\/\ __/ \ \ \ \ \ /\ __/ /\ \L\.\_ /\ \L\ \ \ \_\\ \_\\ \____/\ \____/\/\____/\ \____\ \ \_\ \_\\ \____\\ \__/.\_\\ \___,_\ \/_/ \/_/ \/___/ \/___/ \/___/ \/____/ \/_/\/_/ \/____/ \/__/\/_/ \/__,_ / __ __ /\ \/\ \ __ \ \ \ \ \ ___ /\_\ ___ ___ \ \ \ \ \ /' _ `\\/\ \ / __`\ /' _ `\ \ \ \_\ \ /\ \/\ \\ \ \ /\ \L\ \/\ \/\ \ \ \_____\\ \_\ \_\\ \_\\ \____/\ \_\ \_\ \/_____/ \/_/\/_/ \/_/ \/___/ \/_/\/_/ */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "./ERC721.sol"; import "./Ownable.sol"; import "./ERC721Enumerable.sol"; /** * @title MooseheadUnion contract * We are Mooseheads! The Only 1e4 Mooseheads among 5e17! ᒡ◯ᵔ◯ᒢ */ contract MooseheadUnion is ERC721, ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_TOKENS = 10000; uint256 public constant PRICE = 0.06 ether; // Price of one moosehead! Constant! string private _baseTokenURI = "ipfs://QmdcNp364CygHAydaPK58MCUQCRxsiUyVfBvS1Tmie1ph2/"; string private _baseContractURI = "ipfs://QmdcNp364CygHAydaPK58MCUQCRxsiUyVfBvS1Tmie1ph2/contract"; bool public saleIsActive; constructor() ERC721("MooseheadUnion", "MOOS") { } function mint(uint256 num) public payable { uint256 supply = totalSupply(); require(saleIsActive, "Sale is not active"); require(num > 0, "Minting 0"); require(num <= 20, "Max of 20 is allowed"); require(<FILL_ME>) require(msg.value >= PRICE * num, "Ether sent is not correct"); for(uint256 i = 0; i < num; i++){ uint256 mintIndex = totalSupply(); if (totalSupply() < MAX_TOKENS) { _safeMint(msg.sender, mintIndex); } } } function flipSaleState() public onlyOwner { } function withdraw() onlyOwner public { } /* * @dev Reserve 10 tokens for gifts & roadmap */ function reserveTokens() public onlyOwner { } /* * @dev openSea contract metadata */ function setContractURI(string memory contURI) public onlyOwner { } function contractURI() public view returns (string memory) { } /* * @dev Needed below function to resolve conflicting fns in ERC721 and ERC721Enumerable */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } /* * @dev Needed below function to resolve conflicting fns in ERC721 and ERC721Enumerable */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } }
supply+num<=MAX_TOKENS,"Passing max supply"
294,555
supply+num<=MAX_TOKENS
null
pragma solidity ^0.4.24; /** * @title Ownable */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ constructor(uint256 totalSupply) public { } function totalSupply() public view returns (uint256) { } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } function batchTransfer(address[] _receivers, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { } } contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals) public { } } contract StandardToken is DetailedERC20('Decentralized Medication Supply Platform','BQN',18), BasicToken(100000000000000000000000000) { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { require(<FILL_ME>) allowed[tx.origin][_spender] = _value; emit Approval(tx.origin, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { } function recoverLost( address lost, uint256 amount ) public returns (bool) { } } contract PausableToken is StandardToken, Pausable { function transfer( address _to, uint256 _value ) public whenNotPaused returns (bool) { } function batchTransfer ( address[] _receivers, uint256 _value ) public whenNotPaused onlyOwner returns (bool) { } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { } function approve( address _spender, uint256 _value ) public whenNotPaused returns (bool) { } function increaseApproval( address _spender, uint _addedValue ) public whenNotPaused returns (bool success) { } function decreaseApproval( address _spender, uint _subtractedValue ) public whenNotPaused returns (bool success) { } function recoverLost( address lost, uint256 amount ) public whenNotPaused onlyOwner returns(bool) { } }
allowed[tx.origin][_spender]==0
294,606
allowed[tx.origin][_spender]==0
"Not approve nft to staker address"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { require(<FILL_ME>) UserInfo storage user = _userInfo[_msgSender()]; for (uint256 i = 0; i < __tokenIDList.length; i++) { // Check if the params are correct require( isWhiteListedSeason1( toLeaf(__tokenIDList[i], __indexList[i], __rarityList[i]), __proofList[i] ), "Invalid params" ); IERC721(_season1Nft).safeTransferFrom( _msgSender(), address(this), __tokenIDList[i] ); user._season1Nfts.add(__tokenIDList[i]); user._season1StakeInfos[__tokenIDList[i]] = NftStakeInfo({ _rarity: Rarity(__rarityList[i]), _isLocked: __lockedStaking, _stakedAt: block.timestamp, _pairedTokenId: 0 }); emit Staked(_msgSender(), __tokenIDList[i], true, __lockedStaking); } } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
IERC721(_season1Nft).isApprovedForAll(_msgSender(),address(this)),"Not approve nft to staker address"
294,651
IERC721(_season1Nft).isApprovedForAll(_msgSender(),address(this))
"Invalid params"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { require( IERC721(_season1Nft).isApprovedForAll(_msgSender(), address(this)), "Not approve nft to staker address" ); UserInfo storage user = _userInfo[_msgSender()]; for (uint256 i = 0; i < __tokenIDList.length; i++) { // Check if the params are correct require(<FILL_ME>) IERC721(_season1Nft).safeTransferFrom( _msgSender(), address(this), __tokenIDList[i] ); user._season1Nfts.add(__tokenIDList[i]); user._season1StakeInfos[__tokenIDList[i]] = NftStakeInfo({ _rarity: Rarity(__rarityList[i]), _isLocked: __lockedStaking, _stakedAt: block.timestamp, _pairedTokenId: 0 }); emit Staked(_msgSender(), __tokenIDList[i], true, __lockedStaking); } } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
isWhiteListedSeason1(toLeaf(__tokenIDList[i],__indexList[i],__rarityList[i]),__proofList[i]),"Invalid params"
294,651
isWhiteListedSeason1(toLeaf(__tokenIDList[i],__indexList[i],__rarityList[i]),__proofList[i])
"Not approve nft to staker address"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { require(<FILL_ME>) UserInfo storage user = _userInfo[_msgSender()]; for (uint256 i = 0; i < __tokenIDList.length; i++) { // Check if the params are correct require( isWhiteListedSeason2( toLeaf(__tokenIDList[i], __indexList[i], __rarityList[i]), __proofList[i] ), "Invalid params" ); IERC721(_season2Nft).safeTransferFrom( _msgSender(), address(this), __tokenIDList[i] ); user._season2Nfts.add(__tokenIDList[i]); user._season2StakeInfos[__tokenIDList[i]] = NftStakeInfo({ _rarity: Rarity(__rarityList[i]), _isLocked: __lockedStaking, _stakedAt: block.timestamp, _pairedTokenId: 0 }); emit Staked(_msgSender(), __tokenIDList[i], false, __lockedStaking); } } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
IERC721(_season2Nft).isApprovedForAll(_msgSender(),address(this)),"Not approve nft to staker address"
294,651
IERC721(_season2Nft).isApprovedForAll(_msgSender(),address(this))
"Invalid params"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { require( IERC721(_season2Nft).isApprovedForAll(_msgSender(), address(this)), "Not approve nft to staker address" ); UserInfo storage user = _userInfo[_msgSender()]; for (uint256 i = 0; i < __tokenIDList.length; i++) { // Check if the params are correct require(<FILL_ME>) IERC721(_season2Nft).safeTransferFrom( _msgSender(), address(this), __tokenIDList[i] ); user._season2Nfts.add(__tokenIDList[i]); user._season2StakeInfos[__tokenIDList[i]] = NftStakeInfo({ _rarity: Rarity(__rarityList[i]), _isLocked: __lockedStaking, _stakedAt: block.timestamp, _pairedTokenId: 0 }); emit Staked(_msgSender(), __tokenIDList[i], false, __lockedStaking); } } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
isWhiteListedSeason2(toLeaf(__tokenIDList[i],__indexList[i],__rarityList[i]),__proofList[i]),"Invalid params"
294,651
isWhiteListedSeason2(toLeaf(__tokenIDList[i],__indexList[i],__rarityList[i]),__proofList[i])
"Not staked one of nfts"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { UserInfo storage user = _userInfo[_msgSender()]; for (uint256 i = 0; i < __tokenIDList.length; i++) { require(<FILL_ME>) IERC721(_season1Nft).safeTransferFrom( address(this), _msgSender(), __tokenIDList[i] ); // locked rewards are sent to rewards back to the pool // unlocked rewards are added to the user rewards (, uint256 unlockedRewards) = getSeason1Rewards( _msgSender(), __tokenIDList[i] ); user._pending = user._pending.add(unlockedRewards); user._season1Nfts.remove(__tokenIDList[i]); // If it was paired with a season2 nft, unpair them uint256 pairedTokenId = user ._season1StakeInfos[__tokenIDList[i]] ._pairedTokenId; if (pairedTokenId > 0) { user._season2StakeInfos[pairedTokenId]._pairedTokenId = 0; user._pairCount = user._pairCount.sub(1); } delete user._season1StakeInfos[__tokenIDList[i]]; emit Unstaked(_msgSender(), __tokenIDList[i], true); } } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
user._season1Nfts.contains(__tokenIDList[i]),"Not staked one of nfts"
294,651
user._season1Nfts.contains(__tokenIDList[i])
"Not staked one of nfts"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { UserInfo storage user = _userInfo[_msgSender()]; for (uint256 i = 0; i < __tokenIDList.length; i++) { require(<FILL_ME>) IERC721(_season2Nft).safeTransferFrom( address(this), _msgSender(), __tokenIDList[i] ); // If it was paired with a season1 nft, unpair them uint256 pairedTokenId = user ._season2StakeInfos[__tokenIDList[i]] ._pairedTokenId; if (pairedTokenId > 0) { // locked rewards are sent to rewards back to the pool // unlocked rewards are added to the user rewards (, uint256 unlockedRewards) = getPairedSeason2Rewards( _msgSender(), pairedTokenId ); user._pending = user._pending.add(unlockedRewards); } user._season2Nfts.remove(__tokenIDList[i]); if (pairedTokenId > 0) { user._season1StakeInfos[pairedTokenId]._pairedTokenId = 0; user._pairCount = user._pairCount.sub(1); } delete user._season2StakeInfos[__tokenIDList[i]]; emit Unstaked(_msgSender(), __tokenIDList[i], false); } } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
user._season2Nfts.contains(__tokenIDList[i]),"Not staked one of nfts"
294,651
user._season2Nfts.contains(__tokenIDList[i])
"Locked already"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { UserInfo storage user = _userInfo[_msgSender()]; for (uint256 i = 0; i < __tokenIDList.length; i++) { // Check if the params are correct require( user._season1Nfts.contains(__tokenIDList[i]), "One of nfts not staked yet" ); require(<FILL_ME>) (, uint256 unlockedRewards) = getSeason1Rewards( _msgSender(), __tokenIDList[i] ); user._pending = user._pending.add(unlockedRewards); user._season1StakeInfos[__tokenIDList[i]]._isLocked = true; user._season1StakeInfos[__tokenIDList[i]]._stakedAt = block .timestamp; emit Locked(_msgSender(), __tokenIDList[i], true); } } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
!user._season1StakeInfos[__tokenIDList[i]]._isLocked,"Locked already"
294,651
!user._season1StakeInfos[__tokenIDList[i]]._isLocked
"Locked already"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { UserInfo storage user = _userInfo[_msgSender()]; for (uint256 i = 0; i < __tokenIDList.length; i++) { // Check if the params are correct require( user._season2Nfts.contains(__tokenIDList[i]), "One of nfts not staked yet" ); require(<FILL_ME>) uint256 pairedTokenId = user ._season2StakeInfos[__tokenIDList[i]] ._pairedTokenId; if (pairedTokenId > 0) { (, uint256 unlockedRewards) = getPairedSeason2Rewards( _msgSender(), pairedTokenId ); user._pending = user._pending.add(unlockedRewards); } user._season2StakeInfos[__tokenIDList[i]]._isLocked = true; user._season2StakeInfos[__tokenIDList[i]]._stakedAt = block .timestamp; emit Locked(_msgSender(), __tokenIDList[i], false); } } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
!user._season2StakeInfos[__tokenIDList[i]]._isLocked,"Locked already"
294,651
!user._season2StakeInfos[__tokenIDList[i]]._isLocked
"One of nfts is not staked"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { UserInfo storage user = _userInfo[_msgSender()]; require(<FILL_ME>) require( user._season1StakeInfos[__season1TokenID]._pairedTokenId == 0 && user._season2StakeInfos[__season2TokenID]._pairedTokenId == 0, "Already paired" ); user ._season1StakeInfos[__season1TokenID] ._pairedTokenId = __season2TokenID; user ._season2StakeInfos[__season2TokenID] ._pairedTokenId = __season1TokenID; user._season2StakeInfos[__season2TokenID]._stakedAt = block.timestamp; user._pairCount = user._pairCount.add(1); emit Paired(_msgSender(), __season1TokenID, __season2TokenID); } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
user._season1Nfts.contains(__season1TokenID)&&user._season2Nfts.contains(__season2TokenID),"One of nfts is not staked"
294,651
user._season1Nfts.contains(__season1TokenID)&&user._season2Nfts.contains(__season2TokenID)
"Already paired"
pragma solidity ^0.8.0; contract NftStaking is ReentrancyGuard, Pausable, IERC721Receiver { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; enum Rarity { COMMON, RARE, ICONIC, GOLDEN } enum StakeType { UNLOCKED, LOCKED, PAIR_LOCKED } bytes32 public SEASON1_MERKLE_ROOT; bytes32 public SEASON2_MERKLE_ROOT; /** Season1 / Season2 NFT address */ address public _season1Nft; address public _season2Nft; /** Reward Token address */ address public _rewardToken; // Withdraw lock period uint256 public _lockPeriod = 60 days; // Lock period 60 days uint16 public _unstakeFee = 500; // Unstake fee 5% uint16 public _forcedUnstakeFee = 10000; // Force unstake fee 100% struct NftStakeInfo { Rarity _rarity; bool _isLocked; uint256 _pairedTokenId; uint256 _stakedAt; } struct UserInfo { EnumerableSet.UintSet _season1Nfts; EnumerableSet.UintSet _season2Nfts; mapping(uint256 => NftStakeInfo) _season1StakeInfos; mapping(uint256 => NftStakeInfo) _season2StakeInfos; uint256 _pending; // Not claimed uint256 _totalClaimed; // Claimed so far uint256 _lastClaimedAt; uint256 _pairCount; // Paired count } mapping(Rarity => uint256) _season1BaseRpds; // RPD: reward per day mapping(Rarity => uint16) _season1LockedExtras; mapping(Rarity => mapping(StakeType => uint16)) _season2Extras; // Info of each user that stakes LP tokens. mapping(address => UserInfo) private _userInfo; event Staked( address indexed account, uint256 tokenId, bool isSeason1, bool isLocked ); event Unstaked(address indexed account, uint256 tokenId, bool isSeason1); event Locked(address indexed account, uint256 tokenId, bool isSeason1); event Paired( address indexed account, uint256 season1TokenId, uint256 season2TokenId ); event Harvested(address indexed account, uint256 amount); event InsufficientRewardToken( address indexed account, uint256 amountNeeded, uint256 balance ); constructor(address __rewardToken, address __season1Nft) { } function setSeason2Nft(address __season2Nft) external onlyOwner { } function getRewardInNormal( uint256 __rpd, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256) { } function getRewardInLocked( uint256 __rpd, uint256 __extraRate, uint256 __stakedAt, uint256 __lastClaimedAt ) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getSeason1Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function getPairedSeason2Rewards(address __account, uint256 __nftId) private view returns (uint256 lockedAmount, uint256 unlockedAmount) { } function viewProfit(address __account) public view returns ( uint256 totalEarned, uint256 totalClaimed, uint256 lockedRewards, uint256 unlockedRewards ) { } /** * @notice Get season1 nfts */ function viewSeason1Nfts(address __account) external view returns (uint256[] memory season1Nfts, bool[] memory lockStats) { } /** * @notice Get season2 nfts */ function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { } /** * @notice Get paired season1 / season2 nfts */ function viewPairedNfts(address __account) external view returns ( uint256[] memory pairedSeason1Nfts, uint256[] memory pairedSeason2Nfts ) { } // Verify that a given leaf is in the tree. function isWhiteListedSeason1(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } function isWhiteListedSeason2(bytes32 _leafNode, bytes32[] memory _proof) public view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function toLeaf( uint256 tokenID, uint256 index, uint256 amount ) public pure returns (bytes32) { } function setMerkleRoot(bytes32 _season1Root, bytes32 _season2Root) external onlyOwner { } function updateFeeValues(uint16 __unstakeFee, uint16 __forcedUnstakeFee) external onlyOwner { } function updateLockPeriod(uint256 __lockPeriod) external onlyOwner { } function updateSeason1BaseRpd(Rarity __rarity, uint256 __rpd) external onlyOwner { } function updateSeason1LockedExtraPercent( Rarity __rarity, uint16 __lockedExtraPercent ) external onlyOwner { } function updateSeason2ExtraPercent( Rarity __rarity, StakeType __stakeType, uint16 __extraPercent ) external onlyOwner { } function isStaked(address __account, uint256 __tokenId) external view returns (bool) { } /** * @notice Claim rewards */ function claimRewards() external { } /** * @notice Stake season1 nft */ function stakeSeason1( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } /** * @notice Stake season2 nft */ function stakeSeason2( bool __lockedStaking, uint256[] calldata __tokenIDList, uint256[] calldata __indexList, uint256[] calldata __rarityList, bytes32[][] calldata __proofList ) external nonReentrant whenNotPaused { } function unstakeSeason1(uint256[] calldata __tokenIDList) external nonReentrant { } function unstakeSeason2(uint256[] calldata __tokenIDList) external nonReentrant { } /** * @notice Lock season1 nft from the unlocked pool to the lock pool */ function lockSeason1Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice Lock season2 nft from the unlocked pool to the lock pool */ function lockSeason2Nfts(uint256[] calldata __tokenIDList) external onlyOwner { } /** * @notice */ function pairNfts(uint256 __season1TokenID, uint256 __season2TokenID) external nonReentrant whenNotPaused { UserInfo storage user = _userInfo[_msgSender()]; require( user._season1Nfts.contains(__season1TokenID) && user._season2Nfts.contains(__season2TokenID), "One of nfts is not staked" ); require(<FILL_ME>) user ._season1StakeInfos[__season1TokenID] ._pairedTokenId = __season2TokenID; user ._season2StakeInfos[__season2TokenID] ._pairedTokenId = __season1TokenID; user._season2StakeInfos[__season2TokenID]._stakedAt = block.timestamp; user._pairCount = user._pairCount.add(1); emit Paired(_msgSender(), __season1TokenID, __season2TokenID); } function safeRewardTransfer(address __to, uint256 __amount) internal returns (uint256) { } function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { } }
user._season1StakeInfos[__season1TokenID]._pairedTokenId==0&&user._season2StakeInfos[__season2TokenID]._pairedTokenId==0,"Already paired"
294,651
user._season1StakeInfos[__season1TokenID]._pairedTokenId==0&&user._season2StakeInfos[__season2TokenID]._pairedTokenId==0
"Not enough NFTs left to reserve"
//Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721) // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@rari-capital/solmate/src/tokens/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract LilNessNFT is ERC721, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIds; uint256 MAX_SUPPLY = 5069; uint256 MAX_PER_MINT = 10; uint256 public totalSupply = MAX_SUPPLY; uint256 private PRICE = 0.05 ether; bool public isSaleActive = true; string public baseTokenURI; constructor(string memory baseURI) ERC721("LilNessNFT", "LNNFT") { } function pauseSale() public onlyOwner { } function startSale() public onlyOwner { } function reserveNFT() public onlyOwner { } function reserveTenNFTs() public onlyOwner { uint totalMinted = _tokenIds.current(); require(<FILL_ME>) for (uint i = 0; i < 10; i++) { _mintSingleNFT(); } } function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory _baseTokenURI) public onlyOwner { } function mintNFTs(uint _count) public payable { } function _mintSingleNFT() private { } function withdraw() public payable onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
totalMinted.add(10)<MAX_SUPPLY,"Not enough NFTs left to reserve"
294,652
totalMinted.add(10)<MAX_SUPPLY
"Sold out."
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract TSSNFT is ERC721Enumerable, Ownable { using SafeMath for uint; uint public constant MAX_SNEAKERHEADZ = 4444; uint public constant MAX_SALE = 20; uint public constant MAX_PRESALE = 5; address payableAddress; uint public price; mapping(address => uint256) private preSaleAllowance; bool public hasPreSaleStarted = false; bool public preSaleOver = false; bool public hasSaleStarted = false; event SneakerHeadzMinted(uint indexed tokenId, address indexed owner); constructor() ERC721("The SneakerHeadz Society", "TSS") { } function mint(uint _quantity) external payable { require(hasSaleStarted, "Sale hasn't started."); require(_quantity > 0, "Quantity cannot be zero."); require(_quantity <= MAX_SALE, "Quantity cannot be bigger than MAX_BUYING."); require(<FILL_ME>) require(msg.value >= price.mul(_quantity) || msg.sender == owner(), "Ether value sent is below the price."); (bool success, ) = payableAddress.call{value:msg.value}(""); require(success, "Transfer failed."); for (uint i = 0; i < _quantity; i++) { uint mintIndex = totalSupply(); _safeMint(msg.sender, mintIndex); emit SneakerHeadzMinted(mintIndex, msg.sender); } } function preMint(uint _quantity) external payable { } function mintByOwner(address _to, uint256 _quantity) external onlyOwner { } function tokensOfOwner(address _owner) public view returns(uint[] memory ) { } function tokenURI(uint256 _tokenId) public pure override returns (string memory) { } function baseTokenURI() public pure returns (string memory) { } function contractURI() public pure returns (string memory) { } function setPrice(uint _price) external onlyOwner { } function startSale() external onlyOwner { } function pauseSale() external onlyOwner { } function startPreSale() external onlyOwner { } function pausePreSale() external onlyOwner { } function setPayableAddress(address _payableAddress) external onlyOwner { } function checkEarlyBird(address earlyBirdAddress) public view returns (uint) { } function addEarlyBirds(address[] memory earlyBirdAddresses) external onlyOwner { } }
totalSupply().add(_quantity)<=MAX_SNEAKERHEADZ,"Sold out."
294,695
totalSupply().add(_quantity)<=MAX_SNEAKERHEADZ
"Presale is over, no more allowances."
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract TSSNFT is ERC721Enumerable, Ownable { using SafeMath for uint; uint public constant MAX_SNEAKERHEADZ = 4444; uint public constant MAX_SALE = 20; uint public constant MAX_PRESALE = 5; address payableAddress; uint public price; mapping(address => uint256) private preSaleAllowance; bool public hasPreSaleStarted = false; bool public preSaleOver = false; bool public hasSaleStarted = false; event SneakerHeadzMinted(uint indexed tokenId, address indexed owner); constructor() ERC721("The SneakerHeadz Society", "TSS") { } function mint(uint _quantity) external payable { } function preMint(uint _quantity) external payable { require(hasPreSaleStarted, "Presale hasn't started."); require(<FILL_ME>) require(_quantity > 0, "Quantity cannot be zero."); require(_quantity <= MAX_PRESALE, "Quantity cannot be bigger than MAX_PREMINTING."); require(preSaleAllowance[msg.sender].sub(_quantity) >= 0, "The user is not allowed to do further presale buyings."); require(preSaleAllowance[msg.sender] >= _quantity, "This address is not allowed to buy that quantity."); require(totalSupply().add(_quantity) <= MAX_SNEAKERHEADZ, "Sold out"); require(msg.value >= price.mul(_quantity) || msg.sender == owner(), "Ether value sent is below the price."); (bool success, ) = payableAddress.call{value:msg.value}(""); require(success, "Transfer failed."); preSaleAllowance[msg.sender] = preSaleAllowance[msg.sender].sub(_quantity); for (uint i = 0; i < _quantity; i++) { uint mintIndex = totalSupply(); _safeMint(msg.sender, mintIndex); emit SneakerHeadzMinted(mintIndex, msg.sender); } } function mintByOwner(address _to, uint256 _quantity) external onlyOwner { } function tokensOfOwner(address _owner) public view returns(uint[] memory ) { } function tokenURI(uint256 _tokenId) public pure override returns (string memory) { } function baseTokenURI() public pure returns (string memory) { } function contractURI() public pure returns (string memory) { } function setPrice(uint _price) external onlyOwner { } function startSale() external onlyOwner { } function pauseSale() external onlyOwner { } function startPreSale() external onlyOwner { } function pausePreSale() external onlyOwner { } function setPayableAddress(address _payableAddress) external onlyOwner { } function checkEarlyBird(address earlyBirdAddress) public view returns (uint) { } function addEarlyBirds(address[] memory earlyBirdAddresses) external onlyOwner { } }
!preSaleOver,"Presale is over, no more allowances."
294,695
!preSaleOver
"The user is not allowed to do further presale buyings."
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract TSSNFT is ERC721Enumerable, Ownable { using SafeMath for uint; uint public constant MAX_SNEAKERHEADZ = 4444; uint public constant MAX_SALE = 20; uint public constant MAX_PRESALE = 5; address payableAddress; uint public price; mapping(address => uint256) private preSaleAllowance; bool public hasPreSaleStarted = false; bool public preSaleOver = false; bool public hasSaleStarted = false; event SneakerHeadzMinted(uint indexed tokenId, address indexed owner); constructor() ERC721("The SneakerHeadz Society", "TSS") { } function mint(uint _quantity) external payable { } function preMint(uint _quantity) external payable { require(hasPreSaleStarted, "Presale hasn't started."); require(!preSaleOver, "Presale is over, no more allowances."); require(_quantity > 0, "Quantity cannot be zero."); require(_quantity <= MAX_PRESALE, "Quantity cannot be bigger than MAX_PREMINTING."); require(<FILL_ME>) require(preSaleAllowance[msg.sender] >= _quantity, "This address is not allowed to buy that quantity."); require(totalSupply().add(_quantity) <= MAX_SNEAKERHEADZ, "Sold out"); require(msg.value >= price.mul(_quantity) || msg.sender == owner(), "Ether value sent is below the price."); (bool success, ) = payableAddress.call{value:msg.value}(""); require(success, "Transfer failed."); preSaleAllowance[msg.sender] = preSaleAllowance[msg.sender].sub(_quantity); for (uint i = 0; i < _quantity; i++) { uint mintIndex = totalSupply(); _safeMint(msg.sender, mintIndex); emit SneakerHeadzMinted(mintIndex, msg.sender); } } function mintByOwner(address _to, uint256 _quantity) external onlyOwner { } function tokensOfOwner(address _owner) public view returns(uint[] memory ) { } function tokenURI(uint256 _tokenId) public pure override returns (string memory) { } function baseTokenURI() public pure returns (string memory) { } function contractURI() public pure returns (string memory) { } function setPrice(uint _price) external onlyOwner { } function startSale() external onlyOwner { } function pauseSale() external onlyOwner { } function startPreSale() external onlyOwner { } function pausePreSale() external onlyOwner { } function setPayableAddress(address _payableAddress) external onlyOwner { } function checkEarlyBird(address earlyBirdAddress) public view returns (uint) { } function addEarlyBirds(address[] memory earlyBirdAddresses) external onlyOwner { } }
preSaleAllowance[msg.sender].sub(_quantity)>=0,"The user is not allowed to do further presale buyings."
294,695
preSaleAllowance[msg.sender].sub(_quantity)>=0
"This address is not allowed to buy that quantity."
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract TSSNFT is ERC721Enumerable, Ownable { using SafeMath for uint; uint public constant MAX_SNEAKERHEADZ = 4444; uint public constant MAX_SALE = 20; uint public constant MAX_PRESALE = 5; address payableAddress; uint public price; mapping(address => uint256) private preSaleAllowance; bool public hasPreSaleStarted = false; bool public preSaleOver = false; bool public hasSaleStarted = false; event SneakerHeadzMinted(uint indexed tokenId, address indexed owner); constructor() ERC721("The SneakerHeadz Society", "TSS") { } function mint(uint _quantity) external payable { } function preMint(uint _quantity) external payable { require(hasPreSaleStarted, "Presale hasn't started."); require(!preSaleOver, "Presale is over, no more allowances."); require(_quantity > 0, "Quantity cannot be zero."); require(_quantity <= MAX_PRESALE, "Quantity cannot be bigger than MAX_PREMINTING."); require(preSaleAllowance[msg.sender].sub(_quantity) >= 0, "The user is not allowed to do further presale buyings."); require(<FILL_ME>) require(totalSupply().add(_quantity) <= MAX_SNEAKERHEADZ, "Sold out"); require(msg.value >= price.mul(_quantity) || msg.sender == owner(), "Ether value sent is below the price."); (bool success, ) = payableAddress.call{value:msg.value}(""); require(success, "Transfer failed."); preSaleAllowance[msg.sender] = preSaleAllowance[msg.sender].sub(_quantity); for (uint i = 0; i < _quantity; i++) { uint mintIndex = totalSupply(); _safeMint(msg.sender, mintIndex); emit SneakerHeadzMinted(mintIndex, msg.sender); } } function mintByOwner(address _to, uint256 _quantity) external onlyOwner { } function tokensOfOwner(address _owner) public view returns(uint[] memory ) { } function tokenURI(uint256 _tokenId) public pure override returns (string memory) { } function baseTokenURI() public pure returns (string memory) { } function contractURI() public pure returns (string memory) { } function setPrice(uint _price) external onlyOwner { } function startSale() external onlyOwner { } function pauseSale() external onlyOwner { } function startPreSale() external onlyOwner { } function pausePreSale() external onlyOwner { } function setPayableAddress(address _payableAddress) external onlyOwner { } function checkEarlyBird(address earlyBirdAddress) public view returns (uint) { } function addEarlyBirds(address[] memory earlyBirdAddresses) external onlyOwner { } }
preSaleAllowance[msg.sender]>=_quantity,"This address is not allowed to buy that quantity."
294,695
preSaleAllowance[msg.sender]>=_quantity