comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
null
pragma solidity 0.4.24; /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title RBACWithAdmin * @author Matt Condon (@Shrugs) * @dev It's recommended that you define constants in the contract, * @dev like ROLE_ADMIN below, to avoid typos. */ contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { } /** * @dev constructor. Sets msg.sender as admin by default */ function RBACWithAdmin() public { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract ERC20 { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } // Contract Code for Faculty - Faculty Devs contract FacultyPool is RBACWithAdmin { using SafeMath for uint; // Constants // ======================================================== uint8 constant CONTRACT_OPEN = 1; uint8 constant CONTRACT_CLOSED = 2; uint8 constant CONTRACT_SUBMIT_FUNDS = 3; // 500,000 max gas uint256 constant public gasLimit = 50000000000; // 0.1 ether uint256 constant public minContribution = 100000000000000000; // State Vars // ======================================================== // recipient address for fee address public owner; // the fee taken in tokens from the pool uint256 public feePct; // open our contract initially uint8 public contractStage = CONTRACT_OPEN; // the current Beneficiary Cap level in wei uint256 public currentBeneficiaryCap; // the total cap in wei of the pool uint256 public totalPoolCap; // the destination for this contract address public receiverAddress; // our beneficiaries mapping (address => Beneficiary) beneficiaries; // the total we raised before closing pool uint256 public finalBalance; // a set of refund amounts we may need to process uint256[] public ethRefundAmount; // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) tokenAllocationMap; // the default token address address public defaultToken; // Modifiers and Structs // ======================================================== // only run certain methods when contract is open modifier isOpenContract() { } // stop double processing attacks bool locked; modifier noReentrancy() { require(<FILL_ME>) locked = true; _; locked = false; } // Beneficiary struct Beneficiary { uint256 ethRefund; uint256 balance; uint256 cap; mapping (address => uint256) tokensClaimed; } // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint256[] pct; uint256 balanceRemaining; } // Events // ======================================================== event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance); event ReceiverAddressSet(address indexed receiverAddress); event ERC223Received(address indexed token, uint256 value); event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit); event PoolStageChanged(uint8 stage); event PoolSubmitted(address indexed receiver, uint256 amount); event RefundReceived(address indexed sender, uint256 amount); event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount); event EthRefunded(address indexed beneficiary, uint256 amount); // CODE BELOW HERE // ======================================================== /* * Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And, * optionally, the receiving address if know at time of contract creation. * fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000 */ constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public { } // we pay in here function () payable public { } // receive funds. gas limited. min contrib. function _receiveDeposit() isOpenContract internal { } // Handle refunds only in closed state. function _receiveRefund() internal { } function getCurrentBeneficiaryCap() public view returns(uint256 cap) { } function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) { } // close the pool from receiving more funds function closePool() onlyAdmin isOpenContract public { } function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy { } function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){ } function withdraw(address _tokenAddress) public { } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin { } function _withdraw (address _beneficiary, address _tokenAddr) internal { } function setReceiver(address addr) public onlyAdmin { } // once we have tokens we can enable the withdrawal // setting this _useAsDefault to true will set this incoming address to the defaultToken. function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy { } // get the available tokens function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { } // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { } }
!locked
23,991
!locked
"Deposit will put pool over limit. Reverting."
pragma solidity 0.4.24; /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title RBACWithAdmin * @author Matt Condon (@Shrugs) * @dev It's recommended that you define constants in the contract, * @dev like ROLE_ADMIN below, to avoid typos. */ contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { } /** * @dev constructor. Sets msg.sender as admin by default */ function RBACWithAdmin() public { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract ERC20 { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } // Contract Code for Faculty - Faculty Devs contract FacultyPool is RBACWithAdmin { using SafeMath for uint; // Constants // ======================================================== uint8 constant CONTRACT_OPEN = 1; uint8 constant CONTRACT_CLOSED = 2; uint8 constant CONTRACT_SUBMIT_FUNDS = 3; // 500,000 max gas uint256 constant public gasLimit = 50000000000; // 0.1 ether uint256 constant public minContribution = 100000000000000000; // State Vars // ======================================================== // recipient address for fee address public owner; // the fee taken in tokens from the pool uint256 public feePct; // open our contract initially uint8 public contractStage = CONTRACT_OPEN; // the current Beneficiary Cap level in wei uint256 public currentBeneficiaryCap; // the total cap in wei of the pool uint256 public totalPoolCap; // the destination for this contract address public receiverAddress; // our beneficiaries mapping (address => Beneficiary) beneficiaries; // the total we raised before closing pool uint256 public finalBalance; // a set of refund amounts we may need to process uint256[] public ethRefundAmount; // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) tokenAllocationMap; // the default token address address public defaultToken; // Modifiers and Structs // ======================================================== // only run certain methods when contract is open modifier isOpenContract() { } // stop double processing attacks bool locked; modifier noReentrancy() { } // Beneficiary struct Beneficiary { uint256 ethRefund; uint256 balance; uint256 cap; mapping (address => uint256) tokensClaimed; } // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint256[] pct; uint256 balanceRemaining; } // Events // ======================================================== event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance); event ReceiverAddressSet(address indexed receiverAddress); event ERC223Received(address indexed token, uint256 value); event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit); event PoolStageChanged(uint8 stage); event PoolSubmitted(address indexed receiver, uint256 amount); event RefundReceived(address indexed sender, uint256 amount); event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount); event EthRefunded(address indexed beneficiary, uint256 amount); // CODE BELOW HERE // ======================================================== /* * Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And, * optionally, the receiving address if know at time of contract creation. * fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000 */ constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public { } // we pay in here function () payable public { } // receive funds. gas limited. min contrib. function _receiveDeposit() isOpenContract internal { require(tx.gasprice <= gasLimit, "Gas too high"); require(<FILL_ME>) // Now the code Beneficiary storage b = beneficiaries[msg.sender]; uint256 newBalance = b.balance.add(msg.value); require(newBalance >= minContribution, "contribution is lower than minContribution"); if(b.cap > 0){ require(newBalance <= b.cap, "balance is less than set cap for beneficiary"); } else if(currentBeneficiaryCap == 0) { // we have an open cap, no limits b.cap = totalPoolCap; }else { require(newBalance <= currentBeneficiaryCap, "balance is more than currentBeneficiaryCap"); // we set it to the default cap b.cap = currentBeneficiaryCap; } b.balance = newBalance; emit BeneficiaryBalanceChanged(msg.sender, newBalance); } // Handle refunds only in closed state. function _receiveRefund() internal { } function getCurrentBeneficiaryCap() public view returns(uint256 cap) { } function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) { } // close the pool from receiving more funds function closePool() onlyAdmin isOpenContract public { } function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy { } function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){ } function withdraw(address _tokenAddress) public { } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin { } function _withdraw (address _beneficiary, address _tokenAddr) internal { } function setReceiver(address addr) public onlyAdmin { } // once we have tokens we can enable the withdrawal // setting this _useAsDefault to true will set this incoming address to the defaultToken. function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy { } // get the available tokens function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { } // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { } }
address(this).balance<=totalPoolCap,"Deposit will put pool over limit. Reverting."
23,991
address(this).balance<=totalPoolCap
"Receiver or Admins only"
pragma solidity 0.4.24; /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title RBACWithAdmin * @author Matt Condon (@Shrugs) * @dev It's recommended that you define constants in the contract, * @dev like ROLE_ADMIN below, to avoid typos. */ contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { } /** * @dev constructor. Sets msg.sender as admin by default */ function RBACWithAdmin() public { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract ERC20 { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } // Contract Code for Faculty - Faculty Devs contract FacultyPool is RBACWithAdmin { using SafeMath for uint; // Constants // ======================================================== uint8 constant CONTRACT_OPEN = 1; uint8 constant CONTRACT_CLOSED = 2; uint8 constant CONTRACT_SUBMIT_FUNDS = 3; // 500,000 max gas uint256 constant public gasLimit = 50000000000; // 0.1 ether uint256 constant public minContribution = 100000000000000000; // State Vars // ======================================================== // recipient address for fee address public owner; // the fee taken in tokens from the pool uint256 public feePct; // open our contract initially uint8 public contractStage = CONTRACT_OPEN; // the current Beneficiary Cap level in wei uint256 public currentBeneficiaryCap; // the total cap in wei of the pool uint256 public totalPoolCap; // the destination for this contract address public receiverAddress; // our beneficiaries mapping (address => Beneficiary) beneficiaries; // the total we raised before closing pool uint256 public finalBalance; // a set of refund amounts we may need to process uint256[] public ethRefundAmount; // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) tokenAllocationMap; // the default token address address public defaultToken; // Modifiers and Structs // ======================================================== // only run certain methods when contract is open modifier isOpenContract() { } // stop double processing attacks bool locked; modifier noReentrancy() { } // Beneficiary struct Beneficiary { uint256 ethRefund; uint256 balance; uint256 cap; mapping (address => uint256) tokensClaimed; } // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint256[] pct; uint256 balanceRemaining; } // Events // ======================================================== event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance); event ReceiverAddressSet(address indexed receiverAddress); event ERC223Received(address indexed token, uint256 value); event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit); event PoolStageChanged(uint8 stage); event PoolSubmitted(address indexed receiver, uint256 amount); event RefundReceived(address indexed sender, uint256 amount); event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount); event EthRefunded(address indexed beneficiary, uint256 amount); // CODE BELOW HERE // ======================================================== /* * Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And, * optionally, the receiving address if know at time of contract creation. * fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000 */ constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public { } // we pay in here function () payable public { } // receive funds. gas limited. min contrib. function _receiveDeposit() isOpenContract internal { } // Handle refunds only in closed state. function _receiveRefund() internal { assert(contractStage >= 2); require(<FILL_ME>) ethRefundAmount.push(msg.value); emit RefundReceived(msg.sender, msg.value); } function getCurrentBeneficiaryCap() public view returns(uint256 cap) { } function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) { } // close the pool from receiving more funds function closePool() onlyAdmin isOpenContract public { } function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy { } function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){ } function withdraw(address _tokenAddress) public { } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin { } function _withdraw (address _beneficiary, address _tokenAddr) internal { } function setReceiver(address addr) public onlyAdmin { } // once we have tokens we can enable the withdrawal // setting this _useAsDefault to true will set this incoming address to the defaultToken. function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy { } // get the available tokens function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { } // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { } }
hasRole(msg.sender,ROLE_ADMIN)||msg.sender==receiverAddress,"Receiver or Admins only"
23,991
hasRole(msg.sender,ROLE_ADMIN)||msg.sender==receiverAddress
"Error submitting pool to receivingAddress"
pragma solidity 0.4.24; /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title RBACWithAdmin * @author Matt Condon (@Shrugs) * @dev It's recommended that you define constants in the contract, * @dev like ROLE_ADMIN below, to avoid typos. */ contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { } /** * @dev constructor. Sets msg.sender as admin by default */ function RBACWithAdmin() public { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract ERC20 { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } // Contract Code for Faculty - Faculty Devs contract FacultyPool is RBACWithAdmin { using SafeMath for uint; // Constants // ======================================================== uint8 constant CONTRACT_OPEN = 1; uint8 constant CONTRACT_CLOSED = 2; uint8 constant CONTRACT_SUBMIT_FUNDS = 3; // 500,000 max gas uint256 constant public gasLimit = 50000000000; // 0.1 ether uint256 constant public minContribution = 100000000000000000; // State Vars // ======================================================== // recipient address for fee address public owner; // the fee taken in tokens from the pool uint256 public feePct; // open our contract initially uint8 public contractStage = CONTRACT_OPEN; // the current Beneficiary Cap level in wei uint256 public currentBeneficiaryCap; // the total cap in wei of the pool uint256 public totalPoolCap; // the destination for this contract address public receiverAddress; // our beneficiaries mapping (address => Beneficiary) beneficiaries; // the total we raised before closing pool uint256 public finalBalance; // a set of refund amounts we may need to process uint256[] public ethRefundAmount; // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) tokenAllocationMap; // the default token address address public defaultToken; // Modifiers and Structs // ======================================================== // only run certain methods when contract is open modifier isOpenContract() { } // stop double processing attacks bool locked; modifier noReentrancy() { } // Beneficiary struct Beneficiary { uint256 ethRefund; uint256 balance; uint256 cap; mapping (address => uint256) tokensClaimed; } // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint256[] pct; uint256 balanceRemaining; } // Events // ======================================================== event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance); event ReceiverAddressSet(address indexed receiverAddress); event ERC223Received(address indexed token, uint256 value); event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit); event PoolStageChanged(uint8 stage); event PoolSubmitted(address indexed receiver, uint256 amount); event RefundReceived(address indexed sender, uint256 amount); event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount); event EthRefunded(address indexed beneficiary, uint256 amount); // CODE BELOW HERE // ======================================================== /* * Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And, * optionally, the receiving address if know at time of contract creation. * fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000 */ constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public { } // we pay in here function () payable public { } // receive funds. gas limited. min contrib. function _receiveDeposit() isOpenContract internal { } // Handle refunds only in closed state. function _receiveRefund() internal { } function getCurrentBeneficiaryCap() public view returns(uint256 cap) { } function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) { } // close the pool from receiving more funds function closePool() onlyAdmin isOpenContract public { } function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy { require(contractStage < CONTRACT_SUBMIT_FUNDS, "Cannot resubmit pool."); require(receiverAddress != 0x00, "receiver address cannot be empty"); uint256 contractBalance = address(this).balance; if(weiAmount == 0){ weiAmount = contractBalance; } require(minContribution <= weiAmount && weiAmount <= contractBalance, "submitted amount too small or larger than the balance"); finalBalance = contractBalance; // transfer to upstream receiverAddress require(<FILL_ME>) // get balance post transfer contractBalance = address(this).balance; if(contractBalance > 0) { ethRefundAmount.push(contractBalance); } contractStage = CONTRACT_SUBMIT_FUNDS; emit PoolSubmitted(receiverAddress, weiAmount); } function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){ } function withdraw(address _tokenAddress) public { } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin { } function _withdraw (address _beneficiary, address _tokenAddr) internal { } function setReceiver(address addr) public onlyAdmin { } // once we have tokens we can enable the withdrawal // setting this _useAsDefault to true will set this incoming address to the defaultToken. function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy { } // get the available tokens function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { } // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { } }
receiverAddress.call.value(weiAmount).gas(gasleft().sub(5000))(),"Error submitting pool to receivingAddress"
23,991
receiverAddress.call.value(weiAmount).gas(gasleft().sub(5000))()
"Beneficary has no funds to withdraw"
pragma solidity 0.4.24; /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title RBACWithAdmin * @author Matt Condon (@Shrugs) * @dev It's recommended that you define constants in the contract, * @dev like ROLE_ADMIN below, to avoid typos. */ contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { } /** * @dev constructor. Sets msg.sender as admin by default */ function RBACWithAdmin() public { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract ERC20 { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } // Contract Code for Faculty - Faculty Devs contract FacultyPool is RBACWithAdmin { using SafeMath for uint; // Constants // ======================================================== uint8 constant CONTRACT_OPEN = 1; uint8 constant CONTRACT_CLOSED = 2; uint8 constant CONTRACT_SUBMIT_FUNDS = 3; // 500,000 max gas uint256 constant public gasLimit = 50000000000; // 0.1 ether uint256 constant public minContribution = 100000000000000000; // State Vars // ======================================================== // recipient address for fee address public owner; // the fee taken in tokens from the pool uint256 public feePct; // open our contract initially uint8 public contractStage = CONTRACT_OPEN; // the current Beneficiary Cap level in wei uint256 public currentBeneficiaryCap; // the total cap in wei of the pool uint256 public totalPoolCap; // the destination for this contract address public receiverAddress; // our beneficiaries mapping (address => Beneficiary) beneficiaries; // the total we raised before closing pool uint256 public finalBalance; // a set of refund amounts we may need to process uint256[] public ethRefundAmount; // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) tokenAllocationMap; // the default token address address public defaultToken; // Modifiers and Structs // ======================================================== // only run certain methods when contract is open modifier isOpenContract() { } // stop double processing attacks bool locked; modifier noReentrancy() { } // Beneficiary struct Beneficiary { uint256 ethRefund; uint256 balance; uint256 cap; mapping (address => uint256) tokensClaimed; } // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint256[] pct; uint256 balanceRemaining; } // Events // ======================================================== event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance); event ReceiverAddressSet(address indexed receiverAddress); event ERC223Received(address indexed token, uint256 value); event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit); event PoolStageChanged(uint8 stage); event PoolSubmitted(address indexed receiver, uint256 amount); event RefundReceived(address indexed sender, uint256 amount); event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount); event EthRefunded(address indexed beneficiary, uint256 amount); // CODE BELOW HERE // ======================================================== /* * Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And, * optionally, the receiving address if know at time of contract creation. * fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000 */ constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public { } // we pay in here function () payable public { } // receive funds. gas limited. min contrib. function _receiveDeposit() isOpenContract internal { } // Handle refunds only in closed state. function _receiveRefund() internal { } function getCurrentBeneficiaryCap() public view returns(uint256 cap) { } function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) { } // close the pool from receiving more funds function closePool() onlyAdmin isOpenContract public { } function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy { } function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){ } function withdraw(address _tokenAddress) public { } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin { require (contractStage == CONTRACT_SUBMIT_FUNDS, "Can only be done on Submitted Contract"); require(<FILL_ME>) _withdraw(_beneficiary, tokenAddr); } function _withdraw (address _beneficiary, address _tokenAddr) internal { } function setReceiver(address addr) public onlyAdmin { } // once we have tokens we can enable the withdrawal // setting this _useAsDefault to true will set this incoming address to the defaultToken. function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy { } // get the available tokens function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { } // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { } }
beneficiaries[_beneficiary].balance>0,"Beneficary has no funds to withdraw"
23,991
beneficiaries[_beneficiary].balance>0
null
pragma solidity 0.4.24; /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title RBACWithAdmin * @author Matt Condon (@Shrugs) * @dev It's recommended that you define constants in the contract, * @dev like ROLE_ADMIN below, to avoid typos. */ contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { } /** * @dev constructor. Sets msg.sender as admin by default */ function RBACWithAdmin() public { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract ERC20 { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } // Contract Code for Faculty - Faculty Devs contract FacultyPool is RBACWithAdmin { using SafeMath for uint; // Constants // ======================================================== uint8 constant CONTRACT_OPEN = 1; uint8 constant CONTRACT_CLOSED = 2; uint8 constant CONTRACT_SUBMIT_FUNDS = 3; // 500,000 max gas uint256 constant public gasLimit = 50000000000; // 0.1 ether uint256 constant public minContribution = 100000000000000000; // State Vars // ======================================================== // recipient address for fee address public owner; // the fee taken in tokens from the pool uint256 public feePct; // open our contract initially uint8 public contractStage = CONTRACT_OPEN; // the current Beneficiary Cap level in wei uint256 public currentBeneficiaryCap; // the total cap in wei of the pool uint256 public totalPoolCap; // the destination for this contract address public receiverAddress; // our beneficiaries mapping (address => Beneficiary) beneficiaries; // the total we raised before closing pool uint256 public finalBalance; // a set of refund amounts we may need to process uint256[] public ethRefundAmount; // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) tokenAllocationMap; // the default token address address public defaultToken; // Modifiers and Structs // ======================================================== // only run certain methods when contract is open modifier isOpenContract() { } // stop double processing attacks bool locked; modifier noReentrancy() { } // Beneficiary struct Beneficiary { uint256 ethRefund; uint256 balance; uint256 cap; mapping (address => uint256) tokensClaimed; } // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint256[] pct; uint256 balanceRemaining; } // Events // ======================================================== event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance); event ReceiverAddressSet(address indexed receiverAddress); event ERC223Received(address indexed token, uint256 value); event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit); event PoolStageChanged(uint8 stage); event PoolSubmitted(address indexed receiver, uint256 amount); event RefundReceived(address indexed sender, uint256 amount); event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount); event EthRefunded(address indexed beneficiary, uint256 amount); // CODE BELOW HERE // ======================================================== /* * Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And, * optionally, the receiving address if know at time of contract creation. * fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000 */ constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public { } // we pay in here function () payable public { } // receive funds. gas limited. min contrib. function _receiveDeposit() isOpenContract internal { } // Handle refunds only in closed state. function _receiveRefund() internal { } function getCurrentBeneficiaryCap() public view returns(uint256 cap) { } function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) { } // close the pool from receiving more funds function closePool() onlyAdmin isOpenContract public { } function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy { } function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){ } function withdraw(address _tokenAddress) public { } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin { } function _withdraw (address _beneficiary, address _tokenAddr) internal { require(contractStage == CONTRACT_SUBMIT_FUNDS, "Cannot withdraw when contract is not CONTRACT_SUBMIT_FUNDS"); Beneficiary storage b = beneficiaries[_beneficiary]; if (_tokenAddr == 0x00) { _tokenAddr = defaultToken; } TokenAllocation storage ta = tokenAllocationMap[_tokenAddr]; require(<FILL_ME>) if (ethRefundAmount.length > b.ethRefund) { uint256 pct = _toPct(b.balance,finalBalance); uint256 ethAmount = 0; for (uint i= b.ethRefund; i < ethRefundAmount.length; i++) { ethAmount = ethAmount.add(_applyPct(ethRefundAmount[i],pct)); } b.ethRefund = ethRefundAmount.length; if (ethAmount > 0) { _beneficiary.transfer(ethAmount); emit EthRefunded(_beneficiary, ethAmount); } } if (ta.pct.length > b.tokensClaimed[_tokenAddr]) { uint tokenAmount = 0; for (i= b.tokensClaimed[_tokenAddr]; i< ta.pct.length; i++) { tokenAmount = tokenAmount.add(_applyPct(b.balance, ta.pct[i])); } b.tokensClaimed[_tokenAddr] = ta.pct.length; if (tokenAmount > 0) { require(ta.token.transfer(_beneficiary,tokenAmount)); ta.balanceRemaining = ta.balanceRemaining.sub(tokenAmount); emit TokenWithdrawal(_beneficiary, _tokenAddr, tokenAmount); } } } function setReceiver(address addr) public onlyAdmin { } // once we have tokens we can enable the withdrawal // setting this _useAsDefault to true will set this incoming address to the defaultToken. function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy { } // get the available tokens function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { } // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { } }
(ethRefundAmount.length>b.ethRefund)||ta.pct.length>b.tokensClaimed[_tokenAddr]
23,991
(ethRefundAmount.length>b.ethRefund)||ta.pct.length>b.tokensClaimed[_tokenAddr]
null
pragma solidity 0.4.24; /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title RBACWithAdmin * @author Matt Condon (@Shrugs) * @dev It's recommended that you define constants in the contract, * @dev like ROLE_ADMIN below, to avoid typos. */ contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { } /** * @dev constructor. Sets msg.sender as admin by default */ function RBACWithAdmin() public { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract ERC20 { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } // Contract Code for Faculty - Faculty Devs contract FacultyPool is RBACWithAdmin { using SafeMath for uint; // Constants // ======================================================== uint8 constant CONTRACT_OPEN = 1; uint8 constant CONTRACT_CLOSED = 2; uint8 constant CONTRACT_SUBMIT_FUNDS = 3; // 500,000 max gas uint256 constant public gasLimit = 50000000000; // 0.1 ether uint256 constant public minContribution = 100000000000000000; // State Vars // ======================================================== // recipient address for fee address public owner; // the fee taken in tokens from the pool uint256 public feePct; // open our contract initially uint8 public contractStage = CONTRACT_OPEN; // the current Beneficiary Cap level in wei uint256 public currentBeneficiaryCap; // the total cap in wei of the pool uint256 public totalPoolCap; // the destination for this contract address public receiverAddress; // our beneficiaries mapping (address => Beneficiary) beneficiaries; // the total we raised before closing pool uint256 public finalBalance; // a set of refund amounts we may need to process uint256[] public ethRefundAmount; // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) tokenAllocationMap; // the default token address address public defaultToken; // Modifiers and Structs // ======================================================== // only run certain methods when contract is open modifier isOpenContract() { } // stop double processing attacks bool locked; modifier noReentrancy() { } // Beneficiary struct Beneficiary { uint256 ethRefund; uint256 balance; uint256 cap; mapping (address => uint256) tokensClaimed; } // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint256[] pct; uint256 balanceRemaining; } // Events // ======================================================== event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance); event ReceiverAddressSet(address indexed receiverAddress); event ERC223Received(address indexed token, uint256 value); event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit); event PoolStageChanged(uint8 stage); event PoolSubmitted(address indexed receiver, uint256 amount); event RefundReceived(address indexed sender, uint256 amount); event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount); event EthRefunded(address indexed beneficiary, uint256 amount); // CODE BELOW HERE // ======================================================== /* * Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And, * optionally, the receiving address if know at time of contract creation. * fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000 */ constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public { } // we pay in here function () payable public { } // receive funds. gas limited. min contrib. function _receiveDeposit() isOpenContract internal { } // Handle refunds only in closed state. function _receiveRefund() internal { } function getCurrentBeneficiaryCap() public view returns(uint256 cap) { } function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) { } // close the pool from receiving more funds function closePool() onlyAdmin isOpenContract public { } function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy { } function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){ } function withdraw(address _tokenAddress) public { } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin { } function _withdraw (address _beneficiary, address _tokenAddr) internal { require(contractStage == CONTRACT_SUBMIT_FUNDS, "Cannot withdraw when contract is not CONTRACT_SUBMIT_FUNDS"); Beneficiary storage b = beneficiaries[_beneficiary]; if (_tokenAddr == 0x00) { _tokenAddr = defaultToken; } TokenAllocation storage ta = tokenAllocationMap[_tokenAddr]; require ( (ethRefundAmount.length > b.ethRefund) || ta.pct.length > b.tokensClaimed[_tokenAddr] ); if (ethRefundAmount.length > b.ethRefund) { uint256 pct = _toPct(b.balance,finalBalance); uint256 ethAmount = 0; for (uint i= b.ethRefund; i < ethRefundAmount.length; i++) { ethAmount = ethAmount.add(_applyPct(ethRefundAmount[i],pct)); } b.ethRefund = ethRefundAmount.length; if (ethAmount > 0) { _beneficiary.transfer(ethAmount); emit EthRefunded(_beneficiary, ethAmount); } } if (ta.pct.length > b.tokensClaimed[_tokenAddr]) { uint tokenAmount = 0; for (i= b.tokensClaimed[_tokenAddr]; i< ta.pct.length; i++) { tokenAmount = tokenAmount.add(_applyPct(b.balance, ta.pct[i])); } b.tokensClaimed[_tokenAddr] = ta.pct.length; if (tokenAmount > 0) { require(<FILL_ME>) ta.balanceRemaining = ta.balanceRemaining.sub(tokenAmount); emit TokenWithdrawal(_beneficiary, _tokenAddr, tokenAmount); } } } function setReceiver(address addr) public onlyAdmin { } // once we have tokens we can enable the withdrawal // setting this _useAsDefault to true will set this incoming address to the defaultToken. function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy { } // get the available tokens function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { } // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { } }
ta.token.transfer(_beneficiary,tokenAmount)
23,991
ta.token.transfer(_beneficiary,tokenAmount)
null
pragma solidity 0.4.24; /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title RBACWithAdmin * @author Matt Condon (@Shrugs) * @dev It's recommended that you define constants in the contract, * @dev like ROLE_ADMIN below, to avoid typos. */ contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { } /** * @dev constructor. Sets msg.sender as admin by default */ function RBACWithAdmin() public { } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract ERC20 { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } // Contract Code for Faculty - Faculty Devs contract FacultyPool is RBACWithAdmin { using SafeMath for uint; // Constants // ======================================================== uint8 constant CONTRACT_OPEN = 1; uint8 constant CONTRACT_CLOSED = 2; uint8 constant CONTRACT_SUBMIT_FUNDS = 3; // 500,000 max gas uint256 constant public gasLimit = 50000000000; // 0.1 ether uint256 constant public minContribution = 100000000000000000; // State Vars // ======================================================== // recipient address for fee address public owner; // the fee taken in tokens from the pool uint256 public feePct; // open our contract initially uint8 public contractStage = CONTRACT_OPEN; // the current Beneficiary Cap level in wei uint256 public currentBeneficiaryCap; // the total cap in wei of the pool uint256 public totalPoolCap; // the destination for this contract address public receiverAddress; // our beneficiaries mapping (address => Beneficiary) beneficiaries; // the total we raised before closing pool uint256 public finalBalance; // a set of refund amounts we may need to process uint256[] public ethRefundAmount; // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) tokenAllocationMap; // the default token address address public defaultToken; // Modifiers and Structs // ======================================================== // only run certain methods when contract is open modifier isOpenContract() { } // stop double processing attacks bool locked; modifier noReentrancy() { } // Beneficiary struct Beneficiary { uint256 ethRefund; uint256 balance; uint256 cap; mapping (address => uint256) tokensClaimed; } // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint256[] pct; uint256 balanceRemaining; } // Events // ======================================================== event BeneficiaryBalanceChanged(address indexed beneficiary, uint256 totalBalance); event ReceiverAddressSet(address indexed receiverAddress); event ERC223Received(address indexed token, uint256 value); event DepositReceived(address indexed beneficiary, uint256 amount, uint256 gas, uint256 gasprice, uint256 gasLimit); event PoolStageChanged(uint8 stage); event PoolSubmitted(address indexed receiver, uint256 amount); event RefundReceived(address indexed sender, uint256 amount); event TokenWithdrawal(address indexed beneficiary, address indexed token, uint256 amount); event EthRefunded(address indexed beneficiary, uint256 amount); // CODE BELOW HERE // ======================================================== /* * Construct a pool with a set of admins, the poolCap and the cap each beneficiary gets. And, * optionally, the receiving address if know at time of contract creation. * fee is in bips so 3.5% would be set as 350 and 100% == 100*100 => 10000 */ constructor(address[] _admins, uint256 _poolCap, uint256 _beneficiaryCap, address _receiverAddr, uint256 _feePct) public { } // we pay in here function () payable public { } // receive funds. gas limited. min contrib. function _receiveDeposit() isOpenContract internal { } // Handle refunds only in closed state. function _receiveRefund() internal { } function getCurrentBeneficiaryCap() public view returns(uint256 cap) { } function getPoolDetails() public view returns(uint256 total, uint256 currentBalance, uint256 remaining) { } // close the pool from receiving more funds function closePool() onlyAdmin isOpenContract public { } function submitPool(uint256 weiAmount) public onlyAdmin noReentrancy { } function viewBeneficiaryDetails(address beneficiary) public view returns (uint256 cap, uint256 balance, uint256 remaining, uint256 ethRefund){ } function withdraw(address _tokenAddress) public { } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address _beneficiary, address tokenAddr) public onlyAdmin { } function _withdraw (address _beneficiary, address _tokenAddr) internal { } function setReceiver(address addr) public onlyAdmin { } // once we have tokens we can enable the withdrawal // setting this _useAsDefault to true will set this incoming address to the defaultToken. function enableTokenWithdrawals (address _tokenAddr, bool _useAsDefault) public onlyAdmin noReentrancy { require (contractStage == CONTRACT_SUBMIT_FUNDS, "wrong contract stage"); if (_useAsDefault) { defaultToken = _tokenAddr; } else { require (defaultToken != 0x00, "defaultToken must be set"); } TokenAllocation storage ta = tokenAllocationMap[_tokenAddr]; if (ta.pct.length==0){ ta.token = ERC20(_tokenAddr); } uint256 amount = ta.token.balanceOf(this).sub(ta.balanceRemaining); require (amount > 0); if (feePct > 0) { uint256 feePctFromBips = _toPct(feePct, 10000); uint256 feeAmount = _applyPct(amount, feePctFromBips); require(<FILL_ME>) emit TokenWithdrawal(owner, _tokenAddr, feeAmount); } amount = ta.token.balanceOf(this).sub(ta.balanceRemaining); ta.balanceRemaining = ta.token.balanceOf(this); ta.pct.push(_toPct(amount,finalBalance)); } // get the available tokens function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { } // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { } }
ta.token.transfer(owner,feeAmount)
23,991
ta.token.transfer(owner,feeAmount)
null
/** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Multiplies two signed integers, reverts on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } require(<FILL_ME>) // This is the only case of overflow not detected by the check below int256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two signed integers truncating the quotient, reverts on division by zero. */ function div(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two signed integers, reverts on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two signed integers, reverts on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } }
!(a==-1&&b==INT256_MIN)
24,008
!(a==-1&&b==INT256_MIN)
null
/** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Multiplies two signed integers, reverts on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two signed integers truncating the quotient, reverts on division by zero. */ function div(int256 a, int256 b) internal pure returns (int256) { require(b != 0); // Solidity only automatically asserts when dividing by 0 require(<FILL_ME>) // This is the only case of overflow int256 c = a / b; return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two signed integers, reverts on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two signed integers, reverts on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } }
!(b==-1&&a==INT256_MIN)
24,008
!(b==-1&&a==INT256_MIN)
"Sale end"
/** *Submitted for verification at Etherscan.io on 2022-01-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; function toString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { } } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { } } interface IERC721 is IERC165 { 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); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); } interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; string private _name; string private _symbol; mapping(uint256 => address) private _owners; mapping(address => uint256) private _balances; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; string public _baseURI; constructor(string memory name_, string memory symbol_) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view virtual override returns (uint256) { } function ownerOf(uint256 tokenId) public view virtual override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function baseURI() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public virtual override { } function getApproved(uint256 tokenId) public view virtual override returns (address) { } function setApprovalForAll(address operator, bool approved) public virtual override { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { } function _exists(uint256 tokenId) internal view virtual returns (bool) { } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { } function _safeMint(address to, uint256 tokenId) internal virtual { } function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { } function _mint(address to, uint256 tokenId) internal virtual { } function _burn(uint256 tokenId) internal virtual { } function _transfer( address from, address to, uint256 tokenId ) internal virtual { } function _approve(address to, uint256 tokenId) internal virtual { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { mapping(address => mapping(uint256 => uint256)) private _ownedTokens; mapping(uint256 => uint256) private _ownedTokensIndex; uint256[] private _allTokens; mapping(uint256 => uint256) private _allTokensIndex; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { } function totalSupply() public view virtual override returns (uint256) { } function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } contract CrazyCrawFish is ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; uint public constant _TOTALSUPPLY = 510; uint public maxQuantity =10; uint public maxPerUser=10; uint public publicMint=0; uint256 public price = 0.08 ether; uint256 public status = 0; // 0-pause, 1-public bool public reveal = false; constructor(string memory baseURI) ERC721("Crazy Craw Fish", "CCF") { } function setBaseURI(string memory baseURI) public onlyOwner { } function setPrice(uint256 _newPrice) public onlyOwner() { } function setStatus(uint8 s) public onlyOwner{ } function setMaxxQtPerTx(uint256 _quantity) public onlyOwner { } function setReveal() public onlyOwner{ } function setMaxPerUser(uint256 _maxPerUser) public onlyOwner() { } modifier isSaleOpen{ require(<FILL_ME>) _; } function getStatus() public view returns (uint256) { } function getPrice(uint256 _quantity) public view returns (uint256) { } function getMaxPerUser() public view returns (uint256) { } function mint(uint chosenAmount) public payable isSaleOpen { } function tokensOfOwner(address _owner) public view returns (uint256[] memory) { } function withdraw() public onlyOwner { } function totalsupply() private view returns (uint) { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function contractURI() public view returns (string memory) { } } library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
totalSupply()<510,"Sale end"
24,071
totalSupply()<510
"Quantity must be lesser then MaxSupply"
/** *Submitted for verification at Etherscan.io on 2022-01-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; function toString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { } } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { } } interface IERC721 is IERC165 { 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); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); } interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; string private _name; string private _symbol; mapping(uint256 => address) private _owners; mapping(address => uint256) private _balances; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; string public _baseURI; constructor(string memory name_, string memory symbol_) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view virtual override returns (uint256) { } function ownerOf(uint256 tokenId) public view virtual override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function baseURI() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public virtual override { } function getApproved(uint256 tokenId) public view virtual override returns (address) { } function setApprovalForAll(address operator, bool approved) public virtual override { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { } function _exists(uint256 tokenId) internal view virtual returns (bool) { } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { } function _safeMint(address to, uint256 tokenId) internal virtual { } function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { } function _mint(address to, uint256 tokenId) internal virtual { } function _burn(uint256 tokenId) internal virtual { } function _transfer( address from, address to, uint256 tokenId ) internal virtual { } function _approve(address to, uint256 tokenId) internal virtual { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { mapping(address => mapping(uint256 => uint256)) private _ownedTokens; mapping(uint256 => uint256) private _ownedTokensIndex; uint256[] private _allTokens; mapping(uint256 => uint256) private _allTokensIndex; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { } function totalSupply() public view virtual override returns (uint256) { } function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } contract CrazyCrawFish is ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; uint public constant _TOTALSUPPLY = 510; uint public maxQuantity =10; uint public maxPerUser=10; uint public publicMint=0; uint256 public price = 0.08 ether; uint256 public status = 0; // 0-pause, 1-public bool public reveal = false; constructor(string memory baseURI) ERC721("Crazy Craw Fish", "CCF") { } function setBaseURI(string memory baseURI) public onlyOwner { } function setPrice(uint256 _newPrice) public onlyOwner() { } function setStatus(uint8 s) public onlyOwner{ } function setMaxxQtPerTx(uint256 _quantity) public onlyOwner { } function setReveal() public onlyOwner{ } function setMaxPerUser(uint256 _maxPerUser) public onlyOwner() { } modifier isSaleOpen{ } function getStatus() public view returns (uint256) { } function getPrice(uint256 _quantity) public view returns (uint256) { } function getMaxPerUser() public view returns (uint256) { } function mint(uint chosenAmount) public payable isSaleOpen { require(<FILL_ME>) require(chosenAmount > 0, "Number of tokens can not be less than or equal to 0"); require(chosenAmount <= maxQuantity,"Chosen Amount exceeds MaxQuantity"); require(price.mul(chosenAmount) == msg.value, "Sent ether value is incorrect"); require(status == 1, "Sorry the sale is not open"); require(chosenAmount + balanceOf(msg.sender) <= maxPerUser , "You can not mint more than the maximum allowed per user."); for (uint i = 0; i < chosenAmount; i++) { _safeMint(msg.sender, totalsupply()); publicMint++; } } function tokensOfOwner(address _owner) public view returns (uint256[] memory) { } function withdraw() public onlyOwner { } function totalsupply() private view returns (uint) { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function contractURI() public view returns (string memory) { } } library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
totalSupply()+chosenAmount<=_TOTALSUPPLY,"Quantity must be lesser then MaxSupply"
24,071
totalSupply()+chosenAmount<=_TOTALSUPPLY
"Sent ether value is incorrect"
/** *Submitted for verification at Etherscan.io on 2022-01-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; function toString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { } } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { } } interface IERC721 is IERC165 { 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); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); } interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; string private _name; string private _symbol; mapping(uint256 => address) private _owners; mapping(address => uint256) private _balances; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; string public _baseURI; constructor(string memory name_, string memory symbol_) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view virtual override returns (uint256) { } function ownerOf(uint256 tokenId) public view virtual override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function baseURI() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public virtual override { } function getApproved(uint256 tokenId) public view virtual override returns (address) { } function setApprovalForAll(address operator, bool approved) public virtual override { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { } function _exists(uint256 tokenId) internal view virtual returns (bool) { } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { } function _safeMint(address to, uint256 tokenId) internal virtual { } function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { } function _mint(address to, uint256 tokenId) internal virtual { } function _burn(uint256 tokenId) internal virtual { } function _transfer( address from, address to, uint256 tokenId ) internal virtual { } function _approve(address to, uint256 tokenId) internal virtual { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { mapping(address => mapping(uint256 => uint256)) private _ownedTokens; mapping(uint256 => uint256) private _ownedTokensIndex; uint256[] private _allTokens; mapping(uint256 => uint256) private _allTokensIndex; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { } function totalSupply() public view virtual override returns (uint256) { } function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } contract CrazyCrawFish is ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; uint public constant _TOTALSUPPLY = 510; uint public maxQuantity =10; uint public maxPerUser=10; uint public publicMint=0; uint256 public price = 0.08 ether; uint256 public status = 0; // 0-pause, 1-public bool public reveal = false; constructor(string memory baseURI) ERC721("Crazy Craw Fish", "CCF") { } function setBaseURI(string memory baseURI) public onlyOwner { } function setPrice(uint256 _newPrice) public onlyOwner() { } function setStatus(uint8 s) public onlyOwner{ } function setMaxxQtPerTx(uint256 _quantity) public onlyOwner { } function setReveal() public onlyOwner{ } function setMaxPerUser(uint256 _maxPerUser) public onlyOwner() { } modifier isSaleOpen{ } function getStatus() public view returns (uint256) { } function getPrice(uint256 _quantity) public view returns (uint256) { } function getMaxPerUser() public view returns (uint256) { } function mint(uint chosenAmount) public payable isSaleOpen { require(totalSupply()+chosenAmount<=_TOTALSUPPLY,"Quantity must be lesser then MaxSupply"); require(chosenAmount > 0, "Number of tokens can not be less than or equal to 0"); require(chosenAmount <= maxQuantity,"Chosen Amount exceeds MaxQuantity"); require(<FILL_ME>) require(status == 1, "Sorry the sale is not open"); require(chosenAmount + balanceOf(msg.sender) <= maxPerUser , "You can not mint more than the maximum allowed per user."); for (uint i = 0; i < chosenAmount; i++) { _safeMint(msg.sender, totalsupply()); publicMint++; } } function tokensOfOwner(address _owner) public view returns (uint256[] memory) { } function withdraw() public onlyOwner { } function totalsupply() private view returns (uint) { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function contractURI() public view returns (string memory) { } } library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
price.mul(chosenAmount)==msg.value,"Sent ether value is incorrect"
24,071
price.mul(chosenAmount)==msg.value
"You can not mint more than the maximum allowed per user."
/** *Submitted for verification at Etherscan.io on 2022-01-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; function toString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { } } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { } } interface IERC721 is IERC165 { 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); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); } interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; string private _name; string private _symbol; mapping(uint256 => address) private _owners; mapping(address => uint256) private _balances; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; string public _baseURI; constructor(string memory name_, string memory symbol_) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view virtual override returns (uint256) { } function ownerOf(uint256 tokenId) public view virtual override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function baseURI() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public virtual override { } function getApproved(uint256 tokenId) public view virtual override returns (address) { } function setApprovalForAll(address operator, bool approved) public virtual override { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { } function _exists(uint256 tokenId) internal view virtual returns (bool) { } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { } function _safeMint(address to, uint256 tokenId) internal virtual { } function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { } function _mint(address to, uint256 tokenId) internal virtual { } function _burn(uint256 tokenId) internal virtual { } function _transfer( address from, address to, uint256 tokenId ) internal virtual { } function _approve(address to, uint256 tokenId) internal virtual { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { mapping(address => mapping(uint256 => uint256)) private _ownedTokens; mapping(uint256 => uint256) private _ownedTokensIndex; uint256[] private _allTokens; mapping(uint256 => uint256) private _allTokensIndex; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { } function totalSupply() public view virtual override returns (uint256) { } function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } contract CrazyCrawFish is ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; uint public constant _TOTALSUPPLY = 510; uint public maxQuantity =10; uint public maxPerUser=10; uint public publicMint=0; uint256 public price = 0.08 ether; uint256 public status = 0; // 0-pause, 1-public bool public reveal = false; constructor(string memory baseURI) ERC721("Crazy Craw Fish", "CCF") { } function setBaseURI(string memory baseURI) public onlyOwner { } function setPrice(uint256 _newPrice) public onlyOwner() { } function setStatus(uint8 s) public onlyOwner{ } function setMaxxQtPerTx(uint256 _quantity) public onlyOwner { } function setReveal() public onlyOwner{ } function setMaxPerUser(uint256 _maxPerUser) public onlyOwner() { } modifier isSaleOpen{ } function getStatus() public view returns (uint256) { } function getPrice(uint256 _quantity) public view returns (uint256) { } function getMaxPerUser() public view returns (uint256) { } function mint(uint chosenAmount) public payable isSaleOpen { require(totalSupply()+chosenAmount<=_TOTALSUPPLY,"Quantity must be lesser then MaxSupply"); require(chosenAmount > 0, "Number of tokens can not be less than or equal to 0"); require(chosenAmount <= maxQuantity,"Chosen Amount exceeds MaxQuantity"); require(price.mul(chosenAmount) == msg.value, "Sent ether value is incorrect"); require(status == 1, "Sorry the sale is not open"); require(<FILL_ME>) for (uint i = 0; i < chosenAmount; i++) { _safeMint(msg.sender, totalsupply()); publicMint++; } } function tokensOfOwner(address _owner) public view returns (uint256[] memory) { } function withdraw() public onlyOwner { } function totalsupply() private view returns (uint) { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function contractURI() public view returns (string memory) { } } library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
chosenAmount+balanceOf(msg.sender)<=maxPerUser,"You can not mint more than the maximum allowed per user."
24,071
chosenAmount+balanceOf(msg.sender)<=maxPerUser
"Only the contract admin can perform this action"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { } } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract LnAdmin { address public admin; address public candidate; constructor(address _admin) public { } function setCandidate(address _candidate) external onlyAdmin { } function becomeAdmin( ) external { } modifier onlyAdmin { require(<FILL_ME>) _; } event candidateChanged(address oldCandidate, address newCandidate ); event AdminChanged(address oldAdmin, address newAdmin); } // approve contract LnTokenLocker is LnAdmin, Pausable { using SafeMath for uint; IERC20 private token; struct LockInfo { uint256 amount; uint256 lockTimestamp; // lock time at block.timestamp uint256 lockDays; uint256 claimedAmount; } mapping (address => LockInfo) public lockData; constructor(address _token, address _admin) public LnAdmin(_admin) { } function sendLockTokenMany(address[] calldata _users, uint256[] calldata _amounts, uint256[] calldata _lockdays) external onlyAdmin { } // 1. msg.sender/admin approve many token to this contract function sendLockToken(address _user, uint256 _amount, uint256 _lockdays) public onlyAdmin returns (bool) { } function claimToken(uint256 _amount) external returns (uint256) { } } contract LnTokenCliffLocker is LnAdmin, Pausable { using SafeMath for uint; IERC20 private token; struct LockInfo { uint256 amount; uint256 lockTimestamp; // lock time at block.timestamp uint256 claimedAmount; } mapping (address => LockInfo) public lockData; constructor(address _token, address _admin) public LnAdmin(_admin) { } function sendLockTokenMany(address[] calldata _users, uint256[] calldata _amounts, uint256[] calldata _locktimes) external onlyAdmin { } function avaible(address _user ) external view returns( uint256 ){ } // 1. msg.sender/admin approve many token to this contract function sendLockToken(address _user, uint256 _amount, uint256 _locktimes ) public onlyAdmin returns (bool) { } function claimToken(uint256 _amount) external returns (uint256) { } }
(msg.sender==admin),"Only the contract admin can perform this action"
24,079
(msg.sender==admin)
"this address has locked"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { } } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract LnAdmin { address public admin; address public candidate; constructor(address _admin) public { } function setCandidate(address _candidate) external onlyAdmin { } function becomeAdmin( ) external { } modifier onlyAdmin { } event candidateChanged(address oldCandidate, address newCandidate ); event AdminChanged(address oldAdmin, address newAdmin); } // approve contract LnTokenLocker is LnAdmin, Pausable { using SafeMath for uint; IERC20 private token; struct LockInfo { uint256 amount; uint256 lockTimestamp; // lock time at block.timestamp uint256 lockDays; uint256 claimedAmount; } mapping (address => LockInfo) public lockData; constructor(address _token, address _admin) public LnAdmin(_admin) { } function sendLockTokenMany(address[] calldata _users, uint256[] calldata _amounts, uint256[] calldata _lockdays) external onlyAdmin { } // 1. msg.sender/admin approve many token to this contract function sendLockToken(address _user, uint256 _amount, uint256 _lockdays) public onlyAdmin returns (bool) { require(_amount > 0, "amount can not zero"); require(<FILL_ME>) require(_lockdays > 0, "lock days need more than zero"); LockInfo memory lockinfo = LockInfo({ amount:_amount, lockTimestamp:block.timestamp, lockDays:_lockdays, claimedAmount:0 }); lockData[_user] = lockinfo; return true; } function claimToken(uint256 _amount) external returns (uint256) { } } contract LnTokenCliffLocker is LnAdmin, Pausable { using SafeMath for uint; IERC20 private token; struct LockInfo { uint256 amount; uint256 lockTimestamp; // lock time at block.timestamp uint256 claimedAmount; } mapping (address => LockInfo) public lockData; constructor(address _token, address _admin) public LnAdmin(_admin) { } function sendLockTokenMany(address[] calldata _users, uint256[] calldata _amounts, uint256[] calldata _locktimes) external onlyAdmin { } function avaible(address _user ) external view returns( uint256 ){ } // 1. msg.sender/admin approve many token to this contract function sendLockToken(address _user, uint256 _amount, uint256 _locktimes ) public onlyAdmin returns (bool) { } function claimToken(uint256 _amount) external returns (uint256) { } }
lockData[_user].amount==0,"this address has locked"
24,079
lockData[_user].amount==0
"No lock token to claim"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { } } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract LnAdmin { address public admin; address public candidate; constructor(address _admin) public { } function setCandidate(address _candidate) external onlyAdmin { } function becomeAdmin( ) external { } modifier onlyAdmin { } event candidateChanged(address oldCandidate, address newCandidate ); event AdminChanged(address oldAdmin, address newAdmin); } // approve contract LnTokenLocker is LnAdmin, Pausable { using SafeMath for uint; IERC20 private token; struct LockInfo { uint256 amount; uint256 lockTimestamp; // lock time at block.timestamp uint256 lockDays; uint256 claimedAmount; } mapping (address => LockInfo) public lockData; constructor(address _token, address _admin) public LnAdmin(_admin) { } function sendLockTokenMany(address[] calldata _users, uint256[] calldata _amounts, uint256[] calldata _lockdays) external onlyAdmin { } // 1. msg.sender/admin approve many token to this contract function sendLockToken(address _user, uint256 _amount, uint256 _lockdays) public onlyAdmin returns (bool) { } function claimToken(uint256 _amount) external returns (uint256) { require(_amount > 0, "Invalid parameter amount"); address _user = msg.sender; require(<FILL_ME>) uint256 passdays = block.timestamp.sub(lockData[_user].lockTimestamp).div(1 days); require(passdays > 0, "need wait for one day at least"); uint256 available = 0; if (passdays >= lockData[_user].lockDays) { available = lockData[_user].amount; } else { available = lockData[_user].amount.div(lockData[_user].lockDays).mul(passdays); } available = available.sub(lockData[_user].claimedAmount); require(available > 0, "not available claim"); //require(_amount <= available, "insufficient available"); uint256 claim = _amount; if (_amount > available) { // claim as much as possible claim = available; } lockData[_user].claimedAmount = lockData[_user].claimedAmount.add(claim); token.transfer(_user, claim); return claim; } } contract LnTokenCliffLocker is LnAdmin, Pausable { using SafeMath for uint; IERC20 private token; struct LockInfo { uint256 amount; uint256 lockTimestamp; // lock time at block.timestamp uint256 claimedAmount; } mapping (address => LockInfo) public lockData; constructor(address _token, address _admin) public LnAdmin(_admin) { } function sendLockTokenMany(address[] calldata _users, uint256[] calldata _amounts, uint256[] calldata _locktimes) external onlyAdmin { } function avaible(address _user ) external view returns( uint256 ){ } // 1. msg.sender/admin approve many token to this contract function sendLockToken(address _user, uint256 _amount, uint256 _locktimes ) public onlyAdmin returns (bool) { } function claimToken(uint256 _amount) external returns (uint256) { } }
lockData[_user].amount>0,"No lock token to claim"
24,079
lockData[_user].amount>0
"RainiStakingPool: not enougth eth"
pragma solidity ^0.8.3; contract RainiStakingPool is AccessControl, ReentrancyGuard { bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); using SafeMath for uint256; using SafeERC20 for IERC20; uint256 public rewardRate; uint256 public minRewardStake; uint256 public rewardDecimals = 1000000; uint256 public maxBonus; uint256 public bonusDuration; uint256 public bonusRate; uint256 public bonusDecimals = 1000000000; uint256 public rainbowToEth; uint256 public totalSupply; IERC20 public rainiToken; mapping(address => uint256) internal staked; mapping(address => uint256) internal balances; mapping(address => uint256) internal lastBonus; mapping(address => uint256) internal lastUpdated; event EthWithdrawn(uint256 amount); event RewardSet(uint256 rewardRate, uint256 minRewardStake); event BonusesSet(uint256 maxBonus, uint256 bonusDuration); event RainiTokenSet(address token); event RainbowToEthSet(uint256 rainbowToEth); event TokensStaked(address payer, uint256 amount, uint256 timestamp); event TokensWithdrawn(address owner, uint256 amount, uint256 timestamp); event RainbowPointsBurned(address owner, uint256 amount); event RainbowPointsMinted(address owner, uint256 amount); event RainbowPointsBought(address owner, uint256 amount); constructor(address _rainiToken) { } modifier onlyOwner() { } modifier onlyBurner() { } modifier onlyMinter() { } modifier balanceUpdate(address _owner) { } function getRewardByDuration(address _owner, uint256 _amount, uint256 _duration) public view returns(uint256) { } function getStaked(address _owner) public view returns(uint256) { } function balanceOf(address _owner) public view returns(uint256) { } function getCurrentBonus(address _owner) public view returns(uint256) { } function getCurrentAvgBonus(address _owner, uint256 _duration) public view returns(uint256) { } function setReward(uint256 _rewardRate, uint256 _minRewardStake) external onlyOwner { } function setRainbowToEth(uint256 _rainbowToEth) external onlyOwner { } function setBonus(uint256 _maxBonus, uint256 _bonusDuration) external onlyOwner { } function stake(uint256 _amount) external nonReentrant balanceUpdate(_msgSender()) { } function withdraw(uint256 _amount) external nonReentrant balanceUpdate(_msgSender()) { } function withdrawEth(uint256 _amount) external onlyOwner { } function mint(address[] calldata _addresses, uint256[] calldata _points) external onlyMinter { } function buyRainbow(uint256 _amount) external payable { require(_amount > 0, "RainiStakingPool: _amount is zero"); require(<FILL_ME>) balances[_msgSender()] = balances[_msgSender()].add(_amount); uint256 refund = msg.value.sub(_amount.div(rainbowToEth)); if(refund > 0) { (bool success, ) = _msgSender().call{ value: refund }(""); require(success, "RainiStakingPool: transfer failed"); } emit RainbowPointsBought(_msgSender(), _amount); } function burn(address _owner, uint256 _amount) external nonReentrant onlyBurner balanceUpdate(_owner) { } function calculateReward(address _owner, uint256 _amount, uint256 _duration) private view returns(uint256) { } function calculateBonus(address _owner, uint256 _amount, uint256 _duration) private view returns(uint256) { } }
msg.value.mul(rainbowToEth)>=_amount,"RainiStakingPool: not enougth eth"
24,246
msg.value.mul(rainbowToEth)>=_amount
"Bootstrap mode not engaged"
/** * . * / \ * |.'.| * |'.'| * ,'| |`. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, and trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty * */ pragma solidity 0.7.6; pragma abicoder v2; // SPDX-License-Identifier: GPL-3.0-only import "../../RocketBase.sol"; import "../../../interface/dao/protocol/RocketDAOProtocolInterface.sol"; import "../../../interface/dao/protocol/RocketDAOProtocolProposalsInterface.sol"; import "../../../types/SettingType.sol"; // The Rocket Pool Network DAO - This is a placeholder for the network DAO to come contract RocketDAOProtocol is RocketBase, RocketDAOProtocolInterface { // The namespace for any data stored in the network DAO (do not change) string constant daoNameSpace = "dao.protocol."; // Only allow bootstrapping when enabled modifier onlyBootstrapMode() { require(<FILL_ME>) _; } // Construct constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) { } /**** DAO Properties **************/ // Returns true if bootstrap mode is disabled function getBootstrapModeDisabled() override public view returns (bool) { } /**** Bootstrapping ***************/ // While bootstrap mode is engaged, RP can change settings alongside the DAO (when its implemented). When disabled, only DAO will be able to control settings // Bootstrap mode - multi Setting function bootstrapSettingMulti(string[] memory _settingContractNames, string[] memory _settingPaths, SettingType[] memory _types, bytes[] memory _values) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAOProtocol", address(this)) { } // Bootstrap mode - Uint Setting function bootstrapSettingUint(string memory _settingContractName, string memory _settingPath, uint256 _value) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAOProtocol", address(this)) { } // Bootstrap mode - Bool Setting function bootstrapSettingBool(string memory _settingContractName, string memory _settingPath, bool _value) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAOProtocol", address(this)) { } // Bootstrap mode - Address Setting function bootstrapSettingAddress(string memory _settingContractName, string memory _settingPath, address _value) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAOProtocol", address(this)) { } // Bootstrap mode - Set a claiming contract to receive a % of RPL inflation rewards function bootstrapSettingClaimer(string memory _contractName, uint256 _perc) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAOProtocol", address(this)) { } // Bootstrap mode -Spend DAO treasury function bootstrapSpendTreasury(string memory _invoiceID, address _recipientAddress, uint256 _amount) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAOProtocol", address(this)) { } // Bootstrap mode - Disable RP Access (only RP can call this to hand over full control to the DAO) function bootstrapDisable(bool _confirmDisableBootstrapMode) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAOProtocol", address(this)) { } }
getBootstrapModeDisabled()==false,"Bootstrap mode not engaged"
24,274
getBootstrapModeDisabled()==false
"BW: msg.sender not an authorized module"
// Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.6.12; import "../modules/common/IModule.sol"; import "./IWallet.sol"; /** * @title BaseWallet * @notice Simple modular wallet that authorises modules to call its invoke() method. * @author Julien Niset - <[email protected]> */ contract BaseWallet is IWallet { // The implementation of the proxy address public implementation; // The owner address public override owner; // The authorised modules mapping (address => bool) public override authorised; // The enabled static calls mapping (bytes4 => address) public override enabled; // The number of modules uint public override modules; event AuthorisedModule(address indexed module, bool value); event EnabledStaticCall(address indexed module, bytes4 indexed method); event Invoked(address indexed module, address indexed target, uint indexed value, bytes data); event Received(uint indexed value, address indexed sender, bytes data); event OwnerChanged(address owner); /** * @notice Throws if the sender is not an authorised module. */ modifier moduleOnly { require(<FILL_ME>) _; } /** * @notice Inits the wallet by setting the owner and authorising a list of modules. * @param _owner The owner. * @param _modules The modules to authorise. */ function init(address _owner, address[] calldata _modules) external { } /** * @inheritdoc IWallet */ function authoriseModule(address _module, bool _value) external override moduleOnly { } /** * @inheritdoc IWallet */ function enableStaticCall(address _module, bytes4 _method) external override moduleOnly { } /** * @inheritdoc IWallet */ function setOwner(address _newOwner) external override moduleOnly { } /** * @notice Performs a generic transaction. * @param _target The address for the transaction. * @param _value The value of the transaction. * @param _data The data of the transaction. */ function invoke(address _target, uint _value, bytes calldata _data) external moduleOnly returns (bytes memory _result) { } /** * @notice This method delegates the static call to a target contract if the data corresponds * to an enabled module, or logs the call otherwise. */ fallback() external payable { } receive() external payable { } }
authorised[msg.sender],"BW: msg.sender not an authorized module"
24,290
authorised[msg.sender]
"BW: module is already added"
// Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.6.12; import "../modules/common/IModule.sol"; import "./IWallet.sol"; /** * @title BaseWallet * @notice Simple modular wallet that authorises modules to call its invoke() method. * @author Julien Niset - <[email protected]> */ contract BaseWallet is IWallet { // The implementation of the proxy address public implementation; // The owner address public override owner; // The authorised modules mapping (address => bool) public override authorised; // The enabled static calls mapping (bytes4 => address) public override enabled; // The number of modules uint public override modules; event AuthorisedModule(address indexed module, bool value); event EnabledStaticCall(address indexed module, bytes4 indexed method); event Invoked(address indexed module, address indexed target, uint indexed value, bytes data); event Received(uint indexed value, address indexed sender, bytes data); event OwnerChanged(address owner); /** * @notice Throws if the sender is not an authorised module. */ modifier moduleOnly { } /** * @notice Inits the wallet by setting the owner and authorising a list of modules. * @param _owner The owner. * @param _modules The modules to authorise. */ function init(address _owner, address[] calldata _modules) external { require(owner == address(0) && modules == 0, "BW: wallet already initialised"); require(_modules.length > 0, "BW: construction requires at least 1 module"); owner = _owner; modules = _modules.length; for (uint256 i = 0; i < _modules.length; i++) { require(<FILL_ME>) authorised[_modules[i]] = true; IModule(_modules[i]).init(address(this)); emit AuthorisedModule(_modules[i], true); } if (address(this).balance > 0) { emit Received(address(this).balance, address(0), ""); } } /** * @inheritdoc IWallet */ function authoriseModule(address _module, bool _value) external override moduleOnly { } /** * @inheritdoc IWallet */ function enableStaticCall(address _module, bytes4 _method) external override moduleOnly { } /** * @inheritdoc IWallet */ function setOwner(address _newOwner) external override moduleOnly { } /** * @notice Performs a generic transaction. * @param _target The address for the transaction. * @param _value The value of the transaction. * @param _data The data of the transaction. */ function invoke(address _target, uint _value, bytes calldata _data) external moduleOnly returns (bytes memory _result) { } /** * @notice This method delegates the static call to a target contract if the data corresponds * to an enabled module, or logs the call otherwise. */ fallback() external payable { } receive() external payable { } }
authorised[_modules[i]]==false,"BW: module is already added"
24,290
authorised[_modules[i]]==false
"BW: must be an authorised module for static call"
// Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.6.12; import "../modules/common/IModule.sol"; import "./IWallet.sol"; /** * @title BaseWallet * @notice Simple modular wallet that authorises modules to call its invoke() method. * @author Julien Niset - <[email protected]> */ contract BaseWallet is IWallet { // The implementation of the proxy address public implementation; // The owner address public override owner; // The authorised modules mapping (address => bool) public override authorised; // The enabled static calls mapping (bytes4 => address) public override enabled; // The number of modules uint public override modules; event AuthorisedModule(address indexed module, bool value); event EnabledStaticCall(address indexed module, bytes4 indexed method); event Invoked(address indexed module, address indexed target, uint indexed value, bytes data); event Received(uint indexed value, address indexed sender, bytes data); event OwnerChanged(address owner); /** * @notice Throws if the sender is not an authorised module. */ modifier moduleOnly { } /** * @notice Inits the wallet by setting the owner and authorising a list of modules. * @param _owner The owner. * @param _modules The modules to authorise. */ function init(address _owner, address[] calldata _modules) external { } /** * @inheritdoc IWallet */ function authoriseModule(address _module, bool _value) external override moduleOnly { } /** * @inheritdoc IWallet */ function enableStaticCall(address _module, bytes4 _method) external override moduleOnly { require(<FILL_ME>) enabled[_method] = _module; emit EnabledStaticCall(_module, _method); } /** * @inheritdoc IWallet */ function setOwner(address _newOwner) external override moduleOnly { } /** * @notice Performs a generic transaction. * @param _target The address for the transaction. * @param _value The value of the transaction. * @param _data The data of the transaction. */ function invoke(address _target, uint _value, bytes calldata _data) external moduleOnly returns (bytes memory _result) { } /** * @notice This method delegates the static call to a target contract if the data corresponds * to an enabled module, or logs the call otherwise. */ fallback() external payable { } receive() external payable { } }
authorised[_module],"BW: must be an authorised module for static call"
24,290
authorised[_module]
"BW: must be an authorised module for static call"
// Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.6.12; import "../modules/common/IModule.sol"; import "./IWallet.sol"; /** * @title BaseWallet * @notice Simple modular wallet that authorises modules to call its invoke() method. * @author Julien Niset - <[email protected]> */ contract BaseWallet is IWallet { // The implementation of the proxy address public implementation; // The owner address public override owner; // The authorised modules mapping (address => bool) public override authorised; // The enabled static calls mapping (bytes4 => address) public override enabled; // The number of modules uint public override modules; event AuthorisedModule(address indexed module, bool value); event EnabledStaticCall(address indexed module, bytes4 indexed method); event Invoked(address indexed module, address indexed target, uint indexed value, bytes data); event Received(uint indexed value, address indexed sender, bytes data); event OwnerChanged(address owner); /** * @notice Throws if the sender is not an authorised module. */ modifier moduleOnly { } /** * @notice Inits the wallet by setting the owner and authorising a list of modules. * @param _owner The owner. * @param _modules The modules to authorise. */ function init(address _owner, address[] calldata _modules) external { } /** * @inheritdoc IWallet */ function authoriseModule(address _module, bool _value) external override moduleOnly { } /** * @inheritdoc IWallet */ function enableStaticCall(address _module, bytes4 _method) external override moduleOnly { } /** * @inheritdoc IWallet */ function setOwner(address _newOwner) external override moduleOnly { } /** * @notice Performs a generic transaction. * @param _target The address for the transaction. * @param _value The value of the transaction. * @param _data The data of the transaction. */ function invoke(address _target, uint _value, bytes calldata _data) external moduleOnly returns (bytes memory _result) { } /** * @notice This method delegates the static call to a target contract if the data corresponds * to an enabled module, or logs the call otherwise. */ fallback() external payable { address module = enabled[msg.sig]; if (module == address(0)) { emit Received(msg.value, msg.sender, msg.data); } else { require(<FILL_ME>) // solhint-disable-next-line no-inline-assembly assembly { calldatacopy(0, 0, calldatasize()) let result := staticcall(gas(), module, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) switch result case 0 {revert(0, returndatasize())} default {return (0, returndatasize())} } } } receive() external payable { } }
authorised[module],"BW: must be an authorised module for static call"
24,290
authorised[module]
"insufficient token hoding"
pragma solidity 0.5.16; import "openzeppelin-solidity-2.3.0/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity-2.3.0/contracts/math/SafeMath.sol"; import "openzeppelin-solidity-2.3.0/contracts/utils/ReentrancyGuard.sol"; import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/IERC20.sol"; import "synthetix/contracts/interfaces/IStakingRewards.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-core/contracts/libraries/Math.sol"; import "./uniswap/IUniswapV2Router02.sol"; import "./Strategy.sol"; import "./SafeToken.sol"; import "./Orbit.sol"; import "./interfaces/ITokenPermission.sol"; contract UniswapOrbit is Ownable, ReentrancyGuard, Orbit { /// @notice Libraries using SafeToken for address; using SafeMath for uint256; /// @notice Events event Refuel(address indexed caller, uint256 reward, uint256 bounty); event AddShare(uint256 indexed id, uint256 share); event RemoveShare(uint256 indexed id, uint256 share); event Destroy(uint256 indexed id, uint256 wad); /// @notice Immutable variables IStakingRewards public staking; IUniswapV2Factory public factory; IUniswapV2Router02 public router; IUniswapV2Pair public lpToken; ITokenPermission public tokenPermission; address public weth; address public fToken; address public uni; address public operator; /// @notice Mutable state variables mapping(uint256 => uint256) public shares; mapping(address => bool) public okStrats; uint256 public totalShare; Strategy public addStrat; Strategy public liqStrat; uint256 public refuelBountyBps; constructor( address _operator, IStakingRewards _staking, IUniswapV2Router02 _router, address _fToken, address _uni, Strategy _addStrat, Strategy _liqStrat, uint256 _refuelBountyBps, ITokenPermission _tokenPermission ) public { } /// @dev Require that the caller must be an EOA account to avoid flash loans. modifier onlyEOA() { } /// @dev Require that the caller must be the operator (the bank). modifier onlyOperator() { } /// @dev Return the entitied LP token balance for the given shares. /// @param share The number of shares to be converted to LP balance. function shareToBalance(uint256 share) public view returns (uint256) { } /// @dev Return the number of shares to receive if staking the given LP tokens. /// @param balance the number of LP tokens to be converted to shares. function balanceToShare(uint256 balance) public view returns (uint256) { } /// @dev Re-invest whatever this worker has earned back to staked LP tokens. function refuel() public onlyEOA nonReentrant { require(<FILL_ME>) // 1. Withdraw all the rewards. staking.getReward(); uint256 reward = uni.myBalance(); if (reward == 0) return; // 2. Send the reward bounty to the caller. uint256 bounty = reward.mul(refuelBountyBps) / 10000; uni.safeTransfer(msg.sender, bounty); // 3. Convert all the remaining rewards to ETH. address[] memory path = new address[](2); path[0] = address(uni); path[1] = address(weth); router.swapExactTokensForETH(reward.sub(bounty), 0, path, address(this), now); // 4. Use add ETH strategy to convert all ETH to LP tokens. addStrat.operate.value(address(this).balance)(address(0), 0, abi.encode(fToken, 0)); // 5. Mint more LP tokens and stake them for more rewards. staking.stake(lpToken.balanceOf(address(this))); emit Refuel(msg.sender, reward, bounty); } /// @dev Work on the given position. Must be called by the operator. /// @param id The position ID to work on. /// @param user The original user that is interacting with the operator. /// @param debt The amount of user debt to help the strategy make decisions. /// @param data The encoded data, consisting of strategy address and calldata. function launch(uint256 id, address user, uint256 debt, bytes calldata data) external payable onlyOperator nonReentrant { } /// @dev Return maximum output given the input amount and the status of Uniswap reserves. /// @param aIn The amount of asset to market sell. /// @param rIn the amount of asset in reserve for input. /// @param rOut The amount of asset in reserve for output. function getMktSellAmount(uint256 aIn, uint256 rIn, uint256 rOut) public pure returns (uint256) { } /// @dev Return the amount of ETH to receive if we are to liquidate the given position. /// @param id The position ID to perform condition check. function condition(uint256 id) external view returns (uint256) { } /// @dev Liquidate the given position by converting it to ETH and return back to caller. /// @param id The position ID to perform liquidation function destroy(uint256 id, address user) external onlyOperator nonReentrant { } /// @dev Internal function to stake all outstanding LP tokens to the given position ID. function _addShare(uint256 id) internal { } /// @dev Internal function to remove shares of the ID and convert to outstanding LP tokens. function _removeShare(uint256 id) internal { } /// @dev Recover ERC20 tokens that were accidentally sent to this smart contract. /// @param token The token contract. Can be anything. This contract should not hold ERC20 tokens. /// @param to The address to send the tokens to. /// @param value The number of tokens to transfer to `to`. function recover(address token, address to, uint256 value) external onlyOwner nonReentrant { } /// @dev Set the reward bounty for calling refuel operations. /// @param _refuelBountyBps The bounty value to update. function setRefuelBountyBps(uint256 _refuelBountyBps) external onlyOwner { } /// @dev Set the given strategies' approval status. /// @param strats The strategy addresses. /// @param isOk Whether to approve or unapprove the given strategies. function setStrategyOk(address[] calldata strats, bool isOk) external onlyOwner { } /// @dev Update critical strategy smart contracts. EMERGENCY ONLY. Bad strategies can steal funds. /// @param _addStrat The new add strategy contract. /// @param _liqStrat The new liquidate strategy contract. function setCriticalStrategies(Strategy _addStrat, Strategy _liqStrat) external onlyOwner { } function() external payable {} }
IERC20(tokenPermission.getRefuelTokenPermission()).balanceOf(msg.sender)>=tokenPermission.getRefuelTokenAmount(),"insufficient token hoding"
24,336
IERC20(tokenPermission.getRefuelTokenPermission()).balanceOf(msg.sender)>=tokenPermission.getRefuelTokenAmount()
"unapproved work strategy"
pragma solidity 0.5.16; import "openzeppelin-solidity-2.3.0/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity-2.3.0/contracts/math/SafeMath.sol"; import "openzeppelin-solidity-2.3.0/contracts/utils/ReentrancyGuard.sol"; import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/IERC20.sol"; import "synthetix/contracts/interfaces/IStakingRewards.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-core/contracts/libraries/Math.sol"; import "./uniswap/IUniswapV2Router02.sol"; import "./Strategy.sol"; import "./SafeToken.sol"; import "./Orbit.sol"; import "./interfaces/ITokenPermission.sol"; contract UniswapOrbit is Ownable, ReentrancyGuard, Orbit { /// @notice Libraries using SafeToken for address; using SafeMath for uint256; /// @notice Events event Refuel(address indexed caller, uint256 reward, uint256 bounty); event AddShare(uint256 indexed id, uint256 share); event RemoveShare(uint256 indexed id, uint256 share); event Destroy(uint256 indexed id, uint256 wad); /// @notice Immutable variables IStakingRewards public staking; IUniswapV2Factory public factory; IUniswapV2Router02 public router; IUniswapV2Pair public lpToken; ITokenPermission public tokenPermission; address public weth; address public fToken; address public uni; address public operator; /// @notice Mutable state variables mapping(uint256 => uint256) public shares; mapping(address => bool) public okStrats; uint256 public totalShare; Strategy public addStrat; Strategy public liqStrat; uint256 public refuelBountyBps; constructor( address _operator, IStakingRewards _staking, IUniswapV2Router02 _router, address _fToken, address _uni, Strategy _addStrat, Strategy _liqStrat, uint256 _refuelBountyBps, ITokenPermission _tokenPermission ) public { } /// @dev Require that the caller must be an EOA account to avoid flash loans. modifier onlyEOA() { } /// @dev Require that the caller must be the operator (the bank). modifier onlyOperator() { } /// @dev Return the entitied LP token balance for the given shares. /// @param share The number of shares to be converted to LP balance. function shareToBalance(uint256 share) public view returns (uint256) { } /// @dev Return the number of shares to receive if staking the given LP tokens. /// @param balance the number of LP tokens to be converted to shares. function balanceToShare(uint256 balance) public view returns (uint256) { } /// @dev Re-invest whatever this worker has earned back to staked LP tokens. function refuel() public onlyEOA nonReentrant { } /// @dev Work on the given position. Must be called by the operator. /// @param id The position ID to work on. /// @param user The original user that is interacting with the operator. /// @param debt The amount of user debt to help the strategy make decisions. /// @param data The encoded data, consisting of strategy address and calldata. function launch(uint256 id, address user, uint256 debt, bytes calldata data) external payable onlyOperator nonReentrant { // 1. Convert this position back to LP tokens. _removeShare(id); // 2. Perform the worker strategy; sending LP tokens + ETH; expecting LP tokens + ETH. (address strat, bytes memory ext) = abi.decode(data, (address, bytes)); require(<FILL_ME>) lpToken.transfer(strat, lpToken.balanceOf(address(this))); Strategy(strat).operate.value(msg.value)(user, debt, ext); // 3. Add LP tokens back to the farming pool. _addShare(id); // 4. Return any remaining ETH back to the operator. SafeToken.safeTransferETH(msg.sender, address(this).balance); } /// @dev Return maximum output given the input amount and the status of Uniswap reserves. /// @param aIn The amount of asset to market sell. /// @param rIn the amount of asset in reserve for input. /// @param rOut The amount of asset in reserve for output. function getMktSellAmount(uint256 aIn, uint256 rIn, uint256 rOut) public pure returns (uint256) { } /// @dev Return the amount of ETH to receive if we are to liquidate the given position. /// @param id The position ID to perform condition check. function condition(uint256 id) external view returns (uint256) { } /// @dev Liquidate the given position by converting it to ETH and return back to caller. /// @param id The position ID to perform liquidation function destroy(uint256 id, address user) external onlyOperator nonReentrant { } /// @dev Internal function to stake all outstanding LP tokens to the given position ID. function _addShare(uint256 id) internal { } /// @dev Internal function to remove shares of the ID and convert to outstanding LP tokens. function _removeShare(uint256 id) internal { } /// @dev Recover ERC20 tokens that were accidentally sent to this smart contract. /// @param token The token contract. Can be anything. This contract should not hold ERC20 tokens. /// @param to The address to send the tokens to. /// @param value The number of tokens to transfer to `to`. function recover(address token, address to, uint256 value) external onlyOwner nonReentrant { } /// @dev Set the reward bounty for calling refuel operations. /// @param _refuelBountyBps The bounty value to update. function setRefuelBountyBps(uint256 _refuelBountyBps) external onlyOwner { } /// @dev Set the given strategies' approval status. /// @param strats The strategy addresses. /// @param isOk Whether to approve or unapprove the given strategies. function setStrategyOk(address[] calldata strats, bool isOk) external onlyOwner { } /// @dev Update critical strategy smart contracts. EMERGENCY ONLY. Bad strategies can steal funds. /// @param _addStrat The new add strategy contract. /// @param _liqStrat The new liquidate strategy contract. function setCriticalStrategies(Strategy _addStrat, Strategy _liqStrat) external onlyOwner { } function() external payable {} }
okStrats[strat],"unapproved work strategy"
24,336
okStrats[strat]
"insufficient token hoding"
pragma solidity 0.5.16; import "openzeppelin-solidity-2.3.0/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity-2.3.0/contracts/math/SafeMath.sol"; import "openzeppelin-solidity-2.3.0/contracts/utils/ReentrancyGuard.sol"; import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/IERC20.sol"; import "synthetix/contracts/interfaces/IStakingRewards.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-core/contracts/libraries/Math.sol"; import "./uniswap/IUniswapV2Router02.sol"; import "./Strategy.sol"; import "./SafeToken.sol"; import "./Orbit.sol"; import "./interfaces/ITokenPermission.sol"; contract UniswapOrbit is Ownable, ReentrancyGuard, Orbit { /// @notice Libraries using SafeToken for address; using SafeMath for uint256; /// @notice Events event Refuel(address indexed caller, uint256 reward, uint256 bounty); event AddShare(uint256 indexed id, uint256 share); event RemoveShare(uint256 indexed id, uint256 share); event Destroy(uint256 indexed id, uint256 wad); /// @notice Immutable variables IStakingRewards public staking; IUniswapV2Factory public factory; IUniswapV2Router02 public router; IUniswapV2Pair public lpToken; ITokenPermission public tokenPermission; address public weth; address public fToken; address public uni; address public operator; /// @notice Mutable state variables mapping(uint256 => uint256) public shares; mapping(address => bool) public okStrats; uint256 public totalShare; Strategy public addStrat; Strategy public liqStrat; uint256 public refuelBountyBps; constructor( address _operator, IStakingRewards _staking, IUniswapV2Router02 _router, address _fToken, address _uni, Strategy _addStrat, Strategy _liqStrat, uint256 _refuelBountyBps, ITokenPermission _tokenPermission ) public { } /// @dev Require that the caller must be an EOA account to avoid flash loans. modifier onlyEOA() { } /// @dev Require that the caller must be the operator (the bank). modifier onlyOperator() { } /// @dev Return the entitied LP token balance for the given shares. /// @param share The number of shares to be converted to LP balance. function shareToBalance(uint256 share) public view returns (uint256) { } /// @dev Return the number of shares to receive if staking the given LP tokens. /// @param balance the number of LP tokens to be converted to shares. function balanceToShare(uint256 balance) public view returns (uint256) { } /// @dev Re-invest whatever this worker has earned back to staked LP tokens. function refuel() public onlyEOA nonReentrant { } /// @dev Work on the given position. Must be called by the operator. /// @param id The position ID to work on. /// @param user The original user that is interacting with the operator. /// @param debt The amount of user debt to help the strategy make decisions. /// @param data The encoded data, consisting of strategy address and calldata. function launch(uint256 id, address user, uint256 debt, bytes calldata data) external payable onlyOperator nonReentrant { } /// @dev Return maximum output given the input amount and the status of Uniswap reserves. /// @param aIn The amount of asset to market sell. /// @param rIn the amount of asset in reserve for input. /// @param rOut The amount of asset in reserve for output. function getMktSellAmount(uint256 aIn, uint256 rIn, uint256 rOut) public pure returns (uint256) { } /// @dev Return the amount of ETH to receive if we are to liquidate the given position. /// @param id The position ID to perform condition check. function condition(uint256 id) external view returns (uint256) { } /// @dev Liquidate the given position by converting it to ETH and return back to caller. /// @param id The position ID to perform liquidation function destroy(uint256 id, address user) external onlyOperator nonReentrant { require(<FILL_ME>) // 1. Convert the position back to LP tokens and use liquidate strategy. _removeShare(id); lpToken.transfer(address(liqStrat), lpToken.balanceOf(address(this))); liqStrat.operate(address(0), 0, abi.encode(fToken, 0)); // 2. Return all available ETH back to the operator. uint256 wad = address(this).balance; SafeToken.safeTransferETH(msg.sender, wad); emit Destroy(id, wad); } /// @dev Internal function to stake all outstanding LP tokens to the given position ID. function _addShare(uint256 id) internal { } /// @dev Internal function to remove shares of the ID and convert to outstanding LP tokens. function _removeShare(uint256 id) internal { } /// @dev Recover ERC20 tokens that were accidentally sent to this smart contract. /// @param token The token contract. Can be anything. This contract should not hold ERC20 tokens. /// @param to The address to send the tokens to. /// @param value The number of tokens to transfer to `to`. function recover(address token, address to, uint256 value) external onlyOwner nonReentrant { } /// @dev Set the reward bounty for calling refuel operations. /// @param _refuelBountyBps The bounty value to update. function setRefuelBountyBps(uint256 _refuelBountyBps) external onlyOwner { } /// @dev Set the given strategies' approval status. /// @param strats The strategy addresses. /// @param isOk Whether to approve or unapprove the given strategies. function setStrategyOk(address[] calldata strats, bool isOk) external onlyOwner { } /// @dev Update critical strategy smart contracts. EMERGENCY ONLY. Bad strategies can steal funds. /// @param _addStrat The new add strategy contract. /// @param _liqStrat The new liquidate strategy contract. function setCriticalStrategies(Strategy _addStrat, Strategy _liqStrat) external onlyOwner { } function() external payable {} }
IERC20(tokenPermission.getTerminateTokenPermission()).balanceOf(user)>=tokenPermission.getTerminateTokenAmount(),"insufficient token hoding"
24,336
IERC20(tokenPermission.getTerminateTokenPermission()).balanceOf(user)>=tokenPermission.getTerminateTokenAmount()
null
/* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.5.9; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibZeroExTransaction.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibEIP712ExchangeDomain.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibExchangeRichErrors.sol"; import "@0x/contracts-utils/contracts/src/LibRichErrors.sol"; import "@0x/contracts-utils/contracts/src/Refundable.sol"; import "./interfaces/ITransactions.sol"; import "./interfaces/ISignatureValidator.sol"; contract MixinTransactions is Refundable, LibEIP712ExchangeDomain, ISignatureValidator, ITransactions { using LibZeroExTransaction for LibZeroExTransaction.ZeroExTransaction; /// @dev Mapping of transaction hash => executed /// This prevents transactions from being executed more than once. /// @param 0 The transaction hash. /// @return 0 Whether the transation was executed. mapping (bytes32 => bool) public transactionsExecuted; /// @dev Address of current transaction signer. /// @return 0 The address associated with the the current transaction. address public currentContextAddress; /// @dev Executes an Exchange method call in the context of signer. /// @param transaction 0x transaction structure. /// @param signature Proof that transaction has been signed by signer. /// @return ABI encoded return data of the underlying Exchange function call. function executeTransaction( LibZeroExTransaction.ZeroExTransaction memory transaction, bytes memory signature ) public payable disableRefundUntilEnd returns (bytes memory) { } /// @dev Executes a batch of Exchange method calls in the context of signer(s). /// @param transactions Array of 0x transaction structures. /// @param signatures Array of proofs that transactions have been signed by signer(s). /// @return returnData Array containing ABI encoded return data for each of the underlying Exchange function calls. function batchExecuteTransactions( LibZeroExTransaction.ZeroExTransaction[] memory transactions, bytes[] memory signatures ) public payable disableRefundUntilEnd returns (bytes[] memory returnData) { } /// @dev Executes an Exchange method call in the context of signer. /// @param transaction 0x transaction structure. /// @param signature Proof that transaction has been signed by signer. /// @return ABI encoded return data of the underlying Exchange function call. function _executeTransaction( LibZeroExTransaction.ZeroExTransaction memory transaction, bytes memory signature ) internal returns (bytes memory) { } /// @dev Validates context for executeTransaction. Succeeds or throws. /// @param transaction 0x transaction structure. /// @param signature Proof that transaction has been signed by signer. /// @param transactionHash EIP712 typed data hash of 0x transaction. function _assertExecutableTransaction( LibZeroExTransaction.ZeroExTransaction memory transaction, bytes memory signature, bytes32 transactionHash ) internal view { // Check transaction is not expired // solhint-disable-next-line not-rely-on-time if (block.timestamp >= transaction.expirationTimeSeconds) { LibRichErrors.rrevert(LibExchangeRichErrors.TransactionError( LibExchangeRichErrors.TransactionErrorCodes.EXPIRED, transactionHash )); } // Validate that transaction is executed with the correct gasPrice uint256 requiredGasPrice = transaction.gasPrice; if (tx.gasprice != requiredGasPrice) { require(<FILL_ME>) } // Prevent `executeTransaction` from being called when context is already set address currentContextAddress_ = currentContextAddress; if (currentContextAddress_ != address(0)) { LibRichErrors.rrevert(LibExchangeRichErrors.TransactionInvalidContextError( transactionHash, currentContextAddress_ )); } // Validate transaction has not been executed if (transactionsExecuted[transactionHash]) { LibRichErrors.rrevert(LibExchangeRichErrors.TransactionError( LibExchangeRichErrors.TransactionErrorCodes.ALREADY_EXECUTED, transactionHash )); } // Validate signature // Transaction always valid if signer is sender of transaction address signerAddress = transaction.signerAddress; if (signerAddress != msg.sender && !_isValidTransactionWithHashSignature( transaction, transactionHash, signature ) ) { LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError( LibExchangeRichErrors.SignatureErrorCodes.BAD_TRANSACTION_SIGNATURE, transactionHash, signerAddress, signature )); } } /// @dev Sets the currentContextAddress if the current context is not msg.sender. /// @param signerAddress Address of the transaction signer. /// @param contextAddress The current context address. function _setCurrentContextAddressIfRequired( address signerAddress, address contextAddress ) internal { } /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`). /// If calling a fill function, this address will represent the taker. /// If calling a cancel function, this address will represent the maker. /// @return Signer of 0x transaction if entry point is `executeTransaction`. /// `msg.sender` if entry point is any other function. function _getCurrentContextAddress() internal view returns (address) { } }
rrors.rrevert(LibExchangeRichErrors.TransactionGasPriceError(transactionHash,tx.gasprice,requiredGasPrice)
24,446
LibExchangeRichErrors.TransactionGasPriceError(transactionHash,tx.gasprice,requiredGasPrice)
"Ether value sent is not correct"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface LootInterface { function ownerOf(uint256 tokenId) external view returns (address owner); } contract DiceForLoot is ERC721Enumerable, ReentrancyGuard, Ownable { uint256 public price = 20000000000000000; //0.02 ETH //Loot Contract address public lootAddress = 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7; LootInterface public lootContract = LootInterface(lootAddress); function random(string memory input) internal pure returns (uint256) { } function getFirstDice(uint256 tokenId) public pure returns (uint256) { } function getSecondDice(uint256 tokenId) public pure returns (uint256) { } function getThirdDice(uint256 tokenId) public pure returns (uint256) { } function getFourthDice(uint256 tokenId) public pure returns (uint256) { } function getFifthDice(uint256 tokenId) public pure returns (uint256) { } function getSixthDice(uint256 tokenId) public pure returns (uint256) { } function getSeventhDice(uint256 tokenId) public pure returns (uint256) { } function getEighthDice(uint256 tokenId) public pure returns (uint256) { } function roll(uint256 _tokenId, uint256 _index) internal pure returns (uint256 output) { } function outputCircleSVG( uint256 _x, uint256 _y, uint256 _r, string memory _color ) internal pure returns (string memory output) { } function outputsDiceSVG( uint256 _num, uint256 _x, uint256 _y ) internal pure returns (string memory output) { } function tokenURI(uint256 tokenId) public pure override returns (string memory) { } function mint(uint256 tokenId) public payable nonReentrant { } function multiMint(uint256[] memory tokenIds) public payable nonReentrant { require(<FILL_ME>) for (uint256 i = 0; i < tokenIds.length; i++) { require( tokenIds[i] > 8000 && tokenIds[i] < 12000, "Token ID invalid" ); _safeMint(msg.sender, tokenIds[i]); } } function mintWithLoot(uint256 lootId) public payable nonReentrant { } function multiMintWithLoot(uint256[] memory lootIds) public payable nonReentrant { } function withdraw() public onlyOwner { } function toString(uint256 value) internal pure returns (string memory) { } constructor() ERC721("Dice for Loot", "Dice") Ownable() {} } /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
(price*tokenIds.length)<=msg.value,"Ether value sent is not correct"
24,490
(price*tokenIds.length)<=msg.value
"Token ID invalid"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface LootInterface { function ownerOf(uint256 tokenId) external view returns (address owner); } contract DiceForLoot is ERC721Enumerable, ReentrancyGuard, Ownable { uint256 public price = 20000000000000000; //0.02 ETH //Loot Contract address public lootAddress = 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7; LootInterface public lootContract = LootInterface(lootAddress); function random(string memory input) internal pure returns (uint256) { } function getFirstDice(uint256 tokenId) public pure returns (uint256) { } function getSecondDice(uint256 tokenId) public pure returns (uint256) { } function getThirdDice(uint256 tokenId) public pure returns (uint256) { } function getFourthDice(uint256 tokenId) public pure returns (uint256) { } function getFifthDice(uint256 tokenId) public pure returns (uint256) { } function getSixthDice(uint256 tokenId) public pure returns (uint256) { } function getSeventhDice(uint256 tokenId) public pure returns (uint256) { } function getEighthDice(uint256 tokenId) public pure returns (uint256) { } function roll(uint256 _tokenId, uint256 _index) internal pure returns (uint256 output) { } function outputCircleSVG( uint256 _x, uint256 _y, uint256 _r, string memory _color ) internal pure returns (string memory output) { } function outputsDiceSVG( uint256 _num, uint256 _x, uint256 _y ) internal pure returns (string memory output) { } function tokenURI(uint256 tokenId) public pure override returns (string memory) { } function mint(uint256 tokenId) public payable nonReentrant { } function multiMint(uint256[] memory tokenIds) public payable nonReentrant { require( (price * tokenIds.length) <= msg.value, "Ether value sent is not correct" ); for (uint256 i = 0; i < tokenIds.length; i++) { require(<FILL_ME>) _safeMint(msg.sender, tokenIds[i]); } } function mintWithLoot(uint256 lootId) public payable nonReentrant { } function multiMintWithLoot(uint256[] memory lootIds) public payable nonReentrant { } function withdraw() public onlyOwner { } function toString(uint256 value) internal pure returns (string memory) { } constructor() ERC721("Dice for Loot", "Dice") Ownable() {} } /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
tokenIds[i]>8000&&tokenIds[i]<12000,"Token ID invalid"
24,490
tokenIds[i]>8000&&tokenIds[i]<12000
"Not the owner of this loot"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface LootInterface { function ownerOf(uint256 tokenId) external view returns (address owner); } contract DiceForLoot is ERC721Enumerable, ReentrancyGuard, Ownable { uint256 public price = 20000000000000000; //0.02 ETH //Loot Contract address public lootAddress = 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7; LootInterface public lootContract = LootInterface(lootAddress); function random(string memory input) internal pure returns (uint256) { } function getFirstDice(uint256 tokenId) public pure returns (uint256) { } function getSecondDice(uint256 tokenId) public pure returns (uint256) { } function getThirdDice(uint256 tokenId) public pure returns (uint256) { } function getFourthDice(uint256 tokenId) public pure returns (uint256) { } function getFifthDice(uint256 tokenId) public pure returns (uint256) { } function getSixthDice(uint256 tokenId) public pure returns (uint256) { } function getSeventhDice(uint256 tokenId) public pure returns (uint256) { } function getEighthDice(uint256 tokenId) public pure returns (uint256) { } function roll(uint256 _tokenId, uint256 _index) internal pure returns (uint256 output) { } function outputCircleSVG( uint256 _x, uint256 _y, uint256 _r, string memory _color ) internal pure returns (string memory output) { } function outputsDiceSVG( uint256 _num, uint256 _x, uint256 _y ) internal pure returns (string memory output) { } function tokenURI(uint256 tokenId) public pure override returns (string memory) { } function mint(uint256 tokenId) public payable nonReentrant { } function multiMint(uint256[] memory tokenIds) public payable nonReentrant { } function mintWithLoot(uint256 lootId) public payable nonReentrant { require(lootId > 0 && lootId <= 8000, "Token ID invalid"); require(<FILL_ME>) _safeMint(_msgSender(), lootId); } function multiMintWithLoot(uint256[] memory lootIds) public payable nonReentrant { } function withdraw() public onlyOwner { } function toString(uint256 value) internal pure returns (string memory) { } constructor() ERC721("Dice for Loot", "Dice") Ownable() {} } /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
lootContract.ownerOf(lootId)==msg.sender,"Not the owner of this loot"
24,490
lootContract.ownerOf(lootId)==msg.sender
"Not the owner of this loot"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface LootInterface { function ownerOf(uint256 tokenId) external view returns (address owner); } contract DiceForLoot is ERC721Enumerable, ReentrancyGuard, Ownable { uint256 public price = 20000000000000000; //0.02 ETH //Loot Contract address public lootAddress = 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7; LootInterface public lootContract = LootInterface(lootAddress); function random(string memory input) internal pure returns (uint256) { } function getFirstDice(uint256 tokenId) public pure returns (uint256) { } function getSecondDice(uint256 tokenId) public pure returns (uint256) { } function getThirdDice(uint256 tokenId) public pure returns (uint256) { } function getFourthDice(uint256 tokenId) public pure returns (uint256) { } function getFifthDice(uint256 tokenId) public pure returns (uint256) { } function getSixthDice(uint256 tokenId) public pure returns (uint256) { } function getSeventhDice(uint256 tokenId) public pure returns (uint256) { } function getEighthDice(uint256 tokenId) public pure returns (uint256) { } function roll(uint256 _tokenId, uint256 _index) internal pure returns (uint256 output) { } function outputCircleSVG( uint256 _x, uint256 _y, uint256 _r, string memory _color ) internal pure returns (string memory output) { } function outputsDiceSVG( uint256 _num, uint256 _x, uint256 _y ) internal pure returns (string memory output) { } function tokenURI(uint256 tokenId) public pure override returns (string memory) { } function mint(uint256 tokenId) public payable nonReentrant { } function multiMint(uint256[] memory tokenIds) public payable nonReentrant { } function mintWithLoot(uint256 lootId) public payable nonReentrant { } function multiMintWithLoot(uint256[] memory lootIds) public payable nonReentrant { for (uint256 i = 0; i < lootIds.length; i++) { require(<FILL_ME>) _safeMint(_msgSender(), lootIds[i]); } } function withdraw() public onlyOwner { } function toString(uint256 value) internal pure returns (string memory) { } constructor() ERC721("Dice for Loot", "Dice") Ownable() {} } /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { } }
lootContract.ownerOf(lootIds[i])==msg.sender,"Not the owner of this loot"
24,490
lootContract.ownerOf(lootIds[i])==msg.sender
"TokenVesting: final time is before current time"
pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, with a cliff and vesting period. Optionally revocable by the * owner. */ contract TokenVesting is Ownable { // The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is // therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore, // it is recommended to avoid using short time durations (less than a minute). Typical vesting schemes, with a // cliff period of a year and a duration of four years, are safe to use. // solhint-disable not-rely-on-time using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); event TokenVestingRevoked(address token); // beneficiary of tokens after they are released address private _beneficiary; // Durations and timestamps are expressed in UNIX time, the same units as block.timestamp. uint256 private _cliff; uint256 private _start; uint256 private _duration; bool private _revocable; mapping (address => uint256) private _released; mapping (address => bool) private _revoked; /** * @dev Creates a vesting contract that vests its balance of any ERC20 token to the * beneficiary, gradually in a linear fashion until start + duration. By then all * of the balance will have vested. * @param beneficiary address of the beneficiary to whom vested tokens are transferred * @param cliffDuration duration in seconds of the cliff in which tokens will begin to vest * @param start the time (as Unix time) at which point vesting starts * @param duration duration in seconds of the period in which the tokens will vest * @param revocable whether the vesting is revocable or not */ constructor (address beneficiary, uint256 start, uint256 cliffDuration, uint256 duration, bool revocable) { require(beneficiary != address(0), "TokenVesting: beneficiary is the zero address"); // solhint-disable-next-line max-line-length require(cliffDuration <= duration, "TokenVesting: cliff is longer than duration"); require(duration > 0, "TokenVesting: duration is 0"); // solhint-disable-next-line max-line-length require(<FILL_ME>) _beneficiary = beneficiary; _revocable = revocable; _duration = duration; _cliff = start + cliffDuration; _start = start; } /** * @return the beneficiary of the tokens. */ function beneficiary() public view returns (address) { } /** * @return the cliff time of the token vesting. */ function cliff() public view returns (uint256) { } /** * @return the start time of the token vesting. */ function start() public view returns (uint256) { } /** * @return the duration of the token vesting. */ function duration() public view returns (uint256) { } /** * @return true if the vesting is revocable. */ function revocable() public view returns (bool) { } /** * @return the amount of the token released. */ function released(address token) public view returns (uint256) { } /** * @return true if the token is revoked. */ function revoked(address token) public view returns (bool) { } /** * @notice Transfers vested tokens to beneficiary. * @param token ERC20 token which is being vested */ function release(IERC20 token) public { } /** * @notice Allows the owner to revoke the vesting. Tokens already vested * remain in the contract, the rest are returned to the owner. * @param token ERC20 token which is being vested */ function revoke(IERC20 token) public onlyOwner { } /** * @dev Calculates the amount that has already vested but hasn't been released yet. * @param token ERC20 token which is being vested */ function _releasableAmount(IERC20 token) private view returns (uint256) { } /** * @dev Calculates the amount that has already vested. * @param token ERC20 token which is being vested */ function _vestedAmount(IERC20 token) private view returns (uint256) { } function releasableAmount(IERC20 token) public view returns (uint256) { } function vestedAmount(IERC20 token) public view returns (uint256) { } }
start+duration>block.timestamp,"TokenVesting: final time is before current time"
24,577
start+duration>block.timestamp
"TokenVesting: token already revoked"
pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, with a cliff and vesting period. Optionally revocable by the * owner. */ contract TokenVesting is Ownable { // The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is // therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore, // it is recommended to avoid using short time durations (less than a minute). Typical vesting schemes, with a // cliff period of a year and a duration of four years, are safe to use. // solhint-disable not-rely-on-time using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); event TokenVestingRevoked(address token); // beneficiary of tokens after they are released address private _beneficiary; // Durations and timestamps are expressed in UNIX time, the same units as block.timestamp. uint256 private _cliff; uint256 private _start; uint256 private _duration; bool private _revocable; mapping (address => uint256) private _released; mapping (address => bool) private _revoked; /** * @dev Creates a vesting contract that vests its balance of any ERC20 token to the * beneficiary, gradually in a linear fashion until start + duration. By then all * of the balance will have vested. * @param beneficiary address of the beneficiary to whom vested tokens are transferred * @param cliffDuration duration in seconds of the cliff in which tokens will begin to vest * @param start the time (as Unix time) at which point vesting starts * @param duration duration in seconds of the period in which the tokens will vest * @param revocable whether the vesting is revocable or not */ constructor (address beneficiary, uint256 start, uint256 cliffDuration, uint256 duration, bool revocable) { } /** * @return the beneficiary of the tokens. */ function beneficiary() public view returns (address) { } /** * @return the cliff time of the token vesting. */ function cliff() public view returns (uint256) { } /** * @return the start time of the token vesting. */ function start() public view returns (uint256) { } /** * @return the duration of the token vesting. */ function duration() public view returns (uint256) { } /** * @return true if the vesting is revocable. */ function revocable() public view returns (bool) { } /** * @return the amount of the token released. */ function released(address token) public view returns (uint256) { } /** * @return true if the token is revoked. */ function revoked(address token) public view returns (bool) { } /** * @notice Transfers vested tokens to beneficiary. * @param token ERC20 token which is being vested */ function release(IERC20 token) public { } /** * @notice Allows the owner to revoke the vesting. Tokens already vested * remain in the contract, the rest are returned to the owner. * @param token ERC20 token which is being vested */ function revoke(IERC20 token) public onlyOwner { require(_revocable, "TokenVesting: cannot revoke"); require(<FILL_ME>) uint256 balance = token.balanceOf(address(this)); uint256 unreleased = _releasableAmount(token); uint256 refund = balance - unreleased; _revoked[address(token)] = true; token.safeTransfer(owner(), refund); emit TokenVestingRevoked(address(token)); } /** * @dev Calculates the amount that has already vested but hasn't been released yet. * @param token ERC20 token which is being vested */ function _releasableAmount(IERC20 token) private view returns (uint256) { } /** * @dev Calculates the amount that has already vested. * @param token ERC20 token which is being vested */ function _vestedAmount(IERC20 token) private view returns (uint256) { } function releasableAmount(IERC20 token) public view returns (uint256) { } function vestedAmount(IERC20 token) public view returns (uint256) { } }
!_revoked[address(token)],"TokenVesting: token already revoked"
24,577
!_revoked[address(token)]
'All strategies are currently off'
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ | // | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ | // | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ | // | | // ==================================================================== // ======================= FraxPoolInvestorForV2 ====================== // ==================================================================== // Frax Finance: https://github.com/FraxFinance // Primary Author(s) // Travis Moore: https://github.com/FortisFortuna // Reviewer(s) / Contributor(s) // Jason Huan: https://github.com/jasonhuan // Sam Kazemian: https://github.com/samkazemian import "../Math/SafeMath.sol"; import "../FXS/FXS.sol"; import "../Frax/Frax.sol"; import "../ERC20/ERC20.sol"; import "../ERC20/Variants/Comp.sol"; import "../Oracle/UniswapPairOracle.sol"; import "../Governance/AccessControl.sol"; import "../Frax/Pools/FraxPool.sol"; import "./yearn/IyUSDC_V2_Partial.sol"; import "./aave/IAAVELendingPool_Partial.sol"; import "./aave/IAAVE_aUSDC_Partial.sol"; import "./compound/ICompComptrollerPartial.sol"; import "./compound/IcUSDC_Partial.sol"; // Lower APY: yearn, AAVE, Compound // Higher APY: KeeperDAO, BZX, Harvest contract FraxPoolInvestorForV2 is AccessControl { using SafeMath for uint256; /* ========== STATE VARIABLES ========== */ ERC20 private collateral_token; FRAXShares private FXS; FRAXStablecoin private FRAX; FraxPool private pool; // Pools and vaults IyUSDC_V2_Partial private yUSDC_V2 = IyUSDC_V2_Partial(0x5f18C75AbDAe578b483E5F43f12a39cF75b973a9); IAAVELendingPool_Partial private aaveUSDC_Pool = IAAVELendingPool_Partial(0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9); IAAVE_aUSDC_Partial private aaveUSDC_Token = IAAVE_aUSDC_Partial(0xBcca60bB61934080951369a648Fb03DF4F96263C); IcUSDC_Partial private cUSDC = IcUSDC_Partial(0x39AA39c021dfbaE8faC545936693aC917d5E7563); // Reward Tokens Comp private COMP = Comp(0xc00e94Cb662C3520282E6f5717214004A7f26888); ICompComptrollerPartial private CompController = ICompComptrollerPartial(0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B); address public collateral_address; address public pool_address; address public owner_address; address public timelock_address; address public custodian_address; address public weth_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; uint256 public immutable missing_decimals; uint256 private constant PRICE_PRECISION = 1e6; // Max amount of collateral this contract can borrow from the FraxPool uint256 public borrow_cap = uint256(20000e6); // Amount the contract borrowed uint256 public borrowed_balance = 0; uint256 public borrowed_historical = 0; uint256 public paid_back_historical = 0; // Allowed strategies (can eventually be made into an array) bool public allow_yearn = true; bool public allow_aave = true; bool public allow_compound = true; /* ========== MODIFIERS ========== */ modifier onlyByOwnerOrGovernance() { } modifier onlyCustodian() { } /* ========== CONSTRUCTOR ========== */ constructor( address _frax_contract_address, address _fxs_contract_address, address _pool_address, address _collateral_address, address _owner_address, address _custodian_address, address _timelock_address ) public { } /* ========== VIEWS ========== */ function showAllocations() external view returns (uint256[5] memory allocations) { } function showRewards() external view returns (uint256[1] memory rewards) { } /* ========== PUBLIC FUNCTIONS ========== */ // Needed for the Frax contract to function function collatDollarBalance() external view returns (uint256) { } // This is basically a workaround to transfer USDC from the FraxPool to this investor contract // This contract is essentially marked as a 'pool' so it can call OnlyPools functions like pool_mint and pool_burn_from // on the main FRAX contract // It mints FRAX from nothing, and redeems it on the target pool for collateral and FXS // The burn can be called separately later on function mintRedeemPart1(uint256 frax_amount) public onlyByOwnerOrGovernance { require(<FILL_ME>) uint256 redemption_fee = pool.redemption_fee(); uint256 col_price_usd = pool.getCollateralPrice(); uint256 global_collateral_ratio = FRAX.global_collateral_ratio(); uint256 redeem_amount_E6 = (frax_amount.mul(uint256(1e6).sub(redemption_fee))).div(1e6).div(10 ** missing_decimals); uint256 expected_collat_amount = redeem_amount_E6.mul(global_collateral_ratio).div(1e6); expected_collat_amount = expected_collat_amount.mul(1e6).div(col_price_usd); require(borrowed_balance.add(expected_collat_amount) <= borrow_cap, "Borrow cap reached"); borrowed_balance = borrowed_balance.add(expected_collat_amount); borrowed_historical = borrowed_historical.add(expected_collat_amount); // Mint the frax FRAX.pool_mint(address(this), frax_amount); // Redeem the frax FRAX.approve(address(pool), frax_amount); pool.redeemFractionalFRAX(frax_amount, 0, 0); } function mintRedeemPart2() public onlyByOwnerOrGovernance { } function giveCollatBack(uint256 amount) public onlyByOwnerOrGovernance { } function burnFXS(uint256 amount) public onlyByOwnerOrGovernance { } /* ========== yearn V2 ========== */ function yDepositUSDC(uint256 USDC_amount) public onlyByOwnerOrGovernance { } // E6 function yWithdrawUSDC(uint256 yUSDC_amount) public onlyByOwnerOrGovernance { } /* ========== AAVE V2 ========== */ function aaveDepositUSDC(uint256 USDC_amount) public onlyByOwnerOrGovernance { } // E6 function aaveWithdrawUSDC(uint256 aUSDC_amount) public onlyByOwnerOrGovernance { } /* ========== Compound cUSDC + COMP ========== */ function compoundMint_cUSDC(uint256 USDC_amount) public onlyByOwnerOrGovernance { } // E8 function compoundRedeem_cUSDC(uint256 cUSDC_amount) public onlyByOwnerOrGovernance { } function compoundCollectCOMP() public onlyByOwnerOrGovernance { } /* ========== Custodian ========== */ function withdrawRewards() public onlyCustodian { } /* ========== RESTRICTED FUNCTIONS ========== */ function setTimelock(address new_timelock) external onlyByOwnerOrGovernance { } function setOwner(address _owner_address) external onlyByOwnerOrGovernance { } function setWethAddress(address _weth_address) external onlyByOwnerOrGovernance { } function setMiscRewardsCustodian(address _custodian_address) external onlyByOwnerOrGovernance { } function setPool(address _pool_address) external onlyByOwnerOrGovernance { } function setBorrowCap(uint256 _borrow_cap) external onlyByOwnerOrGovernance { } function setAllowedStrategies(bool _yearn, bool _aave, bool _compound) external onlyByOwnerOrGovernance { } function emergencyRecoverERC20(address tokenAddress, uint256 tokenAmount) external onlyByOwnerOrGovernance { } /* ========== EVENTS ========== */ event Recovered(address token, uint256 amount); }
allow_yearn||allow_aave||allow_compound,'All strategies are currently off'
24,704
allow_yearn||allow_aave||allow_compound
"Borrow cap reached"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ | // | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ | // | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ | // | | // ==================================================================== // ======================= FraxPoolInvestorForV2 ====================== // ==================================================================== // Frax Finance: https://github.com/FraxFinance // Primary Author(s) // Travis Moore: https://github.com/FortisFortuna // Reviewer(s) / Contributor(s) // Jason Huan: https://github.com/jasonhuan // Sam Kazemian: https://github.com/samkazemian import "../Math/SafeMath.sol"; import "../FXS/FXS.sol"; import "../Frax/Frax.sol"; import "../ERC20/ERC20.sol"; import "../ERC20/Variants/Comp.sol"; import "../Oracle/UniswapPairOracle.sol"; import "../Governance/AccessControl.sol"; import "../Frax/Pools/FraxPool.sol"; import "./yearn/IyUSDC_V2_Partial.sol"; import "./aave/IAAVELendingPool_Partial.sol"; import "./aave/IAAVE_aUSDC_Partial.sol"; import "./compound/ICompComptrollerPartial.sol"; import "./compound/IcUSDC_Partial.sol"; // Lower APY: yearn, AAVE, Compound // Higher APY: KeeperDAO, BZX, Harvest contract FraxPoolInvestorForV2 is AccessControl { using SafeMath for uint256; /* ========== STATE VARIABLES ========== */ ERC20 private collateral_token; FRAXShares private FXS; FRAXStablecoin private FRAX; FraxPool private pool; // Pools and vaults IyUSDC_V2_Partial private yUSDC_V2 = IyUSDC_V2_Partial(0x5f18C75AbDAe578b483E5F43f12a39cF75b973a9); IAAVELendingPool_Partial private aaveUSDC_Pool = IAAVELendingPool_Partial(0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9); IAAVE_aUSDC_Partial private aaveUSDC_Token = IAAVE_aUSDC_Partial(0xBcca60bB61934080951369a648Fb03DF4F96263C); IcUSDC_Partial private cUSDC = IcUSDC_Partial(0x39AA39c021dfbaE8faC545936693aC917d5E7563); // Reward Tokens Comp private COMP = Comp(0xc00e94Cb662C3520282E6f5717214004A7f26888); ICompComptrollerPartial private CompController = ICompComptrollerPartial(0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B); address public collateral_address; address public pool_address; address public owner_address; address public timelock_address; address public custodian_address; address public weth_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; uint256 public immutable missing_decimals; uint256 private constant PRICE_PRECISION = 1e6; // Max amount of collateral this contract can borrow from the FraxPool uint256 public borrow_cap = uint256(20000e6); // Amount the contract borrowed uint256 public borrowed_balance = 0; uint256 public borrowed_historical = 0; uint256 public paid_back_historical = 0; // Allowed strategies (can eventually be made into an array) bool public allow_yearn = true; bool public allow_aave = true; bool public allow_compound = true; /* ========== MODIFIERS ========== */ modifier onlyByOwnerOrGovernance() { } modifier onlyCustodian() { } /* ========== CONSTRUCTOR ========== */ constructor( address _frax_contract_address, address _fxs_contract_address, address _pool_address, address _collateral_address, address _owner_address, address _custodian_address, address _timelock_address ) public { } /* ========== VIEWS ========== */ function showAllocations() external view returns (uint256[5] memory allocations) { } function showRewards() external view returns (uint256[1] memory rewards) { } /* ========== PUBLIC FUNCTIONS ========== */ // Needed for the Frax contract to function function collatDollarBalance() external view returns (uint256) { } // This is basically a workaround to transfer USDC from the FraxPool to this investor contract // This contract is essentially marked as a 'pool' so it can call OnlyPools functions like pool_mint and pool_burn_from // on the main FRAX contract // It mints FRAX from nothing, and redeems it on the target pool for collateral and FXS // The burn can be called separately later on function mintRedeemPart1(uint256 frax_amount) public onlyByOwnerOrGovernance { require(allow_yearn || allow_aave || allow_compound, 'All strategies are currently off'); uint256 redemption_fee = pool.redemption_fee(); uint256 col_price_usd = pool.getCollateralPrice(); uint256 global_collateral_ratio = FRAX.global_collateral_ratio(); uint256 redeem_amount_E6 = (frax_amount.mul(uint256(1e6).sub(redemption_fee))).div(1e6).div(10 ** missing_decimals); uint256 expected_collat_amount = redeem_amount_E6.mul(global_collateral_ratio).div(1e6); expected_collat_amount = expected_collat_amount.mul(1e6).div(col_price_usd); require(<FILL_ME>) borrowed_balance = borrowed_balance.add(expected_collat_amount); borrowed_historical = borrowed_historical.add(expected_collat_amount); // Mint the frax FRAX.pool_mint(address(this), frax_amount); // Redeem the frax FRAX.approve(address(pool), frax_amount); pool.redeemFractionalFRAX(frax_amount, 0, 0); } function mintRedeemPart2() public onlyByOwnerOrGovernance { } function giveCollatBack(uint256 amount) public onlyByOwnerOrGovernance { } function burnFXS(uint256 amount) public onlyByOwnerOrGovernance { } /* ========== yearn V2 ========== */ function yDepositUSDC(uint256 USDC_amount) public onlyByOwnerOrGovernance { } // E6 function yWithdrawUSDC(uint256 yUSDC_amount) public onlyByOwnerOrGovernance { } /* ========== AAVE V2 ========== */ function aaveDepositUSDC(uint256 USDC_amount) public onlyByOwnerOrGovernance { } // E6 function aaveWithdrawUSDC(uint256 aUSDC_amount) public onlyByOwnerOrGovernance { } /* ========== Compound cUSDC + COMP ========== */ function compoundMint_cUSDC(uint256 USDC_amount) public onlyByOwnerOrGovernance { } // E8 function compoundRedeem_cUSDC(uint256 cUSDC_amount) public onlyByOwnerOrGovernance { } function compoundCollectCOMP() public onlyByOwnerOrGovernance { } /* ========== Custodian ========== */ function withdrawRewards() public onlyCustodian { } /* ========== RESTRICTED FUNCTIONS ========== */ function setTimelock(address new_timelock) external onlyByOwnerOrGovernance { } function setOwner(address _owner_address) external onlyByOwnerOrGovernance { } function setWethAddress(address _weth_address) external onlyByOwnerOrGovernance { } function setMiscRewardsCustodian(address _custodian_address) external onlyByOwnerOrGovernance { } function setPool(address _pool_address) external onlyByOwnerOrGovernance { } function setBorrowCap(uint256 _borrow_cap) external onlyByOwnerOrGovernance { } function setAllowedStrategies(bool _yearn, bool _aave, bool _compound) external onlyByOwnerOrGovernance { } function emergencyRecoverERC20(address tokenAddress, uint256 tokenAmount) external onlyByOwnerOrGovernance { } /* ========== EVENTS ========== */ event Recovered(address token, uint256 amount); }
borrowed_balance.add(expected_collat_amount)<=borrow_cap,"Borrow cap reached"
24,704
borrowed_balance.add(expected_collat_amount)<=borrow_cap
"minting would exceed max supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface IPup { function transferFrom( address sender, address recipient, uint256 amount ) external; } contract PupFrens is ERC721A, Ownable { string private _name = "PupFrens"; string private _symbol = "PFP"; uint256 public MAX_MINT_PER_TX = 20; IPup public pupContract; string private _customBaseUri = "https://assets.pupfrens.com/metadata/"; string private _contractUri = "https://assets.pupfrens.com/metadata/contract.json"; uint256 public maxSupply = 10000; uint256 public priceEthWei = 99999 ether; uint256 public priceMilliPup = 50000000000; // 50 million $PUP starting price (50m + 3 decimals) event MintedWithPup(uint256 numMinted, uint256 priceMilliPup); event MintedWithEth(uint256 numMinted, uint256 priceEthWei); constructor() public ERC721A(_name, _symbol) { } function mintWithPup(uint256 numToMint) public { } function mintWithEth(uint256 numToMint) public payable { } function _checkMintAmount(uint256 numToMint) internal view { require( numToMint <= MAX_MINT_PER_TX, "Trying to mint too many in a single tx" ); require(<FILL_ME>) } function _checkEthPayment(uint256 numMinted) internal view { } function _baseURI() internal view virtual override returns (string memory) { } function contractURI() public view returns (string memory) { } /** * Gets the contract address for the PUP erc20 token. */ function _pupErc20Address() internal view returns (address) { } function isApprovedForAll(address owner, address operator) public view override returns (bool) { } function setEthWeiPrice(uint256 newPriceWei) public onlyOwner { } function setMilliPupPrice(uint256 newPriceMilliPup) public onlyOwner { } function withdraw() public onlyOwner { } function setBaseURI(string calldata newURI) public onlyOwner { } function setContractUri(string calldata newUri) public onlyOwner { } function decreaseMaxSupply(uint256 newSupply) public onlyOwner { } } library OpenSeaGasFreeListing { /** @notice Returns whether the operator is an OpenSea proxy for the owner, thus allowing it to list without the token owner paying gas. @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if this function returns true. */ function isApprovedForAll(address owner, address operator) internal view returns (bool) { } } contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; }
totalSupply()+numToMint<=maxSupply,"minting would exceed max supply"
24,713
totalSupply()+numToMint<=maxSupply
"The tokenWeights array should not contains zeros"
contract MultiToken is IMultiToken, BasicMultiToken { using CheckedERC20 for ERC20; mapping(address => uint256) private _weights; uint256 internal _minimalWeight; bool private _changesEnabled = true; event ChangesDisabled(); modifier whenChangesEnabled { } function weights(address _token) public view returns(uint256) { } function changesEnabled() public view returns(bool) { } function init(ERC20[] tokens, uint256[] tokenWeights, string theName, string theSymbol, uint8 theDecimals) public { super.init(tokens, theName, theSymbol, theDecimals); require(tokenWeights.length == tokens.length, "Lenghts of tokens and tokenWeights array should be equal"); uint256 minimalWeight = 0; for (uint i = 0; i < tokens.length; i++) { require(<FILL_ME>) require(_weights[tokens[i]] == 0, "The tokens array have duplicates"); _weights[tokens[i]] = tokenWeights[i]; if (minimalWeight == 0 || tokenWeights[i] < minimalWeight) { minimalWeight = tokenWeights[i]; } } _minimalWeight = minimalWeight; _registerInterface(InterfaceId_IMultiToken); } function getReturn(address fromToken, address toToken, uint256 amount) public view returns(uint256 returnAmount) { } function change(address fromToken, address toToken, uint256 amount, uint256 minReturn) public whenChangesEnabled notInLendingMode returns(uint256 returnAmount) { } // Admin methods function disableChanges() public onlyOwner { } // Internal methods function setWeight(address token, uint256 newWeight) internal { } }
tokenWeights[i]!=0,"The tokenWeights array should not contains zeros"
24,775
tokenWeights[i]!=0
"The tokens array have duplicates"
contract MultiToken is IMultiToken, BasicMultiToken { using CheckedERC20 for ERC20; mapping(address => uint256) private _weights; uint256 internal _minimalWeight; bool private _changesEnabled = true; event ChangesDisabled(); modifier whenChangesEnabled { } function weights(address _token) public view returns(uint256) { } function changesEnabled() public view returns(bool) { } function init(ERC20[] tokens, uint256[] tokenWeights, string theName, string theSymbol, uint8 theDecimals) public { super.init(tokens, theName, theSymbol, theDecimals); require(tokenWeights.length == tokens.length, "Lenghts of tokens and tokenWeights array should be equal"); uint256 minimalWeight = 0; for (uint i = 0; i < tokens.length; i++) { require(tokenWeights[i] != 0, "The tokenWeights array should not contains zeros"); require(<FILL_ME>) _weights[tokens[i]] = tokenWeights[i]; if (minimalWeight == 0 || tokenWeights[i] < minimalWeight) { minimalWeight = tokenWeights[i]; } } _minimalWeight = minimalWeight; _registerInterface(InterfaceId_IMultiToken); } function getReturn(address fromToken, address toToken, uint256 amount) public view returns(uint256 returnAmount) { } function change(address fromToken, address toToken, uint256 amount, uint256 minReturn) public whenChangesEnabled notInLendingMode returns(uint256 returnAmount) { } // Admin methods function disableChanges() public onlyOwner { } // Internal methods function setWeight(address token, uint256 newWeight) internal { } }
_weights[tokens[i]]==0,"The tokens array have duplicates"
24,775
_weights[tokens[i]]==0
"resolver not active"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0 <0.9.0; /// @notice Bilateral escrow for ETH and ERC-20/721 tokens. /// @author LexDAO LLC. contract LexLocker { uint256 lockerCount; mapping(uint256 => Locker) public lockers; mapping(address => Resolver) public resolvers; /// @dev Events to assist web3 applications. event Deposit( bool nft, address indexed depositor, address indexed receiver, address resolver, address token, uint256 value, uint256 indexed registration, string details); event Release(uint256 indexed registration); event Lock(uint256 indexed registration); event Resolve(uint256 indexed registration, uint256 indexed depositorAward, uint256 indexed receiverAward, string details); event RegisterResolver(address indexed resolver, bool indexed active, uint256 indexed fee); /// @dev Tracks registered escrow status. struct Locker { bool nft; bool locked; address depositor; address receiver; address resolver; address token; uint256 value; } /// @dev Tracks registered resolver status. struct Resolver { bool active; uint8 fee; } // **** ESCROW PROTOCOL **** // // -------------------------- // /// @notice Deposits tokens (ERC-20/721) into escrow - locked funds can be released by `msg.sender` `depositor` - both parties can {lock} for `resolver`. /// @param receiver The account that receives funds. /// @param resolver The account that unlock funds. /// @param token The asset used for funds. /// @param value The amount of funds - if `nft`, the 'tokenId'. /// @param nft If 'false', ERC-20 is assumed, otherwise, non-fungible asset. /// @param details Describes context of escrow - stamped into event. function deposit( address receiver, address resolver, address token, uint256 value, bool nft, string calldata details ) external payable returns (uint256 registration) { require(<FILL_ME>) /// @dev Handle ETH/ERC-20/721 deposit. if (msg.value != 0) { require(msg.value == value, "wrong msg.value"); /// @dev Override to clarify ETH is used. if (token != address(0)) token = address(0); } else { safeTransferFrom(token, msg.sender, address(this), value); } /// @dev Increment registered lockers and assign # to escrow deposit. lockerCount++; registration = lockerCount; lockers[registration] = Locker(nft, false, msg.sender, receiver, resolver, token, value); emit Deposit(nft, msg.sender, receiver, resolver, token, value, registration, details); } /// @notice Releases escrowed assets to designated `receiver` - can only be called by `depositor` if not `locked`. /// @param registration The index of escrow deposit. function release(uint256 registration) external { } // **** DISPUTE PROTOCOL **** // // --------------------------- // /// @notice Locks escrowed assets for resolution - can only be called by locker parties. /// @param registration The index of escrow deposit. function lock(uint256 registration) external { } /// @notice Resolves locked escrow deposit in split between parties - if NFT, must be complete award (so, one party receives '0'). /// @param registration The registration index of escrow deposit. /// @param depositorAward The sum given to `depositor`. /// @param receiverAward The sum given to `receiver`. function resolve(uint256 registration, uint256 depositorAward, uint256 receiverAward, string calldata details) external { } function registerResolver(bool active, uint8 fee) external { } // **** TRANSFER HELPERS **** // // -------------------------- // /// @notice Provides 'safe' ERC-20/721 {transfer} for tokens that don't consistently return 'true/false'. /// @param token Address of ERC-20/721 token. /// @param recipient Account to send tokens to. /// @param value Token amount to send - if NFT, 'tokenId'. function safeTransfer(address token, address recipient, uint256 value) private { } /// @notice Provides 'safe' ERC-20/721 {transferFrom} for tokens that don't consistently return 'true/false'. /// @param token Address of ERC-20/721 token. /// @param sender Account to send tokens from. /// @param recipient Account to send tokens to. /// @param value Token amount to send - if NFT, 'tokenId'. function safeTransferFrom(address token, address sender, address recipient, uint256 value) private { } /// @notice Provides 'safe' ETH transfer. /// @param recipient Account to send ETH to. /// @param value ETH amount to send. function safeTransferETH(address recipient, uint256 value) private { } }
resolvers[resolver].active,"resolver not active"
24,904
resolvers[resolver].active
"locked"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0 <0.9.0; /// @notice Bilateral escrow for ETH and ERC-20/721 tokens. /// @author LexDAO LLC. contract LexLocker { uint256 lockerCount; mapping(uint256 => Locker) public lockers; mapping(address => Resolver) public resolvers; /// @dev Events to assist web3 applications. event Deposit( bool nft, address indexed depositor, address indexed receiver, address resolver, address token, uint256 value, uint256 indexed registration, string details); event Release(uint256 indexed registration); event Lock(uint256 indexed registration); event Resolve(uint256 indexed registration, uint256 indexed depositorAward, uint256 indexed receiverAward, string details); event RegisterResolver(address indexed resolver, bool indexed active, uint256 indexed fee); /// @dev Tracks registered escrow status. struct Locker { bool nft; bool locked; address depositor; address receiver; address resolver; address token; uint256 value; } /// @dev Tracks registered resolver status. struct Resolver { bool active; uint8 fee; } // **** ESCROW PROTOCOL **** // // -------------------------- // /// @notice Deposits tokens (ERC-20/721) into escrow - locked funds can be released by `msg.sender` `depositor` - both parties can {lock} for `resolver`. /// @param receiver The account that receives funds. /// @param resolver The account that unlock funds. /// @param token The asset used for funds. /// @param value The amount of funds - if `nft`, the 'tokenId'. /// @param nft If 'false', ERC-20 is assumed, otherwise, non-fungible asset. /// @param details Describes context of escrow - stamped into event. function deposit( address receiver, address resolver, address token, uint256 value, bool nft, string calldata details ) external payable returns (uint256 registration) { } /// @notice Releases escrowed assets to designated `receiver` - can only be called by `depositor` if not `locked`. /// @param registration The index of escrow deposit. function release(uint256 registration) external { Locker storage locker = lockers[registration]; require(msg.sender == locker.depositor, "not depositor"); require(<FILL_ME>) /// @dev Handle asset transfer. if (locker.token == address(0)) { /// @dev Release ETH. safeTransferETH(locker.receiver, locker.value); } else if (!locker.nft) { /// @dev Release ERC-20. safeTransfer(locker.token, locker.receiver, locker.value); } else { /// @dev Release NFT. safeTransferFrom(locker.token, address(this), locker.receiver, locker.value); } delete lockers[registration]; emit Release(registration); } // **** DISPUTE PROTOCOL **** // // --------------------------- // /// @notice Locks escrowed assets for resolution - can only be called by locker parties. /// @param registration The index of escrow deposit. function lock(uint256 registration) external { } /// @notice Resolves locked escrow deposit in split between parties - if NFT, must be complete award (so, one party receives '0'). /// @param registration The registration index of escrow deposit. /// @param depositorAward The sum given to `depositor`. /// @param receiverAward The sum given to `receiver`. function resolve(uint256 registration, uint256 depositorAward, uint256 receiverAward, string calldata details) external { } function registerResolver(bool active, uint8 fee) external { } // **** TRANSFER HELPERS **** // // -------------------------- // /// @notice Provides 'safe' ERC-20/721 {transfer} for tokens that don't consistently return 'true/false'. /// @param token Address of ERC-20/721 token. /// @param recipient Account to send tokens to. /// @param value Token amount to send - if NFT, 'tokenId'. function safeTransfer(address token, address recipient, uint256 value) private { } /// @notice Provides 'safe' ERC-20/721 {transferFrom} for tokens that don't consistently return 'true/false'. /// @param token Address of ERC-20/721 token. /// @param sender Account to send tokens from. /// @param recipient Account to send tokens to. /// @param value Token amount to send - if NFT, 'tokenId'. function safeTransferFrom(address token, address sender, address recipient, uint256 value) private { } /// @notice Provides 'safe' ETH transfer. /// @param recipient Account to send ETH to. /// @param value ETH amount to send. function safeTransferETH(address recipient, uint256 value) private { } }
!locker.locked,"locked"
24,904
!locker.locked
"not locked"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0 <0.9.0; /// @notice Bilateral escrow for ETH and ERC-20/721 tokens. /// @author LexDAO LLC. contract LexLocker { uint256 lockerCount; mapping(uint256 => Locker) public lockers; mapping(address => Resolver) public resolvers; /// @dev Events to assist web3 applications. event Deposit( bool nft, address indexed depositor, address indexed receiver, address resolver, address token, uint256 value, uint256 indexed registration, string details); event Release(uint256 indexed registration); event Lock(uint256 indexed registration); event Resolve(uint256 indexed registration, uint256 indexed depositorAward, uint256 indexed receiverAward, string details); event RegisterResolver(address indexed resolver, bool indexed active, uint256 indexed fee); /// @dev Tracks registered escrow status. struct Locker { bool nft; bool locked; address depositor; address receiver; address resolver; address token; uint256 value; } /// @dev Tracks registered resolver status. struct Resolver { bool active; uint8 fee; } // **** ESCROW PROTOCOL **** // // -------------------------- // /// @notice Deposits tokens (ERC-20/721) into escrow - locked funds can be released by `msg.sender` `depositor` - both parties can {lock} for `resolver`. /// @param receiver The account that receives funds. /// @param resolver The account that unlock funds. /// @param token The asset used for funds. /// @param value The amount of funds - if `nft`, the 'tokenId'. /// @param nft If 'false', ERC-20 is assumed, otherwise, non-fungible asset. /// @param details Describes context of escrow - stamped into event. function deposit( address receiver, address resolver, address token, uint256 value, bool nft, string calldata details ) external payable returns (uint256 registration) { } /// @notice Releases escrowed assets to designated `receiver` - can only be called by `depositor` if not `locked`. /// @param registration The index of escrow deposit. function release(uint256 registration) external { } // **** DISPUTE PROTOCOL **** // // --------------------------- // /// @notice Locks escrowed assets for resolution - can only be called by locker parties. /// @param registration The index of escrow deposit. function lock(uint256 registration) external { } /// @notice Resolves locked escrow deposit in split between parties - if NFT, must be complete award (so, one party receives '0'). /// @param registration The registration index of escrow deposit. /// @param depositorAward The sum given to `depositor`. /// @param receiverAward The sum given to `receiver`. function resolve(uint256 registration, uint256 depositorAward, uint256 receiverAward, string calldata details) external { Locker storage locker = lockers[registration]; require(msg.sender == locker.resolver, "not resolver"); require(<FILL_ME>) require(depositorAward + receiverAward == locker.value, "not remainder"); /// @dev Calculate resolution fee and apply to awards. unchecked { uint256 resolverFee = locker.value / resolvers[locker.resolver].fee / 2; depositorAward -= resolverFee; receiverAward -= resolverFee; } /// @dev Handle asset transfer. if (locker.token == address(0)) { /// @dev Split ETH. safeTransferETH(locker.depositor, depositorAward); safeTransferETH(locker.receiver, receiverAward); } else if (!locker.nft) { /// @dev ...ERC20. safeTransfer(locker.token, locker.depositor, depositorAward); safeTransfer(locker.token, locker.receiver, receiverAward); } else { /// @dev Award NFT. if (depositorAward != 0) { safeTransferFrom(locker.token, address(this), locker.depositor, locker.value); } else { safeTransferFrom(locker.token, address(this), locker.receiver, locker.value); } } delete lockers[registration]; emit Resolve(registration, depositorAward, receiverAward, details); } function registerResolver(bool active, uint8 fee) external { } // **** TRANSFER HELPERS **** // // -------------------------- // /// @notice Provides 'safe' ERC-20/721 {transfer} for tokens that don't consistently return 'true/false'. /// @param token Address of ERC-20/721 token. /// @param recipient Account to send tokens to. /// @param value Token amount to send - if NFT, 'tokenId'. function safeTransfer(address token, address recipient, uint256 value) private { } /// @notice Provides 'safe' ERC-20/721 {transferFrom} for tokens that don't consistently return 'true/false'. /// @param token Address of ERC-20/721 token. /// @param sender Account to send tokens from. /// @param recipient Account to send tokens to. /// @param value Token amount to send - if NFT, 'tokenId'. function safeTransferFrom(address token, address sender, address recipient, uint256 value) private { } /// @notice Provides 'safe' ETH transfer. /// @param recipient Account to send ETH to. /// @param value ETH amount to send. function safeTransferETH(address recipient, uint256 value) private { } }
locker.locked,"not locked"
24,904
locker.locked
"not remainder"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0 <0.9.0; /// @notice Bilateral escrow for ETH and ERC-20/721 tokens. /// @author LexDAO LLC. contract LexLocker { uint256 lockerCount; mapping(uint256 => Locker) public lockers; mapping(address => Resolver) public resolvers; /// @dev Events to assist web3 applications. event Deposit( bool nft, address indexed depositor, address indexed receiver, address resolver, address token, uint256 value, uint256 indexed registration, string details); event Release(uint256 indexed registration); event Lock(uint256 indexed registration); event Resolve(uint256 indexed registration, uint256 indexed depositorAward, uint256 indexed receiverAward, string details); event RegisterResolver(address indexed resolver, bool indexed active, uint256 indexed fee); /// @dev Tracks registered escrow status. struct Locker { bool nft; bool locked; address depositor; address receiver; address resolver; address token; uint256 value; } /// @dev Tracks registered resolver status. struct Resolver { bool active; uint8 fee; } // **** ESCROW PROTOCOL **** // // -------------------------- // /// @notice Deposits tokens (ERC-20/721) into escrow - locked funds can be released by `msg.sender` `depositor` - both parties can {lock} for `resolver`. /// @param receiver The account that receives funds. /// @param resolver The account that unlock funds. /// @param token The asset used for funds. /// @param value The amount of funds - if `nft`, the 'tokenId'. /// @param nft If 'false', ERC-20 is assumed, otherwise, non-fungible asset. /// @param details Describes context of escrow - stamped into event. function deposit( address receiver, address resolver, address token, uint256 value, bool nft, string calldata details ) external payable returns (uint256 registration) { } /// @notice Releases escrowed assets to designated `receiver` - can only be called by `depositor` if not `locked`. /// @param registration The index of escrow deposit. function release(uint256 registration) external { } // **** DISPUTE PROTOCOL **** // // --------------------------- // /// @notice Locks escrowed assets for resolution - can only be called by locker parties. /// @param registration The index of escrow deposit. function lock(uint256 registration) external { } /// @notice Resolves locked escrow deposit in split between parties - if NFT, must be complete award (so, one party receives '0'). /// @param registration The registration index of escrow deposit. /// @param depositorAward The sum given to `depositor`. /// @param receiverAward The sum given to `receiver`. function resolve(uint256 registration, uint256 depositorAward, uint256 receiverAward, string calldata details) external { Locker storage locker = lockers[registration]; require(msg.sender == locker.resolver, "not resolver"); require(locker.locked, "not locked"); require(<FILL_ME>) /// @dev Calculate resolution fee and apply to awards. unchecked { uint256 resolverFee = locker.value / resolvers[locker.resolver].fee / 2; depositorAward -= resolverFee; receiverAward -= resolverFee; } /// @dev Handle asset transfer. if (locker.token == address(0)) { /// @dev Split ETH. safeTransferETH(locker.depositor, depositorAward); safeTransferETH(locker.receiver, receiverAward); } else if (!locker.nft) { /// @dev ...ERC20. safeTransfer(locker.token, locker.depositor, depositorAward); safeTransfer(locker.token, locker.receiver, receiverAward); } else { /// @dev Award NFT. if (depositorAward != 0) { safeTransferFrom(locker.token, address(this), locker.depositor, locker.value); } else { safeTransferFrom(locker.token, address(this), locker.receiver, locker.value); } } delete lockers[registration]; emit Resolve(registration, depositorAward, receiverAward, details); } function registerResolver(bool active, uint8 fee) external { } // **** TRANSFER HELPERS **** // // -------------------------- // /// @notice Provides 'safe' ERC-20/721 {transfer} for tokens that don't consistently return 'true/false'. /// @param token Address of ERC-20/721 token. /// @param recipient Account to send tokens to. /// @param value Token amount to send - if NFT, 'tokenId'. function safeTransfer(address token, address recipient, uint256 value) private { } /// @notice Provides 'safe' ERC-20/721 {transferFrom} for tokens that don't consistently return 'true/false'. /// @param token Address of ERC-20/721 token. /// @param sender Account to send tokens from. /// @param recipient Account to send tokens to. /// @param value Token amount to send - if NFT, 'tokenId'. function safeTransferFrom(address token, address sender, address recipient, uint256 value) private { } /// @notice Provides 'safe' ETH transfer. /// @param recipient Account to send ETH to. /// @param value ETH amount to send. function safeTransferETH(address recipient, uint256 value) private { } }
depositorAward+receiverAward==locker.value,"not remainder"
24,904
depositorAward+receiverAward==locker.value
"Not participating."
contract VerityEvent { /// Contract's owner, used for permission management address public owner; /// Token contract address, used for tokend distribution address public tokenAddress; /// Event registry contract address address public eventRegistryAddress; /// Designated validation nodes that will decide rewards. address[] eventResolvers; /// - WaitingForRewards: Waiting for current master to set rewards. /// - Validating: Master has set rewards. Vaiting for node validation. /// - Finished: Either successfully validated or failed. enum ValidationState { WaitingForRewards, Validating, Finished } ValidationState validationState = ValidationState.WaitingForRewards; struct RewardsValidation { address currentMasterNode; string rewardsHash; uint approvalCount; uint rejectionCount; string[] altHashes; mapping(address => uint) votersRound; mapping(string => address[]) altHashVotes; mapping(string => bool) rejectedHashes; } RewardsValidation rewardsValidation; /// Round of validation. Increases by each failed validation uint public rewardsValidationRound; /// A list of all the participating wallet addresses, implemented as a mapping /// to provide constant lookup times. mapping(address => bool) participants; address[] participantsIndex; enum RewardType { Ether, Token } RewardType rewardType; /// A mapping of addresses to their assigned rewards mapping(address => mapping(uint => uint)) rewards; address[] rewardsIndex; /// Event application start time, users cannot apply to participate before it uint applicationStartTime; /// Event application end time, users cannot apply after this time uint applicationEndTime; /// Event actual start time, votes before this should not be accepted uint eventStartTime; /// Event end time, it is calculated in the constructor uint eventEndTime; /// Ipfs event data hash string ipfsEventHash; /// Event name, here for informational use - not used otherwise /// owner can recover tokens and ether after this time uint leftoversRecoverableAfter; /// Amount of tokens that each user must stake before voting. uint public stakingAmount; struct Dispute { uint amount; uint timeout; uint round; uint expiresAt; uint multiplier; mapping(address => bool) disputers; address currentDisputer; } Dispute dispute; uint defaultDisputeTimeExtension = 1800; // 30 minutes string public eventName; /// Data feed hash, used for verification string public dataFeedHash; bytes32[] results; enum RewardsDistribution { Linear, // 0 Exponential // 1 } struct ConsensusRules { uint minTotalVotes; uint minConsensusVotes; uint minConsensusRatio; uint minParticipantRatio; uint maxParticipants; RewardsDistribution rewardsDistribution; } ConsensusRules consensusRules; /// Event's states /// Events advance in the order defined here. Once the event reaches "Reward" /// state, it cannot advance further. /// Event states: /// - Waiting -- Contract has been created, nothing is happening yet /// - Application -- After applicationStartTime, the event advances here /// new wallets can be added to the participats list during this state. /// - Running -- Event is running, no new participants can be added /// - DisputeTimeout -- Dispute possible /// - Reward -- Participants can claim their payouts here - final state; can't be modified. /// - Failed -- Event failed (no consensus, not enough users, timeout, ...) - final state; can't be modified enum EventStates { Waiting, Application, Running, DisputeTimeout, Reward, Failed } EventStates eventState = EventStates.Waiting; event StateTransition(EventStates newState); event JoinEvent(address wallet); event ClaimReward(address recipient); event Error(string description); event EventFailed(string description); event ValidationStarted(uint validationRound); event ValidationRestart(uint validationRound); event DisputeTriggered(address byAddress); event ClaimStake(address recipient); constructor( string _eventName, uint _applicationStartTime, uint _applicationEndTime, uint _eventStartTime, uint _eventRunTime, // in seconds address _tokenAddress, address _registry, address[] _eventResolvers, uint _leftoversRecoverableAfter, // with timestamp (in seconds) uint[6] _consensusRules, // [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants, distribution] uint _stakingAmount, uint[3] _disputeRules, // [dispute amount, dispute timeout, dispute multiplier] string _ipfsEventHash ) public payable { } /// A modifier signifiying that a certain method can only be used by the creator /// of the contract. /// Rollbacks the transaction on failure. modifier onlyOwner() { } /// A modifier signifiying that rewards can be set only by the designated master node. /// Rollbacks the transaction on failure. modifier onlyCurrentMaster() { } /// A modifier signifying that a certain method can only be used by a wallet /// marked as a participant. /// Rollbacks the transaction or failure. modifier onlyParticipating() { require(<FILL_ME>) _; } /// A modifier signifying that a certain method can only be used when the event /// is in a certain state. /// @param _state The event's required state /// Example: /// function claimReward() onlyParticipanting onlyState(EventStates.Reward) { /// // ... content /// } modifier onlyState(EventStates _state) { } /// A modifier taking care of all the timed state transitions. /// Should always be used before all other modifiers, especially `onlyState`, /// since it can change state. /// Should probably be used in ALL non-constant (transaction) methods of /// the contract. modifier timedStateTransition() { } modifier onlyChangeableState() { } modifier onlyAfterLefroversCanBeRecovered() { } modifier canValidateRewards(uint forRound) { } /// Ensure we can receive money at any time. /// Not used, but we might want to extend the reward fund while event is running. function() public payable {} /// Apply for participation in this event. /// Available only during the Application state. /// A transaction to this function has to be done by the users themselves, /// registering their wallet address as a participent. /// The transaction does not have to include any funds. function joinEvent() public timedStateTransition { } /// Checks whether an address is participating in this event. /// @param _user The addres to check for participation /// @return {bool} Whether the given address is a participant of this event function isParticipating(address _user) public view returns(bool) { } function getParticipants() public view returns(address[]) { } function getEventTimes() public view returns(uint[5]) { } /// Assign the actual rewards. /// Receives a list of addresses and a list rewards. Mapping between the two /// is done by the addresses' and reward's numerical index in the list, so /// order is important. /// @param _addresses A list of addresses /// @param _etherRewards A list of ether rewards, must be the exact same length as addresses /// @param _tokenRewards A list of token rewards, must be the exact same length as addresses function setRewards( address[] _addresses, uint[] _etherRewards, uint[] _tokenRewards ) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Triggered by the master node once rewards are set and ready to validate function markRewardsSet(string rewardsHash) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Called by event resolver nodes if they agree with rewards function approveRewards(uint validationRound) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Called by event resolvers if they don't agree with rewards function rejectRewards(uint validationRound, string altHash) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Trigger a dispute. function triggerDispute() public timedStateTransition onlyParticipating onlyState(EventStates.DisputeTimeout) { } /// Checks current approvals for threshold function checkApprovalRatio() private { } /// Checks current rejections for threshold function checkRejectionRatio() private { } /// Handle the rejection of current rewards function rejectCurrentValidation() private { } function restartValidation() private { } /// Delete rewards. function deleteRewards() private { } /// Delete validation data function deleteValidationData() private { } /// Ratio of nodes that approved of current hash function approvalRatio() private view returns(uint) { } /// Ratio of nodes that rejected the current hash function rejectionRatio() private view returns(uint) { } /// Returns the whole array of event resolvers. function getEventResolvers() public view returns(address[]) { } /// Checks if the address is current master node. function isMasterNode() public view returns(bool) { } function isNode(address node) private view returns(bool) { } /// Returns the calling user's assigned rewards. Can be 0. /// Only available to participating users in the Reward state, since rewards /// are not assigned before that. function getReward() public view returns(uint[2]) { } /// Returns all the addresses that have rewards set. function getRewardsIndex() public view returns(address[]) { } /// Returns rewards for specified addresses. /// [[ethRewards, tokenRewards], [ethRewards, tokenRewards], ...] function getRewards(address[] _addresses) public view returns(uint[], uint[]) { } /// Claim a reward. /// Needs to be called by the users themselves. /// Only available in the Reward state, after rewards have been received from /// the validation nodes. function claimReward() public onlyParticipating timedStateTransition onlyState(EventStates.Reward) { } function claimFailed() public onlyParticipating timedStateTransition onlyState(EventStates.Failed) { } function setDataFeedHash(string _hash) public onlyOwner { } function setResults(bytes32[] _results) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } function getResults() public view returns(bytes32[]) { } function getState() public view returns(uint) { } function getBalance() public view returns(uint[2]) { } /// Returns an array of consensus rules. /// [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants] function getConsensusRules() public view returns(uint[6]) { } /// Returns an array of dispute rules. /// [dispute amount, dispute timeout, dispute round] function getDisputeData() public view returns(uint[4], address) { } function recoverLeftovers() public onlyOwner onlyAfterLefroversCanBeRecovered { } /// Advances the event's state to the next one. Only for internal use. function advanceState() private onlyChangeableState { } /// Sets consensus rules. For internal use only. function setConsensusRules(uint[6] rules) private { } function markAsFailed(string description) private onlyChangeableState { } function setDisputeData(uint[3] rules) private { } }
isParticipating(msg.sender),"Not participating."
24,917
isParticipating(msg.sender)
null
contract VerityEvent { /// Contract's owner, used for permission management address public owner; /// Token contract address, used for tokend distribution address public tokenAddress; /// Event registry contract address address public eventRegistryAddress; /// Designated validation nodes that will decide rewards. address[] eventResolvers; /// - WaitingForRewards: Waiting for current master to set rewards. /// - Validating: Master has set rewards. Vaiting for node validation. /// - Finished: Either successfully validated or failed. enum ValidationState { WaitingForRewards, Validating, Finished } ValidationState validationState = ValidationState.WaitingForRewards; struct RewardsValidation { address currentMasterNode; string rewardsHash; uint approvalCount; uint rejectionCount; string[] altHashes; mapping(address => uint) votersRound; mapping(string => address[]) altHashVotes; mapping(string => bool) rejectedHashes; } RewardsValidation rewardsValidation; /// Round of validation. Increases by each failed validation uint public rewardsValidationRound; /// A list of all the participating wallet addresses, implemented as a mapping /// to provide constant lookup times. mapping(address => bool) participants; address[] participantsIndex; enum RewardType { Ether, Token } RewardType rewardType; /// A mapping of addresses to their assigned rewards mapping(address => mapping(uint => uint)) rewards; address[] rewardsIndex; /// Event application start time, users cannot apply to participate before it uint applicationStartTime; /// Event application end time, users cannot apply after this time uint applicationEndTime; /// Event actual start time, votes before this should not be accepted uint eventStartTime; /// Event end time, it is calculated in the constructor uint eventEndTime; /// Ipfs event data hash string ipfsEventHash; /// Event name, here for informational use - not used otherwise /// owner can recover tokens and ether after this time uint leftoversRecoverableAfter; /// Amount of tokens that each user must stake before voting. uint public stakingAmount; struct Dispute { uint amount; uint timeout; uint round; uint expiresAt; uint multiplier; mapping(address => bool) disputers; address currentDisputer; } Dispute dispute; uint defaultDisputeTimeExtension = 1800; // 30 minutes string public eventName; /// Data feed hash, used for verification string public dataFeedHash; bytes32[] results; enum RewardsDistribution { Linear, // 0 Exponential // 1 } struct ConsensusRules { uint minTotalVotes; uint minConsensusVotes; uint minConsensusRatio; uint minParticipantRatio; uint maxParticipants; RewardsDistribution rewardsDistribution; } ConsensusRules consensusRules; /// Event's states /// Events advance in the order defined here. Once the event reaches "Reward" /// state, it cannot advance further. /// Event states: /// - Waiting -- Contract has been created, nothing is happening yet /// - Application -- After applicationStartTime, the event advances here /// new wallets can be added to the participats list during this state. /// - Running -- Event is running, no new participants can be added /// - DisputeTimeout -- Dispute possible /// - Reward -- Participants can claim their payouts here - final state; can't be modified. /// - Failed -- Event failed (no consensus, not enough users, timeout, ...) - final state; can't be modified enum EventStates { Waiting, Application, Running, DisputeTimeout, Reward, Failed } EventStates eventState = EventStates.Waiting; event StateTransition(EventStates newState); event JoinEvent(address wallet); event ClaimReward(address recipient); event Error(string description); event EventFailed(string description); event ValidationStarted(uint validationRound); event ValidationRestart(uint validationRound); event DisputeTriggered(address byAddress); event ClaimStake(address recipient); constructor( string _eventName, uint _applicationStartTime, uint _applicationEndTime, uint _eventStartTime, uint _eventRunTime, // in seconds address _tokenAddress, address _registry, address[] _eventResolvers, uint _leftoversRecoverableAfter, // with timestamp (in seconds) uint[6] _consensusRules, // [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants, distribution] uint _stakingAmount, uint[3] _disputeRules, // [dispute amount, dispute timeout, dispute multiplier] string _ipfsEventHash ) public payable { } /// A modifier signifiying that a certain method can only be used by the creator /// of the contract. /// Rollbacks the transaction on failure. modifier onlyOwner() { } /// A modifier signifiying that rewards can be set only by the designated master node. /// Rollbacks the transaction on failure. modifier onlyCurrentMaster() { } /// A modifier signifying that a certain method can only be used by a wallet /// marked as a participant. /// Rollbacks the transaction or failure. modifier onlyParticipating() { } /// A modifier signifying that a certain method can only be used when the event /// is in a certain state. /// @param _state The event's required state /// Example: /// function claimReward() onlyParticipanting onlyState(EventStates.Reward) { /// // ... content /// } modifier onlyState(EventStates _state) { } /// A modifier taking care of all the timed state transitions. /// Should always be used before all other modifiers, especially `onlyState`, /// since it can change state. /// Should probably be used in ALL non-constant (transaction) methods of /// the contract. modifier timedStateTransition() { if (eventState == EventStates.Waiting && now >= applicationStartTime) { advanceState(); } if (eventState == EventStates.Application && now >= applicationEndTime) { if (participantsIndex.length < consensusRules.minTotalVotes) { require(<FILL_ME>) } else { advanceState(); } } if (eventState == EventStates.DisputeTimeout && now >= dispute.expiresAt) { advanceState(); } _; } modifier onlyChangeableState() { } modifier onlyAfterLefroversCanBeRecovered() { } modifier canValidateRewards(uint forRound) { } /// Ensure we can receive money at any time. /// Not used, but we might want to extend the reward fund while event is running. function() public payable {} /// Apply for participation in this event. /// Available only during the Application state. /// A transaction to this function has to be done by the users themselves, /// registering their wallet address as a participent. /// The transaction does not have to include any funds. function joinEvent() public timedStateTransition { } /// Checks whether an address is participating in this event. /// @param _user The addres to check for participation /// @return {bool} Whether the given address is a participant of this event function isParticipating(address _user) public view returns(bool) { } function getParticipants() public view returns(address[]) { } function getEventTimes() public view returns(uint[5]) { } /// Assign the actual rewards. /// Receives a list of addresses and a list rewards. Mapping between the two /// is done by the addresses' and reward's numerical index in the list, so /// order is important. /// @param _addresses A list of addresses /// @param _etherRewards A list of ether rewards, must be the exact same length as addresses /// @param _tokenRewards A list of token rewards, must be the exact same length as addresses function setRewards( address[] _addresses, uint[] _etherRewards, uint[] _tokenRewards ) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Triggered by the master node once rewards are set and ready to validate function markRewardsSet(string rewardsHash) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Called by event resolver nodes if they agree with rewards function approveRewards(uint validationRound) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Called by event resolvers if they don't agree with rewards function rejectRewards(uint validationRound, string altHash) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Trigger a dispute. function triggerDispute() public timedStateTransition onlyParticipating onlyState(EventStates.DisputeTimeout) { } /// Checks current approvals for threshold function checkApprovalRatio() private { } /// Checks current rejections for threshold function checkRejectionRatio() private { } /// Handle the rejection of current rewards function rejectCurrentValidation() private { } function restartValidation() private { } /// Delete rewards. function deleteRewards() private { } /// Delete validation data function deleteValidationData() private { } /// Ratio of nodes that approved of current hash function approvalRatio() private view returns(uint) { } /// Ratio of nodes that rejected the current hash function rejectionRatio() private view returns(uint) { } /// Returns the whole array of event resolvers. function getEventResolvers() public view returns(address[]) { } /// Checks if the address is current master node. function isMasterNode() public view returns(bool) { } function isNode(address node) private view returns(bool) { } /// Returns the calling user's assigned rewards. Can be 0. /// Only available to participating users in the Reward state, since rewards /// are not assigned before that. function getReward() public view returns(uint[2]) { } /// Returns all the addresses that have rewards set. function getRewardsIndex() public view returns(address[]) { } /// Returns rewards for specified addresses. /// [[ethRewards, tokenRewards], [ethRewards, tokenRewards], ...] function getRewards(address[] _addresses) public view returns(uint[], uint[]) { } /// Claim a reward. /// Needs to be called by the users themselves. /// Only available in the Reward state, after rewards have been received from /// the validation nodes. function claimReward() public onlyParticipating timedStateTransition onlyState(EventStates.Reward) { } function claimFailed() public onlyParticipating timedStateTransition onlyState(EventStates.Failed) { } function setDataFeedHash(string _hash) public onlyOwner { } function setResults(bytes32[] _results) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } function getResults() public view returns(bytes32[]) { } function getState() public view returns(uint) { } function getBalance() public view returns(uint[2]) { } /// Returns an array of consensus rules. /// [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants] function getConsensusRules() public view returns(uint[6]) { } /// Returns an array of dispute rules. /// [dispute amount, dispute timeout, dispute round] function getDisputeData() public view returns(uint[4], address) { } function recoverLeftovers() public onlyOwner onlyAfterLefroversCanBeRecovered { } /// Advances the event's state to the next one. Only for internal use. function advanceState() private onlyChangeableState { } /// Sets consensus rules. For internal use only. function setConsensusRules(uint[6] rules) private { } function markAsFailed(string description) private onlyChangeableState { } function setDisputeData(uint[3] rules) private { } }
iled("Not enough users joined for required minimum votes."
24,917
"Not enough users joined for required minimum votes."
"Event state can't be modified anymore."
contract VerityEvent { /// Contract's owner, used for permission management address public owner; /// Token contract address, used for tokend distribution address public tokenAddress; /// Event registry contract address address public eventRegistryAddress; /// Designated validation nodes that will decide rewards. address[] eventResolvers; /// - WaitingForRewards: Waiting for current master to set rewards. /// - Validating: Master has set rewards. Vaiting for node validation. /// - Finished: Either successfully validated or failed. enum ValidationState { WaitingForRewards, Validating, Finished } ValidationState validationState = ValidationState.WaitingForRewards; struct RewardsValidation { address currentMasterNode; string rewardsHash; uint approvalCount; uint rejectionCount; string[] altHashes; mapping(address => uint) votersRound; mapping(string => address[]) altHashVotes; mapping(string => bool) rejectedHashes; } RewardsValidation rewardsValidation; /// Round of validation. Increases by each failed validation uint public rewardsValidationRound; /// A list of all the participating wallet addresses, implemented as a mapping /// to provide constant lookup times. mapping(address => bool) participants; address[] participantsIndex; enum RewardType { Ether, Token } RewardType rewardType; /// A mapping of addresses to their assigned rewards mapping(address => mapping(uint => uint)) rewards; address[] rewardsIndex; /// Event application start time, users cannot apply to participate before it uint applicationStartTime; /// Event application end time, users cannot apply after this time uint applicationEndTime; /// Event actual start time, votes before this should not be accepted uint eventStartTime; /// Event end time, it is calculated in the constructor uint eventEndTime; /// Ipfs event data hash string ipfsEventHash; /// Event name, here for informational use - not used otherwise /// owner can recover tokens and ether after this time uint leftoversRecoverableAfter; /// Amount of tokens that each user must stake before voting. uint public stakingAmount; struct Dispute { uint amount; uint timeout; uint round; uint expiresAt; uint multiplier; mapping(address => bool) disputers; address currentDisputer; } Dispute dispute; uint defaultDisputeTimeExtension = 1800; // 30 minutes string public eventName; /// Data feed hash, used for verification string public dataFeedHash; bytes32[] results; enum RewardsDistribution { Linear, // 0 Exponential // 1 } struct ConsensusRules { uint minTotalVotes; uint minConsensusVotes; uint minConsensusRatio; uint minParticipantRatio; uint maxParticipants; RewardsDistribution rewardsDistribution; } ConsensusRules consensusRules; /// Event's states /// Events advance in the order defined here. Once the event reaches "Reward" /// state, it cannot advance further. /// Event states: /// - Waiting -- Contract has been created, nothing is happening yet /// - Application -- After applicationStartTime, the event advances here /// new wallets can be added to the participats list during this state. /// - Running -- Event is running, no new participants can be added /// - DisputeTimeout -- Dispute possible /// - Reward -- Participants can claim their payouts here - final state; can't be modified. /// - Failed -- Event failed (no consensus, not enough users, timeout, ...) - final state; can't be modified enum EventStates { Waiting, Application, Running, DisputeTimeout, Reward, Failed } EventStates eventState = EventStates.Waiting; event StateTransition(EventStates newState); event JoinEvent(address wallet); event ClaimReward(address recipient); event Error(string description); event EventFailed(string description); event ValidationStarted(uint validationRound); event ValidationRestart(uint validationRound); event DisputeTriggered(address byAddress); event ClaimStake(address recipient); constructor( string _eventName, uint _applicationStartTime, uint _applicationEndTime, uint _eventStartTime, uint _eventRunTime, // in seconds address _tokenAddress, address _registry, address[] _eventResolvers, uint _leftoversRecoverableAfter, // with timestamp (in seconds) uint[6] _consensusRules, // [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants, distribution] uint _stakingAmount, uint[3] _disputeRules, // [dispute amount, dispute timeout, dispute multiplier] string _ipfsEventHash ) public payable { } /// A modifier signifiying that a certain method can only be used by the creator /// of the contract. /// Rollbacks the transaction on failure. modifier onlyOwner() { } /// A modifier signifiying that rewards can be set only by the designated master node. /// Rollbacks the transaction on failure. modifier onlyCurrentMaster() { } /// A modifier signifying that a certain method can only be used by a wallet /// marked as a participant. /// Rollbacks the transaction or failure. modifier onlyParticipating() { } /// A modifier signifying that a certain method can only be used when the event /// is in a certain state. /// @param _state The event's required state /// Example: /// function claimReward() onlyParticipanting onlyState(EventStates.Reward) { /// // ... content /// } modifier onlyState(EventStates _state) { } /// A modifier taking care of all the timed state transitions. /// Should always be used before all other modifiers, especially `onlyState`, /// since it can change state. /// Should probably be used in ALL non-constant (transaction) methods of /// the contract. modifier timedStateTransition() { } modifier onlyChangeableState() { require(<FILL_ME>) _; } modifier onlyAfterLefroversCanBeRecovered() { } modifier canValidateRewards(uint forRound) { } /// Ensure we can receive money at any time. /// Not used, but we might want to extend the reward fund while event is running. function() public payable {} /// Apply for participation in this event. /// Available only during the Application state. /// A transaction to this function has to be done by the users themselves, /// registering their wallet address as a participent. /// The transaction does not have to include any funds. function joinEvent() public timedStateTransition { } /// Checks whether an address is participating in this event. /// @param _user The addres to check for participation /// @return {bool} Whether the given address is a participant of this event function isParticipating(address _user) public view returns(bool) { } function getParticipants() public view returns(address[]) { } function getEventTimes() public view returns(uint[5]) { } /// Assign the actual rewards. /// Receives a list of addresses and a list rewards. Mapping between the two /// is done by the addresses' and reward's numerical index in the list, so /// order is important. /// @param _addresses A list of addresses /// @param _etherRewards A list of ether rewards, must be the exact same length as addresses /// @param _tokenRewards A list of token rewards, must be the exact same length as addresses function setRewards( address[] _addresses, uint[] _etherRewards, uint[] _tokenRewards ) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Triggered by the master node once rewards are set and ready to validate function markRewardsSet(string rewardsHash) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Called by event resolver nodes if they agree with rewards function approveRewards(uint validationRound) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Called by event resolvers if they don't agree with rewards function rejectRewards(uint validationRound, string altHash) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Trigger a dispute. function triggerDispute() public timedStateTransition onlyParticipating onlyState(EventStates.DisputeTimeout) { } /// Checks current approvals for threshold function checkApprovalRatio() private { } /// Checks current rejections for threshold function checkRejectionRatio() private { } /// Handle the rejection of current rewards function rejectCurrentValidation() private { } function restartValidation() private { } /// Delete rewards. function deleteRewards() private { } /// Delete validation data function deleteValidationData() private { } /// Ratio of nodes that approved of current hash function approvalRatio() private view returns(uint) { } /// Ratio of nodes that rejected the current hash function rejectionRatio() private view returns(uint) { } /// Returns the whole array of event resolvers. function getEventResolvers() public view returns(address[]) { } /// Checks if the address is current master node. function isMasterNode() public view returns(bool) { } function isNode(address node) private view returns(bool) { } /// Returns the calling user's assigned rewards. Can be 0. /// Only available to participating users in the Reward state, since rewards /// are not assigned before that. function getReward() public view returns(uint[2]) { } /// Returns all the addresses that have rewards set. function getRewardsIndex() public view returns(address[]) { } /// Returns rewards for specified addresses. /// [[ethRewards, tokenRewards], [ethRewards, tokenRewards], ...] function getRewards(address[] _addresses) public view returns(uint[], uint[]) { } /// Claim a reward. /// Needs to be called by the users themselves. /// Only available in the Reward state, after rewards have been received from /// the validation nodes. function claimReward() public onlyParticipating timedStateTransition onlyState(EventStates.Reward) { } function claimFailed() public onlyParticipating timedStateTransition onlyState(EventStates.Failed) { } function setDataFeedHash(string _hash) public onlyOwner { } function setResults(bytes32[] _results) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } function getResults() public view returns(bytes32[]) { } function getState() public view returns(uint) { } function getBalance() public view returns(uint[2]) { } /// Returns an array of consensus rules. /// [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants] function getConsensusRules() public view returns(uint[6]) { } /// Returns an array of dispute rules. /// [dispute amount, dispute timeout, dispute round] function getDisputeData() public view returns(uint[4], address) { } function recoverLeftovers() public onlyOwner onlyAfterLefroversCanBeRecovered { } /// Advances the event's state to the next one. Only for internal use. function advanceState() private onlyChangeableState { } /// Sets consensus rules. For internal use only. function setConsensusRules(uint[6] rules) private { } function markAsFailed(string description) private onlyChangeableState { } function setDisputeData(uint[3] rules) private { } }
uint(eventState)<uint(EventStates.Reward),"Event state can't be modified anymore."
24,917
uint(eventState)<uint(EventStates.Reward)
"Not a valid sender address."
contract VerityEvent { /// Contract's owner, used for permission management address public owner; /// Token contract address, used for tokend distribution address public tokenAddress; /// Event registry contract address address public eventRegistryAddress; /// Designated validation nodes that will decide rewards. address[] eventResolvers; /// - WaitingForRewards: Waiting for current master to set rewards. /// - Validating: Master has set rewards. Vaiting for node validation. /// - Finished: Either successfully validated or failed. enum ValidationState { WaitingForRewards, Validating, Finished } ValidationState validationState = ValidationState.WaitingForRewards; struct RewardsValidation { address currentMasterNode; string rewardsHash; uint approvalCount; uint rejectionCount; string[] altHashes; mapping(address => uint) votersRound; mapping(string => address[]) altHashVotes; mapping(string => bool) rejectedHashes; } RewardsValidation rewardsValidation; /// Round of validation. Increases by each failed validation uint public rewardsValidationRound; /// A list of all the participating wallet addresses, implemented as a mapping /// to provide constant lookup times. mapping(address => bool) participants; address[] participantsIndex; enum RewardType { Ether, Token } RewardType rewardType; /// A mapping of addresses to their assigned rewards mapping(address => mapping(uint => uint)) rewards; address[] rewardsIndex; /// Event application start time, users cannot apply to participate before it uint applicationStartTime; /// Event application end time, users cannot apply after this time uint applicationEndTime; /// Event actual start time, votes before this should not be accepted uint eventStartTime; /// Event end time, it is calculated in the constructor uint eventEndTime; /// Ipfs event data hash string ipfsEventHash; /// Event name, here for informational use - not used otherwise /// owner can recover tokens and ether after this time uint leftoversRecoverableAfter; /// Amount of tokens that each user must stake before voting. uint public stakingAmount; struct Dispute { uint amount; uint timeout; uint round; uint expiresAt; uint multiplier; mapping(address => bool) disputers; address currentDisputer; } Dispute dispute; uint defaultDisputeTimeExtension = 1800; // 30 minutes string public eventName; /// Data feed hash, used for verification string public dataFeedHash; bytes32[] results; enum RewardsDistribution { Linear, // 0 Exponential // 1 } struct ConsensusRules { uint minTotalVotes; uint minConsensusVotes; uint minConsensusRatio; uint minParticipantRatio; uint maxParticipants; RewardsDistribution rewardsDistribution; } ConsensusRules consensusRules; /// Event's states /// Events advance in the order defined here. Once the event reaches "Reward" /// state, it cannot advance further. /// Event states: /// - Waiting -- Contract has been created, nothing is happening yet /// - Application -- After applicationStartTime, the event advances here /// new wallets can be added to the participats list during this state. /// - Running -- Event is running, no new participants can be added /// - DisputeTimeout -- Dispute possible /// - Reward -- Participants can claim their payouts here - final state; can't be modified. /// - Failed -- Event failed (no consensus, not enough users, timeout, ...) - final state; can't be modified enum EventStates { Waiting, Application, Running, DisputeTimeout, Reward, Failed } EventStates eventState = EventStates.Waiting; event StateTransition(EventStates newState); event JoinEvent(address wallet); event ClaimReward(address recipient); event Error(string description); event EventFailed(string description); event ValidationStarted(uint validationRound); event ValidationRestart(uint validationRound); event DisputeTriggered(address byAddress); event ClaimStake(address recipient); constructor( string _eventName, uint _applicationStartTime, uint _applicationEndTime, uint _eventStartTime, uint _eventRunTime, // in seconds address _tokenAddress, address _registry, address[] _eventResolvers, uint _leftoversRecoverableAfter, // with timestamp (in seconds) uint[6] _consensusRules, // [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants, distribution] uint _stakingAmount, uint[3] _disputeRules, // [dispute amount, dispute timeout, dispute multiplier] string _ipfsEventHash ) public payable { } /// A modifier signifiying that a certain method can only be used by the creator /// of the contract. /// Rollbacks the transaction on failure. modifier onlyOwner() { } /// A modifier signifiying that rewards can be set only by the designated master node. /// Rollbacks the transaction on failure. modifier onlyCurrentMaster() { } /// A modifier signifying that a certain method can only be used by a wallet /// marked as a participant. /// Rollbacks the transaction or failure. modifier onlyParticipating() { } /// A modifier signifying that a certain method can only be used when the event /// is in a certain state. /// @param _state The event's required state /// Example: /// function claimReward() onlyParticipanting onlyState(EventStates.Reward) { /// // ... content /// } modifier onlyState(EventStates _state) { } /// A modifier taking care of all the timed state transitions. /// Should always be used before all other modifiers, especially `onlyState`, /// since it can change state. /// Should probably be used in ALL non-constant (transaction) methods of /// the contract. modifier timedStateTransition() { } modifier onlyChangeableState() { } modifier onlyAfterLefroversCanBeRecovered() { } modifier canValidateRewards(uint forRound) { require(<FILL_ME>) require( validationState == ValidationState.Validating, "Not validating rewards." ); require( forRound == rewardsValidationRound, "Validation round mismatch." ); require( rewardsValidation.votersRound[msg.sender] < rewardsValidationRound, "Already voted for this round." ); _; } /// Ensure we can receive money at any time. /// Not used, but we might want to extend the reward fund while event is running. function() public payable {} /// Apply for participation in this event. /// Available only during the Application state. /// A transaction to this function has to be done by the users themselves, /// registering their wallet address as a participent. /// The transaction does not have to include any funds. function joinEvent() public timedStateTransition { } /// Checks whether an address is participating in this event. /// @param _user The addres to check for participation /// @return {bool} Whether the given address is a participant of this event function isParticipating(address _user) public view returns(bool) { } function getParticipants() public view returns(address[]) { } function getEventTimes() public view returns(uint[5]) { } /// Assign the actual rewards. /// Receives a list of addresses and a list rewards. Mapping between the two /// is done by the addresses' and reward's numerical index in the list, so /// order is important. /// @param _addresses A list of addresses /// @param _etherRewards A list of ether rewards, must be the exact same length as addresses /// @param _tokenRewards A list of token rewards, must be the exact same length as addresses function setRewards( address[] _addresses, uint[] _etherRewards, uint[] _tokenRewards ) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Triggered by the master node once rewards are set and ready to validate function markRewardsSet(string rewardsHash) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Called by event resolver nodes if they agree with rewards function approveRewards(uint validationRound) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Called by event resolvers if they don't agree with rewards function rejectRewards(uint validationRound, string altHash) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Trigger a dispute. function triggerDispute() public timedStateTransition onlyParticipating onlyState(EventStates.DisputeTimeout) { } /// Checks current approvals for threshold function checkApprovalRatio() private { } /// Checks current rejections for threshold function checkRejectionRatio() private { } /// Handle the rejection of current rewards function rejectCurrentValidation() private { } function restartValidation() private { } /// Delete rewards. function deleteRewards() private { } /// Delete validation data function deleteValidationData() private { } /// Ratio of nodes that approved of current hash function approvalRatio() private view returns(uint) { } /// Ratio of nodes that rejected the current hash function rejectionRatio() private view returns(uint) { } /// Returns the whole array of event resolvers. function getEventResolvers() public view returns(address[]) { } /// Checks if the address is current master node. function isMasterNode() public view returns(bool) { } function isNode(address node) private view returns(bool) { } /// Returns the calling user's assigned rewards. Can be 0. /// Only available to participating users in the Reward state, since rewards /// are not assigned before that. function getReward() public view returns(uint[2]) { } /// Returns all the addresses that have rewards set. function getRewardsIndex() public view returns(address[]) { } /// Returns rewards for specified addresses. /// [[ethRewards, tokenRewards], [ethRewards, tokenRewards], ...] function getRewards(address[] _addresses) public view returns(uint[], uint[]) { } /// Claim a reward. /// Needs to be called by the users themselves. /// Only available in the Reward state, after rewards have been received from /// the validation nodes. function claimReward() public onlyParticipating timedStateTransition onlyState(EventStates.Reward) { } function claimFailed() public onlyParticipating timedStateTransition onlyState(EventStates.Failed) { } function setDataFeedHash(string _hash) public onlyOwner { } function setResults(bytes32[] _results) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } function getResults() public view returns(bytes32[]) { } function getState() public view returns(uint) { } function getBalance() public view returns(uint[2]) { } /// Returns an array of consensus rules. /// [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants] function getConsensusRules() public view returns(uint[6]) { } /// Returns an array of dispute rules. /// [dispute amount, dispute timeout, dispute round] function getDisputeData() public view returns(uint[4], address) { } function recoverLeftovers() public onlyOwner onlyAfterLefroversCanBeRecovered { } /// Advances the event's state to the next one. Only for internal use. function advanceState() private onlyChangeableState { } /// Sets consensus rules. For internal use only. function setConsensusRules(uint[6] rules) private { } function markAsFailed(string description) private onlyChangeableState { } function setDisputeData(uint[3] rules) private { } }
isNode(msg.sender)&&!isMasterNode(),"Not a valid sender address."
24,917
isNode(msg.sender)&&!isMasterNode()
"Already voted for this round."
contract VerityEvent { /// Contract's owner, used for permission management address public owner; /// Token contract address, used for tokend distribution address public tokenAddress; /// Event registry contract address address public eventRegistryAddress; /// Designated validation nodes that will decide rewards. address[] eventResolvers; /// - WaitingForRewards: Waiting for current master to set rewards. /// - Validating: Master has set rewards. Vaiting for node validation. /// - Finished: Either successfully validated or failed. enum ValidationState { WaitingForRewards, Validating, Finished } ValidationState validationState = ValidationState.WaitingForRewards; struct RewardsValidation { address currentMasterNode; string rewardsHash; uint approvalCount; uint rejectionCount; string[] altHashes; mapping(address => uint) votersRound; mapping(string => address[]) altHashVotes; mapping(string => bool) rejectedHashes; } RewardsValidation rewardsValidation; /// Round of validation. Increases by each failed validation uint public rewardsValidationRound; /// A list of all the participating wallet addresses, implemented as a mapping /// to provide constant lookup times. mapping(address => bool) participants; address[] participantsIndex; enum RewardType { Ether, Token } RewardType rewardType; /// A mapping of addresses to their assigned rewards mapping(address => mapping(uint => uint)) rewards; address[] rewardsIndex; /// Event application start time, users cannot apply to participate before it uint applicationStartTime; /// Event application end time, users cannot apply after this time uint applicationEndTime; /// Event actual start time, votes before this should not be accepted uint eventStartTime; /// Event end time, it is calculated in the constructor uint eventEndTime; /// Ipfs event data hash string ipfsEventHash; /// Event name, here for informational use - not used otherwise /// owner can recover tokens and ether after this time uint leftoversRecoverableAfter; /// Amount of tokens that each user must stake before voting. uint public stakingAmount; struct Dispute { uint amount; uint timeout; uint round; uint expiresAt; uint multiplier; mapping(address => bool) disputers; address currentDisputer; } Dispute dispute; uint defaultDisputeTimeExtension = 1800; // 30 minutes string public eventName; /// Data feed hash, used for verification string public dataFeedHash; bytes32[] results; enum RewardsDistribution { Linear, // 0 Exponential // 1 } struct ConsensusRules { uint minTotalVotes; uint minConsensusVotes; uint minConsensusRatio; uint minParticipantRatio; uint maxParticipants; RewardsDistribution rewardsDistribution; } ConsensusRules consensusRules; /// Event's states /// Events advance in the order defined here. Once the event reaches "Reward" /// state, it cannot advance further. /// Event states: /// - Waiting -- Contract has been created, nothing is happening yet /// - Application -- After applicationStartTime, the event advances here /// new wallets can be added to the participats list during this state. /// - Running -- Event is running, no new participants can be added /// - DisputeTimeout -- Dispute possible /// - Reward -- Participants can claim their payouts here - final state; can't be modified. /// - Failed -- Event failed (no consensus, not enough users, timeout, ...) - final state; can't be modified enum EventStates { Waiting, Application, Running, DisputeTimeout, Reward, Failed } EventStates eventState = EventStates.Waiting; event StateTransition(EventStates newState); event JoinEvent(address wallet); event ClaimReward(address recipient); event Error(string description); event EventFailed(string description); event ValidationStarted(uint validationRound); event ValidationRestart(uint validationRound); event DisputeTriggered(address byAddress); event ClaimStake(address recipient); constructor( string _eventName, uint _applicationStartTime, uint _applicationEndTime, uint _eventStartTime, uint _eventRunTime, // in seconds address _tokenAddress, address _registry, address[] _eventResolvers, uint _leftoversRecoverableAfter, // with timestamp (in seconds) uint[6] _consensusRules, // [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants, distribution] uint _stakingAmount, uint[3] _disputeRules, // [dispute amount, dispute timeout, dispute multiplier] string _ipfsEventHash ) public payable { } /// A modifier signifiying that a certain method can only be used by the creator /// of the contract. /// Rollbacks the transaction on failure. modifier onlyOwner() { } /// A modifier signifiying that rewards can be set only by the designated master node. /// Rollbacks the transaction on failure. modifier onlyCurrentMaster() { } /// A modifier signifying that a certain method can only be used by a wallet /// marked as a participant. /// Rollbacks the transaction or failure. modifier onlyParticipating() { } /// A modifier signifying that a certain method can only be used when the event /// is in a certain state. /// @param _state The event's required state /// Example: /// function claimReward() onlyParticipanting onlyState(EventStates.Reward) { /// // ... content /// } modifier onlyState(EventStates _state) { } /// A modifier taking care of all the timed state transitions. /// Should always be used before all other modifiers, especially `onlyState`, /// since it can change state. /// Should probably be used in ALL non-constant (transaction) methods of /// the contract. modifier timedStateTransition() { } modifier onlyChangeableState() { } modifier onlyAfterLefroversCanBeRecovered() { } modifier canValidateRewards(uint forRound) { require( isNode(msg.sender) && !isMasterNode(), "Not a valid sender address." ); require( validationState == ValidationState.Validating, "Not validating rewards." ); require( forRound == rewardsValidationRound, "Validation round mismatch." ); require(<FILL_ME>) _; } /// Ensure we can receive money at any time. /// Not used, but we might want to extend the reward fund while event is running. function() public payable {} /// Apply for participation in this event. /// Available only during the Application state. /// A transaction to this function has to be done by the users themselves, /// registering their wallet address as a participent. /// The transaction does not have to include any funds. function joinEvent() public timedStateTransition { } /// Checks whether an address is participating in this event. /// @param _user The addres to check for participation /// @return {bool} Whether the given address is a participant of this event function isParticipating(address _user) public view returns(bool) { } function getParticipants() public view returns(address[]) { } function getEventTimes() public view returns(uint[5]) { } /// Assign the actual rewards. /// Receives a list of addresses and a list rewards. Mapping between the two /// is done by the addresses' and reward's numerical index in the list, so /// order is important. /// @param _addresses A list of addresses /// @param _etherRewards A list of ether rewards, must be the exact same length as addresses /// @param _tokenRewards A list of token rewards, must be the exact same length as addresses function setRewards( address[] _addresses, uint[] _etherRewards, uint[] _tokenRewards ) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Triggered by the master node once rewards are set and ready to validate function markRewardsSet(string rewardsHash) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Called by event resolver nodes if they agree with rewards function approveRewards(uint validationRound) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Called by event resolvers if they don't agree with rewards function rejectRewards(uint validationRound, string altHash) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Trigger a dispute. function triggerDispute() public timedStateTransition onlyParticipating onlyState(EventStates.DisputeTimeout) { } /// Checks current approvals for threshold function checkApprovalRatio() private { } /// Checks current rejections for threshold function checkRejectionRatio() private { } /// Handle the rejection of current rewards function rejectCurrentValidation() private { } function restartValidation() private { } /// Delete rewards. function deleteRewards() private { } /// Delete validation data function deleteValidationData() private { } /// Ratio of nodes that approved of current hash function approvalRatio() private view returns(uint) { } /// Ratio of nodes that rejected the current hash function rejectionRatio() private view returns(uint) { } /// Returns the whole array of event resolvers. function getEventResolvers() public view returns(address[]) { } /// Checks if the address is current master node. function isMasterNode() public view returns(bool) { } function isNode(address node) private view returns(bool) { } /// Returns the calling user's assigned rewards. Can be 0. /// Only available to participating users in the Reward state, since rewards /// are not assigned before that. function getReward() public view returns(uint[2]) { } /// Returns all the addresses that have rewards set. function getRewardsIndex() public view returns(address[]) { } /// Returns rewards for specified addresses. /// [[ethRewards, tokenRewards], [ethRewards, tokenRewards], ...] function getRewards(address[] _addresses) public view returns(uint[], uint[]) { } /// Claim a reward. /// Needs to be called by the users themselves. /// Only available in the Reward state, after rewards have been received from /// the validation nodes. function claimReward() public onlyParticipating timedStateTransition onlyState(EventStates.Reward) { } function claimFailed() public onlyParticipating timedStateTransition onlyState(EventStates.Failed) { } function setDataFeedHash(string _hash) public onlyOwner { } function setResults(bytes32[] _results) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } function getResults() public view returns(bytes32[]) { } function getState() public view returns(uint) { } function getBalance() public view returns(uint[2]) { } /// Returns an array of consensus rules. /// [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants] function getConsensusRules() public view returns(uint[6]) { } /// Returns an array of dispute rules. /// [dispute amount, dispute timeout, dispute round] function getDisputeData() public view returns(uint[4], address) { } function recoverLeftovers() public onlyOwner onlyAfterLefroversCanBeRecovered { } /// Advances the event's state to the next one. Only for internal use. function advanceState() private onlyChangeableState { } /// Sets consensus rules. For internal use only. function setConsensusRules(uint[6] rules) private { } function markAsFailed(string description) private onlyChangeableState { } function setDisputeData(uint[3] rules) private { } }
rewardsValidation.votersRound[msg.sender]<rewardsValidationRound,"Already voted for this round."
24,917
rewardsValidation.votersRound[msg.sender]<rewardsValidationRound
"Not enough tokens staked for dispute."
contract VerityEvent { /// Contract's owner, used for permission management address public owner; /// Token contract address, used for tokend distribution address public tokenAddress; /// Event registry contract address address public eventRegistryAddress; /// Designated validation nodes that will decide rewards. address[] eventResolvers; /// - WaitingForRewards: Waiting for current master to set rewards. /// - Validating: Master has set rewards. Vaiting for node validation. /// - Finished: Either successfully validated or failed. enum ValidationState { WaitingForRewards, Validating, Finished } ValidationState validationState = ValidationState.WaitingForRewards; struct RewardsValidation { address currentMasterNode; string rewardsHash; uint approvalCount; uint rejectionCount; string[] altHashes; mapping(address => uint) votersRound; mapping(string => address[]) altHashVotes; mapping(string => bool) rejectedHashes; } RewardsValidation rewardsValidation; /// Round of validation. Increases by each failed validation uint public rewardsValidationRound; /// A list of all the participating wallet addresses, implemented as a mapping /// to provide constant lookup times. mapping(address => bool) participants; address[] participantsIndex; enum RewardType { Ether, Token } RewardType rewardType; /// A mapping of addresses to their assigned rewards mapping(address => mapping(uint => uint)) rewards; address[] rewardsIndex; /// Event application start time, users cannot apply to participate before it uint applicationStartTime; /// Event application end time, users cannot apply after this time uint applicationEndTime; /// Event actual start time, votes before this should not be accepted uint eventStartTime; /// Event end time, it is calculated in the constructor uint eventEndTime; /// Ipfs event data hash string ipfsEventHash; /// Event name, here for informational use - not used otherwise /// owner can recover tokens and ether after this time uint leftoversRecoverableAfter; /// Amount of tokens that each user must stake before voting. uint public stakingAmount; struct Dispute { uint amount; uint timeout; uint round; uint expiresAt; uint multiplier; mapping(address => bool) disputers; address currentDisputer; } Dispute dispute; uint defaultDisputeTimeExtension = 1800; // 30 minutes string public eventName; /// Data feed hash, used for verification string public dataFeedHash; bytes32[] results; enum RewardsDistribution { Linear, // 0 Exponential // 1 } struct ConsensusRules { uint minTotalVotes; uint minConsensusVotes; uint minConsensusRatio; uint minParticipantRatio; uint maxParticipants; RewardsDistribution rewardsDistribution; } ConsensusRules consensusRules; /// Event's states /// Events advance in the order defined here. Once the event reaches "Reward" /// state, it cannot advance further. /// Event states: /// - Waiting -- Contract has been created, nothing is happening yet /// - Application -- After applicationStartTime, the event advances here /// new wallets can be added to the participats list during this state. /// - Running -- Event is running, no new participants can be added /// - DisputeTimeout -- Dispute possible /// - Reward -- Participants can claim their payouts here - final state; can't be modified. /// - Failed -- Event failed (no consensus, not enough users, timeout, ...) - final state; can't be modified enum EventStates { Waiting, Application, Running, DisputeTimeout, Reward, Failed } EventStates eventState = EventStates.Waiting; event StateTransition(EventStates newState); event JoinEvent(address wallet); event ClaimReward(address recipient); event Error(string description); event EventFailed(string description); event ValidationStarted(uint validationRound); event ValidationRestart(uint validationRound); event DisputeTriggered(address byAddress); event ClaimStake(address recipient); constructor( string _eventName, uint _applicationStartTime, uint _applicationEndTime, uint _eventStartTime, uint _eventRunTime, // in seconds address _tokenAddress, address _registry, address[] _eventResolvers, uint _leftoversRecoverableAfter, // with timestamp (in seconds) uint[6] _consensusRules, // [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants, distribution] uint _stakingAmount, uint[3] _disputeRules, // [dispute amount, dispute timeout, dispute multiplier] string _ipfsEventHash ) public payable { } /// A modifier signifiying that a certain method can only be used by the creator /// of the contract. /// Rollbacks the transaction on failure. modifier onlyOwner() { } /// A modifier signifiying that rewards can be set only by the designated master node. /// Rollbacks the transaction on failure. modifier onlyCurrentMaster() { } /// A modifier signifying that a certain method can only be used by a wallet /// marked as a participant. /// Rollbacks the transaction or failure. modifier onlyParticipating() { } /// A modifier signifying that a certain method can only be used when the event /// is in a certain state. /// @param _state The event's required state /// Example: /// function claimReward() onlyParticipanting onlyState(EventStates.Reward) { /// // ... content /// } modifier onlyState(EventStates _state) { } /// A modifier taking care of all the timed state transitions. /// Should always be used before all other modifiers, especially `onlyState`, /// since it can change state. /// Should probably be used in ALL non-constant (transaction) methods of /// the contract. modifier timedStateTransition() { } modifier onlyChangeableState() { } modifier onlyAfterLefroversCanBeRecovered() { } modifier canValidateRewards(uint forRound) { } /// Ensure we can receive money at any time. /// Not used, but we might want to extend the reward fund while event is running. function() public payable {} /// Apply for participation in this event. /// Available only during the Application state. /// A transaction to this function has to be done by the users themselves, /// registering their wallet address as a participent. /// The transaction does not have to include any funds. function joinEvent() public timedStateTransition { } /// Checks whether an address is participating in this event. /// @param _user The addres to check for participation /// @return {bool} Whether the given address is a participant of this event function isParticipating(address _user) public view returns(bool) { } function getParticipants() public view returns(address[]) { } function getEventTimes() public view returns(uint[5]) { } /// Assign the actual rewards. /// Receives a list of addresses and a list rewards. Mapping between the two /// is done by the addresses' and reward's numerical index in the list, so /// order is important. /// @param _addresses A list of addresses /// @param _etherRewards A list of ether rewards, must be the exact same length as addresses /// @param _tokenRewards A list of token rewards, must be the exact same length as addresses function setRewards( address[] _addresses, uint[] _etherRewards, uint[] _tokenRewards ) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Triggered by the master node once rewards are set and ready to validate function markRewardsSet(string rewardsHash) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Called by event resolver nodes if they agree with rewards function approveRewards(uint validationRound) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Called by event resolvers if they don't agree with rewards function rejectRewards(uint validationRound, string altHash) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Trigger a dispute. function triggerDispute() public timedStateTransition onlyParticipating onlyState(EventStates.DisputeTimeout) { require(<FILL_ME>) require( dispute.disputers[msg.sender] == false, "Already triggered a dispute." ); /// Increase dispute amount for next dispute and store disputer dispute.amount = dispute.amount * dispute.multiplier**dispute.round; ++dispute.round; dispute.disputers[msg.sender] = true; dispute.currentDisputer = msg.sender; /// Transfer staked amount VerityToken(tokenAddress).transferFrom(msg.sender, address(this), dispute.amount); /// Restart event deleteValidationData(); deleteRewards(); eventState = EventStates.Application; applicationEndTime = eventStartTime = now + defaultDisputeTimeExtension; eventEndTime = eventStartTime + defaultDisputeTimeExtension; /// Make consensus rules stricter /// Increases by ~10% of consensus diff consensusRules.minConsensusRatio += (100 - consensusRules.minConsensusRatio) * 100 / 1000; /// Increase total votes required my ~10% and consensus votes by consensus ratio uint votesIncrease = consensusRules.minTotalVotes * 100 / 1000; consensusRules.minTotalVotes += votesIncrease; consensusRules.minConsensusVotes += votesIncrease * consensusRules.minConsensusRatio / 100; emit DisputeTriggered(msg.sender); } /// Checks current approvals for threshold function checkApprovalRatio() private { } /// Checks current rejections for threshold function checkRejectionRatio() private { } /// Handle the rejection of current rewards function rejectCurrentValidation() private { } function restartValidation() private { } /// Delete rewards. function deleteRewards() private { } /// Delete validation data function deleteValidationData() private { } /// Ratio of nodes that approved of current hash function approvalRatio() private view returns(uint) { } /// Ratio of nodes that rejected the current hash function rejectionRatio() private view returns(uint) { } /// Returns the whole array of event resolvers. function getEventResolvers() public view returns(address[]) { } /// Checks if the address is current master node. function isMasterNode() public view returns(bool) { } function isNode(address node) private view returns(bool) { } /// Returns the calling user's assigned rewards. Can be 0. /// Only available to participating users in the Reward state, since rewards /// are not assigned before that. function getReward() public view returns(uint[2]) { } /// Returns all the addresses that have rewards set. function getRewardsIndex() public view returns(address[]) { } /// Returns rewards for specified addresses. /// [[ethRewards, tokenRewards], [ethRewards, tokenRewards], ...] function getRewards(address[] _addresses) public view returns(uint[], uint[]) { } /// Claim a reward. /// Needs to be called by the users themselves. /// Only available in the Reward state, after rewards have been received from /// the validation nodes. function claimReward() public onlyParticipating timedStateTransition onlyState(EventStates.Reward) { } function claimFailed() public onlyParticipating timedStateTransition onlyState(EventStates.Failed) { } function setDataFeedHash(string _hash) public onlyOwner { } function setResults(bytes32[] _results) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } function getResults() public view returns(bytes32[]) { } function getState() public view returns(uint) { } function getBalance() public view returns(uint[2]) { } /// Returns an array of consensus rules. /// [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants] function getConsensusRules() public view returns(uint[6]) { } /// Returns an array of dispute rules. /// [dispute amount, dispute timeout, dispute round] function getDisputeData() public view returns(uint[4], address) { } function recoverLeftovers() public onlyOwner onlyAfterLefroversCanBeRecovered { } /// Advances the event's state to the next one. Only for internal use. function advanceState() private onlyChangeableState { } /// Sets consensus rules. For internal use only. function setConsensusRules(uint[6] rules) private { } function markAsFailed(string description) private onlyChangeableState { } function setDisputeData(uint[3] rules) private { } }
VerityToken(tokenAddress).allowance(msg.sender,address(this))>=dispute.amount*dispute.multiplier**dispute.round,"Not enough tokens staked for dispute."
24,917
VerityToken(tokenAddress).allowance(msg.sender,address(this))>=dispute.amount*dispute.multiplier**dispute.round
"Already triggered a dispute."
contract VerityEvent { /// Contract's owner, used for permission management address public owner; /// Token contract address, used for tokend distribution address public tokenAddress; /// Event registry contract address address public eventRegistryAddress; /// Designated validation nodes that will decide rewards. address[] eventResolvers; /// - WaitingForRewards: Waiting for current master to set rewards. /// - Validating: Master has set rewards. Vaiting for node validation. /// - Finished: Either successfully validated or failed. enum ValidationState { WaitingForRewards, Validating, Finished } ValidationState validationState = ValidationState.WaitingForRewards; struct RewardsValidation { address currentMasterNode; string rewardsHash; uint approvalCount; uint rejectionCount; string[] altHashes; mapping(address => uint) votersRound; mapping(string => address[]) altHashVotes; mapping(string => bool) rejectedHashes; } RewardsValidation rewardsValidation; /// Round of validation. Increases by each failed validation uint public rewardsValidationRound; /// A list of all the participating wallet addresses, implemented as a mapping /// to provide constant lookup times. mapping(address => bool) participants; address[] participantsIndex; enum RewardType { Ether, Token } RewardType rewardType; /// A mapping of addresses to their assigned rewards mapping(address => mapping(uint => uint)) rewards; address[] rewardsIndex; /// Event application start time, users cannot apply to participate before it uint applicationStartTime; /// Event application end time, users cannot apply after this time uint applicationEndTime; /// Event actual start time, votes before this should not be accepted uint eventStartTime; /// Event end time, it is calculated in the constructor uint eventEndTime; /// Ipfs event data hash string ipfsEventHash; /// Event name, here for informational use - not used otherwise /// owner can recover tokens and ether after this time uint leftoversRecoverableAfter; /// Amount of tokens that each user must stake before voting. uint public stakingAmount; struct Dispute { uint amount; uint timeout; uint round; uint expiresAt; uint multiplier; mapping(address => bool) disputers; address currentDisputer; } Dispute dispute; uint defaultDisputeTimeExtension = 1800; // 30 minutes string public eventName; /// Data feed hash, used for verification string public dataFeedHash; bytes32[] results; enum RewardsDistribution { Linear, // 0 Exponential // 1 } struct ConsensusRules { uint minTotalVotes; uint minConsensusVotes; uint minConsensusRatio; uint minParticipantRatio; uint maxParticipants; RewardsDistribution rewardsDistribution; } ConsensusRules consensusRules; /// Event's states /// Events advance in the order defined here. Once the event reaches "Reward" /// state, it cannot advance further. /// Event states: /// - Waiting -- Contract has been created, nothing is happening yet /// - Application -- After applicationStartTime, the event advances here /// new wallets can be added to the participats list during this state. /// - Running -- Event is running, no new participants can be added /// - DisputeTimeout -- Dispute possible /// - Reward -- Participants can claim their payouts here - final state; can't be modified. /// - Failed -- Event failed (no consensus, not enough users, timeout, ...) - final state; can't be modified enum EventStates { Waiting, Application, Running, DisputeTimeout, Reward, Failed } EventStates eventState = EventStates.Waiting; event StateTransition(EventStates newState); event JoinEvent(address wallet); event ClaimReward(address recipient); event Error(string description); event EventFailed(string description); event ValidationStarted(uint validationRound); event ValidationRestart(uint validationRound); event DisputeTriggered(address byAddress); event ClaimStake(address recipient); constructor( string _eventName, uint _applicationStartTime, uint _applicationEndTime, uint _eventStartTime, uint _eventRunTime, // in seconds address _tokenAddress, address _registry, address[] _eventResolvers, uint _leftoversRecoverableAfter, // with timestamp (in seconds) uint[6] _consensusRules, // [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants, distribution] uint _stakingAmount, uint[3] _disputeRules, // [dispute amount, dispute timeout, dispute multiplier] string _ipfsEventHash ) public payable { } /// A modifier signifiying that a certain method can only be used by the creator /// of the contract. /// Rollbacks the transaction on failure. modifier onlyOwner() { } /// A modifier signifiying that rewards can be set only by the designated master node. /// Rollbacks the transaction on failure. modifier onlyCurrentMaster() { } /// A modifier signifying that a certain method can only be used by a wallet /// marked as a participant. /// Rollbacks the transaction or failure. modifier onlyParticipating() { } /// A modifier signifying that a certain method can only be used when the event /// is in a certain state. /// @param _state The event's required state /// Example: /// function claimReward() onlyParticipanting onlyState(EventStates.Reward) { /// // ... content /// } modifier onlyState(EventStates _state) { } /// A modifier taking care of all the timed state transitions. /// Should always be used before all other modifiers, especially `onlyState`, /// since it can change state. /// Should probably be used in ALL non-constant (transaction) methods of /// the contract. modifier timedStateTransition() { } modifier onlyChangeableState() { } modifier onlyAfterLefroversCanBeRecovered() { } modifier canValidateRewards(uint forRound) { } /// Ensure we can receive money at any time. /// Not used, but we might want to extend the reward fund while event is running. function() public payable {} /// Apply for participation in this event. /// Available only during the Application state. /// A transaction to this function has to be done by the users themselves, /// registering their wallet address as a participent. /// The transaction does not have to include any funds. function joinEvent() public timedStateTransition { } /// Checks whether an address is participating in this event. /// @param _user The addres to check for participation /// @return {bool} Whether the given address is a participant of this event function isParticipating(address _user) public view returns(bool) { } function getParticipants() public view returns(address[]) { } function getEventTimes() public view returns(uint[5]) { } /// Assign the actual rewards. /// Receives a list of addresses and a list rewards. Mapping between the two /// is done by the addresses' and reward's numerical index in the list, so /// order is important. /// @param _addresses A list of addresses /// @param _etherRewards A list of ether rewards, must be the exact same length as addresses /// @param _tokenRewards A list of token rewards, must be the exact same length as addresses function setRewards( address[] _addresses, uint[] _etherRewards, uint[] _tokenRewards ) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Triggered by the master node once rewards are set and ready to validate function markRewardsSet(string rewardsHash) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } /// Called by event resolver nodes if they agree with rewards function approveRewards(uint validationRound) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Called by event resolvers if they don't agree with rewards function rejectRewards(uint validationRound, string altHash) public onlyState(EventStates.Running) canValidateRewards(validationRound) { } /// Trigger a dispute. function triggerDispute() public timedStateTransition onlyParticipating onlyState(EventStates.DisputeTimeout) { require( VerityToken(tokenAddress).allowance(msg.sender, address(this)) >= dispute.amount * dispute.multiplier**dispute.round, "Not enough tokens staked for dispute." ); require(<FILL_ME>) /// Increase dispute amount for next dispute and store disputer dispute.amount = dispute.amount * dispute.multiplier**dispute.round; ++dispute.round; dispute.disputers[msg.sender] = true; dispute.currentDisputer = msg.sender; /// Transfer staked amount VerityToken(tokenAddress).transferFrom(msg.sender, address(this), dispute.amount); /// Restart event deleteValidationData(); deleteRewards(); eventState = EventStates.Application; applicationEndTime = eventStartTime = now + defaultDisputeTimeExtension; eventEndTime = eventStartTime + defaultDisputeTimeExtension; /// Make consensus rules stricter /// Increases by ~10% of consensus diff consensusRules.minConsensusRatio += (100 - consensusRules.minConsensusRatio) * 100 / 1000; /// Increase total votes required my ~10% and consensus votes by consensus ratio uint votesIncrease = consensusRules.minTotalVotes * 100 / 1000; consensusRules.minTotalVotes += votesIncrease; consensusRules.minConsensusVotes += votesIncrease * consensusRules.minConsensusRatio / 100; emit DisputeTriggered(msg.sender); } /// Checks current approvals for threshold function checkApprovalRatio() private { } /// Checks current rejections for threshold function checkRejectionRatio() private { } /// Handle the rejection of current rewards function rejectCurrentValidation() private { } function restartValidation() private { } /// Delete rewards. function deleteRewards() private { } /// Delete validation data function deleteValidationData() private { } /// Ratio of nodes that approved of current hash function approvalRatio() private view returns(uint) { } /// Ratio of nodes that rejected the current hash function rejectionRatio() private view returns(uint) { } /// Returns the whole array of event resolvers. function getEventResolvers() public view returns(address[]) { } /// Checks if the address is current master node. function isMasterNode() public view returns(bool) { } function isNode(address node) private view returns(bool) { } /// Returns the calling user's assigned rewards. Can be 0. /// Only available to participating users in the Reward state, since rewards /// are not assigned before that. function getReward() public view returns(uint[2]) { } /// Returns all the addresses that have rewards set. function getRewardsIndex() public view returns(address[]) { } /// Returns rewards for specified addresses. /// [[ethRewards, tokenRewards], [ethRewards, tokenRewards], ...] function getRewards(address[] _addresses) public view returns(uint[], uint[]) { } /// Claim a reward. /// Needs to be called by the users themselves. /// Only available in the Reward state, after rewards have been received from /// the validation nodes. function claimReward() public onlyParticipating timedStateTransition onlyState(EventStates.Reward) { } function claimFailed() public onlyParticipating timedStateTransition onlyState(EventStates.Failed) { } function setDataFeedHash(string _hash) public onlyOwner { } function setResults(bytes32[] _results) public onlyCurrentMaster timedStateTransition onlyState(EventStates.Running) { } function getResults() public view returns(bytes32[]) { } function getState() public view returns(uint) { } function getBalance() public view returns(uint[2]) { } /// Returns an array of consensus rules. /// [minTotalVotes, minConsensusVotes, minConsensusRatio, minParticipantRatio, maxParticipants] function getConsensusRules() public view returns(uint[6]) { } /// Returns an array of dispute rules. /// [dispute amount, dispute timeout, dispute round] function getDisputeData() public view returns(uint[4], address) { } function recoverLeftovers() public onlyOwner onlyAfterLefroversCanBeRecovered { } /// Advances the event's state to the next one. Only for internal use. function advanceState() private onlyChangeableState { } /// Sets consensus rules. For internal use only. function setConsensusRules(uint[6] rules) private { } function markAsFailed(string description) private onlyChangeableState { } function setDisputeData(uint[3] rules) private { } }
dispute.disputers[msg.sender]==false,"Already triggered a dispute."
24,917
dispute.disputers[msg.sender]==false
"user needs to be whitelist to trigger external call"
pragma solidity ^0.5.0; contract ProxyToken is ERC20, ERC20Detailed, Ownable, ProxyBaseStorage, IERC1538 { mapping(address => mapping(bytes4 => bool)) public WhiteListedCaller; mapping(bytes4 => bool) public nonWhiteListed; address balanceOfDelegate; event balanceOfDelegateUpdated(address newDelegate); constructor() public ERC20Detailed("Hercules", "HERC", 18) { } function updateBalanceDelegate(address _a) public onlyOwner() { } function WhiteListCaller(address a, bytes4 _function) public onlyOwner() { } function deWhiteListCaller(address a, bytes4 _function) public onlyOwner() { } function toggleFunctionWhiteListing(bytes4 _function) public onlyOwner() { } function burn(uint256 _amount) public { } function balanceOf(address _user, uint256 _id) public returns (uint256) { } function() external payable { address delegate = delegates[msg.sig]; require(delegate != address(0), "Function does not exist."); if (nonWhiteListed[msg.sig] == false) { require(<FILL_ME>) } assembly { let ptr := mload(0x40) calldatacopy(ptr, 0, calldatasize) let result := delegatecall(gas, delegate, ptr, calldatasize, 0, 0) let size := returndatasize returndatacopy(ptr, 0, size) switch result case 0 { revert(ptr, size) } default { return(ptr, size) } } } /////////////////////////////////////////////////////////////////////////////////////////////// /// @notice Updates functions in a transparent contract. /// @dev If the value of _delegate is zero then the functions specified /// in _functionSignatures are removed. /// If the value of _delegate is a delegate contract address then the functions /// specified in _functionSignatures will be delegated to that address. /// @param _delegate The address of a delegate contract to delegate to or zero /// @param _functionSignatures A list of function signatures listed one after the other /// @param _commitMessage A short description of the change and why it is made /// This message is passed to the CommitMessage event. function updateContract( address _delegate, string calldata _functionSignatures, string calldata _commitMessage ) external onlyOwner() { } }
WhiteListedCaller[msg.sender][msg.sig]==true,"user needs to be whitelist to trigger external call"
24,929
WhiteListedCaller[msg.sender][msg.sig]==true
"Cannot set a proxy implementation to a non-contract address"
pragma solidity ^0.5.0; library AddressUtils { function isContract(address addr) internal view returns (bool) { } } contract UpgradeabilityProxy is Proxy { event Upgraded(address implementation); bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3; constructor(address _implementation) public { } function _implementation() internal view returns (address impl) { } function _upgradeTo(address newImplementation) internal { } function _setImplementation(address newImplementation) private { require(<FILL_ME>) bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } }
AddressUtils.isContract(newImplementation),"Cannot set a proxy implementation to a non-contract address"
24,941
AddressUtils.isContract(newImplementation)
"ERC20Capped: cap exceeded"
/*! sp500crypto.sol | (c) 2019 Develop by BelovITLab LLC (smartcontract.ru), author @stupidlovejoy | License: MIT */ pragma solidity 0.5.11; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); } contract StandardToken is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view returns (uint256) { } function balanceOf(address owner) public view returns (uint256) { } function allowance(address owner, address spender) public view returns (uint256) { } function transfer(address to, uint256 value) public returns (bool) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address from, address to, uint256 value) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address from, address to, uint256 value) internal { } function _mint(address account, uint256 value) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 value) internal { } } contract MintableToken is StandardToken, Ownable { bool public mintingFinished = false; event MintFinished(address account); modifier canMint() { } function finishMinting() onlyOwner canMint public returns(bool) { } function mint(address to, uint256 value) public canMint onlyOwner returns (bool) { } } contract CappedToken is MintableToken { uint256 private _cap; constructor(uint256 cap) public { } function cap() public view returns (uint256) { } function _mint(address account, uint256 value) internal { require(<FILL_ME>) super._mint(account, value); } } contract BurnableToken is StandardToken { function burn(uint256 value) public { } function burnFrom(address from, uint256 value) public { } } contract Withdrawable is Ownable { event WithdrawEther(address indexed to, uint value); function withdrawEther(address payable _to, uint _value) onlyOwner public { } function withdrawTokensTransfer(IERC20 _token, address _to, uint256 _value) onlyOwner public { } function withdrawTokensTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) onlyOwner public { } function withdrawTokensApprove(IERC20 _token, address _spender, uint256 _value) onlyOwner public { } } contract Pausable is Ownable { event Paused(address account); event Unpaused(address account); bool private _paused; constructor() internal { } function paused() public view returns (bool) { } modifier whenNotPaused() { } modifier whenPaused() { } function pause() public onlyOwner whenNotPaused { } function unpause() public onlyOwner whenPaused { } } contract Token is MintableToken, BurnableToken, Withdrawable, Pausable { mapping(address => bool) blockeds; uint public commission = 0; uint public maxFee = 1e8; modifier whenNotBlocked(address addr) { } constructor() StandardToken("S&P500 Token", "SP500", 6) public { } function transfer(address to, uint256 value) public whenNotPaused whenNotBlocked(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused whenNotBlocked(from) returns (bool) { } function blockAddr(address addr) public onlyOwner { } function unblockAddr(address addr) public onlyOwner { } function setCommission(uint value) public onlyOwner { } function setMaxFee(uint value) public onlyOwner { } }
totalSupply().add(value)<=_cap,"ERC20Capped: cap exceeded"
24,965
totalSupply().add(value)<=_cap
"Blocked: block"
/*! sp500crypto.sol | (c) 2019 Develop by BelovITLab LLC (smartcontract.ru), author @stupidlovejoy | License: MIT */ pragma solidity 0.5.11; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); } contract StandardToken is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view returns (uint256) { } function balanceOf(address owner) public view returns (uint256) { } function allowance(address owner, address spender) public view returns (uint256) { } function transfer(address to, uint256 value) public returns (bool) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address from, address to, uint256 value) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address from, address to, uint256 value) internal { } function _mint(address account, uint256 value) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 value) internal { } } contract MintableToken is StandardToken, Ownable { bool public mintingFinished = false; event MintFinished(address account); modifier canMint() { } function finishMinting() onlyOwner canMint public returns(bool) { } function mint(address to, uint256 value) public canMint onlyOwner returns (bool) { } } contract CappedToken is MintableToken { uint256 private _cap; constructor(uint256 cap) public { } function cap() public view returns (uint256) { } function _mint(address account, uint256 value) internal { } } contract BurnableToken is StandardToken { function burn(uint256 value) public { } function burnFrom(address from, uint256 value) public { } } contract Withdrawable is Ownable { event WithdrawEther(address indexed to, uint value); function withdrawEther(address payable _to, uint _value) onlyOwner public { } function withdrawTokensTransfer(IERC20 _token, address _to, uint256 _value) onlyOwner public { } function withdrawTokensTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) onlyOwner public { } function withdrawTokensApprove(IERC20 _token, address _spender, uint256 _value) onlyOwner public { } } contract Pausable is Ownable { event Paused(address account); event Unpaused(address account); bool private _paused; constructor() internal { } function paused() public view returns (bool) { } modifier whenNotPaused() { } modifier whenPaused() { } function pause() public onlyOwner whenNotPaused { } function unpause() public onlyOwner whenPaused { } } contract Token is MintableToken, BurnableToken, Withdrawable, Pausable { mapping(address => bool) blockeds; uint public commission = 0; uint public maxFee = 1e8; modifier whenNotBlocked(address addr) { require(<FILL_ME>) _; } constructor() StandardToken("S&P500 Token", "SP500", 6) public { } function transfer(address to, uint256 value) public whenNotPaused whenNotBlocked(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused whenNotBlocked(from) returns (bool) { } function blockAddr(address addr) public onlyOwner { } function unblockAddr(address addr) public onlyOwner { } function setCommission(uint value) public onlyOwner { } function setMaxFee(uint value) public onlyOwner { } }
!blockeds[addr],"Blocked: block"
24,965
!blockeds[addr]
"address frozen"
pragma solidity ^0.4.24; import "./SafeMath.sol"; /** * Token Implementation */ contract TokenImpl { /** * MATH */ using SafeMath for uint256; /** * DATA */ // INITIALIZATION DATA bool private initialized = false; // ERC20 BASIC DATA mapping(address => uint256) internal balances; uint256 internal totalSupply_; string public constant name = "PFC"; // solium-disable-line uppercase string public constant symbol = "PFC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase // ERC20 DATA mapping (address => mapping (address => uint256)) internal allowed; // OWNER DATA address public owner; // PAUSABILITY DATA bool public paused = false; // LAW ENFORCEMENT DATA address public lawEnforcementRole; mapping(address => bool) internal frozen; // SUPPLY CONTROL DATA address public supplyController; /** * EVENTS */ // ERC20 BASIC EVENTS event Transfer(address indexed from, address indexed to, uint256 value); // ERC20 EVENTS event Approval( address indexed owner, address indexed spender, uint256 value ); // OWNABLE EVENTS event OwnershipTransferred( address indexed oldOwner, address indexed newOwner ); // PAUSABLE EVENTS event Pause(); event Unpause(); // LAW ENFORCEMENT EVENTS event AddressFrozen(address indexed addr); event AddressUnfrozen(address indexed addr); event FrozenAddressWiped(address indexed addr); event LawEnforcementRoleSet ( address indexed oldLawEnforcementRole, address indexed newLawEnforcementRole ); // SUPPLY CONTROL EVENTS event SupplyIncreased(address indexed to, uint256 value); event SupplyDecreased(address indexed from, uint256 value); event SupplyControllerSet( address indexed oldSupplyController, address indexed newSupplyController ); /** * FUNCTIONALITY */ // INITIALIZATION FUNCTIONALITY /** * @dev sets 0 initials tokens, the owner, and the supplyController. * this serves as the constructor for the proxy but compiles to the * memory model of the Implementation contract. */ function initialize() public { } /** * The constructor is used here to ensure that the implementation * contract is initialized. An uncontrolled implementation * contract might lead to misleading state * for users who accidentally interact with it. */ constructor() public { } // ERC20 BASIC FUNCTIONALITY /** * @dev Total number of tokens in existence */ 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 whenNotPaused returns (bool) { require(_to != address(0), "cannot transfer to address zero"); require(<FILL_ME>) require(_value <= balances[msg.sender], "insufficient funds"); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _addr The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _addr) public view returns (uint256) { } // ERC20 FUNCTIONALITY /** * @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 whenNotPaused 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 whenNotPaused returns (bool) { } /** * @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) { } // OWNER FUNCTIONALITY /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } // PAUSABILITY FUNCTIONALITY /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner { } // LAW ENFORCEMENT FUNCTIONALITY /** * @dev Sets a new law enforcement role address. * @param _newLawEnforcementRole The new address allowed to freeze/unfreeze addresses and seize their tokens. */ function setLawEnforcementRole(address _newLawEnforcementRole) public { } modifier onlyLawEnforcementRole() { } /** * @dev Freezes an address balance from being transferred. * @param _addr The new address to freeze. */ function freeze(address _addr) public onlyLawEnforcementRole { } /** * @dev Unfreezes an address balance allowing transfer. * @param _addr The new address to unfreeze. */ function unfreeze(address _addr) public onlyLawEnforcementRole { } /** * @dev Wipes the balance of a frozen address, burning the tokens * and setting the approval to zero. * @param _addr The new frozen address to wipe. */ function wipeFrozenAddress(address _addr) public onlyLawEnforcementRole { } /** * @dev Gets the balance of the specified address. * @param _addr The address to check if frozen. * @return A bool representing whether the given address is frozen. */ function isFrozen(address _addr) public view returns (bool) { } // SUPPLY CONTROL FUNCTIONALITY /** * @dev Sets a new supply controller address. * @param _newSupplyController The address allowed to burn/mint tokens to control supply. */ function setSupplyController(address _newSupplyController) public { } modifier onlySupplyController() { } /** * @dev Increases the total supply by minting the specified number of tokens to the supply controller account. * @param _value The number of tokens to add. * @return A boolean that indicates if the operation was successful. */ function increaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } /** * @dev Decreases the total supply by burning the specified number of tokens from the supply controller account. * @param _value The number of tokens to remove. * @return A boolean that indicates if the operation was successful. */ function decreaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } }
!frozen[_to]&&!frozen[msg.sender],"address frozen"
25,040
!frozen[_to]&&!frozen[msg.sender]
"address frozen"
pragma solidity ^0.4.24; import "./SafeMath.sol"; /** * Token Implementation */ contract TokenImpl { /** * MATH */ using SafeMath for uint256; /** * DATA */ // INITIALIZATION DATA bool private initialized = false; // ERC20 BASIC DATA mapping(address => uint256) internal balances; uint256 internal totalSupply_; string public constant name = "PFC"; // solium-disable-line uppercase string public constant symbol = "PFC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase // ERC20 DATA mapping (address => mapping (address => uint256)) internal allowed; // OWNER DATA address public owner; // PAUSABILITY DATA bool public paused = false; // LAW ENFORCEMENT DATA address public lawEnforcementRole; mapping(address => bool) internal frozen; // SUPPLY CONTROL DATA address public supplyController; /** * EVENTS */ // ERC20 BASIC EVENTS event Transfer(address indexed from, address indexed to, uint256 value); // ERC20 EVENTS event Approval( address indexed owner, address indexed spender, uint256 value ); // OWNABLE EVENTS event OwnershipTransferred( address indexed oldOwner, address indexed newOwner ); // PAUSABLE EVENTS event Pause(); event Unpause(); // LAW ENFORCEMENT EVENTS event AddressFrozen(address indexed addr); event AddressUnfrozen(address indexed addr); event FrozenAddressWiped(address indexed addr); event LawEnforcementRoleSet ( address indexed oldLawEnforcementRole, address indexed newLawEnforcementRole ); // SUPPLY CONTROL EVENTS event SupplyIncreased(address indexed to, uint256 value); event SupplyDecreased(address indexed from, uint256 value); event SupplyControllerSet( address indexed oldSupplyController, address indexed newSupplyController ); /** * FUNCTIONALITY */ // INITIALIZATION FUNCTIONALITY /** * @dev sets 0 initials tokens, the owner, and the supplyController. * this serves as the constructor for the proxy but compiles to the * memory model of the Implementation contract. */ function initialize() public { } /** * The constructor is used here to ensure that the implementation * contract is initialized. An uncontrolled implementation * contract might lead to misleading state * for users who accidentally interact with it. */ constructor() public { } // ERC20 BASIC FUNCTIONALITY /** * @dev Total number of tokens in existence */ 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 whenNotPaused returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _addr The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _addr) public view returns (uint256) { } // ERC20 FUNCTIONALITY /** * @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 whenNotPaused returns (bool) { require(_to != address(0), "cannot transfer to address zero"); require(<FILL_ME>) require(_value <= balances[_from], "insufficient funds"); require(_value <= allowed[_from][msg.sender], "insufficient allowance"); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @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 whenNotPaused returns (bool) { } /** * @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) { } // OWNER FUNCTIONALITY /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } // PAUSABILITY FUNCTIONALITY /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner { } // LAW ENFORCEMENT FUNCTIONALITY /** * @dev Sets a new law enforcement role address. * @param _newLawEnforcementRole The new address allowed to freeze/unfreeze addresses and seize their tokens. */ function setLawEnforcementRole(address _newLawEnforcementRole) public { } modifier onlyLawEnforcementRole() { } /** * @dev Freezes an address balance from being transferred. * @param _addr The new address to freeze. */ function freeze(address _addr) public onlyLawEnforcementRole { } /** * @dev Unfreezes an address balance allowing transfer. * @param _addr The new address to unfreeze. */ function unfreeze(address _addr) public onlyLawEnforcementRole { } /** * @dev Wipes the balance of a frozen address, burning the tokens * and setting the approval to zero. * @param _addr The new frozen address to wipe. */ function wipeFrozenAddress(address _addr) public onlyLawEnforcementRole { } /** * @dev Gets the balance of the specified address. * @param _addr The address to check if frozen. * @return A bool representing whether the given address is frozen. */ function isFrozen(address _addr) public view returns (bool) { } // SUPPLY CONTROL FUNCTIONALITY /** * @dev Sets a new supply controller address. * @param _newSupplyController The address allowed to burn/mint tokens to control supply. */ function setSupplyController(address _newSupplyController) public { } modifier onlySupplyController() { } /** * @dev Increases the total supply by minting the specified number of tokens to the supply controller account. * @param _value The number of tokens to add. * @return A boolean that indicates if the operation was successful. */ function increaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } /** * @dev Decreases the total supply by burning the specified number of tokens from the supply controller account. * @param _value The number of tokens to remove. * @return A boolean that indicates if the operation was successful. */ function decreaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } }
!frozen[_to]&&!frozen[_from]&&!frozen[msg.sender],"address frozen"
25,040
!frozen[_to]&&!frozen[_from]&&!frozen[msg.sender]
"address frozen"
pragma solidity ^0.4.24; import "./SafeMath.sol"; /** * Token Implementation */ contract TokenImpl { /** * MATH */ using SafeMath for uint256; /** * DATA */ // INITIALIZATION DATA bool private initialized = false; // ERC20 BASIC DATA mapping(address => uint256) internal balances; uint256 internal totalSupply_; string public constant name = "PFC"; // solium-disable-line uppercase string public constant symbol = "PFC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase // ERC20 DATA mapping (address => mapping (address => uint256)) internal allowed; // OWNER DATA address public owner; // PAUSABILITY DATA bool public paused = false; // LAW ENFORCEMENT DATA address public lawEnforcementRole; mapping(address => bool) internal frozen; // SUPPLY CONTROL DATA address public supplyController; /** * EVENTS */ // ERC20 BASIC EVENTS event Transfer(address indexed from, address indexed to, uint256 value); // ERC20 EVENTS event Approval( address indexed owner, address indexed spender, uint256 value ); // OWNABLE EVENTS event OwnershipTransferred( address indexed oldOwner, address indexed newOwner ); // PAUSABLE EVENTS event Pause(); event Unpause(); // LAW ENFORCEMENT EVENTS event AddressFrozen(address indexed addr); event AddressUnfrozen(address indexed addr); event FrozenAddressWiped(address indexed addr); event LawEnforcementRoleSet ( address indexed oldLawEnforcementRole, address indexed newLawEnforcementRole ); // SUPPLY CONTROL EVENTS event SupplyIncreased(address indexed to, uint256 value); event SupplyDecreased(address indexed from, uint256 value); event SupplyControllerSet( address indexed oldSupplyController, address indexed newSupplyController ); /** * FUNCTIONALITY */ // INITIALIZATION FUNCTIONALITY /** * @dev sets 0 initials tokens, the owner, and the supplyController. * this serves as the constructor for the proxy but compiles to the * memory model of the Implementation contract. */ function initialize() public { } /** * The constructor is used here to ensure that the implementation * contract is initialized. An uncontrolled implementation * contract might lead to misleading state * for users who accidentally interact with it. */ constructor() public { } // ERC20 BASIC FUNCTIONALITY /** * @dev Total number of tokens in existence */ 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 whenNotPaused returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _addr The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _addr) public view returns (uint256) { } // ERC20 FUNCTIONALITY /** * @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 whenNotPaused 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 whenNotPaused returns (bool) { require(<FILL_ME>) allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _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) { } // OWNER FUNCTIONALITY /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } // PAUSABILITY FUNCTIONALITY /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner { } // LAW ENFORCEMENT FUNCTIONALITY /** * @dev Sets a new law enforcement role address. * @param _newLawEnforcementRole The new address allowed to freeze/unfreeze addresses and seize their tokens. */ function setLawEnforcementRole(address _newLawEnforcementRole) public { } modifier onlyLawEnforcementRole() { } /** * @dev Freezes an address balance from being transferred. * @param _addr The new address to freeze. */ function freeze(address _addr) public onlyLawEnforcementRole { } /** * @dev Unfreezes an address balance allowing transfer. * @param _addr The new address to unfreeze. */ function unfreeze(address _addr) public onlyLawEnforcementRole { } /** * @dev Wipes the balance of a frozen address, burning the tokens * and setting the approval to zero. * @param _addr The new frozen address to wipe. */ function wipeFrozenAddress(address _addr) public onlyLawEnforcementRole { } /** * @dev Gets the balance of the specified address. * @param _addr The address to check if frozen. * @return A bool representing whether the given address is frozen. */ function isFrozen(address _addr) public view returns (bool) { } // SUPPLY CONTROL FUNCTIONALITY /** * @dev Sets a new supply controller address. * @param _newSupplyController The address allowed to burn/mint tokens to control supply. */ function setSupplyController(address _newSupplyController) public { } modifier onlySupplyController() { } /** * @dev Increases the total supply by minting the specified number of tokens to the supply controller account. * @param _value The number of tokens to add. * @return A boolean that indicates if the operation was successful. */ function increaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } /** * @dev Decreases the total supply by burning the specified number of tokens from the supply controller account. * @param _value The number of tokens to remove. * @return A boolean that indicates if the operation was successful. */ function decreaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } }
!frozen[_spender]&&!frozen[msg.sender],"address frozen"
25,040
!frozen[_spender]&&!frozen[msg.sender]
"address already frozen"
pragma solidity ^0.4.24; import "./SafeMath.sol"; /** * Token Implementation */ contract TokenImpl { /** * MATH */ using SafeMath for uint256; /** * DATA */ // INITIALIZATION DATA bool private initialized = false; // ERC20 BASIC DATA mapping(address => uint256) internal balances; uint256 internal totalSupply_; string public constant name = "PFC"; // solium-disable-line uppercase string public constant symbol = "PFC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase // ERC20 DATA mapping (address => mapping (address => uint256)) internal allowed; // OWNER DATA address public owner; // PAUSABILITY DATA bool public paused = false; // LAW ENFORCEMENT DATA address public lawEnforcementRole; mapping(address => bool) internal frozen; // SUPPLY CONTROL DATA address public supplyController; /** * EVENTS */ // ERC20 BASIC EVENTS event Transfer(address indexed from, address indexed to, uint256 value); // ERC20 EVENTS event Approval( address indexed owner, address indexed spender, uint256 value ); // OWNABLE EVENTS event OwnershipTransferred( address indexed oldOwner, address indexed newOwner ); // PAUSABLE EVENTS event Pause(); event Unpause(); // LAW ENFORCEMENT EVENTS event AddressFrozen(address indexed addr); event AddressUnfrozen(address indexed addr); event FrozenAddressWiped(address indexed addr); event LawEnforcementRoleSet ( address indexed oldLawEnforcementRole, address indexed newLawEnforcementRole ); // SUPPLY CONTROL EVENTS event SupplyIncreased(address indexed to, uint256 value); event SupplyDecreased(address indexed from, uint256 value); event SupplyControllerSet( address indexed oldSupplyController, address indexed newSupplyController ); /** * FUNCTIONALITY */ // INITIALIZATION FUNCTIONALITY /** * @dev sets 0 initials tokens, the owner, and the supplyController. * this serves as the constructor for the proxy but compiles to the * memory model of the Implementation contract. */ function initialize() public { } /** * The constructor is used here to ensure that the implementation * contract is initialized. An uncontrolled implementation * contract might lead to misleading state * for users who accidentally interact with it. */ constructor() public { } // ERC20 BASIC FUNCTIONALITY /** * @dev Total number of tokens in existence */ 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 whenNotPaused returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _addr The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _addr) public view returns (uint256) { } // ERC20 FUNCTIONALITY /** * @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 whenNotPaused 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 whenNotPaused returns (bool) { } /** * @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) { } // OWNER FUNCTIONALITY /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } // PAUSABILITY FUNCTIONALITY /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner { } // LAW ENFORCEMENT FUNCTIONALITY /** * @dev Sets a new law enforcement role address. * @param _newLawEnforcementRole The new address allowed to freeze/unfreeze addresses and seize their tokens. */ function setLawEnforcementRole(address _newLawEnforcementRole) public { } modifier onlyLawEnforcementRole() { } /** * @dev Freezes an address balance from being transferred. * @param _addr The new address to freeze. */ function freeze(address _addr) public onlyLawEnforcementRole { require(<FILL_ME>) frozen[_addr] = true; emit AddressFrozen(_addr); } /** * @dev Unfreezes an address balance allowing transfer. * @param _addr The new address to unfreeze. */ function unfreeze(address _addr) public onlyLawEnforcementRole { } /** * @dev Wipes the balance of a frozen address, burning the tokens * and setting the approval to zero. * @param _addr The new frozen address to wipe. */ function wipeFrozenAddress(address _addr) public onlyLawEnforcementRole { } /** * @dev Gets the balance of the specified address. * @param _addr The address to check if frozen. * @return A bool representing whether the given address is frozen. */ function isFrozen(address _addr) public view returns (bool) { } // SUPPLY CONTROL FUNCTIONALITY /** * @dev Sets a new supply controller address. * @param _newSupplyController The address allowed to burn/mint tokens to control supply. */ function setSupplyController(address _newSupplyController) public { } modifier onlySupplyController() { } /** * @dev Increases the total supply by minting the specified number of tokens to the supply controller account. * @param _value The number of tokens to add. * @return A boolean that indicates if the operation was successful. */ function increaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } /** * @dev Decreases the total supply by burning the specified number of tokens from the supply controller account. * @param _value The number of tokens to remove. * @return A boolean that indicates if the operation was successful. */ function decreaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } }
!frozen[_addr],"address already frozen"
25,040
!frozen[_addr]
"address already unfrozen"
pragma solidity ^0.4.24; import "./SafeMath.sol"; /** * Token Implementation */ contract TokenImpl { /** * MATH */ using SafeMath for uint256; /** * DATA */ // INITIALIZATION DATA bool private initialized = false; // ERC20 BASIC DATA mapping(address => uint256) internal balances; uint256 internal totalSupply_; string public constant name = "PFC"; // solium-disable-line uppercase string public constant symbol = "PFC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase // ERC20 DATA mapping (address => mapping (address => uint256)) internal allowed; // OWNER DATA address public owner; // PAUSABILITY DATA bool public paused = false; // LAW ENFORCEMENT DATA address public lawEnforcementRole; mapping(address => bool) internal frozen; // SUPPLY CONTROL DATA address public supplyController; /** * EVENTS */ // ERC20 BASIC EVENTS event Transfer(address indexed from, address indexed to, uint256 value); // ERC20 EVENTS event Approval( address indexed owner, address indexed spender, uint256 value ); // OWNABLE EVENTS event OwnershipTransferred( address indexed oldOwner, address indexed newOwner ); // PAUSABLE EVENTS event Pause(); event Unpause(); // LAW ENFORCEMENT EVENTS event AddressFrozen(address indexed addr); event AddressUnfrozen(address indexed addr); event FrozenAddressWiped(address indexed addr); event LawEnforcementRoleSet ( address indexed oldLawEnforcementRole, address indexed newLawEnforcementRole ); // SUPPLY CONTROL EVENTS event SupplyIncreased(address indexed to, uint256 value); event SupplyDecreased(address indexed from, uint256 value); event SupplyControllerSet( address indexed oldSupplyController, address indexed newSupplyController ); /** * FUNCTIONALITY */ // INITIALIZATION FUNCTIONALITY /** * @dev sets 0 initials tokens, the owner, and the supplyController. * this serves as the constructor for the proxy but compiles to the * memory model of the Implementation contract. */ function initialize() public { } /** * The constructor is used here to ensure that the implementation * contract is initialized. An uncontrolled implementation * contract might lead to misleading state * for users who accidentally interact with it. */ constructor() public { } // ERC20 BASIC FUNCTIONALITY /** * @dev Total number of tokens in existence */ 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 whenNotPaused returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _addr The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _addr) public view returns (uint256) { } // ERC20 FUNCTIONALITY /** * @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 whenNotPaused 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 whenNotPaused returns (bool) { } /** * @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) { } // OWNER FUNCTIONALITY /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } // PAUSABILITY FUNCTIONALITY /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner { } // LAW ENFORCEMENT FUNCTIONALITY /** * @dev Sets a new law enforcement role address. * @param _newLawEnforcementRole The new address allowed to freeze/unfreeze addresses and seize their tokens. */ function setLawEnforcementRole(address _newLawEnforcementRole) public { } modifier onlyLawEnforcementRole() { } /** * @dev Freezes an address balance from being transferred. * @param _addr The new address to freeze. */ function freeze(address _addr) public onlyLawEnforcementRole { } /** * @dev Unfreezes an address balance allowing transfer. * @param _addr The new address to unfreeze. */ function unfreeze(address _addr) public onlyLawEnforcementRole { require(<FILL_ME>) frozen[_addr] = false; emit AddressUnfrozen(_addr); } /** * @dev Wipes the balance of a frozen address, burning the tokens * and setting the approval to zero. * @param _addr The new frozen address to wipe. */ function wipeFrozenAddress(address _addr) public onlyLawEnforcementRole { } /** * @dev Gets the balance of the specified address. * @param _addr The address to check if frozen. * @return A bool representing whether the given address is frozen. */ function isFrozen(address _addr) public view returns (bool) { } // SUPPLY CONTROL FUNCTIONALITY /** * @dev Sets a new supply controller address. * @param _newSupplyController The address allowed to burn/mint tokens to control supply. */ function setSupplyController(address _newSupplyController) public { } modifier onlySupplyController() { } /** * @dev Increases the total supply by minting the specified number of tokens to the supply controller account. * @param _value The number of tokens to add. * @return A boolean that indicates if the operation was successful. */ function increaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } /** * @dev Decreases the total supply by burning the specified number of tokens from the supply controller account. * @param _value The number of tokens to remove. * @return A boolean that indicates if the operation was successful. */ function decreaseSupply(uint256 _value) public onlySupplyController returns (bool success) { } }
frozen[_addr],"address already unfrozen"
25,040
frozen[_addr]
"No enough balance to approve!"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; library Math { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } /******************************************/ /* TOKEN INSTANCE STARTS HERE */ /******************************************/ contract Token { using Math for uint256; //variables of the token, EIP20 standard string public name = "Power Magic Coin"; string public symbol = "PMC"; uint256 public decimals = 10; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply = uint256(250000000).mul(uint256(10) ** decimals); address ZERO_ADDR = address(0x0000000000000000000000000000000000000000); address payable public creator; // for destruct contract // mapping structure mapping (address => uint256) public balanceOf; //eip20 mapping (address => mapping (address => uint256)) public allowance; //eip20 /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 token); //eip20 event Approval(address indexed owner, address indexed spender, uint256 token); //eip20 /* Initializes contract with initial supply tokens to the creator of the contract */ // constructor (string memory _name, string memory _symbol, uint256 _total, uint256 _decimals) public { constructor () public { } /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal returns (bool) { } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to to account // - Owner's account must have sufficient balance to transfer // ------------------------------------------------------------------------ function transfer(address to, uint256 token) public returns (bool success) { } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint256 token) public returns (bool success) { require(spender != ZERO_ADDR); require(<FILL_ME>) // prevent state race attack require(allowance[msg.sender][spender] == 0 || token == 0, "Invalid allowance state!"); allowance[msg.sender][spender] = token; emit Approval(msg.sender, spender, token); return true; } // ------------------------------------------------------------------------ // Transfer tokens from the from account to the to account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the from account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 token) public returns (bool success) { } //destroy this contract function destroy() public { } //Fallback: reverts if Ether is sent to this smart contract by mistake fallback() external { } }
balanceOf[msg.sender]>=token,"No enough balance to approve!"
25,080
balanceOf[msg.sender]>=token
"Invalid allowance state!"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; library Math { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } /******************************************/ /* TOKEN INSTANCE STARTS HERE */ /******************************************/ contract Token { using Math for uint256; //variables of the token, EIP20 standard string public name = "Power Magic Coin"; string public symbol = "PMC"; uint256 public decimals = 10; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply = uint256(250000000).mul(uint256(10) ** decimals); address ZERO_ADDR = address(0x0000000000000000000000000000000000000000); address payable public creator; // for destruct contract // mapping structure mapping (address => uint256) public balanceOf; //eip20 mapping (address => mapping (address => uint256)) public allowance; //eip20 /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 token); //eip20 event Approval(address indexed owner, address indexed spender, uint256 token); //eip20 /* Initializes contract with initial supply tokens to the creator of the contract */ // constructor (string memory _name, string memory _symbol, uint256 _total, uint256 _decimals) public { constructor () public { } /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal returns (bool) { } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to to account // - Owner's account must have sufficient balance to transfer // ------------------------------------------------------------------------ function transfer(address to, uint256 token) public returns (bool success) { } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint256 token) public returns (bool success) { require(spender != ZERO_ADDR); require(balanceOf[msg.sender] >= token, "No enough balance to approve!"); // prevent state race attack require(<FILL_ME>) allowance[msg.sender][spender] = token; emit Approval(msg.sender, spender, token); return true; } // ------------------------------------------------------------------------ // Transfer tokens from the from account to the to account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the from account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 token) public returns (bool success) { } //destroy this contract function destroy() public { } //Fallback: reverts if Ether is sent to this smart contract by mistake fallback() external { } }
allowance[msg.sender][spender]==0||token==0,"Invalid allowance state!"
25,080
allowance[msg.sender][spender]==0||token==0
"No enough allowance to transfer!"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; library Math { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } /******************************************/ /* TOKEN INSTANCE STARTS HERE */ /******************************************/ contract Token { using Math for uint256; //variables of the token, EIP20 standard string public name = "Power Magic Coin"; string public symbol = "PMC"; uint256 public decimals = 10; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply = uint256(250000000).mul(uint256(10) ** decimals); address ZERO_ADDR = address(0x0000000000000000000000000000000000000000); address payable public creator; // for destruct contract // mapping structure mapping (address => uint256) public balanceOf; //eip20 mapping (address => mapping (address => uint256)) public allowance; //eip20 /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 token); //eip20 event Approval(address indexed owner, address indexed spender, uint256 token); //eip20 /* Initializes contract with initial supply tokens to the creator of the contract */ // constructor (string memory _name, string memory _symbol, uint256 _total, uint256 _decimals) public { constructor () public { } /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal returns (bool) { } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to to account // - Owner's account must have sufficient balance to transfer // ------------------------------------------------------------------------ function transfer(address to, uint256 token) public returns (bool success) { } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint256 token) public returns (bool success) { } // ------------------------------------------------------------------------ // Transfer tokens from the from account to the to account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the from account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 token) public returns (bool success) { require(<FILL_ME>) allowance[from][msg.sender] = allowance[from][msg.sender].sub(token); _transfer(from, to, token); return true; } //destroy this contract function destroy() public { } //Fallback: reverts if Ether is sent to this smart contract by mistake fallback() external { } }
allowance[from][msg.sender]>=token,"No enough allowance to transfer!"
25,080
allowance[from][msg.sender]>=token
null
pragma solidity ^0.4.18; /** * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant 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 constant 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 => Snapshot[]) balances; mapping (address => uint256) userWithdrawalBlocks; /** * @dev 'Snapshot' is the structure that attaches a block number to a * given value, the block number attached is the one that last changed the value * 'fromBlock' - is the block number that the value was generated from * 'value' - is the amount of tokens at a specific block number */ struct Snapshot { uint128 fromBlock; uint128 value; } /** * @dev tracks history of totalSupply */ Snapshot[] totalSupplyHistory; /** * @dev track history of 'ETH balance' for dividends */ Snapshot[] balanceForDividendsHistory; /** * @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) { } /** * @dev internal function for transfers handling */ function doTransfer(address _from, address _to, uint _amount) internal returns(bool) { if (_amount == 0) { return true; } // Do not allow transfer to 0x0 or the token contract itself require(<FILL_ME>) // If the amount being transfered is more than the balance of the // account the transfer returns false var previousBalanceFrom = balanceOfAt(_from, block.number); if (previousBalanceFrom < _amount) { return false; } // First update the balance array with the new value for the address // sending the tokens updateValueAtNow(balances[_from], previousBalanceFrom - _amount); // Then update the balance array with the new value for the address // receiving the tokens var previousBalanceTo = balanceOfAt(_to, block.number); require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow updateValueAtNow(balances[_to], previousBalanceTo + _amount); // An event to make the transfer easy to find on the blockchain Transfer(_from, _to, _amount); return true; } /** * @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 constant returns (uint256 balance) { } /** * @dev Queries the balance of `_owner` at a specific `_blockNumber` * @param _owner The address from which the balance will be retrieved * @param _blockNumber The block number when the balance is queried * @return The balance at `_blockNumber` */ function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint) { } /** * @dev Total amount of tokens at a specific `_blockNumber`. * @param _blockNumber The block number when the totalSupply is queried * @return The total amount of tokens at `_blockNumber` */ function totalSupplyAt(uint _blockNumber) public constant returns(uint) { } /** * @dev `getValueAt` retrieves the number of tokens at a given block number * @param checkpoints The history of values being queried * @param _block The block number to retrieve the value at * @return The number of tokens being queried */ function getValueAt(Snapshot[] storage checkpoints, uint _block) constant internal returns (uint) { } /** * @dev `updateValueAtNow` used to update the `balances` map and the `totalSupplyHistory` * @param checkpoints The history of data being updated * @param _value The new number of tokens */ function updateValueAtNow(Snapshot[] storage checkpoints, uint _value) internal { } /** * @dev This function makes it easy to get the total number of tokens * @return The total number of tokens */ function redeemedSupply() public constant returns (uint) { } } contract Ownable { address public owner; /** * @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) public onlyOwner { } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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. * @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) { } /** * @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 constant returns (uint256 remaining) { } } contract MintableToken is StandardToken { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; string public name = "Honey Mining Token"; string public symbol = "HMT"; uint8 public decimals = 8; modifier canMint() { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) public canMint returns (bool) { } /** * @dev Function to record snapshot block and amount */ function recordDeposit(uint256 _amount) public { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public returns (bool) { } /** * @dev Function to calculate dividends * @return awailable for withdrawal ethere (wei value) */ function awailableDividends(address userAddress) public view returns (uint256) { } /** * @dev Function to record user withdrawal */ function recordWithdraw(address userAddress) public { } } contract HoneyMiningToken is Ownable { using SafeMath for uint256; MintableToken public token; /** * @dev Info of max supply */ uint256 public maxSupply = 300000000000000; /** * event for token purchase logging * @param purchaser who paid for the tokens, basically - 0x0, but could be user address on refferal case * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount - of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); /** * event for referral comission logging * @param purchaser who paid for the tokens * @param beneficiary who got the bonus tokens * @param amount - of tokens as ref reward */ event ReferralBonus(address indexed purchaser, address indexed beneficiary, uint amount); /** * event for token dividends deposit logging * @param amount - amount of ETH deposited */ event DepositForDividends(uint256 indexed amount); /** * event for dividends withdrawal logging * @param holder - who has the tokens * @param amount - amount of ETH which was withdraw */ event WithdrawDividends(address indexed holder, uint256 amount); /** * event for dev rewards logging * @param purchaser - who paid for the tokens * @param amount - representation of dev reward */ event DevReward(address purchaser, uint amount); function HoneyMiningToken() public { } /** * @dev fallback function can be used to buy tokens */ function () public payable { } /** * @dev low level token purchase function * @param referrer - optional parameter for ref bonus */ function buyTokens(address referrer) public payable { } /** * @return true if the transaction can buy tokens */ function validPurchase() internal constant returns (bool) { } /** * @return true if sale is over */ function hasEnded() public constant returns (bool) { } /** * @dev get current user balance * @param userAddress - address of user * @return current balance of tokens */ function checkBalance(address userAddress) public constant returns (uint){ } /** * @dev get user balance of tokens on specific block * @param userAddress - address of user * @param targetBlock - block number * @return address balance on block */ function checkBalanceAt(address userAddress, uint256 targetBlock) public constant returns (uint){ } /** * @dev get awailable dividends for withdrawal * @param userAddress - target * @return amount of ether (wei value) for current user */ function awailableDividends(address userAddress) public constant returns (uint){ } /** * @return total purchased tokens value */ function redeemedSupply() public view returns (uint){ } /** * @dev user-related method for withdrawal dividends */ function withdrawDividends() public { } /** * @dev function for deposit ether to token address as/for dividends */ function depositForDividends() public payable onlyOwner { } function stopSales() public onlyOwner{ } function forwardFunds() internal { } function rate() internal constant returns (uint) { } }
(_to!=0)&&(_to!=address(this))
25,168
(_to!=0)&&(_to!=address(this))
null
pragma solidity ^0.4.18; /** * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant 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 constant 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 => Snapshot[]) balances; mapping (address => uint256) userWithdrawalBlocks; /** * @dev 'Snapshot' is the structure that attaches a block number to a * given value, the block number attached is the one that last changed the value * 'fromBlock' - is the block number that the value was generated from * 'value' - is the amount of tokens at a specific block number */ struct Snapshot { uint128 fromBlock; uint128 value; } /** * @dev tracks history of totalSupply */ Snapshot[] totalSupplyHistory; /** * @dev track history of 'ETH balance' for dividends */ Snapshot[] balanceForDividendsHistory; /** * @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) { } /** * @dev internal function for transfers handling */ function doTransfer(address _from, address _to, uint _amount) internal 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 constant returns (uint256 balance) { } /** * @dev Queries the balance of `_owner` at a specific `_blockNumber` * @param _owner The address from which the balance will be retrieved * @param _blockNumber The block number when the balance is queried * @return The balance at `_blockNumber` */ function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint) { } /** * @dev Total amount of tokens at a specific `_blockNumber`. * @param _blockNumber The block number when the totalSupply is queried * @return The total amount of tokens at `_blockNumber` */ function totalSupplyAt(uint _blockNumber) public constant returns(uint) { } /** * @dev `getValueAt` retrieves the number of tokens at a given block number * @param checkpoints The history of values being queried * @param _block The block number to retrieve the value at * @return The number of tokens being queried */ function getValueAt(Snapshot[] storage checkpoints, uint _block) constant internal returns (uint) { } /** * @dev `updateValueAtNow` used to update the `balances` map and the `totalSupplyHistory` * @param checkpoints The history of data being updated * @param _value The new number of tokens */ function updateValueAtNow(Snapshot[] storage checkpoints, uint _value) internal { } /** * @dev This function makes it easy to get the total number of tokens * @return The total number of tokens */ function redeemedSupply() public constant returns (uint) { } } contract Ownable { address public owner; /** * @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) public onlyOwner { } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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. * @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) { } /** * @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 constant returns (uint256 remaining) { } } contract MintableToken is StandardToken { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; string public name = "Honey Mining Token"; string public symbol = "HMT"; uint8 public decimals = 8; modifier canMint() { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) public canMint returns (bool) { } /** * @dev Function to record snapshot block and amount */ function recordDeposit(uint256 _amount) public { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public returns (bool) { } /** * @dev Function to calculate dividends * @return awailable for withdrawal ethere (wei value) */ function awailableDividends(address userAddress) public view returns (uint256) { } /** * @dev Function to record user withdrawal */ function recordWithdraw(address userAddress) public { } } contract HoneyMiningToken is Ownable { using SafeMath for uint256; MintableToken public token; /** * @dev Info of max supply */ uint256 public maxSupply = 300000000000000; /** * event for token purchase logging * @param purchaser who paid for the tokens, basically - 0x0, but could be user address on refferal case * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount - of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); /** * event for referral comission logging * @param purchaser who paid for the tokens * @param beneficiary who got the bonus tokens * @param amount - of tokens as ref reward */ event ReferralBonus(address indexed purchaser, address indexed beneficiary, uint amount); /** * event for token dividends deposit logging * @param amount - amount of ETH deposited */ event DepositForDividends(uint256 indexed amount); /** * event for dividends withdrawal logging * @param holder - who has the tokens * @param amount - amount of ETH which was withdraw */ event WithdrawDividends(address indexed holder, uint256 amount); /** * event for dev rewards logging * @param purchaser - who paid for the tokens * @param amount - representation of dev reward */ event DevReward(address purchaser, uint amount); function HoneyMiningToken() public { } /** * @dev fallback function can be used to buy tokens */ function () public payable { } /** * @dev low level token purchase function * @param referrer - optional parameter for ref bonus */ function buyTokens(address referrer) public payable { require(msg.sender != 0x0); require(msg.sender != referrer); require(validPurchase()); //we dont need 18 decimals - and will use only 8 uint256 amount = msg.value.div(10000000000); // calculate token amount to be created uint256 tokens = amount.mul(rate()); require(tokens >= 100000000); uint256 devTokens = tokens.mul(30).div(100); if(referrer != 0x0){ require(<FILL_ME>) // 2.5% for referral and referrer uint256 refTokens = tokens.mul(25).div(1000); //tokens = tokens+refTokens; require(maxSupply.sub(redeemedSupply()) >= tokens.add(refTokens.mul(2)).add(devTokens)); //generate tokens for purchser token.mint(msg.sender, tokens.add(refTokens)); TokenPurchase(msg.sender, msg.sender, amount, tokens.add(refTokens)); token.mint(referrer, refTokens); ReferralBonus(msg.sender, referrer, refTokens); } else{ require(maxSupply.sub(redeemedSupply())>=tokens.add(devTokens)); //updatedReddemedSupply = redeemedSupply().add(tokens.add(devTokens)); //generate tokens for purchser token.mint(msg.sender, tokens); // log purchase TokenPurchase(msg.sender, msg.sender, amount, tokens); } token.mint(owner, devTokens); DevReward(msg.sender, devTokens); forwardFunds(); } /** * @return true if the transaction can buy tokens */ function validPurchase() internal constant returns (bool) { } /** * @return true if sale is over */ function hasEnded() public constant returns (bool) { } /** * @dev get current user balance * @param userAddress - address of user * @return current balance of tokens */ function checkBalance(address userAddress) public constant returns (uint){ } /** * @dev get user balance of tokens on specific block * @param userAddress - address of user * @param targetBlock - block number * @return address balance on block */ function checkBalanceAt(address userAddress, uint256 targetBlock) public constant returns (uint){ } /** * @dev get awailable dividends for withdrawal * @param userAddress - target * @return amount of ether (wei value) for current user */ function awailableDividends(address userAddress) public constant returns (uint){ } /** * @return total purchased tokens value */ function redeemedSupply() public view returns (uint){ } /** * @dev user-related method for withdrawal dividends */ function withdrawDividends() public { } /** * @dev function for deposit ether to token address as/for dividends */ function depositForDividends() public payable onlyOwner { } function stopSales() public onlyOwner{ } function forwardFunds() internal { } function rate() internal constant returns (uint) { } }
token.balanceOf(referrer)>=100000000
25,168
token.balanceOf(referrer)>=100000000
null
pragma solidity ^0.4.18; /** * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant 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 constant 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 => Snapshot[]) balances; mapping (address => uint256) userWithdrawalBlocks; /** * @dev 'Snapshot' is the structure that attaches a block number to a * given value, the block number attached is the one that last changed the value * 'fromBlock' - is the block number that the value was generated from * 'value' - is the amount of tokens at a specific block number */ struct Snapshot { uint128 fromBlock; uint128 value; } /** * @dev tracks history of totalSupply */ Snapshot[] totalSupplyHistory; /** * @dev track history of 'ETH balance' for dividends */ Snapshot[] balanceForDividendsHistory; /** * @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) { } /** * @dev internal function for transfers handling */ function doTransfer(address _from, address _to, uint _amount) internal 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 constant returns (uint256 balance) { } /** * @dev Queries the balance of `_owner` at a specific `_blockNumber` * @param _owner The address from which the balance will be retrieved * @param _blockNumber The block number when the balance is queried * @return The balance at `_blockNumber` */ function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint) { } /** * @dev Total amount of tokens at a specific `_blockNumber`. * @param _blockNumber The block number when the totalSupply is queried * @return The total amount of tokens at `_blockNumber` */ function totalSupplyAt(uint _blockNumber) public constant returns(uint) { } /** * @dev `getValueAt` retrieves the number of tokens at a given block number * @param checkpoints The history of values being queried * @param _block The block number to retrieve the value at * @return The number of tokens being queried */ function getValueAt(Snapshot[] storage checkpoints, uint _block) constant internal returns (uint) { } /** * @dev `updateValueAtNow` used to update the `balances` map and the `totalSupplyHistory` * @param checkpoints The history of data being updated * @param _value The new number of tokens */ function updateValueAtNow(Snapshot[] storage checkpoints, uint _value) internal { } /** * @dev This function makes it easy to get the total number of tokens * @return The total number of tokens */ function redeemedSupply() public constant returns (uint) { } } contract Ownable { address public owner; /** * @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) public onlyOwner { } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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. * @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) { } /** * @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 constant returns (uint256 remaining) { } } contract MintableToken is StandardToken { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; string public name = "Honey Mining Token"; string public symbol = "HMT"; uint8 public decimals = 8; modifier canMint() { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) public canMint returns (bool) { } /** * @dev Function to record snapshot block and amount */ function recordDeposit(uint256 _amount) public { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public returns (bool) { } /** * @dev Function to calculate dividends * @return awailable for withdrawal ethere (wei value) */ function awailableDividends(address userAddress) public view returns (uint256) { } /** * @dev Function to record user withdrawal */ function recordWithdraw(address userAddress) public { } } contract HoneyMiningToken is Ownable { using SafeMath for uint256; MintableToken public token; /** * @dev Info of max supply */ uint256 public maxSupply = 300000000000000; /** * event for token purchase logging * @param purchaser who paid for the tokens, basically - 0x0, but could be user address on refferal case * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount - of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); /** * event for referral comission logging * @param purchaser who paid for the tokens * @param beneficiary who got the bonus tokens * @param amount - of tokens as ref reward */ event ReferralBonus(address indexed purchaser, address indexed beneficiary, uint amount); /** * event for token dividends deposit logging * @param amount - amount of ETH deposited */ event DepositForDividends(uint256 indexed amount); /** * event for dividends withdrawal logging * @param holder - who has the tokens * @param amount - amount of ETH which was withdraw */ event WithdrawDividends(address indexed holder, uint256 amount); /** * event for dev rewards logging * @param purchaser - who paid for the tokens * @param amount - representation of dev reward */ event DevReward(address purchaser, uint amount); function HoneyMiningToken() public { } /** * @dev fallback function can be used to buy tokens */ function () public payable { } /** * @dev low level token purchase function * @param referrer - optional parameter for ref bonus */ function buyTokens(address referrer) public payable { require(msg.sender != 0x0); require(msg.sender != referrer); require(validPurchase()); //we dont need 18 decimals - and will use only 8 uint256 amount = msg.value.div(10000000000); // calculate token amount to be created uint256 tokens = amount.mul(rate()); require(tokens >= 100000000); uint256 devTokens = tokens.mul(30).div(100); if(referrer != 0x0){ require(token.balanceOf(referrer) >= 100000000); // 2.5% for referral and referrer uint256 refTokens = tokens.mul(25).div(1000); //tokens = tokens+refTokens; require(<FILL_ME>) //generate tokens for purchser token.mint(msg.sender, tokens.add(refTokens)); TokenPurchase(msg.sender, msg.sender, amount, tokens.add(refTokens)); token.mint(referrer, refTokens); ReferralBonus(msg.sender, referrer, refTokens); } else{ require(maxSupply.sub(redeemedSupply())>=tokens.add(devTokens)); //updatedReddemedSupply = redeemedSupply().add(tokens.add(devTokens)); //generate tokens for purchser token.mint(msg.sender, tokens); // log purchase TokenPurchase(msg.sender, msg.sender, amount, tokens); } token.mint(owner, devTokens); DevReward(msg.sender, devTokens); forwardFunds(); } /** * @return true if the transaction can buy tokens */ function validPurchase() internal constant returns (bool) { } /** * @return true if sale is over */ function hasEnded() public constant returns (bool) { } /** * @dev get current user balance * @param userAddress - address of user * @return current balance of tokens */ function checkBalance(address userAddress) public constant returns (uint){ } /** * @dev get user balance of tokens on specific block * @param userAddress - address of user * @param targetBlock - block number * @return address balance on block */ function checkBalanceAt(address userAddress, uint256 targetBlock) public constant returns (uint){ } /** * @dev get awailable dividends for withdrawal * @param userAddress - target * @return amount of ether (wei value) for current user */ function awailableDividends(address userAddress) public constant returns (uint){ } /** * @return total purchased tokens value */ function redeemedSupply() public view returns (uint){ } /** * @dev user-related method for withdrawal dividends */ function withdrawDividends() public { } /** * @dev function for deposit ether to token address as/for dividends */ function depositForDividends() public payable onlyOwner { } function stopSales() public onlyOwner{ } function forwardFunds() internal { } function rate() internal constant returns (uint) { } }
maxSupply.sub(redeemedSupply())>=tokens.add(refTokens.mul(2)).add(devTokens)
25,168
maxSupply.sub(redeemedSupply())>=tokens.add(refTokens.mul(2)).add(devTokens)
null
pragma solidity ^0.4.18; /** * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant 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 constant 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 => Snapshot[]) balances; mapping (address => uint256) userWithdrawalBlocks; /** * @dev 'Snapshot' is the structure that attaches a block number to a * given value, the block number attached is the one that last changed the value * 'fromBlock' - is the block number that the value was generated from * 'value' - is the amount of tokens at a specific block number */ struct Snapshot { uint128 fromBlock; uint128 value; } /** * @dev tracks history of totalSupply */ Snapshot[] totalSupplyHistory; /** * @dev track history of 'ETH balance' for dividends */ Snapshot[] balanceForDividendsHistory; /** * @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) { } /** * @dev internal function for transfers handling */ function doTransfer(address _from, address _to, uint _amount) internal 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 constant returns (uint256 balance) { } /** * @dev Queries the balance of `_owner` at a specific `_blockNumber` * @param _owner The address from which the balance will be retrieved * @param _blockNumber The block number when the balance is queried * @return The balance at `_blockNumber` */ function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint) { } /** * @dev Total amount of tokens at a specific `_blockNumber`. * @param _blockNumber The block number when the totalSupply is queried * @return The total amount of tokens at `_blockNumber` */ function totalSupplyAt(uint _blockNumber) public constant returns(uint) { } /** * @dev `getValueAt` retrieves the number of tokens at a given block number * @param checkpoints The history of values being queried * @param _block The block number to retrieve the value at * @return The number of tokens being queried */ function getValueAt(Snapshot[] storage checkpoints, uint _block) constant internal returns (uint) { } /** * @dev `updateValueAtNow` used to update the `balances` map and the `totalSupplyHistory` * @param checkpoints The history of data being updated * @param _value The new number of tokens */ function updateValueAtNow(Snapshot[] storage checkpoints, uint _value) internal { } /** * @dev This function makes it easy to get the total number of tokens * @return The total number of tokens */ function redeemedSupply() public constant returns (uint) { } } contract Ownable { address public owner; /** * @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) public onlyOwner { } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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. * @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) { } /** * @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 constant returns (uint256 remaining) { } } contract MintableToken is StandardToken { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; string public name = "Honey Mining Token"; string public symbol = "HMT"; uint8 public decimals = 8; modifier canMint() { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) public canMint returns (bool) { } /** * @dev Function to record snapshot block and amount */ function recordDeposit(uint256 _amount) public { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public returns (bool) { } /** * @dev Function to calculate dividends * @return awailable for withdrawal ethere (wei value) */ function awailableDividends(address userAddress) public view returns (uint256) { } /** * @dev Function to record user withdrawal */ function recordWithdraw(address userAddress) public { } } contract HoneyMiningToken is Ownable { using SafeMath for uint256; MintableToken public token; /** * @dev Info of max supply */ uint256 public maxSupply = 300000000000000; /** * event for token purchase logging * @param purchaser who paid for the tokens, basically - 0x0, but could be user address on refferal case * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount - of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); /** * event for referral comission logging * @param purchaser who paid for the tokens * @param beneficiary who got the bonus tokens * @param amount - of tokens as ref reward */ event ReferralBonus(address indexed purchaser, address indexed beneficiary, uint amount); /** * event for token dividends deposit logging * @param amount - amount of ETH deposited */ event DepositForDividends(uint256 indexed amount); /** * event for dividends withdrawal logging * @param holder - who has the tokens * @param amount - amount of ETH which was withdraw */ event WithdrawDividends(address indexed holder, uint256 amount); /** * event for dev rewards logging * @param purchaser - who paid for the tokens * @param amount - representation of dev reward */ event DevReward(address purchaser, uint amount); function HoneyMiningToken() public { } /** * @dev fallback function can be used to buy tokens */ function () public payable { } /** * @dev low level token purchase function * @param referrer - optional parameter for ref bonus */ function buyTokens(address referrer) public payable { require(msg.sender != 0x0); require(msg.sender != referrer); require(validPurchase()); //we dont need 18 decimals - and will use only 8 uint256 amount = msg.value.div(10000000000); // calculate token amount to be created uint256 tokens = amount.mul(rate()); require(tokens >= 100000000); uint256 devTokens = tokens.mul(30).div(100); if(referrer != 0x0){ require(token.balanceOf(referrer) >= 100000000); // 2.5% for referral and referrer uint256 refTokens = tokens.mul(25).div(1000); //tokens = tokens+refTokens; require(maxSupply.sub(redeemedSupply()) >= tokens.add(refTokens.mul(2)).add(devTokens)); //generate tokens for purchser token.mint(msg.sender, tokens.add(refTokens)); TokenPurchase(msg.sender, msg.sender, amount, tokens.add(refTokens)); token.mint(referrer, refTokens); ReferralBonus(msg.sender, referrer, refTokens); } else{ require(<FILL_ME>) //updatedReddemedSupply = redeemedSupply().add(tokens.add(devTokens)); //generate tokens for purchser token.mint(msg.sender, tokens); // log purchase TokenPurchase(msg.sender, msg.sender, amount, tokens); } token.mint(owner, devTokens); DevReward(msg.sender, devTokens); forwardFunds(); } /** * @return true if the transaction can buy tokens */ function validPurchase() internal constant returns (bool) { } /** * @return true if sale is over */ function hasEnded() public constant returns (bool) { } /** * @dev get current user balance * @param userAddress - address of user * @return current balance of tokens */ function checkBalance(address userAddress) public constant returns (uint){ } /** * @dev get user balance of tokens on specific block * @param userAddress - address of user * @param targetBlock - block number * @return address balance on block */ function checkBalanceAt(address userAddress, uint256 targetBlock) public constant returns (uint){ } /** * @dev get awailable dividends for withdrawal * @param userAddress - target * @return amount of ether (wei value) for current user */ function awailableDividends(address userAddress) public constant returns (uint){ } /** * @return total purchased tokens value */ function redeemedSupply() public view returns (uint){ } /** * @dev user-related method for withdrawal dividends */ function withdrawDividends() public { } /** * @dev function for deposit ether to token address as/for dividends */ function depositForDividends() public payable onlyOwner { } function stopSales() public onlyOwner{ } function forwardFunds() internal { } function rate() internal constant returns (uint) { } }
maxSupply.sub(redeemedSupply())>=tokens.add(devTokens)
25,168
maxSupply.sub(redeemedSupply())>=tokens.add(devTokens)
null
pragma solidity ^0.5.11; contract StockBet { event GameCreated(uint bet); event GameOpened(uint256 initialPrice); event GameClosed(); event OracleSet(address oracle); event FinalPriceSet(uint256 finalPrice); event PlayerBet(address player, uint guess); event PlayersWin(uint result, uint256 splitJackpot); event OwnerWins(address owner); enum State { SETUP, PRICE_SET, OPEN, CLOSED, PLAYERS_WIN, OWNER_WIN } enum PaidStatus { UNDEFINED, NOT_PAID, PAID } struct Guess { mapping (address => PaidStatus) players; uint guesses_number; } address payable public owner; address public oracle; State public state; mapping (uint => Guess) public guesses; uint256 public bet; uint256 splitJackpot; uint public result; uint256 public initialPrice; uint256 public finalPrice; uint constant UP = 1; uint constant DOWN = 0; // ----------MODIFIERS-------------------- modifier byPlayer(){ } modifier byOwner(){ } modifier byOracle(){ } modifier inState(State expected) { } // ------------------------------------- constructor(uint256 _bet) public { } function setOracle(address _oracle) public payable byOwner inState(State.SETUP) { } function setInitialPrice(uint256 _value) public payable byOracle inState(State.SETUP) { } function closeGame() public byOwner inState(State.OPEN){ } function betUp() public payable byPlayer inState(State.OPEN){ require(<FILL_ME>) guesses[UP].guesses_number++; guesses[UP].players[msg.sender] = PaidStatus.NOT_PAID; emit PlayerBet(msg.sender, UP); } function betDown() public payable byPlayer inState(State.OPEN){ } function setFinalPrice(uint256 _value) public payable byOracle inState(State.CLOSED) { } function collectOwnerWinnings() public byOwner inState(State.OWNER_WIN){ } function collectPlayerWinnings() public byPlayer inState(State.PLAYERS_WIN){ } function getBalance() private view returns (uint256){ } }
msg.value==(bet*0.001ether)
25,176
msg.value==(bet*0.001ether)
"parameters not allowed"
pragma solidity ^0.4.23; /** * @title Whitelistable * @dev Base contract implementing a whitelist to keep track of investors. * The construction parameters allow for both whitelisted and non-whitelisted contracts: * 1) maxWhitelistLength = 0 and whitelistThresholdBalance > 0: whitelist disabled * 2) maxWhitelistLength > 0 and whitelistThresholdBalance = 0: whitelist enabled, full whitelisting * 3) maxWhitelistLength > 0 and whitelistThresholdBalance > 0: whitelist enabled, partial whitelisting */ contract Whitelistable is WhitelistableConstraints { event LogMaxWhitelistLengthChanged(address indexed caller, uint256 indexed maxWhitelistLength); event LogWhitelistThresholdBalanceChanged(address indexed caller, uint256 indexed whitelistThresholdBalance); event LogWhitelistAddressAdded(address indexed caller, address indexed subscriber); event LogWhitelistAddressRemoved(address indexed caller, address indexed subscriber); mapping (address => bool) public whitelist; uint256 public whitelistLength; uint256 public maxWhitelistLength; uint256 public whitelistThresholdBalance; constructor(uint256 _maxWhitelistLength, uint256 _whitelistThresholdBalance) internal { require(<FILL_ME>) maxWhitelistLength = _maxWhitelistLength; whitelistThresholdBalance = _whitelistThresholdBalance; } /** * @return true if whitelist is currently enabled, false otherwise */ function isWhitelistEnabled() public view returns(bool isReallyWhitelistEnabled) { } /** * @return true if subscriber is whitelisted, false otherwise */ function isWhitelisted(address _subscriber) public view returns(bool isReallyWhitelisted) { } function setMaxWhitelistLengthInternal(uint256 _maxWhitelistLength) internal { } function setWhitelistThresholdBalanceInternal(uint256 _whitelistThresholdBalance) internal { } function addToWhitelistInternal(address _subscriber) internal { } function removeFromWhitelistInternal(address _subscriber, uint256 _balance) internal { } /** * @param _subscriber The subscriber for which the balance check is required. * @param _balance The balance value to check for allowance. * @return true if the balance is allowed for the subscriber, false otherwise */ function isAllowedBalance(address _subscriber, uint256 _balance) public view returns(bool isReallyAllowed) { } }
isAllowedWhitelist(_maxWhitelistLength,_whitelistThresholdBalance),"parameters not allowed"
25,233
isAllowedWhitelist(_maxWhitelistLength,_whitelistThresholdBalance)
"_maxWhitelistLength not allowed"
pragma solidity ^0.4.23; /** * @title Whitelistable * @dev Base contract implementing a whitelist to keep track of investors. * The construction parameters allow for both whitelisted and non-whitelisted contracts: * 1) maxWhitelistLength = 0 and whitelistThresholdBalance > 0: whitelist disabled * 2) maxWhitelistLength > 0 and whitelistThresholdBalance = 0: whitelist enabled, full whitelisting * 3) maxWhitelistLength > 0 and whitelistThresholdBalance > 0: whitelist enabled, partial whitelisting */ contract Whitelistable is WhitelistableConstraints { event LogMaxWhitelistLengthChanged(address indexed caller, uint256 indexed maxWhitelistLength); event LogWhitelistThresholdBalanceChanged(address indexed caller, uint256 indexed whitelistThresholdBalance); event LogWhitelistAddressAdded(address indexed caller, address indexed subscriber); event LogWhitelistAddressRemoved(address indexed caller, address indexed subscriber); mapping (address => bool) public whitelist; uint256 public whitelistLength; uint256 public maxWhitelistLength; uint256 public whitelistThresholdBalance; constructor(uint256 _maxWhitelistLength, uint256 _whitelistThresholdBalance) internal { } /** * @return true if whitelist is currently enabled, false otherwise */ function isWhitelistEnabled() public view returns(bool isReallyWhitelistEnabled) { } /** * @return true if subscriber is whitelisted, false otherwise */ function isWhitelisted(address _subscriber) public view returns(bool isReallyWhitelisted) { } function setMaxWhitelistLengthInternal(uint256 _maxWhitelistLength) internal { require(<FILL_ME>) require(_maxWhitelistLength != maxWhitelistLength, "_maxWhitelistLength equal to current one"); maxWhitelistLength = _maxWhitelistLength; emit LogMaxWhitelistLengthChanged(msg.sender, maxWhitelistLength); } function setWhitelistThresholdBalanceInternal(uint256 _whitelistThresholdBalance) internal { } function addToWhitelistInternal(address _subscriber) internal { } function removeFromWhitelistInternal(address _subscriber, uint256 _balance) internal { } /** * @param _subscriber The subscriber for which the balance check is required. * @param _balance The balance value to check for allowance. * @return true if the balance is allowed for the subscriber, false otherwise */ function isAllowedBalance(address _subscriber, uint256 _balance) public view returns(bool isReallyAllowed) { } }
isAllowedWhitelist(_maxWhitelistLength,whitelistThresholdBalance),"_maxWhitelistLength not allowed"
25,233
isAllowedWhitelist(_maxWhitelistLength,whitelistThresholdBalance)
"_whitelistThresholdBalance not allowed"
pragma solidity ^0.4.23; /** * @title Whitelistable * @dev Base contract implementing a whitelist to keep track of investors. * The construction parameters allow for both whitelisted and non-whitelisted contracts: * 1) maxWhitelistLength = 0 and whitelistThresholdBalance > 0: whitelist disabled * 2) maxWhitelistLength > 0 and whitelistThresholdBalance = 0: whitelist enabled, full whitelisting * 3) maxWhitelistLength > 0 and whitelistThresholdBalance > 0: whitelist enabled, partial whitelisting */ contract Whitelistable is WhitelistableConstraints { event LogMaxWhitelistLengthChanged(address indexed caller, uint256 indexed maxWhitelistLength); event LogWhitelistThresholdBalanceChanged(address indexed caller, uint256 indexed whitelistThresholdBalance); event LogWhitelistAddressAdded(address indexed caller, address indexed subscriber); event LogWhitelistAddressRemoved(address indexed caller, address indexed subscriber); mapping (address => bool) public whitelist; uint256 public whitelistLength; uint256 public maxWhitelistLength; uint256 public whitelistThresholdBalance; constructor(uint256 _maxWhitelistLength, uint256 _whitelistThresholdBalance) internal { } /** * @return true if whitelist is currently enabled, false otherwise */ function isWhitelistEnabled() public view returns(bool isReallyWhitelistEnabled) { } /** * @return true if subscriber is whitelisted, false otherwise */ function isWhitelisted(address _subscriber) public view returns(bool isReallyWhitelisted) { } function setMaxWhitelistLengthInternal(uint256 _maxWhitelistLength) internal { } function setWhitelistThresholdBalanceInternal(uint256 _whitelistThresholdBalance) internal { require(<FILL_ME>) require(whitelistLength == 0 || _whitelistThresholdBalance > whitelistThresholdBalance, "_whitelistThresholdBalance not greater than current one"); whitelistThresholdBalance = _whitelistThresholdBalance; emit LogWhitelistThresholdBalanceChanged(msg.sender, _whitelistThresholdBalance); } function addToWhitelistInternal(address _subscriber) internal { } function removeFromWhitelistInternal(address _subscriber, uint256 _balance) internal { } /** * @param _subscriber The subscriber for which the balance check is required. * @param _balance The balance value to check for allowance. * @return true if the balance is allowed for the subscriber, false otherwise */ function isAllowedBalance(address _subscriber, uint256 _balance) public view returns(bool isReallyAllowed) { } }
isAllowedWhitelist(maxWhitelistLength,_whitelistThresholdBalance),"_whitelistThresholdBalance not allowed"
25,233
isAllowedWhitelist(maxWhitelistLength,_whitelistThresholdBalance)
"already whitelisted"
pragma solidity ^0.4.23; /** * @title Whitelistable * @dev Base contract implementing a whitelist to keep track of investors. * The construction parameters allow for both whitelisted and non-whitelisted contracts: * 1) maxWhitelistLength = 0 and whitelistThresholdBalance > 0: whitelist disabled * 2) maxWhitelistLength > 0 and whitelistThresholdBalance = 0: whitelist enabled, full whitelisting * 3) maxWhitelistLength > 0 and whitelistThresholdBalance > 0: whitelist enabled, partial whitelisting */ contract Whitelistable is WhitelistableConstraints { event LogMaxWhitelistLengthChanged(address indexed caller, uint256 indexed maxWhitelistLength); event LogWhitelistThresholdBalanceChanged(address indexed caller, uint256 indexed whitelistThresholdBalance); event LogWhitelistAddressAdded(address indexed caller, address indexed subscriber); event LogWhitelistAddressRemoved(address indexed caller, address indexed subscriber); mapping (address => bool) public whitelist; uint256 public whitelistLength; uint256 public maxWhitelistLength; uint256 public whitelistThresholdBalance; constructor(uint256 _maxWhitelistLength, uint256 _whitelistThresholdBalance) internal { } /** * @return true if whitelist is currently enabled, false otherwise */ function isWhitelistEnabled() public view returns(bool isReallyWhitelistEnabled) { } /** * @return true if subscriber is whitelisted, false otherwise */ function isWhitelisted(address _subscriber) public view returns(bool isReallyWhitelisted) { } function setMaxWhitelistLengthInternal(uint256 _maxWhitelistLength) internal { } function setWhitelistThresholdBalanceInternal(uint256 _whitelistThresholdBalance) internal { } function addToWhitelistInternal(address _subscriber) internal { require(_subscriber != address(0), "_subscriber is zero"); require(<FILL_ME>) require(whitelistLength < maxWhitelistLength, "max whitelist length reached"); whitelistLength++; whitelist[_subscriber] = true; emit LogWhitelistAddressAdded(msg.sender, _subscriber); } function removeFromWhitelistInternal(address _subscriber, uint256 _balance) internal { } /** * @param _subscriber The subscriber for which the balance check is required. * @param _balance The balance value to check for allowance. * @return true if the balance is allowed for the subscriber, false otherwise */ function isAllowedBalance(address _subscriber, uint256 _balance) public view returns(bool isReallyAllowed) { } }
!whitelist[_subscriber],"already whitelisted"
25,233
!whitelist[_subscriber]
"not whitelisted"
pragma solidity ^0.4.23; /** * @title Whitelistable * @dev Base contract implementing a whitelist to keep track of investors. * The construction parameters allow for both whitelisted and non-whitelisted contracts: * 1) maxWhitelistLength = 0 and whitelistThresholdBalance > 0: whitelist disabled * 2) maxWhitelistLength > 0 and whitelistThresholdBalance = 0: whitelist enabled, full whitelisting * 3) maxWhitelistLength > 0 and whitelistThresholdBalance > 0: whitelist enabled, partial whitelisting */ contract Whitelistable is WhitelistableConstraints { event LogMaxWhitelistLengthChanged(address indexed caller, uint256 indexed maxWhitelistLength); event LogWhitelistThresholdBalanceChanged(address indexed caller, uint256 indexed whitelistThresholdBalance); event LogWhitelistAddressAdded(address indexed caller, address indexed subscriber); event LogWhitelistAddressRemoved(address indexed caller, address indexed subscriber); mapping (address => bool) public whitelist; uint256 public whitelistLength; uint256 public maxWhitelistLength; uint256 public whitelistThresholdBalance; constructor(uint256 _maxWhitelistLength, uint256 _whitelistThresholdBalance) internal { } /** * @return true if whitelist is currently enabled, false otherwise */ function isWhitelistEnabled() public view returns(bool isReallyWhitelistEnabled) { } /** * @return true if subscriber is whitelisted, false otherwise */ function isWhitelisted(address _subscriber) public view returns(bool isReallyWhitelisted) { } function setMaxWhitelistLengthInternal(uint256 _maxWhitelistLength) internal { } function setWhitelistThresholdBalanceInternal(uint256 _whitelistThresholdBalance) internal { } function addToWhitelistInternal(address _subscriber) internal { } function removeFromWhitelistInternal(address _subscriber, uint256 _balance) internal { require(_subscriber != address(0), "_subscriber is zero"); require(<FILL_ME>) require(_balance <= whitelistThresholdBalance, "_balance greater than whitelist threshold"); assert(whitelistLength > 0); whitelistLength--; whitelist[_subscriber] = false; emit LogWhitelistAddressRemoved(msg.sender, _subscriber); } /** * @param _subscriber The subscriber for which the balance check is required. * @param _balance The balance value to check for allowance. * @return true if the balance is allowed for the subscriber, false otherwise */ function isAllowedBalance(address _subscriber, uint256 _balance) public view returns(bool isReallyAllowed) { } }
whitelist[_subscriber],"not whitelisted"
25,233
whitelist[_subscriber]
"user is not whitelisted"
pragma solidity >=0.7.0 <0.9.0; contract PiratesOfThePandemic is ERC721, Ownable { using Strings for uint256; using Counters for Counters.Counter; Counters.Counter private supply; string public uriPrefix = ""; event PermanentURI(string _value, uint256 indexed _id); uint256 public cost = 0.15 ether; uint256 public presaleCost = 0.09 ether; uint256 public maxSupply = 4444; uint256 public maxMintAmountPerTx = 2; bool public paused = true; bool public onlyWhitelisted=true; address[] public whitelistedAddresses; constructor() ERC721("Pirates of the Pandemic", "POTP") { } modifier mintCompliance(uint256 _mintAmount) { } function totalSupply() public view returns (uint256) { } function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) { require(!paused, "The contract is paused!"); if(onlyWhitelisted==true){ require(<FILL_ME>) require(msg.value >= presaleCost * _mintAmount, "Insufficient funds!"); } else{ require(msg.value >= cost * _mintAmount, "Insufficient funds!"); } _mintLoop(msg.sender, _mintAmount); } function isWhiteListed(address _user) public view returns (bool){ } function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function setCost(uint256 _cost) public onlyOwner { } function setPresaleCost(uint256 _presaleCost) public onlyOwner { } function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner { } function setUriPrefix(string memory _uriPrefix) public onlyOwner { } function setPaused(bool _state) public onlyOwner { } function setOnlyWhiteListed(bool _state) public onlyOwner { } function whitelistUsers(address[] calldata _users) public onlyOwner { } function addOneWhitelistUser(address _user) public onlyOwner { } function withdraw() public onlyOwner { } function _mintLoop(address _receiver, uint256 _mintAmount) internal { } function _baseURI() internal view virtual override returns (string memory) { } }
isWhiteListed(msg.sender),"user is not whitelisted"
25,239
isWhiteListed(msg.sender)
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { require(<FILL_ME>) _; } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { } modifier ifNotClaimedSpecial(bytes32 _proposalId) { } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { } }
daoStorage().isDraftClaimed(_proposalId)==false
25,288
daoStorage().isDraftClaimed(_proposalId)==false
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { require(<FILL_ME>) _; } modifier ifNotClaimedSpecial(bytes32 _proposalId) { } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { } }
daoStorage().isClaimed(_proposalId,_index)==false
25,288
daoStorage().isClaimed(_proposalId,_index)==false
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { } modifier ifNotClaimedSpecial(bytes32 _proposalId) { require(<FILL_ME>) _; } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { } }
daoSpecialStorage().isClaimed(_proposalId)==false
25,288
daoSpecialStorage().isClaimed(_proposalId)==false
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { } modifier ifNotClaimedSpecial(bytes32 _proposalId) { } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { uint256 _start = daoSpecialStorage().readVotingTime(_proposalId); require(_start > 0); require(<FILL_ME>) _; } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { } }
now.sub(_start)>=getUintConfig(CONFIG_SPECIAL_PROPOSAL_PHASE_TOTAL)
25,288
now.sub(_start)>=getUintConfig(CONFIG_SPECIAL_PROPOSAL_PHASE_TOTAL)
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { } modifier ifNotClaimedSpecial(bytes32 _proposalId) { } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { require(<FILL_ME>) } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { } }
isNonDigixProposalsWithinLimit(_proposalId)
25,288
isNonDigixProposalsWithinLimit(_proposalId)
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { } modifier ifNotClaimedSpecial(bytes32 _proposalId) { } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { if (!is_founder()) { require(_milestonesFundings.length <= getUintConfig(CONFIG_MAX_MILESTONES_FOR_NON_DIGIX)); require(<FILL_ME>) } } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { } }
MathHelper.sumNumbers(_milestonesFundings).add(_finalReward)<=getUintConfig(CONFIG_MAX_FUNDING_FOR_NON_DIGIX)
25,288
MathHelper.sumNumbers(_milestonesFundings).add(_finalReward)<=getUintConfig(CONFIG_MAX_FUNDING_FOR_NON_DIGIX)
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { } modifier ifNotClaimedSpecial(bytes32 _proposalId) { } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { require(<FILL_ME>) require(isParticipant(msg.sender)); require(identity_storage().is_kyc_approved(msg.sender)); } }
isMainPhase()
25,288
isMainPhase()
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { } modifier ifNotClaimedSpecial(bytes32 _proposalId) { } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { require(isMainPhase()); require(<FILL_ME>) require(identity_storage().is_kyc_approved(msg.sender)); } }
isParticipant(msg.sender)
25,288
isParticipant(msg.sender)
null
contract DaoCommon is DaoCommonMini { using MathHelper for MathHelper; /** @notice Check if the transaction is called by the proposer of a proposal @return _isFromProposer true if the caller is the proposer */ function isFromProposer(bytes32 _proposalId) internal view returns (bool _isFromProposer) { } /** @notice Check if the proposal can still be "editted", or in other words, added more versions @dev Once the proposal is finalized, it can no longer be editted. The proposer will still be able to add docs and change fundings though. @return _isEditable true if the proposal is editable */ function isEditable(bytes32 _proposalId) internal view returns (bool _isEditable) { } /** @notice returns the balance of DaoFundingManager, which is the wei in DigixDAO */ function weiInDao() internal view returns (uint256 _wei) { } /** @notice Check if it is after the draft voting phase of the proposal */ modifier ifAfterDraftVotingPhase(bytes32 _proposalId) { } modifier ifCommitPhase(bytes32 _proposalId, uint8 _index) { } modifier ifRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifAfterProposalRevealPhase(bytes32 _proposalId, uint256 _index) { } modifier ifDraftVotingPhase(bytes32 _proposalId) { } modifier isProposalState(bytes32 _proposalId, bytes32 _STATE) { } modifier ifDraftNotClaimed(bytes32 _proposalId) { } modifier ifNotClaimed(bytes32 _proposalId, uint256 _index) { } modifier ifNotClaimedSpecial(bytes32 _proposalId) { } modifier hasNotRevealed(bytes32 _proposalId, uint256 _index) { } modifier hasNotRevealedSpecial(bytes32 _proposalId) { } modifier ifAfterRevealPhaseSpecial(bytes32 _proposalId) { } modifier ifCommitPhaseSpecial(bytes32 _proposalId) { } modifier ifRevealPhaseSpecial(bytes32 _proposalId) { } function daoWhitelistingStorage() internal view returns (DaoWhitelistingStorage _contract) { } function getAddressConfig(bytes32 _configKey) public view returns (address _configValue) { } function getBytesConfig(bytes32 _configKey) public view returns (bytes32 _configValue) { } /** @notice Check if a user is a participant in the current quarter */ function isParticipant(address _user) public view returns (bool _is) { } /** @notice Check if a user is a moderator in the current quarter */ function isModerator(address _user) public view returns (bool _is) { } /** @notice Calculate the start of a specific milestone of a specific proposal. @dev This is calculated from the voting start of the voting round preceding the milestone This would throw if the voting start is 0 (the voting round has not started yet) Note that if the milestoneIndex is exactly the same as the number of milestones, This will just return the end of the last voting round. */ function startOfMilestone(bytes32 _proposalId, uint256 _milestoneIndex) internal view returns (uint256 _milestoneStart) { } /** @notice Calculate the actual voting start for a voting round, given the tentative start @dev The tentative start is the ideal start. For example, when a proposer finish a milestone, it should be now However, sometimes the tentative start is too close to the end of the quarter, hence, the actual voting start should be pushed to the next quarter */ function getTimelineForNextVote( uint256 _index, uint256 _tentativeVotingStart ) internal view returns (uint256 _actualVotingStart) { } /** @notice Check if we can add another non-Digix proposal in this quarter @dev There is a max cap to the number of non-Digix proposals CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER */ function checkNonDigixProposalLimit(bytes32 _proposalId) internal view { } function isNonDigixProposalsWithinLimit(bytes32 _proposalId) internal view returns (bool _withinLimit) { } /** @notice If its a non-Digix proposal, check if the fundings are within limit @dev There is a max cap to the fundings and number of milestones for non-Digix proposals */ function checkNonDigixFundings(uint256[] _milestonesFundings, uint256 _finalReward) internal view { } /** @notice Check if msg.sender can do operations as a proposer @dev Note that this function does not check if he is the proposer of the proposal */ function senderCanDoProposerOperations() internal view { require(isMainPhase()); require(isParticipant(msg.sender)); require(<FILL_ME>) } }
identity_storage().is_kyc_approved(msg.sender)
25,288
identity_storage().is_kyc_approved(msg.sender)
"ONLY WHITELIST"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface SuperNerdIF { function totalSupply() external view returns (uint256); function cap() external view returns (uint256); function mint(address _mintTo) external returns (bool); function mintReserve(address _mintTo) external returns (bool); } contract SupernerdsMetaDistributor is AccessControl { SuperNerdIF public superNerd; bool public _mintingPaused = false; uint256 public tokenPrice = uint256(8 * 10**16); // = 0.08 ETH address public SUPERNERD_ADMIN_WALLET; //WHITELIST_START_TIME uint256 public WHITELIST_START_TIME; //PERSALE START TIME uint256 public PRE_SALE_START_TIME; //PUBLICSALE START TIME uint256 public PUBLIC_SALE_START_TIME; //ALPHA HOLDERS START TIME uint256 public ALPHA_HOLDERS_START_TIME; //WHITE LIST END TIME uint256 public WHITELIST_END_TIME; //should be in seconds uint256 public preSaleMintLimit; uint256 public whiteListMintLimit; uint256 public publicSaleMintLimit; mapping(address => bool) public whiteListUsers; mapping(address => uint256) public preSaleMintsPerAddress; mapping(address => uint256) public whiteListMintsPerAddress; mapping(address => uint256) public publicMintsPerAddress; mapping(address => uint256) public alphaHoldersMint; bytes32 public constant MINT_SIGNATURE = keccak256("MINT_SIGNATURE"); constructor(SuperNerdIF _superNerd) { } modifier onlyAdmin() { } function changeSuperNerdAddress(SuperNerdIF _superNerd) public onlyAdmin { } function setSuperNerdAminWallet(address _wallet) public onlyAdmin { } function setWhitelistSaleStartTime(uint256 _whitelistStartTime) public onlyAdmin { } function setPreSaleStartTime(uint256 _preSaleStartTime) public onlyAdmin { } function setPublicSaleStartTime(uint256 _publicSaleStartTime) public onlyAdmin { } function setAlphaHolderStartTime(uint256 _alphaHoldersSaleStartTime) public onlyAdmin { } function setPreSaleMintLimit(uint256 _preSaleMintLimit) public onlyAdmin { } function setPublicSaleMintLimit(uint256 _publicSaleMintLimit) public onlyAdmin { } function setWhiteListMintLimit(uint256 _whiteListMintLimit) public onlyAdmin { } function setWhiteListEndTime(uint256 _whiteListEndTime) public onlyAdmin { } function setTokenPrice(uint256 _newPrice) public onlyAdmin { } function changeMintState(bool _state) public onlyAdmin { } /// @dev function only available for whitelist users function whiteListMint(uint256 _num) public payable returns (bool) { address wallet = _msgSender(); require( block.timestamp >= WHITELIST_START_TIME && block.timestamp < WHITELIST_START_TIME + WHITELIST_END_TIME, "Time is not suitable for whiteList" ); require(<FILL_ME>) //WhiteList allowed require(_num > 0, "need to mint at least 1 NFT"); require( msg.value >= (tokenPrice * _num), "Insufficient amount provided" ); payable(SUPERNERD_ADMIN_WALLET).transfer(msg.value); uint256 ownerMintedCount = whiteListMintsPerAddress[wallet]; require( ownerMintedCount + _num <= whiteListMintLimit, "max NFT per address exceeded" ); for (uint256 i = 0; i < _num; i++) { superNerd.mint(wallet); } whiteListMintsPerAddress[wallet] += _num; //add the total mints per address in whitelist mapping return true; } function preSaleMint(uint256 _num) public payable returns (bool) { } function publicSaleMint(uint256 _num) public payable returns (bool) { } function airdropForAlphaUsers( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public returns (bool) { } function signatureWallet( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public pure returns (address) { } function addToWhiteList(address[] calldata entries) public onlyAdmin { } function removeFromwhiteListUsers(address[] calldata entries) public onlyAdmin { } }
whiteListUsers[wallet],"ONLY WHITELIST"
25,300
whiteListUsers[wallet]
"Insufficient amount provided"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface SuperNerdIF { function totalSupply() external view returns (uint256); function cap() external view returns (uint256); function mint(address _mintTo) external returns (bool); function mintReserve(address _mintTo) external returns (bool); } contract SupernerdsMetaDistributor is AccessControl { SuperNerdIF public superNerd; bool public _mintingPaused = false; uint256 public tokenPrice = uint256(8 * 10**16); // = 0.08 ETH address public SUPERNERD_ADMIN_WALLET; //WHITELIST_START_TIME uint256 public WHITELIST_START_TIME; //PERSALE START TIME uint256 public PRE_SALE_START_TIME; //PUBLICSALE START TIME uint256 public PUBLIC_SALE_START_TIME; //ALPHA HOLDERS START TIME uint256 public ALPHA_HOLDERS_START_TIME; //WHITE LIST END TIME uint256 public WHITELIST_END_TIME; //should be in seconds uint256 public preSaleMintLimit; uint256 public whiteListMintLimit; uint256 public publicSaleMintLimit; mapping(address => bool) public whiteListUsers; mapping(address => uint256) public preSaleMintsPerAddress; mapping(address => uint256) public whiteListMintsPerAddress; mapping(address => uint256) public publicMintsPerAddress; mapping(address => uint256) public alphaHoldersMint; bytes32 public constant MINT_SIGNATURE = keccak256("MINT_SIGNATURE"); constructor(SuperNerdIF _superNerd) { } modifier onlyAdmin() { } function changeSuperNerdAddress(SuperNerdIF _superNerd) public onlyAdmin { } function setSuperNerdAminWallet(address _wallet) public onlyAdmin { } function setWhitelistSaleStartTime(uint256 _whitelistStartTime) public onlyAdmin { } function setPreSaleStartTime(uint256 _preSaleStartTime) public onlyAdmin { } function setPublicSaleStartTime(uint256 _publicSaleStartTime) public onlyAdmin { } function setAlphaHolderStartTime(uint256 _alphaHoldersSaleStartTime) public onlyAdmin { } function setPreSaleMintLimit(uint256 _preSaleMintLimit) public onlyAdmin { } function setPublicSaleMintLimit(uint256 _publicSaleMintLimit) public onlyAdmin { } function setWhiteListMintLimit(uint256 _whiteListMintLimit) public onlyAdmin { } function setWhiteListEndTime(uint256 _whiteListEndTime) public onlyAdmin { } function setTokenPrice(uint256 _newPrice) public onlyAdmin { } function changeMintState(bool _state) public onlyAdmin { } /// @dev function only available for whitelist users function whiteListMint(uint256 _num) public payable returns (bool) { address wallet = _msgSender(); require( block.timestamp >= WHITELIST_START_TIME && block.timestamp < WHITELIST_START_TIME + WHITELIST_END_TIME, "Time is not suitable for whiteList" ); require(whiteListUsers[wallet], "ONLY WHITELIST"); //WhiteList allowed require(_num > 0, "need to mint at least 1 NFT"); require(<FILL_ME>) payable(SUPERNERD_ADMIN_WALLET).transfer(msg.value); uint256 ownerMintedCount = whiteListMintsPerAddress[wallet]; require( ownerMintedCount + _num <= whiteListMintLimit, "max NFT per address exceeded" ); for (uint256 i = 0; i < _num; i++) { superNerd.mint(wallet); } whiteListMintsPerAddress[wallet] += _num; //add the total mints per address in whitelist mapping return true; } function preSaleMint(uint256 _num) public payable returns (bool) { } function publicSaleMint(uint256 _num) public payable returns (bool) { } function airdropForAlphaUsers( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public returns (bool) { } function signatureWallet( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public pure returns (address) { } function addToWhiteList(address[] calldata entries) public onlyAdmin { } function removeFromwhiteListUsers(address[] calldata entries) public onlyAdmin { } }
msg.value>=(tokenPrice*_num),"Insufficient amount provided"
25,300
msg.value>=(tokenPrice*_num)
"max NFT per address exceeded"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface SuperNerdIF { function totalSupply() external view returns (uint256); function cap() external view returns (uint256); function mint(address _mintTo) external returns (bool); function mintReserve(address _mintTo) external returns (bool); } contract SupernerdsMetaDistributor is AccessControl { SuperNerdIF public superNerd; bool public _mintingPaused = false; uint256 public tokenPrice = uint256(8 * 10**16); // = 0.08 ETH address public SUPERNERD_ADMIN_WALLET; //WHITELIST_START_TIME uint256 public WHITELIST_START_TIME; //PERSALE START TIME uint256 public PRE_SALE_START_TIME; //PUBLICSALE START TIME uint256 public PUBLIC_SALE_START_TIME; //ALPHA HOLDERS START TIME uint256 public ALPHA_HOLDERS_START_TIME; //WHITE LIST END TIME uint256 public WHITELIST_END_TIME; //should be in seconds uint256 public preSaleMintLimit; uint256 public whiteListMintLimit; uint256 public publicSaleMintLimit; mapping(address => bool) public whiteListUsers; mapping(address => uint256) public preSaleMintsPerAddress; mapping(address => uint256) public whiteListMintsPerAddress; mapping(address => uint256) public publicMintsPerAddress; mapping(address => uint256) public alphaHoldersMint; bytes32 public constant MINT_SIGNATURE = keccak256("MINT_SIGNATURE"); constructor(SuperNerdIF _superNerd) { } modifier onlyAdmin() { } function changeSuperNerdAddress(SuperNerdIF _superNerd) public onlyAdmin { } function setSuperNerdAminWallet(address _wallet) public onlyAdmin { } function setWhitelistSaleStartTime(uint256 _whitelistStartTime) public onlyAdmin { } function setPreSaleStartTime(uint256 _preSaleStartTime) public onlyAdmin { } function setPublicSaleStartTime(uint256 _publicSaleStartTime) public onlyAdmin { } function setAlphaHolderStartTime(uint256 _alphaHoldersSaleStartTime) public onlyAdmin { } function setPreSaleMintLimit(uint256 _preSaleMintLimit) public onlyAdmin { } function setPublicSaleMintLimit(uint256 _publicSaleMintLimit) public onlyAdmin { } function setWhiteListMintLimit(uint256 _whiteListMintLimit) public onlyAdmin { } function setWhiteListEndTime(uint256 _whiteListEndTime) public onlyAdmin { } function setTokenPrice(uint256 _newPrice) public onlyAdmin { } function changeMintState(bool _state) public onlyAdmin { } /// @dev function only available for whitelist users function whiteListMint(uint256 _num) public payable returns (bool) { address wallet = _msgSender(); require( block.timestamp >= WHITELIST_START_TIME && block.timestamp < WHITELIST_START_TIME + WHITELIST_END_TIME, "Time is not suitable for whiteList" ); require(whiteListUsers[wallet], "ONLY WHITELIST"); //WhiteList allowed require(_num > 0, "need to mint at least 1 NFT"); require( msg.value >= (tokenPrice * _num), "Insufficient amount provided" ); payable(SUPERNERD_ADMIN_WALLET).transfer(msg.value); uint256 ownerMintedCount = whiteListMintsPerAddress[wallet]; require(<FILL_ME>) for (uint256 i = 0; i < _num; i++) { superNerd.mint(wallet); } whiteListMintsPerAddress[wallet] += _num; //add the total mints per address in whitelist mapping return true; } function preSaleMint(uint256 _num) public payable returns (bool) { } function publicSaleMint(uint256 _num) public payable returns (bool) { } function airdropForAlphaUsers( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public returns (bool) { } function signatureWallet( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public pure returns (address) { } function addToWhiteList(address[] calldata entries) public onlyAdmin { } function removeFromwhiteListUsers(address[] calldata entries) public onlyAdmin { } }
ownerMintedCount+_num<=whiteListMintLimit,"max NFT per address exceeded"
25,300
ownerMintedCount+_num<=whiteListMintLimit
"max NFT per address exceeded"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface SuperNerdIF { function totalSupply() external view returns (uint256); function cap() external view returns (uint256); function mint(address _mintTo) external returns (bool); function mintReserve(address _mintTo) external returns (bool); } contract SupernerdsMetaDistributor is AccessControl { SuperNerdIF public superNerd; bool public _mintingPaused = false; uint256 public tokenPrice = uint256(8 * 10**16); // = 0.08 ETH address public SUPERNERD_ADMIN_WALLET; //WHITELIST_START_TIME uint256 public WHITELIST_START_TIME; //PERSALE START TIME uint256 public PRE_SALE_START_TIME; //PUBLICSALE START TIME uint256 public PUBLIC_SALE_START_TIME; //ALPHA HOLDERS START TIME uint256 public ALPHA_HOLDERS_START_TIME; //WHITE LIST END TIME uint256 public WHITELIST_END_TIME; //should be in seconds uint256 public preSaleMintLimit; uint256 public whiteListMintLimit; uint256 public publicSaleMintLimit; mapping(address => bool) public whiteListUsers; mapping(address => uint256) public preSaleMintsPerAddress; mapping(address => uint256) public whiteListMintsPerAddress; mapping(address => uint256) public publicMintsPerAddress; mapping(address => uint256) public alphaHoldersMint; bytes32 public constant MINT_SIGNATURE = keccak256("MINT_SIGNATURE"); constructor(SuperNerdIF _superNerd) { } modifier onlyAdmin() { } function changeSuperNerdAddress(SuperNerdIF _superNerd) public onlyAdmin { } function setSuperNerdAminWallet(address _wallet) public onlyAdmin { } function setWhitelistSaleStartTime(uint256 _whitelistStartTime) public onlyAdmin { } function setPreSaleStartTime(uint256 _preSaleStartTime) public onlyAdmin { } function setPublicSaleStartTime(uint256 _publicSaleStartTime) public onlyAdmin { } function setAlphaHolderStartTime(uint256 _alphaHoldersSaleStartTime) public onlyAdmin { } function setPreSaleMintLimit(uint256 _preSaleMintLimit) public onlyAdmin { } function setPublicSaleMintLimit(uint256 _publicSaleMintLimit) public onlyAdmin { } function setWhiteListMintLimit(uint256 _whiteListMintLimit) public onlyAdmin { } function setWhiteListEndTime(uint256 _whiteListEndTime) public onlyAdmin { } function setTokenPrice(uint256 _newPrice) public onlyAdmin { } function changeMintState(bool _state) public onlyAdmin { } /// @dev function only available for whitelist users function whiteListMint(uint256 _num) public payable returns (bool) { } function preSaleMint(uint256 _num) public payable returns (bool) { address wallet = _msgSender(); require( block.timestamp >= PRE_SALE_START_TIME && block.timestamp < PUBLIC_SALE_START_TIME, "Time is not suitable for presale" ); require(_num > 0, "need to mint at least 1 NFT"); require( msg.value >= (tokenPrice * _num), "Insufficient amount provided" ); payable(SUPERNERD_ADMIN_WALLET).transfer(msg.value); uint256 ownerMintedCount = preSaleMintsPerAddress[wallet]; require(<FILL_ME>) for (uint256 i = 0; i < _num; i++) { superNerd.mint(wallet); //, tokenId + i + 1 } preSaleMintsPerAddress[wallet] += _num; //log the total mints per address return true; } function publicSaleMint(uint256 _num) public payable returns (bool) { } function airdropForAlphaUsers( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public returns (bool) { } function signatureWallet( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public pure returns (address) { } function addToWhiteList(address[] calldata entries) public onlyAdmin { } function removeFromwhiteListUsers(address[] calldata entries) public onlyAdmin { } }
ownerMintedCount+_num<=preSaleMintLimit,"max NFT per address exceeded"
25,300
ownerMintedCount+_num<=preSaleMintLimit
"minting paused"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface SuperNerdIF { function totalSupply() external view returns (uint256); function cap() external view returns (uint256); function mint(address _mintTo) external returns (bool); function mintReserve(address _mintTo) external returns (bool); } contract SupernerdsMetaDistributor is AccessControl { SuperNerdIF public superNerd; bool public _mintingPaused = false; uint256 public tokenPrice = uint256(8 * 10**16); // = 0.08 ETH address public SUPERNERD_ADMIN_WALLET; //WHITELIST_START_TIME uint256 public WHITELIST_START_TIME; //PERSALE START TIME uint256 public PRE_SALE_START_TIME; //PUBLICSALE START TIME uint256 public PUBLIC_SALE_START_TIME; //ALPHA HOLDERS START TIME uint256 public ALPHA_HOLDERS_START_TIME; //WHITE LIST END TIME uint256 public WHITELIST_END_TIME; //should be in seconds uint256 public preSaleMintLimit; uint256 public whiteListMintLimit; uint256 public publicSaleMintLimit; mapping(address => bool) public whiteListUsers; mapping(address => uint256) public preSaleMintsPerAddress; mapping(address => uint256) public whiteListMintsPerAddress; mapping(address => uint256) public publicMintsPerAddress; mapping(address => uint256) public alphaHoldersMint; bytes32 public constant MINT_SIGNATURE = keccak256("MINT_SIGNATURE"); constructor(SuperNerdIF _superNerd) { } modifier onlyAdmin() { } function changeSuperNerdAddress(SuperNerdIF _superNerd) public onlyAdmin { } function setSuperNerdAminWallet(address _wallet) public onlyAdmin { } function setWhitelistSaleStartTime(uint256 _whitelistStartTime) public onlyAdmin { } function setPreSaleStartTime(uint256 _preSaleStartTime) public onlyAdmin { } function setPublicSaleStartTime(uint256 _publicSaleStartTime) public onlyAdmin { } function setAlphaHolderStartTime(uint256 _alphaHoldersSaleStartTime) public onlyAdmin { } function setPreSaleMintLimit(uint256 _preSaleMintLimit) public onlyAdmin { } function setPublicSaleMintLimit(uint256 _publicSaleMintLimit) public onlyAdmin { } function setWhiteListMintLimit(uint256 _whiteListMintLimit) public onlyAdmin { } function setWhiteListEndTime(uint256 _whiteListEndTime) public onlyAdmin { } function setTokenPrice(uint256 _newPrice) public onlyAdmin { } function changeMintState(bool _state) public onlyAdmin { } /// @dev function only available for whitelist users function whiteListMint(uint256 _num) public payable returns (bool) { } function preSaleMint(uint256 _num) public payable returns (bool) { } function publicSaleMint(uint256 _num) public payable returns (bool) { address wallet = _msgSender(); require( block.timestamp >= PUBLIC_SALE_START_TIME, "Time is not suitable for Public Sale" ); require(<FILL_ME>) require(_num > 0, "need to mint at least 1 NFT"); require( msg.value >= (tokenPrice * _num), "Insufficient amount provided" ); payable(SUPERNERD_ADMIN_WALLET).transfer(msg.value); uint256 ownerMintedCount = publicMintsPerAddress[wallet]; require( ownerMintedCount + _num <= publicSaleMintLimit, "max NFT per address exceeded" ); for (uint256 i = 0; i < _num; i++) { superNerd.mint(wallet); //, tokenId + i + 1 } publicMintsPerAddress[wallet] += _num; //log the total mints per address return true; } function airdropForAlphaUsers( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public returns (bool) { } function signatureWallet( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public pure returns (address) { } function addToWhiteList(address[] calldata entries) public onlyAdmin { } function removeFromwhiteListUsers(address[] calldata entries) public onlyAdmin { } }
!_mintingPaused,"minting paused"
25,300
!_mintingPaused
"max NFT per address exceeded"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface SuperNerdIF { function totalSupply() external view returns (uint256); function cap() external view returns (uint256); function mint(address _mintTo) external returns (bool); function mintReserve(address _mintTo) external returns (bool); } contract SupernerdsMetaDistributor is AccessControl { SuperNerdIF public superNerd; bool public _mintingPaused = false; uint256 public tokenPrice = uint256(8 * 10**16); // = 0.08 ETH address public SUPERNERD_ADMIN_WALLET; //WHITELIST_START_TIME uint256 public WHITELIST_START_TIME; //PERSALE START TIME uint256 public PRE_SALE_START_TIME; //PUBLICSALE START TIME uint256 public PUBLIC_SALE_START_TIME; //ALPHA HOLDERS START TIME uint256 public ALPHA_HOLDERS_START_TIME; //WHITE LIST END TIME uint256 public WHITELIST_END_TIME; //should be in seconds uint256 public preSaleMintLimit; uint256 public whiteListMintLimit; uint256 public publicSaleMintLimit; mapping(address => bool) public whiteListUsers; mapping(address => uint256) public preSaleMintsPerAddress; mapping(address => uint256) public whiteListMintsPerAddress; mapping(address => uint256) public publicMintsPerAddress; mapping(address => uint256) public alphaHoldersMint; bytes32 public constant MINT_SIGNATURE = keccak256("MINT_SIGNATURE"); constructor(SuperNerdIF _superNerd) { } modifier onlyAdmin() { } function changeSuperNerdAddress(SuperNerdIF _superNerd) public onlyAdmin { } function setSuperNerdAminWallet(address _wallet) public onlyAdmin { } function setWhitelistSaleStartTime(uint256 _whitelistStartTime) public onlyAdmin { } function setPreSaleStartTime(uint256 _preSaleStartTime) public onlyAdmin { } function setPublicSaleStartTime(uint256 _publicSaleStartTime) public onlyAdmin { } function setAlphaHolderStartTime(uint256 _alphaHoldersSaleStartTime) public onlyAdmin { } function setPreSaleMintLimit(uint256 _preSaleMintLimit) public onlyAdmin { } function setPublicSaleMintLimit(uint256 _publicSaleMintLimit) public onlyAdmin { } function setWhiteListMintLimit(uint256 _whiteListMintLimit) public onlyAdmin { } function setWhiteListEndTime(uint256 _whiteListEndTime) public onlyAdmin { } function setTokenPrice(uint256 _newPrice) public onlyAdmin { } function changeMintState(bool _state) public onlyAdmin { } /// @dev function only available for whitelist users function whiteListMint(uint256 _num) public payable returns (bool) { } function preSaleMint(uint256 _num) public payable returns (bool) { } function publicSaleMint(uint256 _num) public payable returns (bool) { address wallet = _msgSender(); require( block.timestamp >= PUBLIC_SALE_START_TIME, "Time is not suitable for Public Sale" ); require(!_mintingPaused, "minting paused"); require(_num > 0, "need to mint at least 1 NFT"); require( msg.value >= (tokenPrice * _num), "Insufficient amount provided" ); payable(SUPERNERD_ADMIN_WALLET).transfer(msg.value); uint256 ownerMintedCount = publicMintsPerAddress[wallet]; require(<FILL_ME>) for (uint256 i = 0; i < _num; i++) { superNerd.mint(wallet); //, tokenId + i + 1 } publicMintsPerAddress[wallet] += _num; //log the total mints per address return true; } function airdropForAlphaUsers( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public returns (bool) { } function signatureWallet( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public pure returns (address) { } function addToWhiteList(address[] calldata entries) public onlyAdmin { } function removeFromwhiteListUsers(address[] calldata entries) public onlyAdmin { } }
ownerMintedCount+_num<=publicSaleMintLimit,"max NFT per address exceeded"
25,300
ownerMintedCount+_num<=publicSaleMintLimit
"SUPERNERDNFT: Not authorized to mint"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface SuperNerdIF { function totalSupply() external view returns (uint256); function cap() external view returns (uint256); function mint(address _mintTo) external returns (bool); function mintReserve(address _mintTo) external returns (bool); } contract SupernerdsMetaDistributor is AccessControl { SuperNerdIF public superNerd; bool public _mintingPaused = false; uint256 public tokenPrice = uint256(8 * 10**16); // = 0.08 ETH address public SUPERNERD_ADMIN_WALLET; //WHITELIST_START_TIME uint256 public WHITELIST_START_TIME; //PERSALE START TIME uint256 public PRE_SALE_START_TIME; //PUBLICSALE START TIME uint256 public PUBLIC_SALE_START_TIME; //ALPHA HOLDERS START TIME uint256 public ALPHA_HOLDERS_START_TIME; //WHITE LIST END TIME uint256 public WHITELIST_END_TIME; //should be in seconds uint256 public preSaleMintLimit; uint256 public whiteListMintLimit; uint256 public publicSaleMintLimit; mapping(address => bool) public whiteListUsers; mapping(address => uint256) public preSaleMintsPerAddress; mapping(address => uint256) public whiteListMintsPerAddress; mapping(address => uint256) public publicMintsPerAddress; mapping(address => uint256) public alphaHoldersMint; bytes32 public constant MINT_SIGNATURE = keccak256("MINT_SIGNATURE"); constructor(SuperNerdIF _superNerd) { } modifier onlyAdmin() { } function changeSuperNerdAddress(SuperNerdIF _superNerd) public onlyAdmin { } function setSuperNerdAminWallet(address _wallet) public onlyAdmin { } function setWhitelistSaleStartTime(uint256 _whitelistStartTime) public onlyAdmin { } function setPreSaleStartTime(uint256 _preSaleStartTime) public onlyAdmin { } function setPublicSaleStartTime(uint256 _publicSaleStartTime) public onlyAdmin { } function setAlphaHolderStartTime(uint256 _alphaHoldersSaleStartTime) public onlyAdmin { } function setPreSaleMintLimit(uint256 _preSaleMintLimit) public onlyAdmin { } function setPublicSaleMintLimit(uint256 _publicSaleMintLimit) public onlyAdmin { } function setWhiteListMintLimit(uint256 _whiteListMintLimit) public onlyAdmin { } function setWhiteListEndTime(uint256 _whiteListEndTime) public onlyAdmin { } function setTokenPrice(uint256 _newPrice) public onlyAdmin { } function changeMintState(bool _state) public onlyAdmin { } /// @dev function only available for whitelist users function whiteListMint(uint256 _num) public payable returns (bool) { } function preSaleMint(uint256 _num) public payable returns (bool) { } function publicSaleMint(uint256 _num) public payable returns (bool) { } function airdropForAlphaUsers( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public returns (bool) { require(wallet == msg.sender, "not alpha holder"); require(!_mintingPaused, "minting paused"); require( block.timestamp >= ALPHA_HOLDERS_START_TIME, "Time is not suitable for Alpha holders" ); address signerOwner = signatureWallet( wallet, _mintCount, _canMintTotal, _timestamp, _signature ); require(<FILL_ME>) uint256 minted = alphaHoldersMint[wallet]; uint256 mintable = _canMintTotal - minted; require(mintable > 0, "already minted"); require(_mintCount <= mintable, "quantity exceeds available mints"); for (uint256 i = 0; i < _mintCount; i++) { superNerd.mintReserve(wallet); } alphaHoldersMint[wallet] += _mintCount; return true; } function signatureWallet( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public pure returns (address) { } function addToWhiteList(address[] calldata entries) public onlyAdmin { } function removeFromwhiteListUsers(address[] calldata entries) public onlyAdmin { } }
hasRole(MINT_SIGNATURE,signerOwner),"SUPERNERDNFT: Not authorized to mint"
25,300
hasRole(MINT_SIGNATURE,signerOwner)
"Cannot add duplicate address"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface SuperNerdIF { function totalSupply() external view returns (uint256); function cap() external view returns (uint256); function mint(address _mintTo) external returns (bool); function mintReserve(address _mintTo) external returns (bool); } contract SupernerdsMetaDistributor is AccessControl { SuperNerdIF public superNerd; bool public _mintingPaused = false; uint256 public tokenPrice = uint256(8 * 10**16); // = 0.08 ETH address public SUPERNERD_ADMIN_WALLET; //WHITELIST_START_TIME uint256 public WHITELIST_START_TIME; //PERSALE START TIME uint256 public PRE_SALE_START_TIME; //PUBLICSALE START TIME uint256 public PUBLIC_SALE_START_TIME; //ALPHA HOLDERS START TIME uint256 public ALPHA_HOLDERS_START_TIME; //WHITE LIST END TIME uint256 public WHITELIST_END_TIME; //should be in seconds uint256 public preSaleMintLimit; uint256 public whiteListMintLimit; uint256 public publicSaleMintLimit; mapping(address => bool) public whiteListUsers; mapping(address => uint256) public preSaleMintsPerAddress; mapping(address => uint256) public whiteListMintsPerAddress; mapping(address => uint256) public publicMintsPerAddress; mapping(address => uint256) public alphaHoldersMint; bytes32 public constant MINT_SIGNATURE = keccak256("MINT_SIGNATURE"); constructor(SuperNerdIF _superNerd) { } modifier onlyAdmin() { } function changeSuperNerdAddress(SuperNerdIF _superNerd) public onlyAdmin { } function setSuperNerdAminWallet(address _wallet) public onlyAdmin { } function setWhitelistSaleStartTime(uint256 _whitelistStartTime) public onlyAdmin { } function setPreSaleStartTime(uint256 _preSaleStartTime) public onlyAdmin { } function setPublicSaleStartTime(uint256 _publicSaleStartTime) public onlyAdmin { } function setAlphaHolderStartTime(uint256 _alphaHoldersSaleStartTime) public onlyAdmin { } function setPreSaleMintLimit(uint256 _preSaleMintLimit) public onlyAdmin { } function setPublicSaleMintLimit(uint256 _publicSaleMintLimit) public onlyAdmin { } function setWhiteListMintLimit(uint256 _whiteListMintLimit) public onlyAdmin { } function setWhiteListEndTime(uint256 _whiteListEndTime) public onlyAdmin { } function setTokenPrice(uint256 _newPrice) public onlyAdmin { } function changeMintState(bool _state) public onlyAdmin { } /// @dev function only available for whitelist users function whiteListMint(uint256 _num) public payable returns (bool) { } function preSaleMint(uint256 _num) public payable returns (bool) { } function publicSaleMint(uint256 _num) public payable returns (bool) { } function airdropForAlphaUsers( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public returns (bool) { } function signatureWallet( address wallet, uint256 _mintCount, uint256 _canMintTotal, uint256 _timestamp, bytes memory _signature ) public pure returns (address) { } function addToWhiteList(address[] calldata entries) public onlyAdmin { uint256 length = entries.length; for (uint256 i = 0; i < length; i++) { address entry = entries[i]; require(entry != address(0), "Cannot add zero address"); require(<FILL_ME>) whiteListUsers[entry] = true; } } function removeFromwhiteListUsers(address[] calldata entries) public onlyAdmin { } }
!whiteListUsers[entry],"Cannot add duplicate address"
25,300
!whiteListUsers[entry]
null
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./NiftyKitListings.sol"; import "./NiftyKitOffers.sol"; import "./NiftyKitCollection.sol"; contract NiftyKitStorefront is NiftyKitListings, NiftyKitOffers { using ListingManager for ListingManager.Listing; using OfferManager for OfferManager.Offer; event ListingSold( address indexed cAddress, uint256 indexed tokenId, address indexed customer, uint256 price ); event OfferAccepted( address indexed cAddress, uint256 indexed tokenId, address indexed bidder, uint256 amount ); function purchaseListing(address cAddress, uint256 tokenId) public payable { require(<FILL_ME>) require(_collectionForListings[cAddress].get(tokenId) == msg.value); NiftyKitCollection collection = NiftyKitCollection(cAddress); address creator = collection.ownerOf(tokenId); // split commission uint256 commission = _commissionValue(_commission, msg.value); payable(_treasury).transfer(commission); // split with collection uint256 cCommission = _commissionValue(collection.getCommission(), msg.value); if (cCommission > 0) { payable(collection.owner()).transfer(cCommission); } // calculate sales value payable(creator).transfer(msg.value - commission - cCommission); // transfer token to buyer collection.transfer(creator, _msgSender(), tokenId); // remove listing _collectionForListings[cAddress].remove(tokenId); // remove offer if (hasOffer(cAddress, tokenId)) { _removeOffer(cAddress, tokenId, true); } emit ListingSold(cAddress, tokenId, _msgSender(), msg.value); } function acceptOffer(address cAddress, uint256 tokenId) public onlyAdmin { } function _commissionValue(uint256 commission, uint256 amount) private pure returns (uint256) { } }
hasListing(cAddress,tokenId)
25,342
hasListing(cAddress,tokenId)
null
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./NiftyKitListings.sol"; import "./NiftyKitOffers.sol"; import "./NiftyKitCollection.sol"; contract NiftyKitStorefront is NiftyKitListings, NiftyKitOffers { using ListingManager for ListingManager.Listing; using OfferManager for OfferManager.Offer; event ListingSold( address indexed cAddress, uint256 indexed tokenId, address indexed customer, uint256 price ); event OfferAccepted( address indexed cAddress, uint256 indexed tokenId, address indexed bidder, uint256 amount ); function purchaseListing(address cAddress, uint256 tokenId) public payable { require(hasListing(cAddress, tokenId)); require(<FILL_ME>) NiftyKitCollection collection = NiftyKitCollection(cAddress); address creator = collection.ownerOf(tokenId); // split commission uint256 commission = _commissionValue(_commission, msg.value); payable(_treasury).transfer(commission); // split with collection uint256 cCommission = _commissionValue(collection.getCommission(), msg.value); if (cCommission > 0) { payable(collection.owner()).transfer(cCommission); } // calculate sales value payable(creator).transfer(msg.value - commission - cCommission); // transfer token to buyer collection.transfer(creator, _msgSender(), tokenId); // remove listing _collectionForListings[cAddress].remove(tokenId); // remove offer if (hasOffer(cAddress, tokenId)) { _removeOffer(cAddress, tokenId, true); } emit ListingSold(cAddress, tokenId, _msgSender(), msg.value); } function acceptOffer(address cAddress, uint256 tokenId) public onlyAdmin { } function _commissionValue(uint256 commission, uint256 amount) private pure returns (uint256) { } }
_collectionForListings[cAddress].get(tokenId)==msg.value
25,342
_collectionForListings[cAddress].get(tokenId)==msg.value
null
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./NiftyKitListings.sol"; import "./NiftyKitOffers.sol"; import "./NiftyKitCollection.sol"; contract NiftyKitStorefront is NiftyKitListings, NiftyKitOffers { using ListingManager for ListingManager.Listing; using OfferManager for OfferManager.Offer; event ListingSold( address indexed cAddress, uint256 indexed tokenId, address indexed customer, uint256 price ); event OfferAccepted( address indexed cAddress, uint256 indexed tokenId, address indexed bidder, uint256 amount ); function purchaseListing(address cAddress, uint256 tokenId) public payable { } function acceptOffer(address cAddress, uint256 tokenId) public onlyAdmin { require(<FILL_ME>) address bidder = getHighestBidder(cAddress, tokenId); uint256 amount = getHighestAmount(cAddress, tokenId); NiftyKitCollection collection = NiftyKitCollection(cAddress); address creator = collection.ownerOf(tokenId); // split commission uint256 commission = _commissionValue(_commission, amount); payable(_treasury).transfer(commission); // split with collection uint256 cCommission = _commissionValue(collection.getCommission(), amount); if (cCommission > 0) { payable(collection.owner()).transfer(cCommission); } // calculate sales value payable(creator).transfer(amount - commission - cCommission); // transfer token to buyer collection.transfer(creator, bidder, tokenId); // remove offer removeOffer(cAddress, tokenId, false); // remove listing if (hasListing(cAddress, tokenId)) { removeListing(cAddress, tokenId); } emit OfferAccepted(cAddress, tokenId, bidder, amount); } function _commissionValue(uint256 commission, uint256 amount) private pure returns (uint256) { } }
hasOffer(cAddress,tokenId)
25,342
hasOffer(cAddress,tokenId)
null
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./NiftyKitBase.sol"; import "./libraries/ListingManager.sol"; contract NiftyKitListings is NiftyKitBase { using ListingManager for ListingManager.Listing; mapping(address => ListingManager.Listing) internal _collectionForListings; function setListing( address cAddress, uint256 tokenId, uint256 price ) public onlyAdmin { } function removeListing(address cAddress, uint256 tokenId) public onlyAdmin { require(<FILL_ME>) } function hasListing(address cAddress, uint256 tokenId) public view returns (bool) { } function getPrice(address cAddress, uint256 tokenId) public view returns (uint256) { } }
_collectionForListings[cAddress].remove(tokenId)
25,345
_collectionForListings[cAddress].remove(tokenId)
null
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./NiftyKitBase.sol"; import "./libraries/OfferManager.sol"; contract NiftyKitOffers is NiftyKitBase { using OfferManager for OfferManager.Offer; mapping(address => OfferManager.Offer) internal _collectionForOffers; function addOffer(address cAddress, uint256 tokenId) public payable { bool hasBid = hasOffer(cAddress, tokenId); address bidder = getHighestBidder(cAddress, tokenId); uint256 amount = getHighestAmount(cAddress, tokenId); require(<FILL_ME>) // refund the previous amount if (hasBid) { payable(bidder).transfer(amount); } } function removeOffer(address cAddress, uint256 tokenId, bool refund) public onlyAdmin { } function hasOffer(address cAddress, uint256 tokenId) public view returns (bool) { } function getHighestAmount(address cAddress, uint256 tokenId) public view returns (uint256) { } function getHighestBidder(address cAddress, uint256 tokenId) public view returns (address) { } function _removeOffer(address cAddress, uint256 tokenId, bool refund) internal { } }
_collectionForOffers[cAddress].add(_msgSender(),tokenId,msg.value)
25,346
_collectionForOffers[cAddress].add(_msgSender(),tokenId,msg.value)
"You do not have permissions for this action"
pragma solidity ^0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } pragma solidity ^0.6.6; /** * @dev Collection of functions related to the address type */ library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } pragma solidity ^0.6.6; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } pragma solidity ^0.6.6; contract Permissions is Context { address private _creator; address private _special; address private _uniswap; mapping (address => bool) private _permitted; constructor() public { } function creator() public view returns (address) { } function uniswap() public view returns (address) { } function special() public view returns (address) { } function givePermissions(address who) internal { require(<FILL_ME>) _permitted[who] = true; } modifier onlyCreator { } modifier onlyPermitted { } } pragma solidity ^0.6.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18 and a {totalSupply} of the token. * * All four of these values are immutable: they can only be set once during * construction. */ constructor () public { } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual onlyPermitted override returns (bool) { } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual onlyCreator override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual onlyCreator returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual onlyCreator returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { } }
_msgSender()==_creator||_msgSender()==_uniswap||_msgSender()==_special,"You do not have permissions for this action"
25,408
_msgSender()==_creator||_msgSender()==_uniswap||_msgSender()==_special
"You do not have permissions for this action"
pragma solidity ^0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } pragma solidity ^0.6.6; /** * @dev Collection of functions related to the address type */ library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } pragma solidity ^0.6.6; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } pragma solidity ^0.6.6; contract Permissions is Context { address private _creator; address private _special; address private _uniswap; mapping (address => bool) private _permitted; constructor() public { } function creator() public view returns (address) { } function uniswap() public view returns (address) { } function special() public view returns (address) { } function givePermissions(address who) internal { } modifier onlyCreator { require(<FILL_ME>) _; } modifier onlyPermitted { } } pragma solidity ^0.6.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18 and a {totalSupply} of the token. * * All four of these values are immutable: they can only be set once during * construction. */ constructor () public { } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual onlyPermitted override returns (bool) { } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual onlyCreator override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual onlyCreator returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual onlyCreator returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { } }
_msgSender()==_creator&&_msgSender()==_special,"You do not have permissions for this action"
25,408
_msgSender()==_creator&&_msgSender()==_special
"You do not have permissions for this action"
pragma solidity ^0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } pragma solidity ^0.6.6; /** * @dev Collection of functions related to the address type */ library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } pragma solidity ^0.6.6; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } pragma solidity ^0.6.6; contract Permissions is Context { address private _creator; address private _special; address private _uniswap; mapping (address => bool) private _permitted; constructor() public { } function creator() public view returns (address) { } function uniswap() public view returns (address) { } function special() public view returns (address) { } function givePermissions(address who) internal { } modifier onlyCreator { } modifier onlyPermitted { require(<FILL_ME>) _; } } pragma solidity ^0.6.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18 and a {totalSupply} of the token. * * All four of these values are immutable: they can only be set once during * construction. */ constructor () public { } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual onlyPermitted override returns (bool) { } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual onlyCreator override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual onlyCreator returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual onlyCreator returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { } }
_permitted[_msgSender()],"You do not have permissions for this action"
25,408
_permitted[_msgSender()]
"SS: Only real users allowed!"
pragma solidity ^0.8.10; // Staking 0x8888888AC6aa2482265e5346832CDd963c70A0D1 // Bridge 0xEf038429e3BAaF784e1DE93075070df2A43D4278 // BotDetection 0x3C758A487A9c536882aEeAc341c62cb0F665ecf5 // Token 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 // OldStaking 0xDef1Fafc79CD01Cf6797B9d7F51411beF486262a struct StartStake { uint stakedAmount; uint lockedForXDays; } struct Settings { uint MINIMUM_DAYS_FOR_HIGH_PENALTY; uint CONTROLLED_APY; uint SMALLER_PAYS_BETTER_BONUS; uint LONGER_PAYS_BETTER_BONUS; uint END_STAKE_FROM; uint END_STAKE_TO; uint MINIMUM_STAKE_DAYS; uint MAXIMUM_STAKE_DAYS; } contract CerbyStakingSystem is AccessControlEnumerable { DailySnapshot[] public dailySnapshots; uint[] public cachedInterestPerShare; Stake[] public stakes; Settings public settings; uint constant CERBY_BOT_DETECTION_CONTRACT_ID = 3; uint constant MINIMUM_SMALLER_PAYS_BETTER = 1000 * 1e18; // 1k CERBY uint constant MAXIMUM_SMALLER_PAYS_BETTER = 1000000 * 1e18; // 1M CERBY uint constant CACHED_DAYS_INTEREST = 100; uint constant DAYS_IN_ONE_YEAR = 365; uint constant SHARE_PRICE_DENORM = 1e18; uint constant INTEREST_PER_SHARE_DENORM = 1e18; uint constant APY_DENORM = 1e6; uint constant SECONDS_IN_ONE_DAY = 86400; ICerbyTokenMinterBurner cerbyToken = ICerbyTokenMinterBurner( 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 ); address constant BURN_WALLET = address(0x0); uint public launchTimestamp; event StakeStarted( uint stakeId, address owner, uint stakedAmount, uint startDay, uint lockedForXDays, uint sharesCount ); event StakeEnded( uint stakeId, uint endDay, uint interest, uint penalty ); event StakeOwnerChanged( uint stakeId, address newOwner ); event StakeUpdated( uint stakeId, uint lockedForXDays, uint sharesCount ); event DailySnapshotSealed( uint sealedDay, uint inflationAmount, uint totalShares, uint sharePrice, uint totalStaked, uint totalSupply ); event CachedInterestPerShareSealed( uint sealedDay, uint sealedCachedDay, uint cachedInterestPerShare ); event SettingsUpdated( Settings Settings ); event NewMaxSharePriceReached( uint newSharePrice ); event BurnedAndAddedToStakersInflation( address fromAddr, uint amountToBurn, uint currentDay ); constructor() { } modifier executeCronJobs() { } modifier onlyRealUsers { ICerbyBotDetection iCerbyBotDetection = ICerbyBotDetection( ICerbyTokenMinterBurner(cerbyToken).getUtilsContractAtPos(CERBY_BOT_DETECTION_CONTRACT_ID) ); require(<FILL_ME>) _; } modifier onlyStakeOwners(uint stakeId) { } modifier onlyExistingStake(uint stakeId) { } modifier onlyActiveStake(uint stakeId) { } function adminUpdateSettings(Settings calldata _settings) public onlyRole(ROLE_ADMIN) { } function adminBulkTransferOwnership(uint[] calldata stakeIds, address oldOwner, address newOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminBulkDestroyStakes(uint[] calldata stakeIds, address stakeOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminMigrateInitialSnapshots(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialStakes(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialInterestPerShare(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminBurnAndAddToStakersInflation(address fromAddr, uint amountToBurn) public executeCronJobs onlyRole(ROLE_ADMIN) { } function bulkTransferOwnership(uint[] calldata stakeIds, address newOwner) public onlyRealUsers executeCronJobs { } function transferOwnership(uint stakeId, address newOwner) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function _transferOwnership(uint stakeId, address newOwner) private { } function updateAllSnapshots() public { } function updateSnapshots(uint givenDay) public { } function bulkStartStake(StartStake[] calldata startStakes) public onlyRealUsers executeCronJobs { } function startStake(StartStake memory _startStake) private returns(uint stakeId) { } function bulkEndStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function endStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function bulkScrapeStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function scrapeStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function getTotalTokensStaked() public view returns(uint) { } function getDailySnapshotsLength() public view returns(uint) { } function getCachedInterestPerShareLength() public view returns(uint) { } function getStakesLength() public view returns(uint) { } function getInterestById(uint stakeId, uint givenDay) public view returns (uint) { } function getInterestByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getPenaltyById(uint stakeId, uint givenDay, uint interest) public view returns (uint) { } function getPenaltyByStake(Stake memory stake, uint givenDay, uint interest) public view returns (uint) { } function getSharesCountById(uint stakeId, uint givenDay) public view returns(uint) { } function getSharesCountByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getCurrentDaySinceLaunch() public view returns (uint) { } function getCurrentCachedPerShareDay() public view returns (uint) { } function minOfTwoUints(uint uint1, uint uint2) private pure returns(uint) { } }
!iCerbyBotDetection.isBotAddress(msg.sender),"SS: Only real users allowed!"
25,424
!iCerbyBotDetection.isBotAddress(msg.sender)
"SS: Stake was already ended"
pragma solidity ^0.8.10; // Staking 0x8888888AC6aa2482265e5346832CDd963c70A0D1 // Bridge 0xEf038429e3BAaF784e1DE93075070df2A43D4278 // BotDetection 0x3C758A487A9c536882aEeAc341c62cb0F665ecf5 // Token 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 // OldStaking 0xDef1Fafc79CD01Cf6797B9d7F51411beF486262a struct StartStake { uint stakedAmount; uint lockedForXDays; } struct Settings { uint MINIMUM_DAYS_FOR_HIGH_PENALTY; uint CONTROLLED_APY; uint SMALLER_PAYS_BETTER_BONUS; uint LONGER_PAYS_BETTER_BONUS; uint END_STAKE_FROM; uint END_STAKE_TO; uint MINIMUM_STAKE_DAYS; uint MAXIMUM_STAKE_DAYS; } contract CerbyStakingSystem is AccessControlEnumerable { DailySnapshot[] public dailySnapshots; uint[] public cachedInterestPerShare; Stake[] public stakes; Settings public settings; uint constant CERBY_BOT_DETECTION_CONTRACT_ID = 3; uint constant MINIMUM_SMALLER_PAYS_BETTER = 1000 * 1e18; // 1k CERBY uint constant MAXIMUM_SMALLER_PAYS_BETTER = 1000000 * 1e18; // 1M CERBY uint constant CACHED_DAYS_INTEREST = 100; uint constant DAYS_IN_ONE_YEAR = 365; uint constant SHARE_PRICE_DENORM = 1e18; uint constant INTEREST_PER_SHARE_DENORM = 1e18; uint constant APY_DENORM = 1e6; uint constant SECONDS_IN_ONE_DAY = 86400; ICerbyTokenMinterBurner cerbyToken = ICerbyTokenMinterBurner( 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 ); address constant BURN_WALLET = address(0x0); uint public launchTimestamp; event StakeStarted( uint stakeId, address owner, uint stakedAmount, uint startDay, uint lockedForXDays, uint sharesCount ); event StakeEnded( uint stakeId, uint endDay, uint interest, uint penalty ); event StakeOwnerChanged( uint stakeId, address newOwner ); event StakeUpdated( uint stakeId, uint lockedForXDays, uint sharesCount ); event DailySnapshotSealed( uint sealedDay, uint inflationAmount, uint totalShares, uint sharePrice, uint totalStaked, uint totalSupply ); event CachedInterestPerShareSealed( uint sealedDay, uint sealedCachedDay, uint cachedInterestPerShare ); event SettingsUpdated( Settings Settings ); event NewMaxSharePriceReached( uint newSharePrice ); event BurnedAndAddedToStakersInflation( address fromAddr, uint amountToBurn, uint currentDay ); constructor() { } modifier executeCronJobs() { } modifier onlyRealUsers { } modifier onlyStakeOwners(uint stakeId) { } modifier onlyExistingStake(uint stakeId) { } modifier onlyActiveStake(uint stakeId) { require(<FILL_ME>) _; } function adminUpdateSettings(Settings calldata _settings) public onlyRole(ROLE_ADMIN) { } function adminBulkTransferOwnership(uint[] calldata stakeIds, address oldOwner, address newOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminBulkDestroyStakes(uint[] calldata stakeIds, address stakeOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminMigrateInitialSnapshots(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialStakes(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialInterestPerShare(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminBurnAndAddToStakersInflation(address fromAddr, uint amountToBurn) public executeCronJobs onlyRole(ROLE_ADMIN) { } function bulkTransferOwnership(uint[] calldata stakeIds, address newOwner) public onlyRealUsers executeCronJobs { } function transferOwnership(uint stakeId, address newOwner) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function _transferOwnership(uint stakeId, address newOwner) private { } function updateAllSnapshots() public { } function updateSnapshots(uint givenDay) public { } function bulkStartStake(StartStake[] calldata startStakes) public onlyRealUsers executeCronJobs { } function startStake(StartStake memory _startStake) private returns(uint stakeId) { } function bulkEndStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function endStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function bulkScrapeStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function scrapeStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function getTotalTokensStaked() public view returns(uint) { } function getDailySnapshotsLength() public view returns(uint) { } function getCachedInterestPerShareLength() public view returns(uint) { } function getStakesLength() public view returns(uint) { } function getInterestById(uint stakeId, uint givenDay) public view returns (uint) { } function getInterestByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getPenaltyById(uint stakeId, uint givenDay, uint interest) public view returns (uint) { } function getPenaltyByStake(Stake memory stake, uint givenDay, uint interest) public view returns (uint) { } function getSharesCountById(uint stakeId, uint givenDay) public view returns(uint) { } function getSharesCountByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getCurrentDaySinceLaunch() public view returns (uint) { } function getCurrentCachedPerShareDay() public view returns (uint) { } function minOfTwoUints(uint uint1, uint uint2) private pure returns(uint) { } }
stakes[stakeId].endDay==0,"SS: Stake was already ended"
25,424
stakes[stakeId].endDay==0
"SS: New owner must be different from old owner"
pragma solidity ^0.8.10; // Staking 0x8888888AC6aa2482265e5346832CDd963c70A0D1 // Bridge 0xEf038429e3BAaF784e1DE93075070df2A43D4278 // BotDetection 0x3C758A487A9c536882aEeAc341c62cb0F665ecf5 // Token 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 // OldStaking 0xDef1Fafc79CD01Cf6797B9d7F51411beF486262a struct StartStake { uint stakedAmount; uint lockedForXDays; } struct Settings { uint MINIMUM_DAYS_FOR_HIGH_PENALTY; uint CONTROLLED_APY; uint SMALLER_PAYS_BETTER_BONUS; uint LONGER_PAYS_BETTER_BONUS; uint END_STAKE_FROM; uint END_STAKE_TO; uint MINIMUM_STAKE_DAYS; uint MAXIMUM_STAKE_DAYS; } contract CerbyStakingSystem is AccessControlEnumerable { DailySnapshot[] public dailySnapshots; uint[] public cachedInterestPerShare; Stake[] public stakes; Settings public settings; uint constant CERBY_BOT_DETECTION_CONTRACT_ID = 3; uint constant MINIMUM_SMALLER_PAYS_BETTER = 1000 * 1e18; // 1k CERBY uint constant MAXIMUM_SMALLER_PAYS_BETTER = 1000000 * 1e18; // 1M CERBY uint constant CACHED_DAYS_INTEREST = 100; uint constant DAYS_IN_ONE_YEAR = 365; uint constant SHARE_PRICE_DENORM = 1e18; uint constant INTEREST_PER_SHARE_DENORM = 1e18; uint constant APY_DENORM = 1e6; uint constant SECONDS_IN_ONE_DAY = 86400; ICerbyTokenMinterBurner cerbyToken = ICerbyTokenMinterBurner( 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 ); address constant BURN_WALLET = address(0x0); uint public launchTimestamp; event StakeStarted( uint stakeId, address owner, uint stakedAmount, uint startDay, uint lockedForXDays, uint sharesCount ); event StakeEnded( uint stakeId, uint endDay, uint interest, uint penalty ); event StakeOwnerChanged( uint stakeId, address newOwner ); event StakeUpdated( uint stakeId, uint lockedForXDays, uint sharesCount ); event DailySnapshotSealed( uint sealedDay, uint inflationAmount, uint totalShares, uint sharePrice, uint totalStaked, uint totalSupply ); event CachedInterestPerShareSealed( uint sealedDay, uint sealedCachedDay, uint cachedInterestPerShare ); event SettingsUpdated( Settings Settings ); event NewMaxSharePriceReached( uint newSharePrice ); event BurnedAndAddedToStakersInflation( address fromAddr, uint amountToBurn, uint currentDay ); constructor() { } modifier executeCronJobs() { } modifier onlyRealUsers { } modifier onlyStakeOwners(uint stakeId) { } modifier onlyExistingStake(uint stakeId) { } modifier onlyActiveStake(uint stakeId) { } function adminUpdateSettings(Settings calldata _settings) public onlyRole(ROLE_ADMIN) { } function adminBulkTransferOwnership(uint[] calldata stakeIds, address oldOwner, address newOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { for(uint i = 0; i<stakeIds.length; i++) { require(<FILL_ME>) require( stakes[stakeIds[i]].owner == oldOwner, "SS: Stake owner does not match" ); _transferOwnership(stakeIds[i], newOwner); } } function adminBulkDestroyStakes(uint[] calldata stakeIds, address stakeOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminMigrateInitialSnapshots(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialStakes(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialInterestPerShare(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminBurnAndAddToStakersInflation(address fromAddr, uint amountToBurn) public executeCronJobs onlyRole(ROLE_ADMIN) { } function bulkTransferOwnership(uint[] calldata stakeIds, address newOwner) public onlyRealUsers executeCronJobs { } function transferOwnership(uint stakeId, address newOwner) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function _transferOwnership(uint stakeId, address newOwner) private { } function updateAllSnapshots() public { } function updateSnapshots(uint givenDay) public { } function bulkStartStake(StartStake[] calldata startStakes) public onlyRealUsers executeCronJobs { } function startStake(StartStake memory _startStake) private returns(uint stakeId) { } function bulkEndStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function endStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function bulkScrapeStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function scrapeStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function getTotalTokensStaked() public view returns(uint) { } function getDailySnapshotsLength() public view returns(uint) { } function getCachedInterestPerShareLength() public view returns(uint) { } function getStakesLength() public view returns(uint) { } function getInterestById(uint stakeId, uint givenDay) public view returns (uint) { } function getInterestByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getPenaltyById(uint stakeId, uint givenDay, uint interest) public view returns (uint) { } function getPenaltyByStake(Stake memory stake, uint givenDay, uint interest) public view returns (uint) { } function getSharesCountById(uint stakeId, uint givenDay) public view returns(uint) { } function getSharesCountByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getCurrentDaySinceLaunch() public view returns (uint) { } function getCurrentCachedPerShareDay() public view returns (uint) { } function minOfTwoUints(uint uint1, uint uint2) private pure returns(uint) { } }
stakes[stakeIds[i]].owner!=newOwner,"SS: New owner must be different from old owner"
25,424
stakes[stakeIds[i]].owner!=newOwner