comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"Account is already excluded"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } contract SUPERFLECT is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcluded; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1250 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _tBurnTotal; string private _name = 't.me/superflect'; string private _symbol = 'SUPERFLECT'; uint8 private _decimals = 9; // Tax Fee - 15% // Burn Fee - 5% // Tx Limit - 100 uint256 private _taxFee = 15; uint256 private _burnFee = 5; uint256 private _maxTxAmount = 100e9; constructor () public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcluded(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function totalBurn() public view returns (uint256) { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { } function excludeAccount(address account) external onlyOwner() { } function includeAccount(address account) external onlyOwner() { require(<FILL_ME>) for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function _approve(address owner, address spender, uint256 amount) private { } function _transfer(address sender, address recipient, uint256 amount) private { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { } function _reflectFee(uint256 rFee, uint256 rBurn, uint256 tFee, uint256 tBurn) private { } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 burnFee) private pure returns (uint256, uint256, uint256) { } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tBurn, uint256 currentRate) private pure returns (uint256, uint256, uint256) { } function _getRate() private view returns(uint256) { } function _getCurrentSupply() private view returns(uint256, uint256) { } function _getTaxFee() private view returns(uint256) { } function _getMaxTxAmount() private view returns(uint256) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
_isExcluded[account],"Account is already excluded"
4,533
_isExcluded[account]
null
pragma solidity ^0.4.26; library SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { } } contract Token { uint256 public totalSupply; function balanceOf(address _owner) view public returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) view public returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { mapping (address => uint256) public _balances; mapping (address => mapping (address => uint256)) public _allowed; function transfer(address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); require(_value <= _balances[msg.sender]); require(<FILL_ME>) _balances[msg.sender] = SafeMath.safeSub(_balances[msg.sender], _value); _balances[_to] = SafeMath.safeAdd(_balances[_to], _value); emit Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } function balanceOf(address _owner) view public returns (uint256 balance) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _owner, address _spender) view public returns (uint256 remaining) { } } contract TokenERC20 is StandardToken { function () public payable { } string public name = "PSDP"; uint8 public decimals = 4; string public symbol = "PSDP"; uint256 public totalSupply = 10000000000*10**4; constructor() public { } }
_balances[_to]+_value>_balances[_to]
4,566
_balances[_to]+_value>_balances[_to]
null
pragma solidity ^0.4.26; library SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { } } contract Token { uint256 public totalSupply; function balanceOf(address _owner) view public returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) view public returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { mapping (address => uint256) public _balances; mapping (address => mapping (address => uint256)) public _allowed; function transfer(address _to, uint256 _value) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } function balanceOf(address _owner) view public returns (uint256 balance) { } function approve(address _spender, uint256 _value) public returns (bool success) { require(<FILL_ME>) _allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) view public returns (uint256 remaining) { } } contract TokenERC20 is StandardToken { function () public payable { } string public name = "PSDP"; uint8 public decimals = 4; string public symbol = "PSDP"; uint256 public totalSupply = 10000000000*10**4; constructor() public { } }
(_value==0)||(_allowed[msg.sender][_spender]==0)
4,566
(_value==0)||(_allowed[msg.sender][_spender]==0)
null
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(<FILL_ME>) role.bearer[account] = true; } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { } function unfreezeAccount(address holder) public onlyPauser returns (bool) { } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
!has(role,account)
4,759
!has(role,account)
null
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { require(account != address(0)); require(<FILL_ME>) role.bearer[account] = false; } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { } function unfreezeAccount(address holder) public onlyPauser returns (bool) { } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
has(role,account)
4,759
has(role,account)
null
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { require(<FILL_ME>) _; } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { } function unfreezeAccount(address holder) public onlyPauser returns (bool) { } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
isPauser(msg.sender)||isOwner(msg.sender)
4,759
isPauser(msg.sender)||isOwner(msg.sender)
null
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(<FILL_ME>) _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { } function unfreezeAccount(address holder) public onlyPauser returns (bool) { } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
!_paused
4,759
!_paused
null
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { require(<FILL_ME>) _; } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { } function unfreezeAccount(address holder) public onlyPauser returns (bool) { } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
!frozenAccount[_holder]
4,759
!frozenAccount[_holder]
null
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { require(<FILL_ME>) frozenAccount[holder] = true; emit Freeze(holder); return true; } function unfreezeAccount(address holder) public onlyPauser returns (bool) { } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
!frozenAccount[holder]
4,759
!frozenAccount[holder]
null
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { } function unfreezeAccount(address holder) public onlyPauser returns (bool) { require(<FILL_ME>) frozenAccount[holder] = false; emit Unfreeze(holder); return true; } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
frozenAccount[holder]
4,759
frozenAccount[holder]
"There is not enough balances of holder."
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { } function unfreezeAccount(address holder) public onlyPauser returns (bool) { } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { require(<FILL_ME>) _lock(holder,value,releaseTime); return true; } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
_balances[holder]>=value,"There is not enough balances of holder."
4,759
_balances[holder]>=value
"There is not lock info."
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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 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 Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } modifier onlyNewOwner() { } function isOwner(address account) public view returns (bool) { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public onlyNewOwner returns(bool) { } } contract PauserRole is Ownable{ using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { } modifier onlyPauser() { } function isPauser(address account) public view returns (bool) { } function addPauser(address account) public onlyPauser { } function removePauser(address account) public onlyOwner { } function renouncePauser() public { } function _addPauser(address account) internal { } function _removePauser(address account) internal { } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { } } interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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 Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { } } contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract CRK is ERC20Detailed, ERC20Pausable, ERC20Burnable { struct LockInfo { uint256 _releaseTime; uint256 _amount; } address public implementation; mapping (address => LockInfo[]) public timelockList; mapping (address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); modifier notFrozen(address _holder) { } constructor() ERC20Detailed("CRK Token", "CRK", 18) public { } function balanceOf(address owner) public view returns (uint256) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(from) returns (bool) { } function freezeAccount(address holder) public onlyPauser returns (bool) { } function unfreezeAccount(address holder) public onlyPauser returns (bool) { } function lock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlyPauser returns (bool) { } function unlock(address holder, uint256 idx) public onlyPauser returns (bool) { require(<FILL_ME>) _unlock(holder,idx); return true; } /** * @dev Upgrades the implementation address * @param _newImplementation address of the new implementation */ function upgradeTo(address _newImplementation) public onlyOwner { } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { } function _unlock(address holder, uint256 idx) internal returns(bool) { } function _autoUnlock(address holder) internal returns(bool) { } /** * @dev Sets the address of the current implementation * @param _newImp address of the new implementation */ function _setImplementation(address _newImp) internal { } /** * @dev Fallback function allowing to perform a delegatecall * to the given implementation. This function will return * whatever the implementation call returns */ function () payable external { } }
timelockList[holder].length>idx,"There is not lock info."
4,759
timelockList[holder].length>idx
"Validators MUST NOT own multiple stake position"
pragma solidity ^0.5.2; contract StakingNFT is ERC721Full, Ownable { constructor(string memory name, string memory symbol) public ERC721Full(name, symbol) { } function mint(address to, uint256 tokenId) public onlyOwner { require(<FILL_ME>) _mint(to, tokenId); } function burn(uint256 tokenId) public onlyOwner { } function _transferFrom(address from, address to, uint256 tokenId) internal { } }
balanceOf(to)==0,"Validators MUST NOT own multiple stake position"
4,867
balanceOf(to)==0
"This user is already in a team."
pragma solidity 0.5.17; import "./TeamStorage.sol"; interface GAMER { function gamersScalingFactor() external view returns (uint256); function balanceOfUnderlying(address amount) external returns(uint256); function mint(address to, uint256 amount) external; } contract Team is TeamStorage { /// @notice An event thats emitted when someone builds a new team. event BuildTeam(string teamName); /// @notice An event thats emitted when someone joins a team. event JoinTeam(string teamName); /// @notice An event thats emitted when someone's staking GAMER amount changes. event UpdateTeamPoolStaking(address user, bool positive, uint256 amount); modifier onlyGov() { } modifier onlyStakingPool() { } modifier onlyInTeam(address account) { } modifier onlyFreeMan(address account) { require(<FILL_ME>) _; } function _update(address account, bool positive, uint256 amount) internal returns(bool) { } // Public functions function getTeamInfo(address account) external view returns(string memory, uint256) { } function isTeamLeader(address account) external view returns(bool) { } function getAllTeams() external view returns(bytes32[] memory, uint256[] memory) { } function _generateTeamKey(string memory teamName) internal pure returns(bytes32) { } }
teamRelationship[msg.sender]==bytes32(0),"This user is already in a team."
4,987
teamRelationship[msg.sender]==bytes32(0)
"ERC721Metadata: Hash set of nonexistent token"
contract BitPortraits is ERC721, IERC721Receiver, Ownable { using SafeMath for uint256; using Strings for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIdx; uint256 public constant MAX_SUPPLY = 5102; uint256 public SALE_START_TIME = block.timestamp + (3600); // one hour after contract creation time uint256 public SALE_END_TIME = SALE_START_TIME + (30 * 86400); // 30 days or earlier address private contractOwner = 0x2c7dc51aD89359150Db406d18701AfD11D9F62d7; bool private saleIsLive = true; //BitPortraits Provenance is a (SHA256) hash of hashes of the following 5102 images, in the specified order: // 1) A 85x60 Collage of all 5100 BitPortraits ["BitPortraits Opus"] - DB65B2D5F32476E4E9E26BF598757D85EA5AD829BB3B9A97EA2818F376CB1B47 // 2) 5100 BitPortraits (600*800px) that are combinatorial variations of 05 distinct attributes of 300 Core-BitPortraits // 3) A 20x15 Collage of 300 Core-BitPortraits ["BitPortraits Core"] - 7854F278B632F8AD14FA5A136FC848792945DEDCA8F5E3704FAA23835A906C63 bytes32 public constant BP_PROVENANCE = 0xaafbe083b53cc7a741e377a27033190c093a246d9ef52f3374ae788535a228cf; // mapping for token hashes mapping (uint256 => bytes32) private _tokenHashes; event tokenHashSet (uint256 indexed tokenId_, bytes32 indexed tokenHash_); constructor() ERC721("BitPortraits", "BP") { } function _baseURI() internal view virtual override returns (string memory) { } function totalSupply() public view returns (uint256) { } function saleLive() public view returns (bool) { } function transferOpus() onlyOwner public { } function _setTokenHash(uint256 tokenId_, bytes32 tokenHash_) onlyOwner public { require(<FILL_ME>) _tokenHashes[tokenId_] = tokenHash_; emit tokenHashSet(tokenId_, tokenHash_); } function tokenHash(uint256 tokenId_) public view returns (bytes32) { } function tierUpperBound(uint256 tierId_) private pure returns (uint256) { } function tierPrice(uint256 tierId_) private pure returns (uint256) { } function calcTokensSub(uint256 rxEther_, uint256 tierId_) private view returns (uint256) { } function calcTokens(uint256 rxEther_) private view returns (uint256) { } function mintTokens(address sender_, uint256 numberOfTokens_) private { } function mintRemaining(uint256 numberOfTokens_) onlyOwner public { } function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { } function withdraw() onlyOwner public { } receive() external payable { } }
_exists(tokenId_),"ERC721Metadata: Hash set of nonexistent token"
4,994
_exists(tokenId_)
"Current Supply can't be greater than tierUpperBound"
contract BitPortraits is ERC721, IERC721Receiver, Ownable { using SafeMath for uint256; using Strings for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIdx; uint256 public constant MAX_SUPPLY = 5102; uint256 public SALE_START_TIME = block.timestamp + (3600); // one hour after contract creation time uint256 public SALE_END_TIME = SALE_START_TIME + (30 * 86400); // 30 days or earlier address private contractOwner = 0x2c7dc51aD89359150Db406d18701AfD11D9F62d7; bool private saleIsLive = true; //BitPortraits Provenance is a (SHA256) hash of hashes of the following 5102 images, in the specified order: // 1) A 85x60 Collage of all 5100 BitPortraits ["BitPortraits Opus"] - DB65B2D5F32476E4E9E26BF598757D85EA5AD829BB3B9A97EA2818F376CB1B47 // 2) 5100 BitPortraits (600*800px) that are combinatorial variations of 05 distinct attributes of 300 Core-BitPortraits // 3) A 20x15 Collage of 300 Core-BitPortraits ["BitPortraits Core"] - 7854F278B632F8AD14FA5A136FC848792945DEDCA8F5E3704FAA23835A906C63 bytes32 public constant BP_PROVENANCE = 0xaafbe083b53cc7a741e377a27033190c093a246d9ef52f3374ae788535a228cf; // mapping for token hashes mapping (uint256 => bytes32) private _tokenHashes; event tokenHashSet (uint256 indexed tokenId_, bytes32 indexed tokenHash_); constructor() ERC721("BitPortraits", "BP") { } function _baseURI() internal view virtual override returns (string memory) { } function totalSupply() public view returns (uint256) { } function saleLive() public view returns (bool) { } function transferOpus() onlyOwner public { } function _setTokenHash(uint256 tokenId_, bytes32 tokenHash_) onlyOwner public { } function tokenHash(uint256 tokenId_) public view returns (bytes32) { } function tierUpperBound(uint256 tierId_) private pure returns (uint256) { } function tierPrice(uint256 tierId_) private pure returns (uint256) { } function calcTokensSub(uint256 rxEther_, uint256 tierId_) private view returns (uint256) { require(<FILL_ME>) uint256 tierUB; uint256 avlTierValue; uint256 avlTierSupply; uint256 overflowValue; uint256 numberOfTokens; tierUB = tierUpperBound(tierId_); avlTierSupply = tierUB.sub(totalSupply()); avlTierValue = avlTierSupply.mul(tierPrice(tierId_)); if (rxEther_ <= avlTierValue) { numberOfTokens = rxEther_.div(tierPrice(tierId_)); } else { overflowValue = rxEther_.sub(avlTierValue); numberOfTokens = avlTierSupply.add(overflowValue.div(tierPrice(tierId_.add(1)))); } return numberOfTokens; } function calcTokens(uint256 rxEther_) private view returns (uint256) { } function mintTokens(address sender_, uint256 numberOfTokens_) private { } function mintRemaining(uint256 numberOfTokens_) onlyOwner public { } function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { } function withdraw() onlyOwner public { } receive() external payable { } }
totalSupply()<=tierUpperBound(tierId_),"Current Supply can't be greater than tierUpperBound"
4,994
totalSupply()<=tierUpperBound(tierId_)
"Sale has already ended"
contract BitPortraits is ERC721, IERC721Receiver, Ownable { using SafeMath for uint256; using Strings for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIdx; uint256 public constant MAX_SUPPLY = 5102; uint256 public SALE_START_TIME = block.timestamp + (3600); // one hour after contract creation time uint256 public SALE_END_TIME = SALE_START_TIME + (30 * 86400); // 30 days or earlier address private contractOwner = 0x2c7dc51aD89359150Db406d18701AfD11D9F62d7; bool private saleIsLive = true; //BitPortraits Provenance is a (SHA256) hash of hashes of the following 5102 images, in the specified order: // 1) A 85x60 Collage of all 5100 BitPortraits ["BitPortraits Opus"] - DB65B2D5F32476E4E9E26BF598757D85EA5AD829BB3B9A97EA2818F376CB1B47 // 2) 5100 BitPortraits (600*800px) that are combinatorial variations of 05 distinct attributes of 300 Core-BitPortraits // 3) A 20x15 Collage of 300 Core-BitPortraits ["BitPortraits Core"] - 7854F278B632F8AD14FA5A136FC848792945DEDCA8F5E3704FAA23835A906C63 bytes32 public constant BP_PROVENANCE = 0xaafbe083b53cc7a741e377a27033190c093a246d9ef52f3374ae788535a228cf; // mapping for token hashes mapping (uint256 => bytes32) private _tokenHashes; event tokenHashSet (uint256 indexed tokenId_, bytes32 indexed tokenHash_); constructor() ERC721("BitPortraits", "BP") { } function _baseURI() internal view virtual override returns (string memory) { } function totalSupply() public view returns (uint256) { } function saleLive() public view returns (bool) { } function transferOpus() onlyOwner public { } function _setTokenHash(uint256 tokenId_, bytes32 tokenHash_) onlyOwner public { } function tokenHash(uint256 tokenId_) public view returns (bytes32) { } function tierUpperBound(uint256 tierId_) private pure returns (uint256) { } function tierPrice(uint256 tierId_) private pure returns (uint256) { } function calcTokensSub(uint256 rxEther_, uint256 tierId_) private view returns (uint256) { } function calcTokens(uint256 rxEther_) private view returns (uint256) { } function mintTokens(address sender_, uint256 numberOfTokens_) private { require(<FILL_ME>) require(numberOfTokens_ > 0 && numberOfTokens_ <= 20, "tokens minted per transaction capped at 20"); for (uint256 i = 0; i < numberOfTokens_; i++) { _safeMint(sender_, totalSupply()); _tokenIdx.increment(); //_tokenIds.increment(); } if (totalSupply() == 5102 || block.timestamp > SALE_END_TIME) saleIsLive = false; } function mintRemaining(uint256 numberOfTokens_) onlyOwner public { } function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { } function withdraw() onlyOwner public { } receive() external payable { } }
totalSupply()<=MAX_SUPPLY,"Sale has already ended"
4,994
totalSupply()<=MAX_SUPPLY
"Cannot set a proxy implementation to a non-contract address"
/* / | __ / ____| / | |__) | | | / / | _ / | | / ____ | | | |____ /_/ _ |_| _ _____| * ARC: ArcProxy.sol * * Latest source (may be newer): https://github.com/arcxgame/contracts/blob/master/contracts/ArcProxy.sol * * Contract Dependencies: * - BaseAdminUpgradeabilityProxy * - BaseUpgradeabilityProxy * - Proxy * - UpgradeabilityProxy * Libraries: * - OpenZeppelinUpgradesAddress * * MIT License * =========== * * Copyright (c) 2020 ARC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma experimental ABIEncoderV2; /* =============================================== * Flattened with Solidifier by Coinage * * https://solidifier.coina.ge * =============================================== */ pragma solidity ^0.5.0; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { } } /** * Utility library of inline functions on addresses * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version. */ library OpenZeppelinUpgradesAddress { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { } } /** * @title BaseUpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract BaseUpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(<FILL_ME>) bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title UpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with a constructor for initializing * implementation and init data. */ contract UpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { } } /** * @title BaseAdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { } /** * @return The admin slot. */ function _admin() internal view returns (address adm) { } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal { } } /** * @title AdminUpgradeabilityProxy * @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for * initializing the implementation, admin, and init data. */ contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { } } // SPDX-License-Identifier: MIT /* solium-disable-next-line */ contract ArcProxy is AdminUpgradeabilityProxy { /** * @dev The constructor of the proxy that sets the admin and logic. * * @param logic The address of the contract that implements the underlying logic. * @param admin The address of the admin of the proxy. * @param data Any data to send immediately to the implementation contract. */ constructor( address logic, address admin, bytes memory data ) public AdminUpgradeabilityProxy( logic, admin, data ) {} /** * @dev Overrides the default functionality that prevents the admin from reaching the * implementation contract. */ function _willFallback() internal { } }
OpenZeppelinUpgradesAddress.isContract(newImplementation),"Cannot set a proxy implementation to a non-contract address"
4,997
OpenZeppelinUpgradesAddress.isContract(newImplementation)
"PMM: not the UserProxy contract"
pragma solidity ^0.6.0; contract PMM is ReentrancyGuard, IPMM, LibOrder, LibDecoder, LibEncoder { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; // Constants do not have storage slot. string public constant version = "5.0.0"; uint256 private constant MAX_UINT = 2**256 - 1; string public constant SOURCE = "0x v2"; uint256 private constant BPS_MAX = 10000; bytes4 constant internal ERC1271_MAGICVALUE_BYTES32 = 0x1626ba7e; // bytes4(keccak256("isValidSignature(bytes32,bytes)")) address public immutable userProxy; ISpender public immutable spender; IPermanentStorage public immutable permStorage; IZeroExchange public immutable zeroExchange; address public immutable zxERC20Proxy; // Below are the variables which consume storage slots. address public operator; struct TradeInfo { address user; address receiver; uint16 feeFactor; address makerAssetAddr; address takerAssetAddr; bytes32 transactionHash; bytes32 orderHash; } // events event FillOrder( string source, bytes32 indexed transactionHash, bytes32 indexed orderHash, address indexed userAddr, address takerAssetAddr, uint256 takerAssetAmount, address makerAddr, address makerAssetAddr, uint256 makerAssetAmount, address receiverAddr, uint256 settleAmount, uint16 feeFactor ); receive() external payable {} /************************************************************ * Access control and ownership management * *************************************************************/ modifier onlyOperator { } modifier onlyUserProxy() { require(<FILL_ME>) _; } function transferOwnership(address _newOperator) external onlyOperator { } /************************************************************ * Constructor and init functions * *************************************************************/ constructor (address _operator, address _userProxy, ISpender _spender, IPermanentStorage _permStorage, IZeroExchange _zeroExchange, address _zxERC20Proxy) public { } /************************************************************ * Management functions for Operator * *************************************************************/ /** * @dev approve spender to transfer tokens from this contract. This is used to collect fee. */ function setAllowance(address[] calldata _tokenList, address _spender) override external onlyOperator { } function closeAllowance(address[] calldata _tokenList, address _spender) override external onlyOperator { } /************************************************************ * External functions * *************************************************************/ function fill( uint256 userSalt, bytes memory data, bytes memory userSignature ) override public payable onlyUserProxy nonReentrant returns (uint256) { } /** * @dev internal function of `fill`. * It decodes and validates transaction data. */ function _assertTransaction( uint256 userSalt, bytes memory data, bytes memory userSignature ) internal view returns( LibOrder.Order memory order, TradeInfo memory tradeInfo ) { } // settle function _settle(IWETH weth, address receiver, address makerAssetAddr, uint256 makerAssetAmount, uint16 feeFactor) internal returns(uint256) { } function _ecrecoverAddress(bytes32 transactionHash, bytes memory signature) internal pure returns (address){ } }
address(userProxy)==msg.sender,"PMM: not the UserProxy contract"
5,014
address(userProxy)==msg.sender
"PMM: invalid contract address"
pragma solidity ^0.6.0; contract PMM is ReentrancyGuard, IPMM, LibOrder, LibDecoder, LibEncoder { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; // Constants do not have storage slot. string public constant version = "5.0.0"; uint256 private constant MAX_UINT = 2**256 - 1; string public constant SOURCE = "0x v2"; uint256 private constant BPS_MAX = 10000; bytes4 constant internal ERC1271_MAGICVALUE_BYTES32 = 0x1626ba7e; // bytes4(keccak256("isValidSignature(bytes32,bytes)")) address public immutable userProxy; ISpender public immutable spender; IPermanentStorage public immutable permStorage; IZeroExchange public immutable zeroExchange; address public immutable zxERC20Proxy; // Below are the variables which consume storage slots. address public operator; struct TradeInfo { address user; address receiver; uint16 feeFactor; address makerAssetAddr; address takerAssetAddr; bytes32 transactionHash; bytes32 orderHash; } // events event FillOrder( string source, bytes32 indexed transactionHash, bytes32 indexed orderHash, address indexed userAddr, address takerAssetAddr, uint256 takerAssetAmount, address makerAddr, address makerAssetAddr, uint256 makerAssetAmount, address receiverAddr, uint256 settleAmount, uint16 feeFactor ); receive() external payable {} /************************************************************ * Access control and ownership management * *************************************************************/ modifier onlyOperator { } modifier onlyUserProxy() { } function transferOwnership(address _newOperator) external onlyOperator { } /************************************************************ * Constructor and init functions * *************************************************************/ constructor (address _operator, address _userProxy, ISpender _spender, IPermanentStorage _permStorage, IZeroExchange _zeroExchange, address _zxERC20Proxy) public { } /************************************************************ * Management functions for Operator * *************************************************************/ /** * @dev approve spender to transfer tokens from this contract. This is used to collect fee. */ function setAllowance(address[] calldata _tokenList, address _spender) override external onlyOperator { } function closeAllowance(address[] calldata _tokenList, address _spender) override external onlyOperator { } /************************************************************ * External functions * *************************************************************/ function fill( uint256 userSalt, bytes memory data, bytes memory userSignature ) override public payable onlyUserProxy nonReentrant returns (uint256) { } /** * @dev internal function of `fill`. * It decodes and validates transaction data. */ function _assertTransaction( uint256 userSalt, bytes memory data, bytes memory userSignature ) internal view returns( LibOrder.Order memory order, TradeInfo memory tradeInfo ) { // decode fillOrder data uint256 takerFillAmount; bytes memory mmSignature; (order, takerFillAmount, mmSignature) = decodeFillOrder(data); require( order.takerAddress == address(this), "PMM: incorrect taker" ); require( order.takerAssetAmount == takerFillAmount, "PMM: incorrect fill amount" ); // generate transactionHash tradeInfo.transactionHash = encodeTransactionHash( userSalt, address(this), data ); tradeInfo.orderHash = getOrderHash(order); tradeInfo.feeFactor = uint16(order.salt); tradeInfo.receiver = decodeUserSignatureWithoutSign(userSignature); tradeInfo.user = _ecrecoverAddress(tradeInfo.transactionHash, userSignature); if (tradeInfo.user != order.feeRecipientAddress) { require(<FILL_ME>) // isValidSignature() should return magic value: bytes4(keccak256("isValidSignature(bytes32,bytes)")) require( ERC1271_MAGICVALUE_BYTES32 == IERC1271Wallet(order.feeRecipientAddress) .isValidSignature( tradeInfo.transactionHash, userSignature ), "PMM: invalid ERC1271 signer" ); tradeInfo.user = order.feeRecipientAddress; } require( tradeInfo.feeFactor < 10000, "PMM: invalid fee factor" ); require( tradeInfo.receiver != address(0), "PMM: invalid receiver" ); // decode asset // just support ERC20 tradeInfo.makerAssetAddr = decodeERC20Asset(order.makerAssetData); tradeInfo.takerAssetAddr = decodeERC20Asset(order.takerAssetData); return ( order, tradeInfo ); } // settle function _settle(IWETH weth, address receiver, address makerAssetAddr, uint256 makerAssetAmount, uint16 feeFactor) internal returns(uint256) { } function _ecrecoverAddress(bytes32 transactionHash, bytes memory signature) internal pure returns (address){ } }
order.feeRecipientAddress.isContract(),"PMM: invalid contract address"
5,014
order.feeRecipientAddress.isContract()
null
// Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/issues/20 pragma solidity ^0.4.18; contract Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /* You should inherit from StandardToken or, for a token like you would want to deploy in something like Mist, see EthereumX.sol. (This implements ONLY the standard functions and NOTHING else. If you deploy this, you won't have anything useful.) Implements ERC 20 Token standard: https://github.com/ethereum/EIPs/issues/20 .*/ contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; } contract EthereumX is StandardToken { function () { } /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ string public name; //fancy name: eg Simon Bucks uint8 public decimals; //How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like comparing 1 wei to 1 ether. string public symbol; //An identifier: eg SBX string public version = 'ETX1.0'; //EthereumX 1.0 standard. Just an arbitrary versioning scheme. function EthereumX( uint256 _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol ) { } /* Approves and then calls the receiving contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this. //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. require(<FILL_ME>) return true; } }
_spender.call(bytes4(bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))),msg.sender,_value,this,_extraData)
5,081
_spender.call(bytes4(bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))),msg.sender,_value,this,_extraData)
"Sender must own the tokens"
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./interfaces/IVault.sol"; import "./interfaces/IUniversalVault.sol"; interface IVisor { function delegatedTransferERC20(address token, address to, uint256 amount) external; } contract Extract { using SafeERC20 for IERC20; using SafeMath for uint256; IVault public hypervisor; address payable public owner; uint256 public bonus; IERC20 public bonusToken; constructor( address _hypervisor, address _bonusToken, address payable _owner ) { } function extractTokens( uint256 shares, address to, address from ) external { require(<FILL_ME>) IVisor(from).delegatedTransferERC20(address(hypervisor), address(this), shares); uint256 withdrawShares = shares.div(2); IVault(hypervisor).withdraw(withdrawShares, to, address(this)); bonusToken.safeTransfer(to, bonus.mul(shares).div(IERC20(address(hypervisor)).totalSupply())); } function setBonus(uint256 _bonus) external onlyOwner { } function sweepTokens(address token) external onlyOwner { } function sweepEth() external onlyOwner { } modifier onlyOwner { } }
IUniversalVault(from).owner()==msg.sender,"Sender must own the tokens"
5,082
IUniversalVault(from).owner()==msg.sender
"TokenMock/PauserRole"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Pausable.sol"; /** * @dev {ERC20} token, including: * * - ability for holders to burn (destroy) their tokens * - a pauser role that allows to stop all token transfers * * This contract uses {AccessControl} to lock permissioned functions using the * different roles - head to its documentation for details. * * This has an open mint functionality */ contract TokenMock is Context, AccessControl, ERC20Burnable, ERC20Pausable { bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, and `PAUSER_ROLE` to the * account that deploys the contract. * * See {ERC20-constructor}. */ constructor( address _admin, string memory _name, string memory _symbol, uint8 _decimals ) ERC20(_name, _symbol) { } /** * @dev Creates `amount` new tokens for `to`. * * See {ERC20-_mint}. * */ function mint(address to, uint256 amount) external virtual { } /** * @dev Pauses all token transfers. * * See {ERC20Pausable} and {Pausable-_pause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function pause() external virtual { require(<FILL_ME>) _pause(); } /** * @dev Unpauses all token transfers. * * See {ERC20Pausable} and {Pausable-_unpause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function unpause() external virtual { } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override(ERC20, ERC20Pausable) { } }
hasRole(PAUSER_ROLE,_msgSender()),"TokenMock/PauserRole"
5,121
hasRole(PAUSER_ROLE,_msgSender())
"already added"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; import "synthetix/contracts/interfaces/IStakingRewards.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; contract EarnedAggregator { /// @notice The address of the Float Protocol Timelock address public timelock; /// @notice addresses of pools (Staking Rewards Contracts) address[] public pools; constructor(address timelock_, address[] memory pools_) { } function getPools() public view returns (address[] memory) { } function addPool(address pool) public { // Sanity check for function and no error IStakingRewards(pool).earned(timelock); for (uint256 i = 0; i < pools.length; i++) { require(<FILL_ME>) } require(msg.sender == address(timelock), "EarnedAggregator: !timelock"); pools.push(pool); } function removePool(uint256 index) public { } function getCurrentEarned(address account) public view returns (uint256) { } }
pools[i]!=pool,"already added"
5,134
pools[i]!=pool
"MorpherGovernance: Only Validators can invoke that function."
pragma solidity 0.5.16; // ------------------------------------------------------------------------ // Morpher Governance (MAIN CHAIN ONLY) // // Every user able and willig to lock up sufficient token can become a validator // of the Morpher protocol. Validators function similiar to a board of directors // and vote on the protocol Administrator and the Oracle contract. // The Administrator (=Protocol CEO) has the power to add/delete markets and to // pause the contracts to allow for updates. // The Oracle contract is the address of the contract allowed to fetch prices // from outside the smart contract. // // It becomes progressively harder to become a valdiator. Each new validator // has to lock up (numberOfValidators + 1) * 10m Morpher token. Upon stepping // down as validator only 99% of the locked up token are returned, the other 1% // are burned. // // Governance is expected to become more sophisticated in the future // ------------------------------------------------------------------------ import "./Ownable.sol"; import "./SafeMath.sol"; import "./MorpherState.sol"; contract MorpherGovernance is Ownable { using SafeMath for uint256; MorpherState state; event BecomeValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event StepDownAsValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event ElectedAdministrator(address indexed _administratorAddress, uint256 _votes); event ElectedOracle(address indexed _oracleAddress, uint256 _votes); uint256 public constant MINVALIDATORLOCKUP = 10**25; uint256 public constant MAXVALIDATORS = 21; uint256 public constant VALIDATORWARMUPPERIOD = 7 days; uint256 public numberOfValidators; uint256 public lastValidatorJoined; uint256 public rewardBasisPoints; address public morpherToken; mapping(address => uint256) private validatorIndex; mapping(address => uint256) private validatorJoinedAtTime; mapping(uint256 => address) private validatorAddress; mapping(address => address) private oracleVote; mapping(address => address) private administratorVote; mapping(address => uint256) private countVotes; constructor(address _stateAddress, address _coldStorageOwnerAddress) public { } modifier onlyValidator() { require(<FILL_ME>) _; } function setMorpherState(address _stateAddress) private { } function setMorpherTokenAddress(address _address) public onlyOwner { } function getValidatorAddress(uint256 _index) public view returns (address _address) { } function getValidatorIndex(address _address) public view returns (uint256 _index) { } function isValidator(address _address) public view returns (bool) { } function setOracle(address _oracleAddress) private { } function setAdministrator(address _administratorAddress) private { } function getMorpherAdministrator() public view returns (address _address) { } function getMorpherOracle() public view returns (address _address) { } function getOracleVote(address _address) public view returns (address _votedOracleAddress) { } function becomeValidator() public { } function stepDownValidator() public onlyValidator { } function voteOracle(address _oracleAddress) public onlyValidator { } function voteAdministrator(address _administratorAddress) public onlyValidator { } function countOracleVote() public returns (address _votedOracleAddress, uint256 _votes) { } function countAdministratorVote() public returns (address _appointedAdministrator, uint256 _votes) { } }
isValidator(msg.sender),"MorpherGovernance: Only Validators can invoke that function."
5,306
isValidator(msg.sender)
"MorpherGovernance: Insufficient balance to become Validator."
pragma solidity 0.5.16; // ------------------------------------------------------------------------ // Morpher Governance (MAIN CHAIN ONLY) // // Every user able and willig to lock up sufficient token can become a validator // of the Morpher protocol. Validators function similiar to a board of directors // and vote on the protocol Administrator and the Oracle contract. // The Administrator (=Protocol CEO) has the power to add/delete markets and to // pause the contracts to allow for updates. // The Oracle contract is the address of the contract allowed to fetch prices // from outside the smart contract. // // It becomes progressively harder to become a valdiator. Each new validator // has to lock up (numberOfValidators + 1) * 10m Morpher token. Upon stepping // down as validator only 99% of the locked up token are returned, the other 1% // are burned. // // Governance is expected to become more sophisticated in the future // ------------------------------------------------------------------------ import "./Ownable.sol"; import "./SafeMath.sol"; import "./MorpherState.sol"; contract MorpherGovernance is Ownable { using SafeMath for uint256; MorpherState state; event BecomeValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event StepDownAsValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event ElectedAdministrator(address indexed _administratorAddress, uint256 _votes); event ElectedOracle(address indexed _oracleAddress, uint256 _votes); uint256 public constant MINVALIDATORLOCKUP = 10**25; uint256 public constant MAXVALIDATORS = 21; uint256 public constant VALIDATORWARMUPPERIOD = 7 days; uint256 public numberOfValidators; uint256 public lastValidatorJoined; uint256 public rewardBasisPoints; address public morpherToken; mapping(address => uint256) private validatorIndex; mapping(address => uint256) private validatorJoinedAtTime; mapping(uint256 => address) private validatorAddress; mapping(address => address) private oracleVote; mapping(address => address) private administratorVote; mapping(address => uint256) private countVotes; constructor(address _stateAddress, address _coldStorageOwnerAddress) public { } modifier onlyValidator() { } function setMorpherState(address _stateAddress) private { } function setMorpherTokenAddress(address _address) public onlyOwner { } function getValidatorAddress(uint256 _index) public view returns (address _address) { } function getValidatorIndex(address _address) public view returns (uint256 _index) { } function isValidator(address _address) public view returns (bool) { } function setOracle(address _oracleAddress) private { } function setAdministrator(address _administratorAddress) private { } function getMorpherAdministrator() public view returns (address _address) { } function getMorpherOracle() public view returns (address _address) { } function getOracleVote(address _address) public view returns (address _votedOracleAddress) { } function becomeValidator() public { // To become a validator you have to lock up 10m * (number of validators + 1) Morpher Token in escrow // After a warmup period of 7 days the new validator can vote on Oracle contract and protocol Administrator uint256 _requiredAmount = MINVALIDATORLOCKUP.mul(numberOfValidators.add(1)); require(<FILL_ME>) require(isValidator(msg.sender) == false, "MorpherGovernance: Address is already Validator."); require(numberOfValidators <= MAXVALIDATORS, "MorpherGovernance: number of Validators can not exceed Max Validators."); state.transfer(msg.sender, address(this), _requiredAmount); numberOfValidators = numberOfValidators.add(1); validatorIndex[msg.sender] = numberOfValidators; validatorJoinedAtTime[msg.sender] = now; lastValidatorJoined = now; validatorAddress[numberOfValidators] = msg.sender; emit BecomeValidator(msg.sender, numberOfValidators); } function stepDownValidator() public onlyValidator { } function voteOracle(address _oracleAddress) public onlyValidator { } function voteAdministrator(address _administratorAddress) public onlyValidator { } function countOracleVote() public returns (address _votedOracleAddress, uint256 _votes) { } function countAdministratorVote() public returns (address _appointedAdministrator, uint256 _votes) { } }
state.balanceOf(msg.sender)>=_requiredAmount,"MorpherGovernance: Insufficient balance to become Validator."
5,306
state.balanceOf(msg.sender)>=_requiredAmount
"MorpherGovernance: Address is already Validator."
pragma solidity 0.5.16; // ------------------------------------------------------------------------ // Morpher Governance (MAIN CHAIN ONLY) // // Every user able and willig to lock up sufficient token can become a validator // of the Morpher protocol. Validators function similiar to a board of directors // and vote on the protocol Administrator and the Oracle contract. // The Administrator (=Protocol CEO) has the power to add/delete markets and to // pause the contracts to allow for updates. // The Oracle contract is the address of the contract allowed to fetch prices // from outside the smart contract. // // It becomes progressively harder to become a valdiator. Each new validator // has to lock up (numberOfValidators + 1) * 10m Morpher token. Upon stepping // down as validator only 99% of the locked up token are returned, the other 1% // are burned. // // Governance is expected to become more sophisticated in the future // ------------------------------------------------------------------------ import "./Ownable.sol"; import "./SafeMath.sol"; import "./MorpherState.sol"; contract MorpherGovernance is Ownable { using SafeMath for uint256; MorpherState state; event BecomeValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event StepDownAsValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event ElectedAdministrator(address indexed _administratorAddress, uint256 _votes); event ElectedOracle(address indexed _oracleAddress, uint256 _votes); uint256 public constant MINVALIDATORLOCKUP = 10**25; uint256 public constant MAXVALIDATORS = 21; uint256 public constant VALIDATORWARMUPPERIOD = 7 days; uint256 public numberOfValidators; uint256 public lastValidatorJoined; uint256 public rewardBasisPoints; address public morpherToken; mapping(address => uint256) private validatorIndex; mapping(address => uint256) private validatorJoinedAtTime; mapping(uint256 => address) private validatorAddress; mapping(address => address) private oracleVote; mapping(address => address) private administratorVote; mapping(address => uint256) private countVotes; constructor(address _stateAddress, address _coldStorageOwnerAddress) public { } modifier onlyValidator() { } function setMorpherState(address _stateAddress) private { } function setMorpherTokenAddress(address _address) public onlyOwner { } function getValidatorAddress(uint256 _index) public view returns (address _address) { } function getValidatorIndex(address _address) public view returns (uint256 _index) { } function isValidator(address _address) public view returns (bool) { } function setOracle(address _oracleAddress) private { } function setAdministrator(address _administratorAddress) private { } function getMorpherAdministrator() public view returns (address _address) { } function getMorpherOracle() public view returns (address _address) { } function getOracleVote(address _address) public view returns (address _votedOracleAddress) { } function becomeValidator() public { // To become a validator you have to lock up 10m * (number of validators + 1) Morpher Token in escrow // After a warmup period of 7 days the new validator can vote on Oracle contract and protocol Administrator uint256 _requiredAmount = MINVALIDATORLOCKUP.mul(numberOfValidators.add(1)); require(state.balanceOf(msg.sender) >= _requiredAmount, "MorpherGovernance: Insufficient balance to become Validator."); require(<FILL_ME>) require(numberOfValidators <= MAXVALIDATORS, "MorpherGovernance: number of Validators can not exceed Max Validators."); state.transfer(msg.sender, address(this), _requiredAmount); numberOfValidators = numberOfValidators.add(1); validatorIndex[msg.sender] = numberOfValidators; validatorJoinedAtTime[msg.sender] = now; lastValidatorJoined = now; validatorAddress[numberOfValidators] = msg.sender; emit BecomeValidator(msg.sender, numberOfValidators); } function stepDownValidator() public onlyValidator { } function voteOracle(address _oracleAddress) public onlyValidator { } function voteAdministrator(address _administratorAddress) public onlyValidator { } function countOracleVote() public returns (address _votedOracleAddress, uint256 _votes) { } function countAdministratorVote() public returns (address _appointedAdministrator, uint256 _votes) { } }
isValidator(msg.sender)==false,"MorpherGovernance: Address is already Validator."
5,306
isValidator(msg.sender)==false
"MorpherGovernance: Escrow does not have enough funds. Should not happen."
pragma solidity 0.5.16; // ------------------------------------------------------------------------ // Morpher Governance (MAIN CHAIN ONLY) // // Every user able and willig to lock up sufficient token can become a validator // of the Morpher protocol. Validators function similiar to a board of directors // and vote on the protocol Administrator and the Oracle contract. // The Administrator (=Protocol CEO) has the power to add/delete markets and to // pause the contracts to allow for updates. // The Oracle contract is the address of the contract allowed to fetch prices // from outside the smart contract. // // It becomes progressively harder to become a valdiator. Each new validator // has to lock up (numberOfValidators + 1) * 10m Morpher token. Upon stepping // down as validator only 99% of the locked up token are returned, the other 1% // are burned. // // Governance is expected to become more sophisticated in the future // ------------------------------------------------------------------------ import "./Ownable.sol"; import "./SafeMath.sol"; import "./MorpherState.sol"; contract MorpherGovernance is Ownable { using SafeMath for uint256; MorpherState state; event BecomeValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event StepDownAsValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event ElectedAdministrator(address indexed _administratorAddress, uint256 _votes); event ElectedOracle(address indexed _oracleAddress, uint256 _votes); uint256 public constant MINVALIDATORLOCKUP = 10**25; uint256 public constant MAXVALIDATORS = 21; uint256 public constant VALIDATORWARMUPPERIOD = 7 days; uint256 public numberOfValidators; uint256 public lastValidatorJoined; uint256 public rewardBasisPoints; address public morpherToken; mapping(address => uint256) private validatorIndex; mapping(address => uint256) private validatorJoinedAtTime; mapping(uint256 => address) private validatorAddress; mapping(address => address) private oracleVote; mapping(address => address) private administratorVote; mapping(address => uint256) private countVotes; constructor(address _stateAddress, address _coldStorageOwnerAddress) public { } modifier onlyValidator() { } function setMorpherState(address _stateAddress) private { } function setMorpherTokenAddress(address _address) public onlyOwner { } function getValidatorAddress(uint256 _index) public view returns (address _address) { } function getValidatorIndex(address _address) public view returns (uint256 _index) { } function isValidator(address _address) public view returns (bool) { } function setOracle(address _oracleAddress) private { } function setAdministrator(address _administratorAddress) private { } function getMorpherAdministrator() public view returns (address _address) { } function getMorpherOracle() public view returns (address _address) { } function getOracleVote(address _address) public view returns (address _votedOracleAddress) { } function becomeValidator() public { } function stepDownValidator() public onlyValidator { // Stepping down as validator nullifies the validator's votes and releases his token // from escrow. If the validator stepping down is not the validator that joined last, // all validators who joined after the validator stepping down receive 10^7 * 0.99 token from // escrow, and their validator ordinal number is reduced by one. E.g. if validator 3 of 5 steps down // validator 4 becomes validator 3, and validator 5 becomes validator 4. Both receive 10^7 * 0.99 token // from escrow, as their new position requires fewer token in lockup. 1% of the token released from escrow // are burned for every validator receiving a payout. // Burning prevents vote delay attacks: validators stepping down and re-joining could // delay votes for VALIDATORWARMUPPERIOD. uint256 _myValidatorIndex = validatorIndex[msg.sender]; require(<FILL_ME>) // Stepping down as validator potentially releases token to the other validatorAddresses for (uint256 i = _myValidatorIndex; i < numberOfValidators; i++) { validatorAddress[i] = validatorAddress[i+1]; validatorIndex[validatorAddress[i]] = i; // Release 9.9m of token to every validator moving up, burn 0.1m token state.transfer(address(this), validatorAddress[i], MINVALIDATORLOCKUP.div(100).mul(99)); state.burn(address(this), MINVALIDATORLOCKUP.div(100)); } // Release 99% of escrow token of validator dropping out, burn 1% validatorAddress[numberOfValidators] = address(0); validatorIndex[msg.sender] = 0; validatorJoinedAtTime[msg.sender] = 0; oracleVote[msg.sender] = address(0); administratorVote[msg.sender] = address(0); numberOfValidators = numberOfValidators.sub(1); countOracleVote(); countAdministratorVote(); state.transfer(address(this), msg.sender, MINVALIDATORLOCKUP.mul(_myValidatorIndex).div(100).mul(99)); state.burn(address(this), MINVALIDATORLOCKUP.mul(_myValidatorIndex).div(100)); emit StepDownAsValidator(msg.sender, validatorIndex[msg.sender]); } function voteOracle(address _oracleAddress) public onlyValidator { } function voteAdministrator(address _administratorAddress) public onlyValidator { } function countOracleVote() public returns (address _votedOracleAddress, uint256 _votes) { } function countAdministratorVote() public returns (address _appointedAdministrator, uint256 _votes) { } }
state.balanceOf(address(this))>=MINVALIDATORLOCKUP.mul(numberOfValidators),"MorpherGovernance: Escrow does not have enough funds. Should not happen."
5,306
state.balanceOf(address(this))>=MINVALIDATORLOCKUP.mul(numberOfValidators)
"MorpherGovernance: Validator was just appointed and is not eligible to vote yet."
pragma solidity 0.5.16; // ------------------------------------------------------------------------ // Morpher Governance (MAIN CHAIN ONLY) // // Every user able and willig to lock up sufficient token can become a validator // of the Morpher protocol. Validators function similiar to a board of directors // and vote on the protocol Administrator and the Oracle contract. // The Administrator (=Protocol CEO) has the power to add/delete markets and to // pause the contracts to allow for updates. // The Oracle contract is the address of the contract allowed to fetch prices // from outside the smart contract. // // It becomes progressively harder to become a valdiator. Each new validator // has to lock up (numberOfValidators + 1) * 10m Morpher token. Upon stepping // down as validator only 99% of the locked up token are returned, the other 1% // are burned. // // Governance is expected to become more sophisticated in the future // ------------------------------------------------------------------------ import "./Ownable.sol"; import "./SafeMath.sol"; import "./MorpherState.sol"; contract MorpherGovernance is Ownable { using SafeMath for uint256; MorpherState state; event BecomeValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event StepDownAsValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event ElectedAdministrator(address indexed _administratorAddress, uint256 _votes); event ElectedOracle(address indexed _oracleAddress, uint256 _votes); uint256 public constant MINVALIDATORLOCKUP = 10**25; uint256 public constant MAXVALIDATORS = 21; uint256 public constant VALIDATORWARMUPPERIOD = 7 days; uint256 public numberOfValidators; uint256 public lastValidatorJoined; uint256 public rewardBasisPoints; address public morpherToken; mapping(address => uint256) private validatorIndex; mapping(address => uint256) private validatorJoinedAtTime; mapping(uint256 => address) private validatorAddress; mapping(address => address) private oracleVote; mapping(address => address) private administratorVote; mapping(address => uint256) private countVotes; constructor(address _stateAddress, address _coldStorageOwnerAddress) public { } modifier onlyValidator() { } function setMorpherState(address _stateAddress) private { } function setMorpherTokenAddress(address _address) public onlyOwner { } function getValidatorAddress(uint256 _index) public view returns (address _address) { } function getValidatorIndex(address _address) public view returns (uint256 _index) { } function isValidator(address _address) public view returns (bool) { } function setOracle(address _oracleAddress) private { } function setAdministrator(address _administratorAddress) private { } function getMorpherAdministrator() public view returns (address _address) { } function getMorpherOracle() public view returns (address _address) { } function getOracleVote(address _address) public view returns (address _votedOracleAddress) { } function becomeValidator() public { } function stepDownValidator() public onlyValidator { } function voteOracle(address _oracleAddress) public onlyValidator { require(<FILL_ME>) require(lastValidatorJoined.add(VALIDATORWARMUPPERIOD) < now, "MorpherGovernance: New validator joined the board recently, please wait for the end of the warm up period."); oracleVote[msg.sender] = _oracleAddress; // Count Oracle Votes (address _votedOracleAddress, uint256 _votes) = countOracleVote(); emit ElectedOracle(_votedOracleAddress, _votes); } function voteAdministrator(address _administratorAddress) public onlyValidator { } function countOracleVote() public returns (address _votedOracleAddress, uint256 _votes) { } function countAdministratorVote() public returns (address _appointedAdministrator, uint256 _votes) { } }
validatorJoinedAtTime[msg.sender].add(VALIDATORWARMUPPERIOD)<now,"MorpherGovernance: Validator was just appointed and is not eligible to vote yet."
5,306
validatorJoinedAtTime[msg.sender].add(VALIDATORWARMUPPERIOD)<now
"MorpherGovernance: New validator joined the board recently, please wait for the end of the warm up period."
pragma solidity 0.5.16; // ------------------------------------------------------------------------ // Morpher Governance (MAIN CHAIN ONLY) // // Every user able and willig to lock up sufficient token can become a validator // of the Morpher protocol. Validators function similiar to a board of directors // and vote on the protocol Administrator and the Oracle contract. // The Administrator (=Protocol CEO) has the power to add/delete markets and to // pause the contracts to allow for updates. // The Oracle contract is the address of the contract allowed to fetch prices // from outside the smart contract. // // It becomes progressively harder to become a valdiator. Each new validator // has to lock up (numberOfValidators + 1) * 10m Morpher token. Upon stepping // down as validator only 99% of the locked up token are returned, the other 1% // are burned. // // Governance is expected to become more sophisticated in the future // ------------------------------------------------------------------------ import "./Ownable.sol"; import "./SafeMath.sol"; import "./MorpherState.sol"; contract MorpherGovernance is Ownable { using SafeMath for uint256; MorpherState state; event BecomeValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event StepDownAsValidator(address indexed _sender, uint256 indexed _myValidatorIndex); event ElectedAdministrator(address indexed _administratorAddress, uint256 _votes); event ElectedOracle(address indexed _oracleAddress, uint256 _votes); uint256 public constant MINVALIDATORLOCKUP = 10**25; uint256 public constant MAXVALIDATORS = 21; uint256 public constant VALIDATORWARMUPPERIOD = 7 days; uint256 public numberOfValidators; uint256 public lastValidatorJoined; uint256 public rewardBasisPoints; address public morpherToken; mapping(address => uint256) private validatorIndex; mapping(address => uint256) private validatorJoinedAtTime; mapping(uint256 => address) private validatorAddress; mapping(address => address) private oracleVote; mapping(address => address) private administratorVote; mapping(address => uint256) private countVotes; constructor(address _stateAddress, address _coldStorageOwnerAddress) public { } modifier onlyValidator() { } function setMorpherState(address _stateAddress) private { } function setMorpherTokenAddress(address _address) public onlyOwner { } function getValidatorAddress(uint256 _index) public view returns (address _address) { } function getValidatorIndex(address _address) public view returns (uint256 _index) { } function isValidator(address _address) public view returns (bool) { } function setOracle(address _oracleAddress) private { } function setAdministrator(address _administratorAddress) private { } function getMorpherAdministrator() public view returns (address _address) { } function getMorpherOracle() public view returns (address _address) { } function getOracleVote(address _address) public view returns (address _votedOracleAddress) { } function becomeValidator() public { } function stepDownValidator() public onlyValidator { } function voteOracle(address _oracleAddress) public onlyValidator { require(validatorJoinedAtTime[msg.sender].add(VALIDATORWARMUPPERIOD) < now, "MorpherGovernance: Validator was just appointed and is not eligible to vote yet."); require(<FILL_ME>) oracleVote[msg.sender] = _oracleAddress; // Count Oracle Votes (address _votedOracleAddress, uint256 _votes) = countOracleVote(); emit ElectedOracle(_votedOracleAddress, _votes); } function voteAdministrator(address _administratorAddress) public onlyValidator { } function countOracleVote() public returns (address _votedOracleAddress, uint256 _votes) { } function countAdministratorVote() public returns (address _appointedAdministrator, uint256 _votes) { } }
lastValidatorJoined.add(VALIDATORWARMUPPERIOD)<now,"MorpherGovernance: New validator joined the board recently, please wait for the end of the warm up period."
5,306
lastValidatorJoined.add(VALIDATORWARMUPPERIOD)<now
'MerkleDistributor: Drop already claimed.'
// SPDX-License-Identifier: MIT AND GPL-v3-or-later pragma solidity 0.8.1; 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); /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { } } contract CloneFactory { function createClone(address target, bytes32 salt) internal returns (address result) { } function computeCloneAddress(address target, bytes32 salt) internal view returns (address) { } function isClone(address target, address query) internal view returns (bool result) { } } library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { } } interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); } interface IERC721 { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address owner); } 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) { } } library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { } } interface IAstrodrop { // Returns the address of the token distributed by this contract. function token() external view returns (address); // Returns the merkle root of the merkle tree containing account balances available to claim. function merkleRoot() external view returns (bytes32); // Returns true if the index has been marked claimed. function isClaimed(uint256 index) external view returns (bool); // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external; // This event is triggered whenever a call to #claim succeeds. event Claimed(uint256 index, address account, uint256 amount); } contract Astrodrop is IAstrodrop, Ownable { using SafeERC20 for IERC20; address public override token; bytes32 public override merkleRoot; bool public initialized; uint256 public expireTimestamp; // This is a packed array of booleans. mapping(uint256 => uint256) public claimedBitMap; function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external { } function isClaimed(uint256 index) public view override returns (bool) { } function _setClaimed(uint256 index) private { } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { require(<FILL_ME>) // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Astrodrop: Invalid proof'); // Mark it claimed and send the token. _setClaimed(index); IERC20(token).safeTransfer(account, amount); emit Claimed(index, account, amount); } function sweep(address token_, address target) external onlyOwner { } } contract AstrodropERC721 is IAstrodrop, Ownable { using SafeERC20 for IERC20; address public override token; bytes32 public override merkleRoot; bool public initialized; uint256 public expireTimestamp; // This is a packed array of booleans. mapping(uint256 => uint256) public claimedBitMap; function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external { } function isClaimed(uint256 index) public view override returns (bool) { } function _setClaimed(uint256 index) private { } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { } function sweep(address token_, address target) external onlyOwner { } } contract AstrodropFactory is CloneFactory { event CreateAstrodrop(address astrodrop, bytes32 ipfsHash); function createAstrodrop( address template, address token, bytes32 merkleRoot, uint256 expireTimestamp, bytes32 salt, bytes32 ipfsHash ) external returns (Astrodrop drop) { } function computeAstrodropAddress( address template, bytes32 salt ) external view returns (address) { } function isAstrodrop(address template, address query) external view returns (bool) { } }
!isClaimed(index),'MerkleDistributor: Drop already claimed.'
5,379
!isClaimed(index)
'Astrodrop: Invalid proof'
// SPDX-License-Identifier: MIT AND GPL-v3-or-later pragma solidity 0.8.1; 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); /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { } } contract CloneFactory { function createClone(address target, bytes32 salt) internal returns (address result) { } function computeCloneAddress(address target, bytes32 salt) internal view returns (address) { } function isClone(address target, address query) internal view returns (bool result) { } } library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { } } interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); } interface IERC721 { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address owner); } 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) { } } library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { } } interface IAstrodrop { // Returns the address of the token distributed by this contract. function token() external view returns (address); // Returns the merkle root of the merkle tree containing account balances available to claim. function merkleRoot() external view returns (bytes32); // Returns true if the index has been marked claimed. function isClaimed(uint256 index) external view returns (bool); // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external; // This event is triggered whenever a call to #claim succeeds. event Claimed(uint256 index, address account, uint256 amount); } contract Astrodrop is IAstrodrop, Ownable { using SafeERC20 for IERC20; address public override token; bytes32 public override merkleRoot; bool public initialized; uint256 public expireTimestamp; // This is a packed array of booleans. mapping(uint256 => uint256) public claimedBitMap; function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external { } function isClaimed(uint256 index) public view override returns (bool) { } function _setClaimed(uint256 index) private { } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { require(!isClaimed(index), 'MerkleDistributor: Drop already claimed.'); // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require(<FILL_ME>) // Mark it claimed and send the token. _setClaimed(index); IERC20(token).safeTransfer(account, amount); emit Claimed(index, account, amount); } function sweep(address token_, address target) external onlyOwner { } } contract AstrodropERC721 is IAstrodrop, Ownable { using SafeERC20 for IERC20; address public override token; bytes32 public override merkleRoot; bool public initialized; uint256 public expireTimestamp; // This is a packed array of booleans. mapping(uint256 => uint256) public claimedBitMap; function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external { } function isClaimed(uint256 index) public view override returns (bool) { } function _setClaimed(uint256 index) private { } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { } function sweep(address token_, address target) external onlyOwner { } } contract AstrodropFactory is CloneFactory { event CreateAstrodrop(address astrodrop, bytes32 ipfsHash); function createAstrodrop( address template, address token, bytes32 merkleRoot, uint256 expireTimestamp, bytes32 salt, bytes32 ipfsHash ) external returns (Astrodrop drop) { } function computeAstrodropAddress( address template, bytes32 salt ) external view returns (address) { } function isAstrodrop(address template, address query) external view returns (bool) { } }
MerkleProof.verify(merkleProof,merkleRoot,node),'Astrodrop: Invalid proof'
5,379
MerkleProof.verify(merkleProof,merkleRoot,node)
"NO_ENTRY: Cannot enter a noEntry function"
/* * Copyright 2020 Dolomite * * 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.0; contract DolomiteMarginReentrancyGuard { uint256 private _guardCounter; // Functions with this modifier can not be re-entered // (sets counter to odd number when executing, even when finished) modifier singleEntry { } // Functions with this modifier can only be called after entering a singleEntry function modifier noEntry { require(<FILL_ME>) // counter must be odd number _; } }
_guardCounter%2==1,"NO_ENTRY: Cannot enter a noEntry function"
5,471
_guardCounter%2==1
null
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; library Math { function max(uint a, uint b) internal pure returns (uint) { } function min(uint a, uint b) internal pure returns (uint) { } } interface erc20 { function totalSupply() external view returns (uint256); function transfer(address recipient, uint amount) external returns (bool); function balanceOf(address) external view returns (uint); function transferFrom(address sender, address recipient, uint amount) external returns (bool); function approve(address spender, uint value) external returns (bool); } interface ve { function token() external view returns (address); function balanceOfNFT(uint) external view returns (uint); function isApprovedOrOwner(address, uint) external view returns (bool); function isUnlocked() external view returns (bool); function locked__end(uint) external view returns (uint); function create_lock_for(uint, uint, address) external returns (uint); function deposit_for(uint, uint) external; function ownerOf(uint) external view returns (address); function transferFrom(address, address, uint) external; } interface IBribe { function notifyRewardAmount(address token, uint amount) external; function left(address token) external view returns (uint); } interface Voter { function attachTokenToGauge(uint _tokenId, address account) external; function detachTokenFromGauge(uint _tokenId, address account) external; function emitDeposit(uint _tokenId, address account, uint amount) external; function emitWithdraw(uint _tokenId, address account, uint amount) external; function distribute(address _gauge) external; } // Gauges are used to incentivize pools, they emit reward tokens over 7 days for staked LP tokens contract Gauge { address public immutable stake; // the asset token that needs to be staked for rewards address public immutable _ve; // the ve token used for gauges address public immutable bribe; address public immutable voter; bool internal depositsOpen; uint public derivedSupply; mapping(address => uint) public derivedBalances; uint internal constant DURATION = 7 days; // rewards are released over 7 days uint internal constant PRECISION = 10 ** 18; // default snx staking contract implementation mapping(address => uint) public rewardRate; mapping(address => uint) public periodFinish; mapping(address => uint) public lastUpdateTime; mapping(address => uint) public rewardPerTokenStored; mapping(address => mapping(address => uint)) public lastEarn; mapping(address => mapping(address => uint)) public userRewardPerTokenStored; mapping(address => uint) public tokenIds; uint public totalSupply; mapping(address => uint) public balanceOf; address[] public rewards; mapping(address => bool) public isReward; /// @notice A checkpoint for marking balance struct Checkpoint { uint timestamp; uint balanceOf; } /// @notice A checkpoint for marking reward rate struct RewardPerTokenCheckpoint { uint timestamp; uint rewardPerToken; } /// @notice A checkpoint for marking supply struct SupplyCheckpoint { uint timestamp; uint supply; } /// @notice A record of balance checkpoints for each account, by index mapping (address => mapping (uint => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint) public numCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (uint => SupplyCheckpoint) public supplyCheckpoints; /// @notice The number of checkpoints uint public supplyNumCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (address => mapping (uint => RewardPerTokenCheckpoint)) public rewardPerTokenCheckpoints; /// @notice The number of checkpoints for each token mapping (address => uint) public rewardPerTokenNumCheckpoints; event Deposit(address indexed from, uint tokenId, uint amount); event Withdraw(address indexed from, uint tokenId, uint amount); event NotifyReward(address indexed from, address indexed reward, uint amount); event ClaimRewards(address indexed from, address indexed reward, uint amount); constructor(address _stake, address _bribe, address __ve, address _voter) { } modifier whenDepositsOpen() { } function stopDeposits() external { } function openDeposits() external { } function isDepositsOpen() external view returns (bool) { } // simple re-entrancy check uint internal _unlocked = 1; modifier lock() { } /** * @notice Determine the prior balance for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param timestamp The timestamp to get the balance at * @return The balance the account had as of the given block */ function getPriorBalanceIndex(address account, uint timestamp) public view returns (uint) { } function getPriorSupplyIndex(uint timestamp) public view returns (uint) { } function getPriorRewardPerToken(address token, uint timestamp) public view returns (uint, uint) { } function _writeCheckpoint(address account, uint balance) internal { } function _writeRewardPerTokenCheckpoint(address token, uint reward, uint timestamp) internal { } function _writeSupplyCheckpoint() internal { } function rewardsListLength() external view returns (uint) { } // returns the last time the reward was modified or periodFinish if the reward has ended function lastTimeRewardApplicable(address token) public view returns (uint) { } function getReward(address account, address[] memory tokens) external lock { } function rewardPerToken(address token) public view returns (uint) { } function derivedBalance(address account) public view returns (uint) { } function batchRewardPerToken(address token, uint maxRuns) external { } function _batchRewardPerToken(address token, uint maxRuns) internal returns (uint, uint) { } function _calcRewardPerToken(address token, uint timestamp1, uint timestamp0, uint supply, uint startTimestamp) internal view returns (uint, uint) { } function _updateRewardPerToken(address token) internal returns (uint, uint) { } // earned is an estimation, it won't be exact till the supply > rewardPerToken calculations have run function earned(address token, address account) public view returns (uint) { } function depositAll(uint tokenId) external { } function deposit(uint amount, uint tokenId) public whenDepositsOpen lock { require(amount > 0); _safeTransferFrom(stake, msg.sender, address(this), amount); totalSupply += amount; balanceOf[msg.sender] += amount; if (tokenId > 0) { require(<FILL_ME>) if (tokenIds[msg.sender] == 0) { tokenIds[msg.sender] = tokenId; Voter(voter).attachTokenToGauge(tokenId, msg.sender); } require(tokenIds[msg.sender] == tokenId); } else { tokenId = tokenIds[msg.sender]; } uint _derivedBalance = derivedBalances[msg.sender]; derivedSupply -= _derivedBalance; _derivedBalance = derivedBalance(msg.sender); derivedBalances[msg.sender] = _derivedBalance; derivedSupply += _derivedBalance; _writeCheckpoint(msg.sender, _derivedBalance); _writeSupplyCheckpoint(); Voter(voter).emitDeposit(tokenId, msg.sender, amount); emit Deposit(msg.sender, tokenId, amount); } function withdrawAll() external { } function withdraw(uint amount) public { } function withdrawToken(uint amount, uint tokenId) public lock { } function left(address token) external view returns (uint) { } function notifyRewardAmount(address token, uint amount) external lock { } function _safeTransfer(address token, address to, uint256 value) internal { } function _safeTransferFrom(address token, address from, address to, uint256 value) internal { } function _safeApprove(address token, address spender, uint256 value) internal { } } contract GaugeFactory { address public last_gauge; function createGauge(address _asset, address _bribe, address _ve) external returns (address) { } function createGaugeSingle(address _asset, address _bribe, address _ve, address _voter) external returns (address) { } }
ve(_ve).ownerOf(tokenId)==msg.sender
5,491
ve(_ve).ownerOf(tokenId)==msg.sender
null
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; library Math { function max(uint a, uint b) internal pure returns (uint) { } function min(uint a, uint b) internal pure returns (uint) { } } interface erc20 { function totalSupply() external view returns (uint256); function transfer(address recipient, uint amount) external returns (bool); function balanceOf(address) external view returns (uint); function transferFrom(address sender, address recipient, uint amount) external returns (bool); function approve(address spender, uint value) external returns (bool); } interface ve { function token() external view returns (address); function balanceOfNFT(uint) external view returns (uint); function isApprovedOrOwner(address, uint) external view returns (bool); function isUnlocked() external view returns (bool); function locked__end(uint) external view returns (uint); function create_lock_for(uint, uint, address) external returns (uint); function deposit_for(uint, uint) external; function ownerOf(uint) external view returns (address); function transferFrom(address, address, uint) external; } interface IBribe { function notifyRewardAmount(address token, uint amount) external; function left(address token) external view returns (uint); } interface Voter { function attachTokenToGauge(uint _tokenId, address account) external; function detachTokenFromGauge(uint _tokenId, address account) external; function emitDeposit(uint _tokenId, address account, uint amount) external; function emitWithdraw(uint _tokenId, address account, uint amount) external; function distribute(address _gauge) external; } // Gauges are used to incentivize pools, they emit reward tokens over 7 days for staked LP tokens contract Gauge { address public immutable stake; // the asset token that needs to be staked for rewards address public immutable _ve; // the ve token used for gauges address public immutable bribe; address public immutable voter; bool internal depositsOpen; uint public derivedSupply; mapping(address => uint) public derivedBalances; uint internal constant DURATION = 7 days; // rewards are released over 7 days uint internal constant PRECISION = 10 ** 18; // default snx staking contract implementation mapping(address => uint) public rewardRate; mapping(address => uint) public periodFinish; mapping(address => uint) public lastUpdateTime; mapping(address => uint) public rewardPerTokenStored; mapping(address => mapping(address => uint)) public lastEarn; mapping(address => mapping(address => uint)) public userRewardPerTokenStored; mapping(address => uint) public tokenIds; uint public totalSupply; mapping(address => uint) public balanceOf; address[] public rewards; mapping(address => bool) public isReward; /// @notice A checkpoint for marking balance struct Checkpoint { uint timestamp; uint balanceOf; } /// @notice A checkpoint for marking reward rate struct RewardPerTokenCheckpoint { uint timestamp; uint rewardPerToken; } /// @notice A checkpoint for marking supply struct SupplyCheckpoint { uint timestamp; uint supply; } /// @notice A record of balance checkpoints for each account, by index mapping (address => mapping (uint => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint) public numCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (uint => SupplyCheckpoint) public supplyCheckpoints; /// @notice The number of checkpoints uint public supplyNumCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (address => mapping (uint => RewardPerTokenCheckpoint)) public rewardPerTokenCheckpoints; /// @notice The number of checkpoints for each token mapping (address => uint) public rewardPerTokenNumCheckpoints; event Deposit(address indexed from, uint tokenId, uint amount); event Withdraw(address indexed from, uint tokenId, uint amount); event NotifyReward(address indexed from, address indexed reward, uint amount); event ClaimRewards(address indexed from, address indexed reward, uint amount); constructor(address _stake, address _bribe, address __ve, address _voter) { } modifier whenDepositsOpen() { } function stopDeposits() external { } function openDeposits() external { } function isDepositsOpen() external view returns (bool) { } // simple re-entrancy check uint internal _unlocked = 1; modifier lock() { } /** * @notice Determine the prior balance for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param timestamp The timestamp to get the balance at * @return The balance the account had as of the given block */ function getPriorBalanceIndex(address account, uint timestamp) public view returns (uint) { } function getPriorSupplyIndex(uint timestamp) public view returns (uint) { } function getPriorRewardPerToken(address token, uint timestamp) public view returns (uint, uint) { } function _writeCheckpoint(address account, uint balance) internal { } function _writeRewardPerTokenCheckpoint(address token, uint reward, uint timestamp) internal { } function _writeSupplyCheckpoint() internal { } function rewardsListLength() external view returns (uint) { } // returns the last time the reward was modified or periodFinish if the reward has ended function lastTimeRewardApplicable(address token) public view returns (uint) { } function getReward(address account, address[] memory tokens) external lock { } function rewardPerToken(address token) public view returns (uint) { } function derivedBalance(address account) public view returns (uint) { } function batchRewardPerToken(address token, uint maxRuns) external { } function _batchRewardPerToken(address token, uint maxRuns) internal returns (uint, uint) { } function _calcRewardPerToken(address token, uint timestamp1, uint timestamp0, uint supply, uint startTimestamp) internal view returns (uint, uint) { } function _updateRewardPerToken(address token) internal returns (uint, uint) { } // earned is an estimation, it won't be exact till the supply > rewardPerToken calculations have run function earned(address token, address account) public view returns (uint) { } function depositAll(uint tokenId) external { } function deposit(uint amount, uint tokenId) public whenDepositsOpen lock { require(amount > 0); _safeTransferFrom(stake, msg.sender, address(this), amount); totalSupply += amount; balanceOf[msg.sender] += amount; if (tokenId > 0) { require(ve(_ve).ownerOf(tokenId) == msg.sender); if (tokenIds[msg.sender] == 0) { tokenIds[msg.sender] = tokenId; Voter(voter).attachTokenToGauge(tokenId, msg.sender); } require(<FILL_ME>) } else { tokenId = tokenIds[msg.sender]; } uint _derivedBalance = derivedBalances[msg.sender]; derivedSupply -= _derivedBalance; _derivedBalance = derivedBalance(msg.sender); derivedBalances[msg.sender] = _derivedBalance; derivedSupply += _derivedBalance; _writeCheckpoint(msg.sender, _derivedBalance); _writeSupplyCheckpoint(); Voter(voter).emitDeposit(tokenId, msg.sender, amount); emit Deposit(msg.sender, tokenId, amount); } function withdrawAll() external { } function withdraw(uint amount) public { } function withdrawToken(uint amount, uint tokenId) public lock { } function left(address token) external view returns (uint) { } function notifyRewardAmount(address token, uint amount) external lock { } function _safeTransfer(address token, address to, uint256 value) internal { } function _safeTransferFrom(address token, address from, address to, uint256 value) internal { } function _safeApprove(address token, address spender, uint256 value) internal { } } contract GaugeFactory { address public last_gauge; function createGauge(address _asset, address _bribe, address _ve) external returns (address) { } function createGaugeSingle(address _asset, address _bribe, address _ve, address _voter) external returns (address) { } }
tokenIds[msg.sender]==tokenId
5,491
tokenIds[msg.sender]==tokenId
null
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; library Math { function max(uint a, uint b) internal pure returns (uint) { } function min(uint a, uint b) internal pure returns (uint) { } } interface erc20 { function totalSupply() external view returns (uint256); function transfer(address recipient, uint amount) external returns (bool); function balanceOf(address) external view returns (uint); function transferFrom(address sender, address recipient, uint amount) external returns (bool); function approve(address spender, uint value) external returns (bool); } interface ve { function token() external view returns (address); function balanceOfNFT(uint) external view returns (uint); function isApprovedOrOwner(address, uint) external view returns (bool); function isUnlocked() external view returns (bool); function locked__end(uint) external view returns (uint); function create_lock_for(uint, uint, address) external returns (uint); function deposit_for(uint, uint) external; function ownerOf(uint) external view returns (address); function transferFrom(address, address, uint) external; } interface IBribe { function notifyRewardAmount(address token, uint amount) external; function left(address token) external view returns (uint); } interface Voter { function attachTokenToGauge(uint _tokenId, address account) external; function detachTokenFromGauge(uint _tokenId, address account) external; function emitDeposit(uint _tokenId, address account, uint amount) external; function emitWithdraw(uint _tokenId, address account, uint amount) external; function distribute(address _gauge) external; } // Gauges are used to incentivize pools, they emit reward tokens over 7 days for staked LP tokens contract Gauge { address public immutable stake; // the asset token that needs to be staked for rewards address public immutable _ve; // the ve token used for gauges address public immutable bribe; address public immutable voter; bool internal depositsOpen; uint public derivedSupply; mapping(address => uint) public derivedBalances; uint internal constant DURATION = 7 days; // rewards are released over 7 days uint internal constant PRECISION = 10 ** 18; // default snx staking contract implementation mapping(address => uint) public rewardRate; mapping(address => uint) public periodFinish; mapping(address => uint) public lastUpdateTime; mapping(address => uint) public rewardPerTokenStored; mapping(address => mapping(address => uint)) public lastEarn; mapping(address => mapping(address => uint)) public userRewardPerTokenStored; mapping(address => uint) public tokenIds; uint public totalSupply; mapping(address => uint) public balanceOf; address[] public rewards; mapping(address => bool) public isReward; /// @notice A checkpoint for marking balance struct Checkpoint { uint timestamp; uint balanceOf; } /// @notice A checkpoint for marking reward rate struct RewardPerTokenCheckpoint { uint timestamp; uint rewardPerToken; } /// @notice A checkpoint for marking supply struct SupplyCheckpoint { uint timestamp; uint supply; } /// @notice A record of balance checkpoints for each account, by index mapping (address => mapping (uint => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint) public numCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (uint => SupplyCheckpoint) public supplyCheckpoints; /// @notice The number of checkpoints uint public supplyNumCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (address => mapping (uint => RewardPerTokenCheckpoint)) public rewardPerTokenCheckpoints; /// @notice The number of checkpoints for each token mapping (address => uint) public rewardPerTokenNumCheckpoints; event Deposit(address indexed from, uint tokenId, uint amount); event Withdraw(address indexed from, uint tokenId, uint amount); event NotifyReward(address indexed from, address indexed reward, uint amount); event ClaimRewards(address indexed from, address indexed reward, uint amount); constructor(address _stake, address _bribe, address __ve, address _voter) { } modifier whenDepositsOpen() { } function stopDeposits() external { } function openDeposits() external { } function isDepositsOpen() external view returns (bool) { } // simple re-entrancy check uint internal _unlocked = 1; modifier lock() { } /** * @notice Determine the prior balance for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param timestamp The timestamp to get the balance at * @return The balance the account had as of the given block */ function getPriorBalanceIndex(address account, uint timestamp) public view returns (uint) { } function getPriorSupplyIndex(uint timestamp) public view returns (uint) { } function getPriorRewardPerToken(address token, uint timestamp) public view returns (uint, uint) { } function _writeCheckpoint(address account, uint balance) internal { } function _writeRewardPerTokenCheckpoint(address token, uint reward, uint timestamp) internal { } function _writeSupplyCheckpoint() internal { } function rewardsListLength() external view returns (uint) { } // returns the last time the reward was modified or periodFinish if the reward has ended function lastTimeRewardApplicable(address token) public view returns (uint) { } function getReward(address account, address[] memory tokens) external lock { } function rewardPerToken(address token) public view returns (uint) { } function derivedBalance(address account) public view returns (uint) { } function batchRewardPerToken(address token, uint maxRuns) external { } function _batchRewardPerToken(address token, uint maxRuns) internal returns (uint, uint) { } function _calcRewardPerToken(address token, uint timestamp1, uint timestamp0, uint supply, uint startTimestamp) internal view returns (uint, uint) { } function _updateRewardPerToken(address token) internal returns (uint, uint) { } // earned is an estimation, it won't be exact till the supply > rewardPerToken calculations have run function earned(address token, address account) public view returns (uint) { } function depositAll(uint tokenId) external { } function deposit(uint amount, uint tokenId) public whenDepositsOpen lock { } function withdrawAll() external { } function withdraw(uint amount) public { } function withdrawToken(uint amount, uint tokenId) public lock { } function left(address token) external view returns (uint) { } function notifyRewardAmount(address token, uint amount) external lock { require(token != stake); require(amount > 0); if (rewardRate[token] == 0) _writeRewardPerTokenCheckpoint(token, 0, block.timestamp); (rewardPerTokenStored[token], lastUpdateTime[token]) = _updateRewardPerToken(token); if (block.timestamp >= periodFinish[token]) { _safeTransferFrom(token, msg.sender, address(this), amount); rewardRate[token] = amount / DURATION; } else { uint _remaining = periodFinish[token] - block.timestamp; uint _left = _remaining * rewardRate[token]; require(amount > _left); _safeTransferFrom(token, msg.sender, address(this), amount); rewardRate[token] = (amount + _left) / DURATION; } require(<FILL_ME>) uint balance = erc20(token).balanceOf(address(this)); require(rewardRate[token] <= balance / DURATION, "Provided reward too high"); periodFinish[token] = block.timestamp + DURATION; if (!isReward[token]) { isReward[token] = true; rewards.push(token); } emit NotifyReward(msg.sender, token, amount); } function _safeTransfer(address token, address to, uint256 value) internal { } function _safeTransferFrom(address token, address from, address to, uint256 value) internal { } function _safeApprove(address token, address spender, uint256 value) internal { } } contract GaugeFactory { address public last_gauge; function createGauge(address _asset, address _bribe, address _ve) external returns (address) { } function createGaugeSingle(address _asset, address _bribe, address _ve, address _voter) external returns (address) { } }
rewardRate[token]>0
5,491
rewardRate[token]>0
"Provided reward too high"
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; library Math { function max(uint a, uint b) internal pure returns (uint) { } function min(uint a, uint b) internal pure returns (uint) { } } interface erc20 { function totalSupply() external view returns (uint256); function transfer(address recipient, uint amount) external returns (bool); function balanceOf(address) external view returns (uint); function transferFrom(address sender, address recipient, uint amount) external returns (bool); function approve(address spender, uint value) external returns (bool); } interface ve { function token() external view returns (address); function balanceOfNFT(uint) external view returns (uint); function isApprovedOrOwner(address, uint) external view returns (bool); function isUnlocked() external view returns (bool); function locked__end(uint) external view returns (uint); function create_lock_for(uint, uint, address) external returns (uint); function deposit_for(uint, uint) external; function ownerOf(uint) external view returns (address); function transferFrom(address, address, uint) external; } interface IBribe { function notifyRewardAmount(address token, uint amount) external; function left(address token) external view returns (uint); } interface Voter { function attachTokenToGauge(uint _tokenId, address account) external; function detachTokenFromGauge(uint _tokenId, address account) external; function emitDeposit(uint _tokenId, address account, uint amount) external; function emitWithdraw(uint _tokenId, address account, uint amount) external; function distribute(address _gauge) external; } // Gauges are used to incentivize pools, they emit reward tokens over 7 days for staked LP tokens contract Gauge { address public immutable stake; // the asset token that needs to be staked for rewards address public immutable _ve; // the ve token used for gauges address public immutable bribe; address public immutable voter; bool internal depositsOpen; uint public derivedSupply; mapping(address => uint) public derivedBalances; uint internal constant DURATION = 7 days; // rewards are released over 7 days uint internal constant PRECISION = 10 ** 18; // default snx staking contract implementation mapping(address => uint) public rewardRate; mapping(address => uint) public periodFinish; mapping(address => uint) public lastUpdateTime; mapping(address => uint) public rewardPerTokenStored; mapping(address => mapping(address => uint)) public lastEarn; mapping(address => mapping(address => uint)) public userRewardPerTokenStored; mapping(address => uint) public tokenIds; uint public totalSupply; mapping(address => uint) public balanceOf; address[] public rewards; mapping(address => bool) public isReward; /// @notice A checkpoint for marking balance struct Checkpoint { uint timestamp; uint balanceOf; } /// @notice A checkpoint for marking reward rate struct RewardPerTokenCheckpoint { uint timestamp; uint rewardPerToken; } /// @notice A checkpoint for marking supply struct SupplyCheckpoint { uint timestamp; uint supply; } /// @notice A record of balance checkpoints for each account, by index mapping (address => mapping (uint => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint) public numCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (uint => SupplyCheckpoint) public supplyCheckpoints; /// @notice The number of checkpoints uint public supplyNumCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (address => mapping (uint => RewardPerTokenCheckpoint)) public rewardPerTokenCheckpoints; /// @notice The number of checkpoints for each token mapping (address => uint) public rewardPerTokenNumCheckpoints; event Deposit(address indexed from, uint tokenId, uint amount); event Withdraw(address indexed from, uint tokenId, uint amount); event NotifyReward(address indexed from, address indexed reward, uint amount); event ClaimRewards(address indexed from, address indexed reward, uint amount); constructor(address _stake, address _bribe, address __ve, address _voter) { } modifier whenDepositsOpen() { } function stopDeposits() external { } function openDeposits() external { } function isDepositsOpen() external view returns (bool) { } // simple re-entrancy check uint internal _unlocked = 1; modifier lock() { } /** * @notice Determine the prior balance for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param timestamp The timestamp to get the balance at * @return The balance the account had as of the given block */ function getPriorBalanceIndex(address account, uint timestamp) public view returns (uint) { } function getPriorSupplyIndex(uint timestamp) public view returns (uint) { } function getPriorRewardPerToken(address token, uint timestamp) public view returns (uint, uint) { } function _writeCheckpoint(address account, uint balance) internal { } function _writeRewardPerTokenCheckpoint(address token, uint reward, uint timestamp) internal { } function _writeSupplyCheckpoint() internal { } function rewardsListLength() external view returns (uint) { } // returns the last time the reward was modified or periodFinish if the reward has ended function lastTimeRewardApplicable(address token) public view returns (uint) { } function getReward(address account, address[] memory tokens) external lock { } function rewardPerToken(address token) public view returns (uint) { } function derivedBalance(address account) public view returns (uint) { } function batchRewardPerToken(address token, uint maxRuns) external { } function _batchRewardPerToken(address token, uint maxRuns) internal returns (uint, uint) { } function _calcRewardPerToken(address token, uint timestamp1, uint timestamp0, uint supply, uint startTimestamp) internal view returns (uint, uint) { } function _updateRewardPerToken(address token) internal returns (uint, uint) { } // earned is an estimation, it won't be exact till the supply > rewardPerToken calculations have run function earned(address token, address account) public view returns (uint) { } function depositAll(uint tokenId) external { } function deposit(uint amount, uint tokenId) public whenDepositsOpen lock { } function withdrawAll() external { } function withdraw(uint amount) public { } function withdrawToken(uint amount, uint tokenId) public lock { } function left(address token) external view returns (uint) { } function notifyRewardAmount(address token, uint amount) external lock { require(token != stake); require(amount > 0); if (rewardRate[token] == 0) _writeRewardPerTokenCheckpoint(token, 0, block.timestamp); (rewardPerTokenStored[token], lastUpdateTime[token]) = _updateRewardPerToken(token); if (block.timestamp >= periodFinish[token]) { _safeTransferFrom(token, msg.sender, address(this), amount); rewardRate[token] = amount / DURATION; } else { uint _remaining = periodFinish[token] - block.timestamp; uint _left = _remaining * rewardRate[token]; require(amount > _left); _safeTransferFrom(token, msg.sender, address(this), amount); rewardRate[token] = (amount + _left) / DURATION; } require(rewardRate[token] > 0); uint balance = erc20(token).balanceOf(address(this)); require(<FILL_ME>) periodFinish[token] = block.timestamp + DURATION; if (!isReward[token]) { isReward[token] = true; rewards.push(token); } emit NotifyReward(msg.sender, token, amount); } function _safeTransfer(address token, address to, uint256 value) internal { } function _safeTransferFrom(address token, address from, address to, uint256 value) internal { } function _safeApprove(address token, address spender, uint256 value) internal { } } contract GaugeFactory { address public last_gauge; function createGauge(address _asset, address _bribe, address _ve) external returns (address) { } function createGaugeSingle(address _asset, address _bribe, address _ve, address _voter) external returns (address) { } }
rewardRate[token]<=balance/DURATION,"Provided reward too high"
5,491
rewardRate[token]<=balance/DURATION
null
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; library Math { function max(uint a, uint b) internal pure returns (uint) { } function min(uint a, uint b) internal pure returns (uint) { } } interface erc20 { function totalSupply() external view returns (uint256); function transfer(address recipient, uint amount) external returns (bool); function balanceOf(address) external view returns (uint); function transferFrom(address sender, address recipient, uint amount) external returns (bool); function approve(address spender, uint value) external returns (bool); } interface ve { function token() external view returns (address); function balanceOfNFT(uint) external view returns (uint); function isApprovedOrOwner(address, uint) external view returns (bool); function isUnlocked() external view returns (bool); function locked__end(uint) external view returns (uint); function create_lock_for(uint, uint, address) external returns (uint); function deposit_for(uint, uint) external; function ownerOf(uint) external view returns (address); function transferFrom(address, address, uint) external; } interface IBribe { function notifyRewardAmount(address token, uint amount) external; function left(address token) external view returns (uint); } interface Voter { function attachTokenToGauge(uint _tokenId, address account) external; function detachTokenFromGauge(uint _tokenId, address account) external; function emitDeposit(uint _tokenId, address account, uint amount) external; function emitWithdraw(uint _tokenId, address account, uint amount) external; function distribute(address _gauge) external; } // Gauges are used to incentivize pools, they emit reward tokens over 7 days for staked LP tokens contract Gauge { address public immutable stake; // the asset token that needs to be staked for rewards address public immutable _ve; // the ve token used for gauges address public immutable bribe; address public immutable voter; bool internal depositsOpen; uint public derivedSupply; mapping(address => uint) public derivedBalances; uint internal constant DURATION = 7 days; // rewards are released over 7 days uint internal constant PRECISION = 10 ** 18; // default snx staking contract implementation mapping(address => uint) public rewardRate; mapping(address => uint) public periodFinish; mapping(address => uint) public lastUpdateTime; mapping(address => uint) public rewardPerTokenStored; mapping(address => mapping(address => uint)) public lastEarn; mapping(address => mapping(address => uint)) public userRewardPerTokenStored; mapping(address => uint) public tokenIds; uint public totalSupply; mapping(address => uint) public balanceOf; address[] public rewards; mapping(address => bool) public isReward; /// @notice A checkpoint for marking balance struct Checkpoint { uint timestamp; uint balanceOf; } /// @notice A checkpoint for marking reward rate struct RewardPerTokenCheckpoint { uint timestamp; uint rewardPerToken; } /// @notice A checkpoint for marking supply struct SupplyCheckpoint { uint timestamp; uint supply; } /// @notice A record of balance checkpoints for each account, by index mapping (address => mapping (uint => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint) public numCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (uint => SupplyCheckpoint) public supplyCheckpoints; /// @notice The number of checkpoints uint public supplyNumCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (address => mapping (uint => RewardPerTokenCheckpoint)) public rewardPerTokenCheckpoints; /// @notice The number of checkpoints for each token mapping (address => uint) public rewardPerTokenNumCheckpoints; event Deposit(address indexed from, uint tokenId, uint amount); event Withdraw(address indexed from, uint tokenId, uint amount); event NotifyReward(address indexed from, address indexed reward, uint amount); event ClaimRewards(address indexed from, address indexed reward, uint amount); constructor(address _stake, address _bribe, address __ve, address _voter) { } modifier whenDepositsOpen() { } function stopDeposits() external { } function openDeposits() external { } function isDepositsOpen() external view returns (bool) { } // simple re-entrancy check uint internal _unlocked = 1; modifier lock() { } /** * @notice Determine the prior balance for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param timestamp The timestamp to get the balance at * @return The balance the account had as of the given block */ function getPriorBalanceIndex(address account, uint timestamp) public view returns (uint) { } function getPriorSupplyIndex(uint timestamp) public view returns (uint) { } function getPriorRewardPerToken(address token, uint timestamp) public view returns (uint, uint) { } function _writeCheckpoint(address account, uint balance) internal { } function _writeRewardPerTokenCheckpoint(address token, uint reward, uint timestamp) internal { } function _writeSupplyCheckpoint() internal { } function rewardsListLength() external view returns (uint) { } // returns the last time the reward was modified or periodFinish if the reward has ended function lastTimeRewardApplicable(address token) public view returns (uint) { } function getReward(address account, address[] memory tokens) external lock { } function rewardPerToken(address token) public view returns (uint) { } function derivedBalance(address account) public view returns (uint) { } function batchRewardPerToken(address token, uint maxRuns) external { } function _batchRewardPerToken(address token, uint maxRuns) internal returns (uint, uint) { } function _calcRewardPerToken(address token, uint timestamp1, uint timestamp0, uint supply, uint startTimestamp) internal view returns (uint, uint) { } function _updateRewardPerToken(address token) internal returns (uint, uint) { } // earned is an estimation, it won't be exact till the supply > rewardPerToken calculations have run function earned(address token, address account) public view returns (uint) { } function depositAll(uint tokenId) external { } function deposit(uint amount, uint tokenId) public whenDepositsOpen lock { } function withdrawAll() external { } function withdraw(uint amount) public { } function withdrawToken(uint amount, uint tokenId) public lock { } function left(address token) external view returns (uint) { } function notifyRewardAmount(address token, uint amount) external lock { } function _safeTransfer(address token, address to, uint256 value) internal { require(token.code.length > 0); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(erc20.transfer.selector, to, value)); require(<FILL_ME>) } function _safeTransferFrom(address token, address from, address to, uint256 value) internal { } function _safeApprove(address token, address spender, uint256 value) internal { } } contract GaugeFactory { address public last_gauge; function createGauge(address _asset, address _bribe, address _ve) external returns (address) { } function createGaugeSingle(address _asset, address _bribe, address _ve, address _voter) external returns (address) { } }
success&&(data.length==0||abi.decode(data,(bool)))
5,491
success&&(data.length==0||abi.decode(data,(bool)))
"Yo, can't mint while paused"
// Highflyers.sol // // degenerated.io // 2021 // zpm@ // // SPDX-License-Identifier: MIT // if you're looking to reuse this contract and have any questions, just lmk pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Highflyers is ERC721 { // counters is a safe way of counting that can only be +/- by one // https://docs.openzeppelin.com/contracts/4.x/api/utils#Counters using Counters for Counters.Counter; Counters.Counter private _tokensIssuedCounter; // traditionally we'd include SafeMath here, but safemath is no longer necessary in solidity 0.8.0+ // https://docs.openzeppelin.com/contracts/4.x/api/utils // using SafeMath for uint256; uint256 private constant MAX_TOKENS = 6969; uint256 private constant MAX_MINTABLE_AT_ONCE = 20; // total tokens, so 10 pair // this pricing scheme is degenerate ;) // pricing equation is: 0.015E + 0.027E * num_pairs, which results in // 1 = (0.015 + 0.027 * 1) = 0.0420 // 2 = (0.015 + 0.027 * 2) = 0.0690 // n = (0.015 + 0.027 * n) = (etc) // hehehehe uint256 private constant BASE_PRICE_PER_MINT = 15 * 10**15; // .027,000,000,000,000,000 eth in wei uint256 private constant PRICE_PER_PAIR = 27 * 10**15; // .027,000,000,000,000,000 eth in wei uint256 private constant TOKENS_PER_PAIR = 2; // derp // these are private because we write getters for them, no need to make them readable as-is string private _baseTokenURI; bool private _contractIsPaused; address private _ownerAddress; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // core contract logic constructor() ERC721("Highflyers", "HIGHFLYERS") { } // fyi: this used to have address mintAddress as an argument, but instead, we opted to simplify this function and // just mandate that the minted tokens are deposited back into the account that is paying for the mint (msg.sender) function mint(uint256 numberOfPairsToMint) public payable { // this is the public mint function, so check two things: // (1) require contract is not paused // (2) that the message contains enough ETH to perform the mint require(<FILL_ME>) require(msg.value >= (BASE_PRICE_PER_MINT + (numberOfPairsToMint * PRICE_PER_PAIR)), "Yo, you gotta pay at least the minimum" ); // mint _mintWithChecks(msg.sender, numberOfPairsToMint * TOKENS_PER_PAIR); } // the contract-specific function called by both ownerMintAirdrop() and public payable mint() // // IMPORTANT: this function takes the ACTUAL number of tokens to mint, notably, it is not aware of any pair minting // so the mint() and ownerMintAirdrop() functions MUST do the *2 adjustment in their own functions to mint pairs function _mintWithChecks(address mintAddress, uint256 numberOfTokensToMint) internal { } // override the _beforeTokenTransfer hook to check our local paused variable function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override { } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // simple getters // this overrides the inherited _baseURI(), which is used to construct the token uri. honestly, this seems like a // weird way to do this but seems to be a good solution without making the entire contract inherit ERC721URIStorage function _baseURI() internal override view returns (string memory) { } function getIssuedTokenCount() public view returns (uint256) { } function getContractIsPaused() public view returns (bool) { } // this is necessary to be able to edit the collection on opensea; it's a simple way to enable this functionality // without making the entire contract inherit ERC721Ownable, which has a bunch of functions we don't need function owner() public view returns (address) { } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // owner management functions modifier ownerOnlyACL() { } // set a new base token URI, in case metadata/image provider changes function ownerSetBaseTokenURI(string memory newBaseTokenURI) public ownerOnlyACL { } // set paused state function ownerSetPausedState(bool contractIsPaused) public ownerOnlyACL { } // owner manual mint (airdrop) ability, for free, regardless if contract is paused or not function ownerMintAirdrop(address mintAddress, uint256 numberOfPairsToMint) public ownerOnlyACL { } // simplified withdraw function callable by only the owner that withdraws to the owner address. there are no // internal state changes here, and it can only be called by owner, so this should(?) be safe from reentrancy function ownerWithdrawContractBalance() public ownerOnlyACL { } }
!_contractIsPaused,"Yo, can't mint while paused"
5,507
!_contractIsPaused
"Yo, you gotta pay at least the minimum"
// Highflyers.sol // // degenerated.io // 2021 // zpm@ // // SPDX-License-Identifier: MIT // if you're looking to reuse this contract and have any questions, just lmk pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Highflyers is ERC721 { // counters is a safe way of counting that can only be +/- by one // https://docs.openzeppelin.com/contracts/4.x/api/utils#Counters using Counters for Counters.Counter; Counters.Counter private _tokensIssuedCounter; // traditionally we'd include SafeMath here, but safemath is no longer necessary in solidity 0.8.0+ // https://docs.openzeppelin.com/contracts/4.x/api/utils // using SafeMath for uint256; uint256 private constant MAX_TOKENS = 6969; uint256 private constant MAX_MINTABLE_AT_ONCE = 20; // total tokens, so 10 pair // this pricing scheme is degenerate ;) // pricing equation is: 0.015E + 0.027E * num_pairs, which results in // 1 = (0.015 + 0.027 * 1) = 0.0420 // 2 = (0.015 + 0.027 * 2) = 0.0690 // n = (0.015 + 0.027 * n) = (etc) // hehehehe uint256 private constant BASE_PRICE_PER_MINT = 15 * 10**15; // .027,000,000,000,000,000 eth in wei uint256 private constant PRICE_PER_PAIR = 27 * 10**15; // .027,000,000,000,000,000 eth in wei uint256 private constant TOKENS_PER_PAIR = 2; // derp // these are private because we write getters for them, no need to make them readable as-is string private _baseTokenURI; bool private _contractIsPaused; address private _ownerAddress; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // core contract logic constructor() ERC721("Highflyers", "HIGHFLYERS") { } // fyi: this used to have address mintAddress as an argument, but instead, we opted to simplify this function and // just mandate that the minted tokens are deposited back into the account that is paying for the mint (msg.sender) function mint(uint256 numberOfPairsToMint) public payable { // this is the public mint function, so check two things: // (1) require contract is not paused // (2) that the message contains enough ETH to perform the mint require(!_contractIsPaused, "Yo, can't mint while paused"); require(<FILL_ME>) // mint _mintWithChecks(msg.sender, numberOfPairsToMint * TOKENS_PER_PAIR); } // the contract-specific function called by both ownerMintAirdrop() and public payable mint() // // IMPORTANT: this function takes the ACTUAL number of tokens to mint, notably, it is not aware of any pair minting // so the mint() and ownerMintAirdrop() functions MUST do the *2 adjustment in their own functions to mint pairs function _mintWithChecks(address mintAddress, uint256 numberOfTokensToMint) internal { } // override the _beforeTokenTransfer hook to check our local paused variable function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override { } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // simple getters // this overrides the inherited _baseURI(), which is used to construct the token uri. honestly, this seems like a // weird way to do this but seems to be a good solution without making the entire contract inherit ERC721URIStorage function _baseURI() internal override view returns (string memory) { } function getIssuedTokenCount() public view returns (uint256) { } function getContractIsPaused() public view returns (bool) { } // this is necessary to be able to edit the collection on opensea; it's a simple way to enable this functionality // without making the entire contract inherit ERC721Ownable, which has a bunch of functions we don't need function owner() public view returns (address) { } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // owner management functions modifier ownerOnlyACL() { } // set a new base token URI, in case metadata/image provider changes function ownerSetBaseTokenURI(string memory newBaseTokenURI) public ownerOnlyACL { } // set paused state function ownerSetPausedState(bool contractIsPaused) public ownerOnlyACL { } // owner manual mint (airdrop) ability, for free, regardless if contract is paused or not function ownerMintAirdrop(address mintAddress, uint256 numberOfPairsToMint) public ownerOnlyACL { } // simplified withdraw function callable by only the owner that withdraws to the owner address. there are no // internal state changes here, and it can only be called by owner, so this should(?) be safe from reentrancy function ownerWithdrawContractBalance() public ownerOnlyACL { } }
msg.value>=(BASE_PRICE_PER_MINT+(numberOfPairsToMint*PRICE_PER_PAIR)),"Yo, you gotta pay at least the minimum"
5,507
msg.value>=(BASE_PRICE_PER_MINT+(numberOfPairsToMint*PRICE_PER_PAIR))
"Yo, can't mint more than is available"
// Highflyers.sol // // degenerated.io // 2021 // zpm@ // // SPDX-License-Identifier: MIT // if you're looking to reuse this contract and have any questions, just lmk pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Highflyers is ERC721 { // counters is a safe way of counting that can only be +/- by one // https://docs.openzeppelin.com/contracts/4.x/api/utils#Counters using Counters for Counters.Counter; Counters.Counter private _tokensIssuedCounter; // traditionally we'd include SafeMath here, but safemath is no longer necessary in solidity 0.8.0+ // https://docs.openzeppelin.com/contracts/4.x/api/utils // using SafeMath for uint256; uint256 private constant MAX_TOKENS = 6969; uint256 private constant MAX_MINTABLE_AT_ONCE = 20; // total tokens, so 10 pair // this pricing scheme is degenerate ;) // pricing equation is: 0.015E + 0.027E * num_pairs, which results in // 1 = (0.015 + 0.027 * 1) = 0.0420 // 2 = (0.015 + 0.027 * 2) = 0.0690 // n = (0.015 + 0.027 * n) = (etc) // hehehehe uint256 private constant BASE_PRICE_PER_MINT = 15 * 10**15; // .027,000,000,000,000,000 eth in wei uint256 private constant PRICE_PER_PAIR = 27 * 10**15; // .027,000,000,000,000,000 eth in wei uint256 private constant TOKENS_PER_PAIR = 2; // derp // these are private because we write getters for them, no need to make them readable as-is string private _baseTokenURI; bool private _contractIsPaused; address private _ownerAddress; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // core contract logic constructor() ERC721("Highflyers", "HIGHFLYERS") { } // fyi: this used to have address mintAddress as an argument, but instead, we opted to simplify this function and // just mandate that the minted tokens are deposited back into the account that is paying for the mint (msg.sender) function mint(uint256 numberOfPairsToMint) public payable { } // the contract-specific function called by both ownerMintAirdrop() and public payable mint() // // IMPORTANT: this function takes the ACTUAL number of tokens to mint, notably, it is not aware of any pair minting // so the mint() and ownerMintAirdrop() functions MUST do the *2 adjustment in their own functions to mint pairs function _mintWithChecks(address mintAddress, uint256 numberOfTokensToMint) internal { require(numberOfTokensToMint <= MAX_MINTABLE_AT_ONCE, "Yo, can't mint that many at once"); for (uint256 mt = 0; mt < numberOfTokensToMint; mt++) { // check within the loop to protect against reentrancy require(<FILL_ME>) // increment before minting: starts token ids at 1 instead of 0 (which is desired) // also follows checks-effects-interactions pattern _tokensIssuedCounter.increment(); // use _mint here instead of _safeMint, since _safeMint allows reentrancy into the mint function from the // onERC721Received receiver in the remote contract. using _mint means you could mint to a contract address // that doesn't accept ERC721 tokens, but if someone mints to a non-ERC721 accepting address, that's on them _mint(mintAddress, getIssuedTokenCount()); } } // override the _beforeTokenTransfer hook to check our local paused variable function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override { } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // simple getters // this overrides the inherited _baseURI(), which is used to construct the token uri. honestly, this seems like a // weird way to do this but seems to be a good solution without making the entire contract inherit ERC721URIStorage function _baseURI() internal override view returns (string memory) { } function getIssuedTokenCount() public view returns (uint256) { } function getContractIsPaused() public view returns (bool) { } // this is necessary to be able to edit the collection on opensea; it's a simple way to enable this functionality // without making the entire contract inherit ERC721Ownable, which has a bunch of functions we don't need function owner() public view returns (address) { } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // owner management functions modifier ownerOnlyACL() { } // set a new base token URI, in case metadata/image provider changes function ownerSetBaseTokenURI(string memory newBaseTokenURI) public ownerOnlyACL { } // set paused state function ownerSetPausedState(bool contractIsPaused) public ownerOnlyACL { } // owner manual mint (airdrop) ability, for free, regardless if contract is paused or not function ownerMintAirdrop(address mintAddress, uint256 numberOfPairsToMint) public ownerOnlyACL { } // simplified withdraw function callable by only the owner that withdraws to the owner address. there are no // internal state changes here, and it can only be called by owner, so this should(?) be safe from reentrancy function ownerWithdrawContractBalance() public ownerOnlyACL { } }
getIssuedTokenCount()<MAX_TOKENS,"Yo, can't mint more than is available"
5,507
getIssuedTokenCount()<MAX_TOKENS
null
pragma solidity ^0.4.18; 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 Base { uint private bitlocks = 0; modifier noAnyReentrancy { } modifier only(address allowed) { } modifier onlyPayloadSize(uint size) { } } contract ERC20 is Base { mapping (address => uint) balances; mapping (address => mapping (address => uint)) allowed; using SafeMath for uint; uint public totalSupply; bool public isFrozen = false; event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transferFrom(address _from, address _to, uint _value) public isNotFrozenOnly onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) public view returns (uint balance) { } function approve_fixed(address _spender, uint _currentValue, uint _value) public isNotFrozenOnly onlyPayloadSize(3 * 32) returns (bool success) { } function approve(address _spender, uint _value) public isNotFrozenOnly onlyPayloadSize(2 * 32) returns (bool success) { } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } modifier isNotFrozenOnly() { require(<FILL_ME>) _; } modifier isFrozenOnly(){ } } contract Token is ERC20 { string public name = "Array.io Token"; string public symbol = "eRAY"; uint8 public decimals = 18; uint public constant BIT = 10**18; bool public tgeLive = false; uint public tgeStartBlock; uint public tgeSettingsAmount; uint public tgeSettingsPartInvestor; uint public tgeSettingsPartProject; uint public tgeSettingsPartFounders; uint public tgeSettingsBlocksPerStage; uint public tgeSettingsPartInvestorIncreasePerStage; uint public tgeSettingsAmountCollect; uint public tgeSettingsMaxStages; address public projectWallet; address public foundersWallet; address constant public burnAddress = address(0); mapping (address => uint) public invBalances; uint public totalInvSupply; modifier isTgeLive(){ } modifier isNotTgeLive(){ } modifier maxStagesIsNotAchieved() { } modifier targetIsNotAchieved(){ } event Burn(address indexed _owner, uint _value); function transfer(address _to, uint _value) public isNotFrozenOnly onlyPayloadSize(2 * 32) returns (bool success) { } /// @dev Constructor /// @param _projectWallet Wallet of project /// @param _foundersWallet Wallet of founders function Token(address _projectWallet, address _foundersWallet) public { } /// @dev Fallback function allows to buy tokens function () public payable isTgeLive isNotFrozenOnly targetIsNotAchieved maxStagesIsNotAchieved noAnyReentrancy { } function setFinished() public only(projectWallet) isNotFrozenOnly isTgeLive { } function updateStatus() public { } /// @dev Start new tge stage function tgeSetLive() public only(projectWallet) isNotTgeLive isNotFrozenOnly { } /// @dev Burn tokens to burnAddress from msg.sender wallet /// @param _amount Amount of tokens function burn(uint _amount) public isNotFrozenOnly noAnyReentrancy returns(bool _success) { } /// @dev _foundersWallet Wallet of founders /// @param dests array of addresses /// @param values array amount of tokens to transfer function multiTransfer(address[] dests, uint[] values) public isNotFrozenOnly returns(uint) { } //---------------- FROZEN ----------------- /// @dev Allows an owner to confirm freezeng process function setFreeze() public only(projectWallet) isNotFrozenOnly returns (bool) { } /// @dev Allows to users withdraw eth in frozen stage function withdrawFrozen() public isFrozenOnly noAnyReentrancy { } /// @dev Allows an owner to confirm a change settings request. function executeSettingsChange( uint amount, uint partInvestor, uint partProject, uint partFounders, uint blocksPerStage, uint partInvestorIncreasePerStage, uint maxStages ) public only(projectWallet) isNotTgeLive isNotFrozenOnly returns(bool success) { } //---------------- GETTERS ---------------- /// @dev Amount of blocks left to the end of this stage of TGE function tgeStageBlockLeft() public view isTgeLive returns(uint) { } function tgeCurrentPartInvestor() public view isTgeLive returns(uint) { } function tgeNextPartInvestor() public view isTgeLive returns(uint) { } //---------------- INTERNAL --------------- function _mint(uint _amountProject, uint _amountFounders, uint _amountSender) internal { } function _internalTgeSetLive() internal { } }
!isFrozen
5,518
!isFrozen
null
pragma solidity ^0.4.18; 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 Base { uint private bitlocks = 0; modifier noAnyReentrancy { } modifier only(address allowed) { } modifier onlyPayloadSize(uint size) { } } contract ERC20 is Base { mapping (address => uint) balances; mapping (address => mapping (address => uint)) allowed; using SafeMath for uint; uint public totalSupply; bool public isFrozen = false; event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transferFrom(address _from, address _to, uint _value) public isNotFrozenOnly onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) public view returns (uint balance) { } function approve_fixed(address _spender, uint _currentValue, uint _value) public isNotFrozenOnly onlyPayloadSize(3 * 32) returns (bool success) { } function approve(address _spender, uint _value) public isNotFrozenOnly onlyPayloadSize(2 * 32) returns (bool success) { } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } modifier isNotFrozenOnly() { } modifier isFrozenOnly(){ } } contract Token is ERC20 { string public name = "Array.io Token"; string public symbol = "eRAY"; uint8 public decimals = 18; uint public constant BIT = 10**18; bool public tgeLive = false; uint public tgeStartBlock; uint public tgeSettingsAmount; uint public tgeSettingsPartInvestor; uint public tgeSettingsPartProject; uint public tgeSettingsPartFounders; uint public tgeSettingsBlocksPerStage; uint public tgeSettingsPartInvestorIncreasePerStage; uint public tgeSettingsAmountCollect; uint public tgeSettingsMaxStages; address public projectWallet; address public foundersWallet; address constant public burnAddress = address(0); mapping (address => uint) public invBalances; uint public totalInvSupply; modifier isTgeLive(){ } modifier isNotTgeLive(){ require(<FILL_ME>) _; } modifier maxStagesIsNotAchieved() { } modifier targetIsNotAchieved(){ } event Burn(address indexed _owner, uint _value); function transfer(address _to, uint _value) public isNotFrozenOnly onlyPayloadSize(2 * 32) returns (bool success) { } /// @dev Constructor /// @param _projectWallet Wallet of project /// @param _foundersWallet Wallet of founders function Token(address _projectWallet, address _foundersWallet) public { } /// @dev Fallback function allows to buy tokens function () public payable isTgeLive isNotFrozenOnly targetIsNotAchieved maxStagesIsNotAchieved noAnyReentrancy { } function setFinished() public only(projectWallet) isNotFrozenOnly isTgeLive { } function updateStatus() public { } /// @dev Start new tge stage function tgeSetLive() public only(projectWallet) isNotTgeLive isNotFrozenOnly { } /// @dev Burn tokens to burnAddress from msg.sender wallet /// @param _amount Amount of tokens function burn(uint _amount) public isNotFrozenOnly noAnyReentrancy returns(bool _success) { } /// @dev _foundersWallet Wallet of founders /// @param dests array of addresses /// @param values array amount of tokens to transfer function multiTransfer(address[] dests, uint[] values) public isNotFrozenOnly returns(uint) { } //---------------- FROZEN ----------------- /// @dev Allows an owner to confirm freezeng process function setFreeze() public only(projectWallet) isNotFrozenOnly returns (bool) { } /// @dev Allows to users withdraw eth in frozen stage function withdrawFrozen() public isFrozenOnly noAnyReentrancy { } /// @dev Allows an owner to confirm a change settings request. function executeSettingsChange( uint amount, uint partInvestor, uint partProject, uint partFounders, uint blocksPerStage, uint partInvestorIncreasePerStage, uint maxStages ) public only(projectWallet) isNotTgeLive isNotFrozenOnly returns(bool success) { } //---------------- GETTERS ---------------- /// @dev Amount of blocks left to the end of this stage of TGE function tgeStageBlockLeft() public view isTgeLive returns(uint) { } function tgeCurrentPartInvestor() public view isTgeLive returns(uint) { } function tgeNextPartInvestor() public view isTgeLive returns(uint) { } //---------------- INTERNAL --------------- function _mint(uint _amountProject, uint _amountFounders, uint _amountSender) internal { } function _internalTgeSetLive() internal { } }
!tgeLive
5,518
!tgeLive
null
pragma solidity ^0.4.18; 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 Base { uint private bitlocks = 0; modifier noAnyReentrancy { } modifier only(address allowed) { } modifier onlyPayloadSize(uint size) { } } contract ERC20 is Base { mapping (address => uint) balances; mapping (address => mapping (address => uint)) allowed; using SafeMath for uint; uint public totalSupply; bool public isFrozen = false; event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transferFrom(address _from, address _to, uint _value) public isNotFrozenOnly onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) public view returns (uint balance) { } function approve_fixed(address _spender, uint _currentValue, uint _value) public isNotFrozenOnly onlyPayloadSize(3 * 32) returns (bool success) { } function approve(address _spender, uint _value) public isNotFrozenOnly onlyPayloadSize(2 * 32) returns (bool success) { } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } modifier isNotFrozenOnly() { } modifier isFrozenOnly(){ } } contract Token is ERC20 { string public name = "Array.io Token"; string public symbol = "eRAY"; uint8 public decimals = 18; uint public constant BIT = 10**18; bool public tgeLive = false; uint public tgeStartBlock; uint public tgeSettingsAmount; uint public tgeSettingsPartInvestor; uint public tgeSettingsPartProject; uint public tgeSettingsPartFounders; uint public tgeSettingsBlocksPerStage; uint public tgeSettingsPartInvestorIncreasePerStage; uint public tgeSettingsAmountCollect; uint public tgeSettingsMaxStages; address public projectWallet; address public foundersWallet; address constant public burnAddress = address(0); mapping (address => uint) public invBalances; uint public totalInvSupply; modifier isTgeLive(){ } modifier isNotTgeLive(){ } modifier maxStagesIsNotAchieved() { } modifier targetIsNotAchieved(){ } event Burn(address indexed _owner, uint _value); function transfer(address _to, uint _value) public isNotFrozenOnly onlyPayloadSize(2 * 32) returns (bool success) { } /// @dev Constructor /// @param _projectWallet Wallet of project /// @param _foundersWallet Wallet of founders function Token(address _projectWallet, address _foundersWallet) public { } /// @dev Fallback function allows to buy tokens function () public payable isTgeLive isNotFrozenOnly targetIsNotAchieved maxStagesIsNotAchieved noAnyReentrancy { } function setFinished() public only(projectWallet) isNotFrozenOnly isTgeLive { } function updateStatus() public { } /// @dev Start new tge stage function tgeSetLive() public only(projectWallet) isNotTgeLive isNotFrozenOnly { } /// @dev Burn tokens to burnAddress from msg.sender wallet /// @param _amount Amount of tokens function burn(uint _amount) public isNotFrozenOnly noAnyReentrancy returns(bool _success) { } /// @dev _foundersWallet Wallet of founders /// @param dests array of addresses /// @param values array amount of tokens to transfer function multiTransfer(address[] dests, uint[] values) public isNotFrozenOnly returns(uint) { } //---------------- FROZEN ----------------- /// @dev Allows an owner to confirm freezeng process function setFreeze() public only(projectWallet) isNotFrozenOnly returns (bool) { } /// @dev Allows to users withdraw eth in frozen stage function withdrawFrozen() public isFrozenOnly noAnyReentrancy { require(<FILL_ME>) uint amountWithdraw = totalInvSupply.mul(invBalances[msg.sender]).div(totalSupply); invBalances[msg.sender] = 0; msg.sender.transfer(amountWithdraw); } /// @dev Allows an owner to confirm a change settings request. function executeSettingsChange( uint amount, uint partInvestor, uint partProject, uint partFounders, uint blocksPerStage, uint partInvestorIncreasePerStage, uint maxStages ) public only(projectWallet) isNotTgeLive isNotFrozenOnly returns(bool success) { } //---------------- GETTERS ---------------- /// @dev Amount of blocks left to the end of this stage of TGE function tgeStageBlockLeft() public view isTgeLive returns(uint) { } function tgeCurrentPartInvestor() public view isTgeLive returns(uint) { } function tgeNextPartInvestor() public view isTgeLive returns(uint) { } //---------------- INTERNAL --------------- function _mint(uint _amountProject, uint _amountFounders, uint _amountSender) internal { } function _internalTgeSetLive() internal { } }
invBalances[msg.sender]>0
5,518
invBalances[msg.sender]>0
"insufficient privileges (ROLE_ACCESS_MANAGER required)"
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; /** * @title Access Control List * * @notice Access control smart contract provides an API to check * if specific operation is permitted globally and/or * if particular user has a permission to execute it. * * @notice It deals with two main entities: features and roles. * * @notice Features are designed to be used to enable/disable specific * functions (public functions) of the smart contract for everyone. * @notice User roles are designed to restrict access to specific * functions (restricted functions) of the smart contract to some users. * * @notice Terms "role", "permissions" and "set of permissions" have equal meaning * in the documentation text and may be used interchangeably. * @notice Terms "permission", "single permission" implies only one permission bit set. * * @dev This smart contract is designed to be inherited by other * smart contracts which require access control management capabilities. * * @author Basil Gorin */ contract AccessControl { /** * @notice Access manager is responsible for assigning the roles to users, * enabling/disabling global features of the smart contract * @notice Access manager can add, remove and update user roles, * remove and update global features * * @dev Role ROLE_ACCESS_MANAGER allows modifying user roles and global features * @dev Role ROLE_ACCESS_MANAGER has single bit at position 255 enabled */ uint256 public constant ROLE_ACCESS_MANAGER = 0x8000000000000000000000000000000000000000000000000000000000000000; /** * @dev Bitmask representing all the possible permissions (super admin role) * @dev Has all the bits are enabled (2^256 - 1 value) */ uint256 private constant FULL_PRIVILEGES_MASK = type(uint256).max; // before 0.8.0: uint256(-1) overflows to 0xFFFF... /** * @notice Privileged addresses with defined roles/permissions * @notice In the context of ERC20/ERC721 tokens these can be permissions to * allow minting or burning tokens, transferring on behalf and so on * * @dev Maps user address to the permissions bitmask (role), where each bit * represents a permission * @dev Bitmask 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF * represents all possible permissions * @dev Zero address mapping represents global features of the smart contract */ mapping(address => uint256) public userRoles; /** * @dev Fired in updateRole() and updateFeatures() * * @param _by operator which called the function * @param _to address which was granted/revoked permissions * @param _requested permissions requested * @param _actual permissions effectively set */ event RoleUpdated(address indexed _by, address indexed _to, uint256 _requested, uint256 _actual); /** * @notice Creates an access control instance, * setting contract creator to have full privileges */ constructor() { } /** * @notice Retrieves globally set of features enabled * * @dev Auxiliary getter function to maintain compatibility with previous * versions of the Access Control List smart contract, where * features was a separate uint256 public field * * @return 256-bit bitmask of the features enabled */ function features() public view returns(uint256) { } /** * @notice Updates set of the globally enabled features (`features`), * taking into account sender's permissions * * @dev Requires transaction sender to have `ROLE_ACCESS_MANAGER` permission * @dev Function is left for backward compatibility with older versions * * @param _mask bitmask representing a set of features to enable/disable */ function updateFeatures(uint256 _mask) public { } /** * @notice Updates set of permissions (role) for a given user, * taking into account sender's permissions. * * @dev Setting role to zero is equivalent to removing an all permissions * @dev Setting role to `FULL_PRIVILEGES_MASK` is equivalent to * copying senders' permissions (role) to the user * @dev Requires transaction sender to have `ROLE_ACCESS_MANAGER` permission * * @param operator address of a user to alter permissions for or zero * to alter global features of the smart contract * @param role bitmask representing a set of permissions to * enable/disable for a user specified */ function updateRole(address operator, uint256 role) public { // caller must have a permission to update user roles require(<FILL_ME>) // evaluate the role and reassign it userRoles[operator] = evaluateBy(msg.sender, userRoles[operator], role); // fire an event emit RoleUpdated(msg.sender, operator, role, userRoles[operator]); } /** * @notice Determines the permission bitmask an operator can set on the * target permission set * @notice Used to calculate the permission bitmask to be set when requested * in `updateRole` and `updateFeatures` functions * * @dev Calculated based on: * 1) operator's own permission set read from userRoles[operator] * 2) target permission set - what is already set on the target * 3) desired permission set - what do we want set target to * * @dev Corner cases: * 1) Operator is super admin and its permission set is `FULL_PRIVILEGES_MASK`: * `desired` bitset is returned regardless of the `target` permission set value * (what operator sets is what they get) * 2) Operator with no permissions (zero bitset): * `target` bitset is returned regardless of the `desired` value * (operator has no authority and cannot modify anything) * * @dev Example: * Consider an operator with the permissions bitmask 00001111 * is about to modify the target permission set 01010101 * Operator wants to set that permission set to 00110011 * Based on their role, an operator has the permissions * to update only lowest 4 bits on the target, meaning that * high 4 bits of the target set in this example is left * unchanged and low 4 bits get changed as desired: 01010011 * * @param operator address of the contract operator which is about to set the permissions * @param target input set of permissions to operator is going to modify * @param desired desired set of permissions operator would like to set * @return resulting set of permissions given operator will set */ function evaluateBy(address operator, uint256 target, uint256 desired) public view returns(uint256) { } /** * @notice Checks if requested set of features is enabled globally on the contract * * @param required set of features to check against * @return true if all the features requested are enabled, false otherwise */ function isFeatureEnabled(uint256 required) public view returns(bool) { } /** * @notice Checks if transaction sender `msg.sender` has all the permissions required * * @param required set of permissions (role) to check against * @return true if all the permissions requested are enabled, false otherwise */ function isSenderInRole(uint256 required) public view returns(bool) { } /** * @notice Checks if operator has all the permissions (role) required * * @param operator address of the user to check role for * @param required set of permissions (role) to check * @return true if all the permissions requested are enabled, false otherwise */ function isOperatorInRole(address operator, uint256 required) public view returns(bool) { } /** * @dev Checks if role `actual` contains all the permissions required `required` * * @param actual existent role * @param required required role * @return true if actual has required role (all permissions), false otherwise */ function __hasRole(uint256 actual, uint256 required) internal pure returns(bool) { } }
isSenderInRole(ROLE_ACCESS_MANAGER),"insufficient privileges (ROLE_ACCESS_MANAGER required)"
5,590
isSenderInRole(ROLE_ACCESS_MANAGER)
"Initializable: contract is already initialized"
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/Address.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(<FILL_ME>) bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { } }
_initializing||_isConstructor()||!_initialized,"Initializable: contract is already initialized"
5,674
_initializing||_isConstructor()||!_initialized
"Cast overflow"
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; library CastBytes32Bytes6 { function b6(bytes32 x) internal pure returns (bytes6 y){ require(<FILL_ME>) } }
bytes32(y=bytes6(x))==x,"Cast overflow"
5,741
bytes32(y=bytes6(x))==x
"ETH operation not supported by token"
pragma solidity ^0.6.0; /** * @dev This contract serves as a useful bridge between ETH and the WETH * ERC-20 based gTokens. It accepts deposits/withdrawals in ETH performing * the wrapping/unwrapping behind the scenes. */ contract GEtherBridge { /** * @notice Accepts a deposit to the gToken using ETH. The gToken must * have WETH as its reserveToken. This is a payable method and * expects ETH to be sent; which in turn will be converted into * shares. See GToken.sol and GTokenBase.sol for further * documentation. * @param _growthToken The WETH based gToken. */ function deposit(address _growthToken) public payable { address _from = msg.sender; uint256 _cost = msg.value; address _reserveToken = GToken(_growthToken).reserveToken(); require(<FILL_ME>) G.safeWrap(_cost); G.approveFunds(_reserveToken, _growthToken, _cost); GToken(_growthToken).deposit(_cost); uint256 _netShares = G.getBalance(_growthToken); G.pushFunds(_growthToken, _from, _netShares); } /** * @notice Accepts a withdrawal to the gToken using ETH. The gToken must * have WETH as its reserveToken. This method will redeem the * sender's required balance in shares; which in turn will receive * ETH. See GToken.sol and GTokenBase.sol for further documentation. * @param _growthToken The WETH based gToken. * @param _grossShares The number of shares to be redeemed. */ function withdraw(address _growthToken, uint256 _grossShares) public { } /** * @notice Accepts a deposit to the gcToken using ETH. The gcToken must * have WETH as its underlyingToken. This is a payable method and * expects ETH to be sent; which in turn will be converted into * shares. See GCToken.sol and GCTokenBase.sol for further * documentation. * @param _growthToken The WETH based gcToken (e.g. gcETH). */ function depositUnderlying(address _growthToken) public payable { } /** * @notice Accepts a withdrawal to the gcToken using ETH. The gcToken must * have WETH as its underlyingToken. This method will redeem the * sender's required balance in shares; which in turn will receive * ETH. See GCToken.sol and GCTokenBase.sol for further documentation. * @param _growthToken The WETH based gcToken (e.g. gcETH). * @param _grossShares The number of shares to be redeemed. */ function withdrawUnderlying(address _growthToken, uint256 _grossShares) public { } receive() external payable {} // not to be used directly }
_reserveToken==$.WETH,"ETH operation not supported by token"
5,772
_reserveToken==$.WETH
"ETH operation not supported by token"
pragma solidity ^0.6.0; /** * @dev This contract serves as a useful bridge between ETH and the WETH * ERC-20 based gTokens. It accepts deposits/withdrawals in ETH performing * the wrapping/unwrapping behind the scenes. */ contract GEtherBridge { /** * @notice Accepts a deposit to the gToken using ETH. The gToken must * have WETH as its reserveToken. This is a payable method and * expects ETH to be sent; which in turn will be converted into * shares. See GToken.sol and GTokenBase.sol for further * documentation. * @param _growthToken The WETH based gToken. */ function deposit(address _growthToken) public payable { } /** * @notice Accepts a withdrawal to the gToken using ETH. The gToken must * have WETH as its reserveToken. This method will redeem the * sender's required balance in shares; which in turn will receive * ETH. See GToken.sol and GTokenBase.sol for further documentation. * @param _growthToken The WETH based gToken. * @param _grossShares The number of shares to be redeemed. */ function withdraw(address _growthToken, uint256 _grossShares) public { } /** * @notice Accepts a deposit to the gcToken using ETH. The gcToken must * have WETH as its underlyingToken. This is a payable method and * expects ETH to be sent; which in turn will be converted into * shares. See GCToken.sol and GCTokenBase.sol for further * documentation. * @param _growthToken The WETH based gcToken (e.g. gcETH). */ function depositUnderlying(address _growthToken) public payable { address _from = msg.sender; uint256 _underlyingCost = msg.value; address _underlyingToken = GCToken(_growthToken).underlyingToken(); require(<FILL_ME>) G.safeWrap(_underlyingCost); G.approveFunds(_underlyingToken, _growthToken, _underlyingCost); GCToken(_growthToken).depositUnderlying(_underlyingCost); uint256 _netShares = G.getBalance(_growthToken); G.pushFunds(_growthToken, _from, _netShares); } /** * @notice Accepts a withdrawal to the gcToken using ETH. The gcToken must * have WETH as its underlyingToken. This method will redeem the * sender's required balance in shares; which in turn will receive * ETH. See GCToken.sol and GCTokenBase.sol for further documentation. * @param _growthToken The WETH based gcToken (e.g. gcETH). * @param _grossShares The number of shares to be redeemed. */ function withdrawUnderlying(address _growthToken, uint256 _grossShares) public { } receive() external payable {} // not to be used directly }
_underlyingToken==$.WETH,"ETH operation not supported by token"
5,772
_underlyingToken==$.WETH
null
pragma solidity ^0.4.11; contract ERC20Standard { uint public totalSupply; string public name; uint8 public decimals; string public symbol; string public version; mapping (address => uint256) balances; mapping (address => mapping (address => uint)) allowed; modifier onlyPayloadSize(uint size) { } function balanceOf(address _owner) constant returns (uint balance) { } function transfer(address _recipient, uint _value) onlyPayloadSize(2*32) { require(<FILL_ME>) balances[msg.sender] -= _value; balances[_recipient] += _value; Transfer(msg.sender, _recipient, _value); } function transferFrom(address _from, address _to, uint _value) { } function approve(address _spender, uint _value) { } function allowance(address _spender, address _owner) constant returns (uint balance) { } event Transfer( address indexed _from, address indexed _to, uint _value ); event Approval( address indexed _owner, address indexed _spender, uint _value ); } contract NewToken is ERC20Standard { function NewToken() { } }
balances[msg.sender]>=_value&&_value>0
5,908
balances[msg.sender]>=_value&&_value>0
null
pragma solidity ^0.4.11; contract ERC20Standard { uint public totalSupply; string public name; uint8 public decimals; string public symbol; string public version; mapping (address => uint256) balances; mapping (address => mapping (address => uint)) allowed; modifier onlyPayloadSize(uint size) { } function balanceOf(address _owner) constant returns (uint balance) { } function transfer(address _recipient, uint _value) onlyPayloadSize(2*32) { } function transferFrom(address _from, address _to, uint _value) { require(<FILL_ME>) balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); } function approve(address _spender, uint _value) { } function allowance(address _spender, address _owner) constant returns (uint balance) { } event Transfer( address indexed _from, address indexed _to, uint _value ); event Approval( address indexed _owner, address indexed _spender, uint _value ); } contract NewToken is ERC20Standard { function NewToken() { } }
balances[_from]>=_value&&allowed[_from][msg.sender]>=_value&&_value>0
5,908
balances[_from]>=_value&&allowed[_from][msg.sender]>=_value&&_value>0
null
pragma solidity ^0.4.25; /* * Creator: GPC (Green Planet Coin) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() public constant returns (uint256 supply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ constructor () public { } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) public constant returns (uint256 balance) { } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) public returns (bool success) { } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) public returns (bool success) { } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * Green Planet Coin smart contract. */ contract GPCToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 12500000000 * (10**18); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping (address => bool) private frozenAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ constructor () public { } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() public constant returns (uint256 supply) { } string constant public name = "Green Planet Coin"; string constant public symbol = "GPC"; uint8 constant public decimals = 18; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) public returns (bool success) { } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * To change the approve amount you first have to reduce the addresses` * allowance to zero by calling `approve(_spender, 0)` if it is not * already 0 to mitigate the race condition described here: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) public returns (bool success) { require(<FILL_ME>) return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) public returns (bool success) { } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) public { } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () public { } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () public { } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) public { } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) public { } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
allowance(msg.sender,_spender)==0||_value==0
5,950
allowance(msg.sender,_spender)==0||_value==0
"GovernorAlpha::propose: proposer votes below proposal threshold"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "./FXS.sol"; // From https://compound.finance/docs/governance // and https://github.com/compound-finance/compound-protocol/tree/master/contracts/Governance contract GovernorAlpha { /// @notice The name of this contract string public constant name = "FXS Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { } // 4,000,000 = 4% of FXS /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { } // 1,000,000 = 1% of FXS /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed // This also helps protect against flash loan attacks because only the vote balance at the proposal start block is considered function votingDelay() public pure returns (uint) { } // 1 block /// @notice The duration of voting on a proposal, in blocks // function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks) uint public votingPeriod = 17280; /// @notice The address of the Timelock TimelockInterface public timelock; // The address of the FXS token FRAXShares public fxs; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount = 0; struct Proposal { // @notice Unique id for looking up a proposal uint id; // @notice Creator of the proposal address proposer; // @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; // @notice the ordered list of target addresses for calls to be made address[] targets; // @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; // @notice The ordered list of function signatures to be called string[] signatures; // @notice The ordered list of calldata to be passed to each call bytes[] calldatas; // @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; // @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; // @notice Current number of votes in favor of this proposal uint forVotes; // @notice Current number of votes in opposition to this proposal uint againstVotes; // @notice Flag marking whether the proposal has been canceled bool canceled; // @notice Flag marking whether the proposal has been executed bool executed; // @notice Title of the proposal (human-readable) string title; // @notice Description of the proposall (human-readable) string description; // @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { // @notice Whether or not a vote has been cast bool hasVoted; // @notice Whether or not the voter supports the proposal bool support; // @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address fxs_, address guardian_) public { } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory title, string memory description) public returns (uint) { require(<FILL_ME>) require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch"); require(targets.length != 0, "GovernorAlpha::propose: must provide actions"); require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal"); } uint startBlock = add256(block.number, votingDelay()); uint endBlock = add256(startBlock, votingPeriod); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false, title: title, description: description }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } function queue(uint proposalId) public { } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { } function execute(uint proposalId) public payable { } function cancel(uint proposalId) public { } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { } function state(uint proposalId) public view returns (ProposalState) { } function castVote(uint proposalId, bool support) public { } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { } function _castVote(address voter, uint proposalId, bool support) internal { } function __acceptAdmin() public { } function __abdicate() public { } function __setVotingPeriod(uint period) public { } function __setTimelockAddress(address timelock_) public { } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function add256(uint256 a, uint256 b) internal pure returns (uint) { } function sub256(uint256 a, uint256 b) internal pure returns (uint) { } function getChainId() internal pure returns (uint) { } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); }
fxs.getPriorVotes(msg.sender,sub256(block.number,1))>=proposalThreshold(),"GovernorAlpha::propose: proposer votes below proposal threshold"
6,025
fxs.getPriorVotes(msg.sender,sub256(block.number,1))>=proposalThreshold()
"GovernorAlpha::queue: proposal can only be queued if it succeeded"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "./FXS.sol"; // From https://compound.finance/docs/governance // and https://github.com/compound-finance/compound-protocol/tree/master/contracts/Governance contract GovernorAlpha { /// @notice The name of this contract string public constant name = "FXS Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { } // 4,000,000 = 4% of FXS /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { } // 1,000,000 = 1% of FXS /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed // This also helps protect against flash loan attacks because only the vote balance at the proposal start block is considered function votingDelay() public pure returns (uint) { } // 1 block /// @notice The duration of voting on a proposal, in blocks // function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks) uint public votingPeriod = 17280; /// @notice The address of the Timelock TimelockInterface public timelock; // The address of the FXS token FRAXShares public fxs; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount = 0; struct Proposal { // @notice Unique id for looking up a proposal uint id; // @notice Creator of the proposal address proposer; // @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; // @notice the ordered list of target addresses for calls to be made address[] targets; // @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; // @notice The ordered list of function signatures to be called string[] signatures; // @notice The ordered list of calldata to be passed to each call bytes[] calldatas; // @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; // @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; // @notice Current number of votes in favor of this proposal uint forVotes; // @notice Current number of votes in opposition to this proposal uint againstVotes; // @notice Flag marking whether the proposal has been canceled bool canceled; // @notice Flag marking whether the proposal has been executed bool executed; // @notice Title of the proposal (human-readable) string title; // @notice Description of the proposall (human-readable) string description; // @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { // @notice Whether or not a vote has been cast bool hasVoted; // @notice Whether or not the voter supports the proposal bool support; // @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address fxs_, address guardian_) public { } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory title, string memory description) public returns (uint) { } function queue(uint proposalId) public { require(<FILL_ME>) Proposal storage proposal = proposals[proposalId]; uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i < proposal.targets.length; i++) { _queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { } function execute(uint proposalId) public payable { } function cancel(uint proposalId) public { } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { } function state(uint proposalId) public view returns (ProposalState) { } function castVote(uint proposalId, bool support) public { } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { } function _castVote(address voter, uint proposalId, bool support) internal { } function __acceptAdmin() public { } function __abdicate() public { } function __setVotingPeriod(uint period) public { } function __setTimelockAddress(address timelock_) public { } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function add256(uint256 a, uint256 b) internal pure returns (uint) { } function sub256(uint256 a, uint256 b) internal pure returns (uint) { } function getChainId() internal pure returns (uint) { } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); }
state(proposalId)==ProposalState.Succeeded,"GovernorAlpha::queue: proposal can only be queued if it succeeded"
6,025
state(proposalId)==ProposalState.Succeeded
"GovernorAlpha::_queueOrRevert: proposal action already queued at eta"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "./FXS.sol"; // From https://compound.finance/docs/governance // and https://github.com/compound-finance/compound-protocol/tree/master/contracts/Governance contract GovernorAlpha { /// @notice The name of this contract string public constant name = "FXS Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { } // 4,000,000 = 4% of FXS /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { } // 1,000,000 = 1% of FXS /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed // This also helps protect against flash loan attacks because only the vote balance at the proposal start block is considered function votingDelay() public pure returns (uint) { } // 1 block /// @notice The duration of voting on a proposal, in blocks // function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks) uint public votingPeriod = 17280; /// @notice The address of the Timelock TimelockInterface public timelock; // The address of the FXS token FRAXShares public fxs; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount = 0; struct Proposal { // @notice Unique id for looking up a proposal uint id; // @notice Creator of the proposal address proposer; // @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; // @notice the ordered list of target addresses for calls to be made address[] targets; // @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; // @notice The ordered list of function signatures to be called string[] signatures; // @notice The ordered list of calldata to be passed to each call bytes[] calldatas; // @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; // @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; // @notice Current number of votes in favor of this proposal uint forVotes; // @notice Current number of votes in opposition to this proposal uint againstVotes; // @notice Flag marking whether the proposal has been canceled bool canceled; // @notice Flag marking whether the proposal has been executed bool executed; // @notice Title of the proposal (human-readable) string title; // @notice Description of the proposall (human-readable) string description; // @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { // @notice Whether or not a vote has been cast bool hasVoted; // @notice Whether or not the voter supports the proposal bool support; // @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address fxs_, address guardian_) public { } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory title, string memory description) public returns (uint) { } function queue(uint proposalId) public { } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { require(<FILL_ME>) timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint proposalId) public payable { } function cancel(uint proposalId) public { } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { } function state(uint proposalId) public view returns (ProposalState) { } function castVote(uint proposalId, bool support) public { } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { } function _castVote(address voter, uint proposalId, bool support) internal { } function __acceptAdmin() public { } function __abdicate() public { } function __setVotingPeriod(uint period) public { } function __setTimelockAddress(address timelock_) public { } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function add256(uint256 a, uint256 b) internal pure returns (uint) { } function sub256(uint256 a, uint256 b) internal pure returns (uint) { } function getChainId() internal pure returns (uint) { } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); }
!timelock.queuedTransactions(keccak256(abi.encode(target,value,signature,data,eta))),"GovernorAlpha::_queueOrRevert: proposal action already queued at eta"
6,025
!timelock.queuedTransactions(keccak256(abi.encode(target,value,signature,data,eta)))
"GovernorAlpha::execute: proposal can only be executed if it is queued"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "./FXS.sol"; // From https://compound.finance/docs/governance // and https://github.com/compound-finance/compound-protocol/tree/master/contracts/Governance contract GovernorAlpha { /// @notice The name of this contract string public constant name = "FXS Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { } // 4,000,000 = 4% of FXS /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { } // 1,000,000 = 1% of FXS /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed // This also helps protect against flash loan attacks because only the vote balance at the proposal start block is considered function votingDelay() public pure returns (uint) { } // 1 block /// @notice The duration of voting on a proposal, in blocks // function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks) uint public votingPeriod = 17280; /// @notice The address of the Timelock TimelockInterface public timelock; // The address of the FXS token FRAXShares public fxs; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount = 0; struct Proposal { // @notice Unique id for looking up a proposal uint id; // @notice Creator of the proposal address proposer; // @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; // @notice the ordered list of target addresses for calls to be made address[] targets; // @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; // @notice The ordered list of function signatures to be called string[] signatures; // @notice The ordered list of calldata to be passed to each call bytes[] calldatas; // @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; // @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; // @notice Current number of votes in favor of this proposal uint forVotes; // @notice Current number of votes in opposition to this proposal uint againstVotes; // @notice Flag marking whether the proposal has been canceled bool canceled; // @notice Flag marking whether the proposal has been executed bool executed; // @notice Title of the proposal (human-readable) string title; // @notice Description of the proposall (human-readable) string description; // @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { // @notice Whether or not a vote has been cast bool hasVoted; // @notice Whether or not the voter supports the proposal bool support; // @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address fxs_, address guardian_) public { } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory title, string memory description) public returns (uint) { } function queue(uint proposalId) public { } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { } function execute(uint proposalId) public payable { require(<FILL_ME>) Proposal storage proposal = proposals[proposalId]; proposal.executed = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.executeTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalExecuted(proposalId); } function cancel(uint proposalId) public { } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { } function state(uint proposalId) public view returns (ProposalState) { } function castVote(uint proposalId, bool support) public { } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { } function _castVote(address voter, uint proposalId, bool support) internal { } function __acceptAdmin() public { } function __abdicate() public { } function __setVotingPeriod(uint period) public { } function __setTimelockAddress(address timelock_) public { } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function add256(uint256 a, uint256 b) internal pure returns (uint) { } function sub256(uint256 a, uint256 b) internal pure returns (uint) { } function getChainId() internal pure returns (uint) { } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); }
state(proposalId)==ProposalState.Queued,"GovernorAlpha::execute: proposal can only be executed if it is queued"
6,025
state(proposalId)==ProposalState.Queued
"GovernorAlpha::_castVote: voting is closed"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "./FXS.sol"; // From https://compound.finance/docs/governance // and https://github.com/compound-finance/compound-protocol/tree/master/contracts/Governance contract GovernorAlpha { /// @notice The name of this contract string public constant name = "FXS Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { } // 4,000,000 = 4% of FXS /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { } // 1,000,000 = 1% of FXS /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed // This also helps protect against flash loan attacks because only the vote balance at the proposal start block is considered function votingDelay() public pure returns (uint) { } // 1 block /// @notice The duration of voting on a proposal, in blocks // function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks) uint public votingPeriod = 17280; /// @notice The address of the Timelock TimelockInterface public timelock; // The address of the FXS token FRAXShares public fxs; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount = 0; struct Proposal { // @notice Unique id for looking up a proposal uint id; // @notice Creator of the proposal address proposer; // @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; // @notice the ordered list of target addresses for calls to be made address[] targets; // @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; // @notice The ordered list of function signatures to be called string[] signatures; // @notice The ordered list of calldata to be passed to each call bytes[] calldatas; // @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; // @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; // @notice Current number of votes in favor of this proposal uint forVotes; // @notice Current number of votes in opposition to this proposal uint againstVotes; // @notice Flag marking whether the proposal has been canceled bool canceled; // @notice Flag marking whether the proposal has been executed bool executed; // @notice Title of the proposal (human-readable) string title; // @notice Description of the proposall (human-readable) string description; // @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { // @notice Whether or not a vote has been cast bool hasVoted; // @notice Whether or not the voter supports the proposal bool support; // @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address fxs_, address guardian_) public { } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory title, string memory description) public returns (uint) { } function queue(uint proposalId) public { } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { } function execute(uint proposalId) public payable { } function cancel(uint proposalId) public { } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { } function state(uint proposalId) public view returns (ProposalState) { } function castVote(uint proposalId, bool support) public { } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { } function _castVote(address voter, uint proposalId, bool support) internal { require(<FILL_ME>) Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted"); uint96 votes = fxs.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function __acceptAdmin() public { } function __abdicate() public { } function __setVotingPeriod(uint period) public { } function __setTimelockAddress(address timelock_) public { } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { } function add256(uint256 a, uint256 b) internal pure returns (uint) { } function sub256(uint256 a, uint256 b) internal pure returns (uint) { } function getChainId() internal pure returns (uint) { } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); }
state(proposalId)==ProposalState.Active,"GovernorAlpha::_castVote: voting is closed"
6,025
state(proposalId)==ProposalState.Active
null
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } pragma solidity 0.7.0; contract PlutoHipHopDept is ERC721, Ownable { using SafeMath for uint256; uint256 public LilPlutoPrice = 50000000000000000; // 0.05 ETH uint256 public maxPurchase = 20; uint256 public maxLilPluto = 10000; bool public saleIsActive = false; constructor() ERC721("Pluto HipHop Dept.", "PHHD") { } function withdraw() public onlyOwner { } function reserveLilPluto() public onlyOwner { require(<FILL_ME>) uint supply = totalSupply(); uint i; for (i; i < 50; i++) { _safeMint(_msgSender(), supply + i); } } function flipSaleState() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintLilPluto(uint numberOfTokens) public payable { } }
totalSupply()<100
6,195
totalSupply()<100
"Purchase would exceed max supply of LilPlutos"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } pragma solidity 0.7.0; contract PlutoHipHopDept is ERC721, Ownable { using SafeMath for uint256; uint256 public LilPlutoPrice = 50000000000000000; // 0.05 ETH uint256 public maxPurchase = 20; uint256 public maxLilPluto = 10000; bool public saleIsActive = false; constructor() ERC721("Pluto HipHop Dept.", "PHHD") { } function withdraw() public onlyOwner { } function reserveLilPluto() public onlyOwner { } function flipSaleState() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintLilPluto(uint numberOfTokens) public payable { require(saleIsActive, "Sale is not active"); require(numberOfTokens <= maxPurchase, "Exceeds max number of Lil Plutos in one transaction"); require(<FILL_ME>) require(LilPlutoPrice.mul(numberOfTokens) == msg.value, "Ether value sent is not correct"); uint i; uint mintIndex; for (i; i < numberOfTokens; i++) { mintIndex = totalSupply(); if (totalSupply() < maxLilPluto) { _safeMint(_msgSender(), mintIndex); } } } }
totalSupply().add(numberOfTokens)<=maxLilPluto,"Purchase would exceed max supply of LilPlutos"
6,195
totalSupply().add(numberOfTokens)<=maxLilPluto
"Ether value sent is not correct"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } pragma solidity 0.7.0; contract PlutoHipHopDept is ERC721, Ownable { using SafeMath for uint256; uint256 public LilPlutoPrice = 50000000000000000; // 0.05 ETH uint256 public maxPurchase = 20; uint256 public maxLilPluto = 10000; bool public saleIsActive = false; constructor() ERC721("Pluto HipHop Dept.", "PHHD") { } function withdraw() public onlyOwner { } function reserveLilPluto() public onlyOwner { } function flipSaleState() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintLilPluto(uint numberOfTokens) public payable { require(saleIsActive, "Sale is not active"); require(numberOfTokens <= maxPurchase, "Exceeds max number of Lil Plutos in one transaction"); require(totalSupply().add(numberOfTokens) <= maxLilPluto, "Purchase would exceed max supply of LilPlutos"); require(<FILL_ME>) uint i; uint mintIndex; for (i; i < numberOfTokens; i++) { mintIndex = totalSupply(); if (totalSupply() < maxLilPluto) { _safeMint(_msgSender(), mintIndex); } } } }
LilPlutoPrice.mul(numberOfTokens)==msg.value,"Ether value sent is not correct"
6,195
LilPlutoPrice.mul(numberOfTokens)==msg.value
"ERC1155#safeTransferFrom: INVALID_OPERATOR"
pragma solidity 0.6.12; import './IERC165.sol'; import './IERC1155TokenReceiver.sol'; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; /** * @dev Implementation of Multi-Token Standard contract */ contract ERC1155 is IERC165 { using SafeMath for uint256; using Address for address; /***********************************| | Variables and Events | |__________________________________*/ // onReceive function signatures bytes4 constant internal ERC1155_RECEIVED_VALUE = 0xf23a6e61; bytes4 constant internal ERC1155_BATCH_RECEIVED_VALUE = 0xbc197c81; // Objects balances mapping (address => mapping(uint256 => uint256)) internal balances; // Operator Functions mapping (address => mapping(address => bool)) internal operators; // Events event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount); event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts); event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); event URI(string _uri, uint256 indexed _id); /***********************************| | Public Transfer Functions | |__________________________________*/ /** * @notice Transfers amount amount of an _id from the _from address to the _to address specified * @param _from Source address * @param _to Target address * @param _id ID of the token type * @param _amount Transfered amount * @param _data Additional data with no specified format, sent in call to `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data) public { require(<FILL_ME>) require(_to != address(0),"ERC1155#safeTransferFrom: INVALID_RECIPIENT"); // require(_amount >= balances[_from][_id]) is not necessary since checked with safemath operations _safeTransferFrom(_from, _to, _id, _amount); _callonERC1155Received(_from, _to, _id, _amount, _data); } /** * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) * @param _from Source addresses * @param _to Target addresses * @param _ids IDs of each token type * @param _amounts Transfer amounts per token type * @param _data Additional data with no specified format, sent in call to `_to` */ function safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) public { } /***********************************| | Internal Transfer Functions | |__________________________________*/ /** * @notice Transfers amount amount of an _id from the _from address to the _to address specified * @param _from Source address * @param _to Target address * @param _id ID of the token type * @param _amount Transfered amount */ function _safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount) internal { } /** * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155Received(...) */ function _callonERC1155Received(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data) internal { } /** * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) * @param _from Source addresses * @param _to Target addresses * @param _ids IDs of each token type * @param _amounts Transfer amounts per token type */ function _safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts) internal { } /** * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155BatchReceived(...) */ function _callonERC1155BatchReceived(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) internal { } /***********************************| | Operator Functions | |__________________________________*/ /** * @notice Enable or disable approval for a third party ("operator") to manage all of caller's tokens * @param _operator Address to add to the set of authorized operators * @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external { } /** * @notice Queries the approval status of an operator for a given owner * @param _owner The owner of the Tokens * @param _operator Address of authorized operator * @return isOperator Bool of approved for all */ function isApprovedForAll(address _owner, address _operator) public view virtual returns (bool isOperator) { } /***********************************| | Balance Functions | |__________________________________*/ /** * @notice Get the balance of an account's Tokens * @param _owner The address of the token holder * @param _id ID of the Token * @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) public view returns (uint256) { } /** * @notice Get the balance of multiple account/token pairs * @param _owners The addresses of the token holders * @param _ids ID of the Tokens * @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] memory _owners, uint256[] memory _ids) public view returns (uint256[] memory) { } /***********************************| | ERC165 Functions | |__________________________________*/ /** * INTERFACE_SIGNATURE_ERC165 = bytes4(keccak256("supportsInterface(bytes4)")); */ bytes4 constant private INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7; /** * INTERFACE_SIGNATURE_ERC1155 = * bytes4(keccak256("safeTransferFrom(address,address,uint256,uint256,bytes)")) ^ * bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)")) ^ * bytes4(keccak256("balanceOf(address,uint256)")) ^ * bytes4(keccak256("balanceOfBatch(address[],uint256[])")) ^ * bytes4(keccak256("setApprovalForAll(address,bool)")) ^ * bytes4(keccak256("isApprovedForAll(address,address)")); */ bytes4 constant private INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26; /** * @notice Query if a contract implements an interface * @param _interfaceID The interface identifier, as specified in ERC-165 * @return `true` if the contract implements `_interfaceID` and */ function supportsInterface(bytes4 _interfaceID) external view override returns (bool) { } }
(msg.sender==_from)||isApprovedForAll(_from,msg.sender),"ERC1155#safeTransferFrom: INVALID_OPERATOR"
6,210
(msg.sender==_from)||isApprovedForAll(_from,msg.sender)
"Staking not started yet"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { require(<FILL_ME>) return (block.timestamp - lpUsers[msg.sender].startTime) / waitTimeUnit; } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
lpUsers[msg.sender].stakeAmount>0,"Staking not started yet"
6,214
lpUsers[msg.sender].stakeAmount>0
"Staking not started yet"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { require(<FILL_ME>) return lpUsers[user].stage; } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
lpUsers[user].stakeAmount>0,"Staking not started yet"
6,214
lpUsers[user].stakeAmount>0
"Staking not started"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { require(hal9kVault == IHal9kVault(_msgSender()), "Caller is not Hal9kVault Contract"); require(stakeAmount > 0, "Stake amount invalid"); require(<FILL_ME>) if (lpUsers[sender].stakeAmount > stakeAmount) { lpUsers[sender].stakeAmount -= stakeAmount; } else { lpUsers[sender].stakeAmount = 0; lpUsers[sender].lastUpdateTime = 0; lpUsers[sender].startTime = 0; lpUsers[sender].stage = 0; } emit withdrawnLP(sender, lpUsers[sender].startTime); } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
lpUsers[sender].startTime>0,"Staking not started"
6,214
lpUsers[sender].startTime>0
"Staking not started yet"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { require(<FILL_ME>) if (backOrForth == false) { // If user moves to the next stage if (lpUsers[msg.sender].stage == 0) { lpUsers[msg.sender].stage = 1; lpUsers[msg.sender].lastUpdateTime = block.timestamp; } else if (lpUsers[msg.sender].stage >= 1) { lpUsers[msg.sender].stage += 1; lpUsers[msg.sender].lastUpdateTime = block.timestamp; } } else { // If user decides to go one stage back if (lpUsers[msg.sender].stage == 0) { lpUsers[msg.sender].stage = 0; } else if (lpUsers[msg.sender].stage > 3) { lpUsers[msg.sender].stage = 3; lpUsers[msg.sender].lastUpdateTime = block.timestamp; } else { lpUsers[msg.sender].stage -= 1; lpUsers[msg.sender].lastUpdateTime = block.timestamp; } } console.log("Changed stage: ", lpUsers[msg.sender].stage); emit stageUpdated(msg.sender, lpUsers[msg.sender].stage, lpUsers[msg.sender].lastUpdateTime); } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
lpUsers[msg.sender].startTime>0&&lpUsers[msg.sender].stakeAmount>0,"Staking not started yet"
6,214
lpUsers[msg.sender].startTime>0&&lpUsers[msg.sender].stakeAmount>0
"Card not found"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { // Check if cards are available to be minted require(_cardCount > 0, "Mint amount should be more than 1"); require(<FILL_ME>) require(hal9kLtd.totalSupply(_cardId) <= hal9kLtd.maxSupply(_cardId), "Card limit is reached"); // Validation uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); console.log("Mint Card For User (staked amount): ", stakeAmount, lpUsers[msg.sender].stakeAmount); console.log("Caller of MintCardForUser function: ", msg.sender, _cardCount); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.mint(msg.sender, _cardId, _cardCount, ""); emit minted(msg.sender, _cardId, _cardCount); } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd._exists(_cardId)!=false,"Card not found"
6,214
hal9kLtd._exists(_cardId)!=false
"Card limit is reached"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { // Check if cards are available to be minted require(_cardCount > 0, "Mint amount should be more than 1"); require(hal9kLtd._exists(_cardId) != false, "Card not found"); require(<FILL_ME>) // Validation uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); console.log("Mint Card For User (staked amount): ", stakeAmount, lpUsers[msg.sender].stakeAmount); console.log("Caller of MintCardForUser function: ", msg.sender, _cardCount); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.mint(msg.sender, _cardId, _cardCount, ""); emit minted(msg.sender, _cardId, _cardCount); } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd.totalSupply(_cardId)<=hal9kLtd.maxSupply(_cardId),"Card limit is reached"
6,214
hal9kLtd.totalSupply(_cardId)<=hal9kLtd.maxSupply(_cardId)
"Sell event is not set"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ require(<FILL_ME>) require(_eventData[_cardId].sellEndTime >= _eventData[_cardId].sellStartTime, "Is the sell event set correctly?"); require(_eventData[_cardId].soldAmount < _eventData[_cardId].cardAmount, "All cards are sold"); require(block.timestamp >= _eventData[_cardId].sellStartTime, "Sell event is not started"); require(block.timestamp <= _eventData[_cardId].sellEndTime, "Sell event is ended"); require(_cardBought[_cardId][msg.sender] != true, "You've already bought the card"); require(msg.value == _eventData[_cardId].price, "Invalid price"); require(_cardCount > 0, "Mint amount should be more than 1"); require(hal9kLtd._exists(_cardId) != false, "Card not found"); require(hal9kLtd.totalSupply(_cardId) <= hal9kLtd.maxSupply(_cardId), "Card limit is reached"); address payable receiver = payable(address(owner())); receiver.transfer(msg.value); hal9kLtd.mint(msg.sender, _cardId, _cardCount, ""); _cardBought[_cardId][msg.sender] = true; boughtAddress[_cardId].push(msg.sender); _eventData[_cardId].soldAmount = _eventData[_cardId].soldAmount + 1; emit minted(msg.sender, _cardId, _cardCount); } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
_eventData[_cardId].sellStartTime>=0&&_eventData[_cardId].sellEndTime>=0,"Sell event is not set"
6,214
_eventData[_cardId].sellStartTime>=0&&_eventData[_cardId].sellEndTime>=0
"Is the sell event set correctly?"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ require(_eventData[_cardId].sellStartTime >= 0 && _eventData[_cardId].sellEndTime >= 0, "Sell event is not set"); require(<FILL_ME>) require(_eventData[_cardId].soldAmount < _eventData[_cardId].cardAmount, "All cards are sold"); require(block.timestamp >= _eventData[_cardId].sellStartTime, "Sell event is not started"); require(block.timestamp <= _eventData[_cardId].sellEndTime, "Sell event is ended"); require(_cardBought[_cardId][msg.sender] != true, "You've already bought the card"); require(msg.value == _eventData[_cardId].price, "Invalid price"); require(_cardCount > 0, "Mint amount should be more than 1"); require(hal9kLtd._exists(_cardId) != false, "Card not found"); require(hal9kLtd.totalSupply(_cardId) <= hal9kLtd.maxSupply(_cardId), "Card limit is reached"); address payable receiver = payable(address(owner())); receiver.transfer(msg.value); hal9kLtd.mint(msg.sender, _cardId, _cardCount, ""); _cardBought[_cardId][msg.sender] = true; boughtAddress[_cardId].push(msg.sender); _eventData[_cardId].soldAmount = _eventData[_cardId].soldAmount + 1; emit minted(msg.sender, _cardId, _cardCount); } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
_eventData[_cardId].sellEndTime>=_eventData[_cardId].sellStartTime,"Is the sell event set correctly?"
6,214
_eventData[_cardId].sellEndTime>=_eventData[_cardId].sellStartTime
"All cards are sold"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ require(_eventData[_cardId].sellStartTime >= 0 && _eventData[_cardId].sellEndTime >= 0, "Sell event is not set"); require(_eventData[_cardId].sellEndTime >= _eventData[_cardId].sellStartTime, "Is the sell event set correctly?"); require(<FILL_ME>) require(block.timestamp >= _eventData[_cardId].sellStartTime, "Sell event is not started"); require(block.timestamp <= _eventData[_cardId].sellEndTime, "Sell event is ended"); require(_cardBought[_cardId][msg.sender] != true, "You've already bought the card"); require(msg.value == _eventData[_cardId].price, "Invalid price"); require(_cardCount > 0, "Mint amount should be more than 1"); require(hal9kLtd._exists(_cardId) != false, "Card not found"); require(hal9kLtd.totalSupply(_cardId) <= hal9kLtd.maxSupply(_cardId), "Card limit is reached"); address payable receiver = payable(address(owner())); receiver.transfer(msg.value); hal9kLtd.mint(msg.sender, _cardId, _cardCount, ""); _cardBought[_cardId][msg.sender] = true; boughtAddress[_cardId].push(msg.sender); _eventData[_cardId].soldAmount = _eventData[_cardId].soldAmount + 1; emit minted(msg.sender, _cardId, _cardCount); } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
_eventData[_cardId].soldAmount<_eventData[_cardId].cardAmount,"All cards are sold"
6,214
_eventData[_cardId].soldAmount<_eventData[_cardId].cardAmount
"You've already bought the card"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ require(_eventData[_cardId].sellStartTime >= 0 && _eventData[_cardId].sellEndTime >= 0, "Sell event is not set"); require(_eventData[_cardId].sellEndTime >= _eventData[_cardId].sellStartTime, "Is the sell event set correctly?"); require(_eventData[_cardId].soldAmount < _eventData[_cardId].cardAmount, "All cards are sold"); require(block.timestamp >= _eventData[_cardId].sellStartTime, "Sell event is not started"); require(block.timestamp <= _eventData[_cardId].sellEndTime, "Sell event is ended"); require(<FILL_ME>) require(msg.value == _eventData[_cardId].price, "Invalid price"); require(_cardCount > 0, "Mint amount should be more than 1"); require(hal9kLtd._exists(_cardId) != false, "Card not found"); require(hal9kLtd.totalSupply(_cardId) <= hal9kLtd.maxSupply(_cardId), "Card limit is reached"); address payable receiver = payable(address(owner())); receiver.transfer(msg.value); hal9kLtd.mint(msg.sender, _cardId, _cardCount, ""); _cardBought[_cardId][msg.sender] = true; boughtAddress[_cardId].push(msg.sender); _eventData[_cardId].soldAmount = _eventData[_cardId].soldAmount + 1; emit minted(msg.sender, _cardId, _cardCount); } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
_cardBought[_cardId][msg.sender]!=true,"You've already bought the card"
6,214
_cardBought[_cardId][msg.sender]!=true
"Card doesn't exist"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { require(_cardCount > 0, "Burn amount should be more than 1"); require(<FILL_ME>) require(hal9kLtd.totalSupply(_cardId) > 0, "No cards exist"); uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.burn(msg.sender, _cardId, _cardCount); emit burned(msg.sender, _cardId, _cardCount); } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd._exists(_cardId)==true,"Card doesn't exist"
6,214
hal9kLtd._exists(_cardId)==true
"No cards exist"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { require(_cardCount > 0, "Burn amount should be more than 1"); require(hal9kLtd._exists(_cardId) == true, "Card doesn't exist"); require(<FILL_ME>) uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.burn(msg.sender, _cardId, _cardCount); emit burned(msg.sender, _cardId, _cardCount); } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd.totalSupply(_cardId)>0,"No cards exist"
6,214
hal9kLtd.totalSupply(_cardId)>0
"From card doesn't exist"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { require(_fromCardCount > 0, "Original card should be more than 1"); require(<FILL_ME>) require(hal9kLtd._exists(_toCardId) == true, "To card doesn't exist"); require(hal9kLtd._exists(_upgradeCardId) == true, "Upgrade card doesn't exist"); require(hal9kLtd.totalSupply(_fromCardId) > 0, "No cards exist"); require(hal9kLtd.totalSupply(_toCardId) <= hal9kLtd.maxSupply(_toCardId), "Unable to upgrade because card limit is reached."); uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.burn(msg.sender, _fromCardId, _fromCardCount); hal9kLtd.burn(msg.sender, _upgradeCardId, 1); hal9kLtd.mint(msg.sender, _toCardId, 1, ""); emit upgraded(msg.sender, _toCardId); } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd._exists(_fromCardId)==true,"From card doesn't exist"
6,214
hal9kLtd._exists(_fromCardId)==true
"To card doesn't exist"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { require(_fromCardCount > 0, "Original card should be more than 1"); require(hal9kLtd._exists(_fromCardId) == true, "From card doesn't exist"); require(<FILL_ME>) require(hal9kLtd._exists(_upgradeCardId) == true, "Upgrade card doesn't exist"); require(hal9kLtd.totalSupply(_fromCardId) > 0, "No cards exist"); require(hal9kLtd.totalSupply(_toCardId) <= hal9kLtd.maxSupply(_toCardId), "Unable to upgrade because card limit is reached."); uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.burn(msg.sender, _fromCardId, _fromCardCount); hal9kLtd.burn(msg.sender, _upgradeCardId, 1); hal9kLtd.mint(msg.sender, _toCardId, 1, ""); emit upgraded(msg.sender, _toCardId); } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd._exists(_toCardId)==true,"To card doesn't exist"
6,214
hal9kLtd._exists(_toCardId)==true
"Upgrade card doesn't exist"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { require(_fromCardCount > 0, "Original card should be more than 1"); require(hal9kLtd._exists(_fromCardId) == true, "From card doesn't exist"); require(hal9kLtd._exists(_toCardId) == true, "To card doesn't exist"); require(<FILL_ME>) require(hal9kLtd.totalSupply(_fromCardId) > 0, "No cards exist"); require(hal9kLtd.totalSupply(_toCardId) <= hal9kLtd.maxSupply(_toCardId), "Unable to upgrade because card limit is reached."); uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.burn(msg.sender, _fromCardId, _fromCardCount); hal9kLtd.burn(msg.sender, _upgradeCardId, 1); hal9kLtd.mint(msg.sender, _toCardId, 1, ""); emit upgraded(msg.sender, _toCardId); } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd._exists(_upgradeCardId)==true,"Upgrade card doesn't exist"
6,214
hal9kLtd._exists(_upgradeCardId)==true
"No cards exist"
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { require(_fromCardCount > 0, "Original card should be more than 1"); require(hal9kLtd._exists(_fromCardId) == true, "From card doesn't exist"); require(hal9kLtd._exists(_toCardId) == true, "To card doesn't exist"); require(hal9kLtd._exists(_upgradeCardId) == true, "Upgrade card doesn't exist"); require(<FILL_ME>) require(hal9kLtd.totalSupply(_toCardId) <= hal9kLtd.maxSupply(_toCardId), "Unable to upgrade because card limit is reached."); uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.burn(msg.sender, _fromCardId, _fromCardCount); hal9kLtd.burn(msg.sender, _upgradeCardId, 1); hal9kLtd.mint(msg.sender, _toCardId, 1, ""); emit upgraded(msg.sender, _toCardId); } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd.totalSupply(_fromCardId)>0,"No cards exist"
6,214
hal9kLtd.totalSupply(_fromCardId)>0
"Unable to upgrade because card limit is reached."
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity 0.6.12; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import './ERC1155Tradable.sol'; import '../IHal9kVault.sol'; import "hardhat/console.sol"; contract HAL9KNFTPool is OwnableUpgradeSafe { ERC1155Tradable public hal9kLtd; IHal9kVault public hal9kVault; uint256 private waitTimeUnit; mapping(uint256 => address[]) private boughtAddress; struct UserInfo { uint256 lastUpdateTime; uint256 stakeAmount; uint256 startTime; uint256 stage; } mapping(address => UserInfo) private lpUsers; // Events event stageUpdated(address addr, uint256 stage, uint256 lastUpdateTime); event vaultAddressChanged(address newAddress, address oldAddress); event didHal9kStaking(address addr, uint256 startedTime); event withdrawnLP(address addr, uint256 lastUpdateTime); event waitTimeUnitUpdated(address addr, uint256 waitTimeUnit); event minted(address addr, uint256 cardId, uint256 mintAmount); event burned(address addr, uint256 cardId, uint256 burnAmount); event upgraded(address addr, uint256 newCardId); event eventSet(uint256 cardId, uint256 starTime, uint256 endTime); mapping(uint256 => mapping(address => bool)) public _cardBought; struct SellEvent { uint256 sellStartTime; uint256 sellEndTime; uint256 cardAmount; uint256 soldAmount; uint256 price; } mapping(uint256 => SellEvent) public _eventData; // functions function initialize(ERC1155Tradable _hal9kltdAddress, IHal9kVault _hal9kVaultAddress, address superAdmin) public initializer { } // Change the hal9k vault address function changeHal9kVaultAddress(address _hal9kVaultAddress) external onlyOwner { } function updateWaitTimeUnit(uint256 timeUnit) public onlyOwner { } function getDaysPassedAfterStakingStart() public view returns (uint256) { } function getDaysPassedAfterLastUpdateTime() public view returns (uint256) { } function getCurrentStage(address user) public view returns(uint256 stage) { } function getStakedAmountOfUser(address user) public view returns(uint256 stakeAmount) { } function getStakeStartTime(address user) public view returns(uint256 startTime) { } function getLastUpdateTime(address user) public view returns(uint256 startTime) { } function isHal9kStakingStarted(address user) public view returns(bool started){ } function doHal9kStaking(address sender, uint256 stakeAmount, uint256 currentTime) public { } function withdrawLP(address sender, uint256 stakeAmount) public { } // backOrForth : back if true, forward if false function moveStageBackOrForth(bool backOrForth) public { } // Give NFT to User function mintCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function isAlreadyBought(uint256 _cardId, address buyer) public view returns(bool) { } function isSellEventEnded(uint256 _cardId) public view returns(bool) { } function getSellEventData(uint256 _cardId) public view returns(uint256, uint256, uint256, uint256, uint256) { } function setSellEvent(uint256 _cardId, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _price) public onlyOwner{ } function mintCardForUserDuringSellEvent(uint256 _cardId, uint256 _cardCount) public payable{ } // Burn NFT from user function burnCardForUser(uint256 _pid, uint256 _cardId, uint256 _cardCount) public { } function upgradeCard(uint256 _pid, uint256 _fromCardId, uint256 _fromCardCount, uint256 _toCardId, uint256 _upgradeCardId) public { require(_fromCardCount > 0, "Original card should be more than 1"); require(hal9kLtd._exists(_fromCardId) == true, "From card doesn't exist"); require(hal9kLtd._exists(_toCardId) == true, "To card doesn't exist"); require(hal9kLtd._exists(_upgradeCardId) == true, "Upgrade card doesn't exist"); require(hal9kLtd.totalSupply(_fromCardId) > 0, "No cards exist"); require(<FILL_ME>) uint256 stakeAmount = hal9kVault.getUserInfo(_pid, msg.sender); require(stakeAmount > 0 && stakeAmount == lpUsers[msg.sender].stakeAmount, "Invalid user"); hal9kLtd.burn(msg.sender, _fromCardId, _fromCardCount); hal9kLtd.burn(msg.sender, _upgradeCardId, 1); hal9kLtd.mint(msg.sender, _toCardId, 1, ""); emit upgraded(msg.sender, _toCardId); } address private _superAdmin; event SuperAdminTransfered( address indexed previousOwner, address indexed newOwner ); modifier onlySuperAdmin() { } function burnSuperAdmin() public virtual onlySuperAdmin { } function newSuperAdmin(address newOwner) public virtual onlySuperAdmin { } }
hal9kLtd.totalSupply(_toCardId)<=hal9kLtd.maxSupply(_toCardId),"Unable to upgrade because card limit is reached."
6,214
hal9kLtd.totalSupply(_toCardId)<=hal9kLtd.maxSupply(_toCardId)
null
/// @author Soldier4One pragma solidity >=0.7.0 <0.9.0; contract RacCons is ERC721Enumerable, Ownable { using Strings for uint256; string public baseURI; string public baseExtension = ".json"; string public notRevealedUri; uint256 public cost = 0.055 ether; uint256 public maxSupply = 5555; uint256 public maxMintAmount = 5; uint256 public nftPerAdressLimit = 5; bool public paused = false; bool public revealed = false; bool public onlyWhitelisted= true; address[] public whitelistedAddresses; address payable public payments; constructor( string memory _name, string memory _symbol, string memory _initBaseURI, string memory _initNotRevealedUri, address _payments ) ERC721(_name, _symbol) { } // internal function _baseURI() internal view virtual override returns (string memory) { } // public function mint(uint256 _mintAmount) public payable { require(!paused); uint256 supply = totalSupply(); require(_mintAmount > 0); require(_mintAmount <= maxMintAmount); require(<FILL_ME>) if (msg.sender != owner()) { if(onlyWhitelisted == true) { require(isWhitelisted(msg.sender), "user is not whitelisted"); uint256 ownerTokenCount = balanceOf(msg.sender); require(ownerTokenCount < nftPerAdressLimit); } require(msg.value >= cost * _mintAmount); } for (uint256 i = 1; i <= _mintAmount; i++) { _safeMint(msg.sender, supply + i); } } function isWhitelisted(address _user) public view returns (bool) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function reveal() public onlyOwner { } function setNftPerAdressLimit(uint256 _limit) public onlyOwner() { } function setCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function setOnlyWhitelisted(bool _state) public onlyOwner { } function whitelistUsers(address[] calldata _users) public onlyOwner { } function withdraw() public payable onlyOwner { } }
supply+_mintAmount<=maxSupply
6,311
supply+_mintAmount<=maxSupply
null
/** * @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 { using SafeMath for uint256; using SafeERC20 for ERC20; event Released(uint256 amount); event Revoked(); // beneficiary of tokens after they are released address public beneficiary; uint256 public cliff; uint256 public start; uint256 public duration; bool public revocable; bool public revoked; uint256 public released; ERC20 public token; /** * @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 _cliff duration in seconds of the cliff in which tokens will begin to vest * @param _duration duration in seconds of the period in which the tokens will vest * @param _revocable whether the vesting is revocable or not * @param _token address of the ERC20 token contract */ function TokenVesting( address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, bool _revocable, address _token ) { } /** * @notice Only allow calls from the beneficiary of the vesting contract */ modifier onlyBeneficiary() { } /** * @notice Allow the beneficiary to change its address * @param target the address to transfer the right to */ function changeBeneficiary(address target) onlyBeneficiary public { } /** * @notice Transfers vested tokens to beneficiary. */ function release() onlyBeneficiary public { } /** * @notice Transfers vested tokens to a target address. * @param target the address to send the tokens to */ function releaseTo(address target) onlyBeneficiary public { } /** * @notice Transfers vested tokens to beneficiary. */ function _releaseTo(address target) internal { } /** * @notice Allows the owner to revoke the vesting. Tokens already vested are sent to the beneficiary. */ function revoke() onlyOwner public { require(revocable); require(<FILL_ME>) // Release all vested tokens _releaseTo(beneficiary); // Send the remainder to the owner token.safeTransfer(owner, token.balanceOf(this)); revoked = true; Revoked(); } /** * @dev Calculates the amount that has already vested but hasn't been released yet. */ function releasableAmount() public constant returns (uint256) { } /** * @dev Calculates the amount that has already vested. */ function vestedAmount() public constant returns (uint256) { } /** * @notice Allow withdrawing any token other than the relevant one */ function releaseForeignToken(ERC20 _token, uint256 amount) onlyOwner { } }
!revoked
6,387
!revoked
"User Exists"
/* 8 8888888888 ,o888888o. 8 888888888o. ,o888888o. 8 8888888888 8 8888888888 `8.`8888. ,8' 8 8888 . 8888 `88. 8 8888 `88. 8888 `88. 8 8888 8 8888 `8.`8888. ,8' 8 8888 ,8 8888 `8b 8 8888 `88 ,8 8888 `8. 8 8888 8 8888 `8.`8888. ,8' 8 8888 88 8888 `8b 8 8888 ,88 88 8888 8 8888 8 8888 `8.`8888.,8' 8 888888888888 88 8888 88 8 8888. ,88' 88 8888 8 888888888888 8 888888888888 `8.`88888' 8 8888 88 8888 88 8 888888888P' 88 8888 8 8888 8 8888 .88.`8888. 8 8888 88 8888 ,8P 8 8888`8b 88 8888 8 8888 8 8888 .8'`8.`8888. 8 8888 `8 8888 ,8P 8 8888 `8b. `8 8888 .8' 8 8888 8 8888 .8' `8.`8888. 8 8888 ` 8888 ,88' 8 8888 `8b. 8888 ,88' 8 8888 8 8888 .8' `8.`8888. 8 8888 `8888888P' 8 8888 `88. `8888888P' 8 888888888888 8 888888888888 .8' `8.`8888. Hello I am Forceex, Global One line AutoPool Smart contract. */ pragma solidity 0.5.11; contract Forceex { address public ownerWallet; struct Variables { uint currUserID ; uint pool1currUserID ; uint pool2currUserID ; uint pool3currUserID ; uint pool4currUserID ; uint pool5currUserID ; uint pool6currUserID ; uint pool7currUserID ; uint pool8currUserID ; uint pool9currUserID ; uint pool10currUserID ; uint pool11currUserID ; uint pool12currUserID ; } struct Variables2 { uint pool1activeUserID ; uint pool2activeUserID ; uint pool3activeUserID ; uint pool4activeUserID ; uint pool5activeUserID ; uint pool6activeUserID ; uint pool7activeUserID ; uint pool8activeUserID ; uint pool9activeUserID ; uint pool10activeUserID ; uint pool11activeUserID ; uint pool12activeUserID ; } Variables public vars; Variables2 public vars2; struct UserStruct { bool isExist; uint id; uint referrerID; uint referredUsers; mapping(uint => uint) levelExpired; } struct PoolUserStruct { bool isExist; uint id; uint payment_received; } mapping (address => UserStruct) public users; mapping (uint => address) public userList; mapping (address => PoolUserStruct) public pool1users; mapping (uint => address) public pool1userList; mapping (address => PoolUserStruct) public pool2users; mapping (uint => address) public pool2userList; mapping (address => PoolUserStruct) public pool3users; mapping (uint => address) public pool3userList; mapping (address => PoolUserStruct) public pool4users; mapping (uint => address) public pool4userList; mapping (address => PoolUserStruct) public pool5users; mapping (uint => address) public pool5userList; mapping (address => PoolUserStruct) public pool6users; mapping (uint => address) public pool6userList; mapping (address => PoolUserStruct) public pool7users; mapping (uint => address) public pool7userList; mapping (address => PoolUserStruct) public pool8users; mapping (uint => address) public pool8userList; mapping (address => PoolUserStruct) public pool9users; mapping (uint => address) public pool9userList; mapping (address => PoolUserStruct) public pool10users; mapping (uint => address) public pool10userList; mapping (address => PoolUserStruct) public pool11users; mapping (uint => address) public pool11userList; mapping (address => PoolUserStruct) public pool12users; mapping (uint => address) public pool12userList; mapping(uint => uint) public LEVEL_PRICE; uint public unlimited_level_price = 0; uint REGESTRATION_FESS = 0.10 ether; uint pool1_price = 0.10 ether; uint pool2_price = 0.30 ether; uint pool3_price = 0.70 ether; uint pool4_price = 1.00 ether; uint pool5_price = 2.00 ether; uint pool6_price = 3.00 ether; uint pool7_price = 5.00 ether; uint pool8_price = 10.00 ether; uint pool9_price = 15.00 ether; uint pool10_price = 25.00 ether; uint pool11_price = 35.00 ether; uint pool12_price = 60.00 ether; event regLevelEvent(address indexed _user, address indexed _referrer, uint _time); event getMoneyForLevelEvent(address indexed _user, address indexed _referral, uint _level, uint _time); event regPoolEntry(address indexed _user,uint _level, uint _time); event getPoolPayment(address indexed _user,address indexed _receiver, uint _level, uint _time); event getMoneyForPoolEvent(address indexed _user, address indexed _referral,uint _level, uint _time); UserStruct[] public requests; uint public totalEarned = 0; constructor() public { } function regUser(uint _referrerID) public payable { require(<FILL_ME>) require(_referrerID > 0 && _referrerID <= vars.currUserID, 'Incorrect referral ID'); require(msg.value == REGESTRATION_FESS, 'Incorrect Value'); UserStruct memory userStruct; vars.currUserID++; userStruct = UserStruct({ isExist: true, id: vars.currUserID, referrerID: _referrerID, referredUsers:0 }); users[msg.sender] = userStruct; userList[vars.currUserID]=msg.sender; users[userList[users[msg.sender].referrerID]].referredUsers=users[userList[users[msg.sender].referrerID]].referredUsers+1; payReferral(1,msg.sender); emit regLevelEvent(msg.sender, userList[_referrerID], now); } function payReferral(uint _level, address _user) internal { } function buyPool(uint poolNumber) public payable{ } function getPoolPaymentNumber(uint _poolNumber) internal pure returns (uint){ } function isInPool(uint _poolNumber,address _PoolMember) internal view returns (bool){ } function checkPrice(uint _poolNumber,uint256 Amount) internal view returns (bool){ } function getPoolCurrentUser(uint _poolNumber) internal view returns (address){ } function increasePoolCurrentUserID(uint _poolNumber) internal { } function getPoolCurrentUserID(uint _poolNumber) internal view returns (uint){ } function assignPoolUser(uint _poolNumber,address newPoolMember,uint poolCurrentUserID,PoolUserStruct memory userStruct) internal { } function getPoolPrice(uint _poolNumber) internal view returns (uint){ } function increasePoolPaymentReceive(uint _poolNumber, address CurrentUser) internal { } function getPoolPaymentReceive(uint _poolNumber, address CurrentUser) internal view returns(uint){ } function increasePoolActiveUserID(uint _poolNumber) internal { } function getEthBalance() public view returns(uint) { } function sendBalance() private { } }
!users[msg.sender].isExist,"User Exists"
6,454
!users[msg.sender].isExist
"User Not Registered"
/* 8 8888888888 ,o888888o. 8 888888888o. ,o888888o. 8 8888888888 8 8888888888 `8.`8888. ,8' 8 8888 . 8888 `88. 8 8888 `88. 8888 `88. 8 8888 8 8888 `8.`8888. ,8' 8 8888 ,8 8888 `8b 8 8888 `88 ,8 8888 `8. 8 8888 8 8888 `8.`8888. ,8' 8 8888 88 8888 `8b 8 8888 ,88 88 8888 8 8888 8 8888 `8.`8888.,8' 8 888888888888 88 8888 88 8 8888. ,88' 88 8888 8 888888888888 8 888888888888 `8.`88888' 8 8888 88 8888 88 8 888888888P' 88 8888 8 8888 8 8888 .88.`8888. 8 8888 88 8888 ,8P 8 8888`8b 88 8888 8 8888 8 8888 .8'`8.`8888. 8 8888 `8 8888 ,8P 8 8888 `8b. `8 8888 .8' 8 8888 8 8888 .8' `8.`8888. 8 8888 ` 8888 ,88' 8 8888 `8b. 8888 ,88' 8 8888 8 8888 .8' `8.`8888. 8 8888 `8888888P' 8 8888 `88. `8888888P' 8 888888888888 8 888888888888 .8' `8.`8888. Hello I am Forceex, Global One line AutoPool Smart contract. */ pragma solidity 0.5.11; contract Forceex { address public ownerWallet; struct Variables { uint currUserID ; uint pool1currUserID ; uint pool2currUserID ; uint pool3currUserID ; uint pool4currUserID ; uint pool5currUserID ; uint pool6currUserID ; uint pool7currUserID ; uint pool8currUserID ; uint pool9currUserID ; uint pool10currUserID ; uint pool11currUserID ; uint pool12currUserID ; } struct Variables2 { uint pool1activeUserID ; uint pool2activeUserID ; uint pool3activeUserID ; uint pool4activeUserID ; uint pool5activeUserID ; uint pool6activeUserID ; uint pool7activeUserID ; uint pool8activeUserID ; uint pool9activeUserID ; uint pool10activeUserID ; uint pool11activeUserID ; uint pool12activeUserID ; } Variables public vars; Variables2 public vars2; struct UserStruct { bool isExist; uint id; uint referrerID; uint referredUsers; mapping(uint => uint) levelExpired; } struct PoolUserStruct { bool isExist; uint id; uint payment_received; } mapping (address => UserStruct) public users; mapping (uint => address) public userList; mapping (address => PoolUserStruct) public pool1users; mapping (uint => address) public pool1userList; mapping (address => PoolUserStruct) public pool2users; mapping (uint => address) public pool2userList; mapping (address => PoolUserStruct) public pool3users; mapping (uint => address) public pool3userList; mapping (address => PoolUserStruct) public pool4users; mapping (uint => address) public pool4userList; mapping (address => PoolUserStruct) public pool5users; mapping (uint => address) public pool5userList; mapping (address => PoolUserStruct) public pool6users; mapping (uint => address) public pool6userList; mapping (address => PoolUserStruct) public pool7users; mapping (uint => address) public pool7userList; mapping (address => PoolUserStruct) public pool8users; mapping (uint => address) public pool8userList; mapping (address => PoolUserStruct) public pool9users; mapping (uint => address) public pool9userList; mapping (address => PoolUserStruct) public pool10users; mapping (uint => address) public pool10userList; mapping (address => PoolUserStruct) public pool11users; mapping (uint => address) public pool11userList; mapping (address => PoolUserStruct) public pool12users; mapping (uint => address) public pool12userList; mapping(uint => uint) public LEVEL_PRICE; uint public unlimited_level_price = 0; uint REGESTRATION_FESS = 0.10 ether; uint pool1_price = 0.10 ether; uint pool2_price = 0.30 ether; uint pool3_price = 0.70 ether; uint pool4_price = 1.00 ether; uint pool5_price = 2.00 ether; uint pool6_price = 3.00 ether; uint pool7_price = 5.00 ether; uint pool8_price = 10.00 ether; uint pool9_price = 15.00 ether; uint pool10_price = 25.00 ether; uint pool11_price = 35.00 ether; uint pool12_price = 60.00 ether; event regLevelEvent(address indexed _user, address indexed _referrer, uint _time); event getMoneyForLevelEvent(address indexed _user, address indexed _referral, uint _level, uint _time); event regPoolEntry(address indexed _user,uint _level, uint _time); event getPoolPayment(address indexed _user,address indexed _receiver, uint _level, uint _time); event getMoneyForPoolEvent(address indexed _user, address indexed _referral,uint _level, uint _time); UserStruct[] public requests; uint public totalEarned = 0; constructor() public { } function regUser(uint _referrerID) public payable { } function payReferral(uint _level, address _user) internal { } function buyPool(uint poolNumber) public payable{ require(<FILL_ME>) bool isinpool = isInPool(poolNumber,msg.sender); require(!isinpool, "Already in AutoPool"); require(poolNumber>=1,"Pool number <0"); require(poolNumber<=12,"Pool number >12"); bool isPriceValid = checkPrice(poolNumber,msg.value); require(isPriceValid,"Price of Pool is Wrong"); PoolUserStruct memory userStruct; address poolCurrentuser=getPoolCurrentUser(poolNumber); increasePoolCurrentUserID(poolNumber); userStruct = PoolUserStruct({ isExist:true, id:getPoolCurrentUserID(poolNumber), payment_received:0 }); assignPoolUser(poolNumber,msg.sender,userStruct.id,userStruct); uint pool_price = getPoolPrice(poolNumber); bool sent = false; //direct fee for referer (15%) uint fee = (pool_price * 15) / 100; address referer; referer = userList[users[msg.sender].referrerID]; uint poolshare = pool_price - fee; if (address(uint160(referer)).send(fee)) sent = address(uint160(poolCurrentuser)).send(poolshare); if (sent) { totalEarned += poolshare; increasePoolPaymentReceive(poolNumber,poolCurrentuser); if(getPoolPaymentReceive(poolNumber,poolCurrentuser)>=getPoolPaymentNumber(poolNumber)) { increasePoolActiveUserID(poolNumber); } emit getMoneyForPoolEvent(referer, msg.sender,poolNumber, now); emit getPoolPayment(msg.sender,poolCurrentuser, poolNumber, now); emit regPoolEntry(msg.sender, poolNumber, now); } } function getPoolPaymentNumber(uint _poolNumber) internal pure returns (uint){ } function isInPool(uint _poolNumber,address _PoolMember) internal view returns (bool){ } function checkPrice(uint _poolNumber,uint256 Amount) internal view returns (bool){ } function getPoolCurrentUser(uint _poolNumber) internal view returns (address){ } function increasePoolCurrentUserID(uint _poolNumber) internal { } function getPoolCurrentUserID(uint _poolNumber) internal view returns (uint){ } function assignPoolUser(uint _poolNumber,address newPoolMember,uint poolCurrentUserID,PoolUserStruct memory userStruct) internal { } function getPoolPrice(uint _poolNumber) internal view returns (uint){ } function increasePoolPaymentReceive(uint _poolNumber, address CurrentUser) internal { } function getPoolPaymentReceive(uint _poolNumber, address CurrentUser) internal view returns(uint){ } function increasePoolActiveUserID(uint _poolNumber) internal { } function getEthBalance() public view returns(uint) { } function sendBalance() private { } }
users[msg.sender].isExist,"User Not Registered"
6,454
users[msg.sender].isExist
"Already in AutoPool"
/* 8 8888888888 ,o888888o. 8 888888888o. ,o888888o. 8 8888888888 8 8888888888 `8.`8888. ,8' 8 8888 . 8888 `88. 8 8888 `88. 8888 `88. 8 8888 8 8888 `8.`8888. ,8' 8 8888 ,8 8888 `8b 8 8888 `88 ,8 8888 `8. 8 8888 8 8888 `8.`8888. ,8' 8 8888 88 8888 `8b 8 8888 ,88 88 8888 8 8888 8 8888 `8.`8888.,8' 8 888888888888 88 8888 88 8 8888. ,88' 88 8888 8 888888888888 8 888888888888 `8.`88888' 8 8888 88 8888 88 8 888888888P' 88 8888 8 8888 8 8888 .88.`8888. 8 8888 88 8888 ,8P 8 8888`8b 88 8888 8 8888 8 8888 .8'`8.`8888. 8 8888 `8 8888 ,8P 8 8888 `8b. `8 8888 .8' 8 8888 8 8888 .8' `8.`8888. 8 8888 ` 8888 ,88' 8 8888 `8b. 8888 ,88' 8 8888 8 8888 .8' `8.`8888. 8 8888 `8888888P' 8 8888 `88. `8888888P' 8 888888888888 8 888888888888 .8' `8.`8888. Hello I am Forceex, Global One line AutoPool Smart contract. */ pragma solidity 0.5.11; contract Forceex { address public ownerWallet; struct Variables { uint currUserID ; uint pool1currUserID ; uint pool2currUserID ; uint pool3currUserID ; uint pool4currUserID ; uint pool5currUserID ; uint pool6currUserID ; uint pool7currUserID ; uint pool8currUserID ; uint pool9currUserID ; uint pool10currUserID ; uint pool11currUserID ; uint pool12currUserID ; } struct Variables2 { uint pool1activeUserID ; uint pool2activeUserID ; uint pool3activeUserID ; uint pool4activeUserID ; uint pool5activeUserID ; uint pool6activeUserID ; uint pool7activeUserID ; uint pool8activeUserID ; uint pool9activeUserID ; uint pool10activeUserID ; uint pool11activeUserID ; uint pool12activeUserID ; } Variables public vars; Variables2 public vars2; struct UserStruct { bool isExist; uint id; uint referrerID; uint referredUsers; mapping(uint => uint) levelExpired; } struct PoolUserStruct { bool isExist; uint id; uint payment_received; } mapping (address => UserStruct) public users; mapping (uint => address) public userList; mapping (address => PoolUserStruct) public pool1users; mapping (uint => address) public pool1userList; mapping (address => PoolUserStruct) public pool2users; mapping (uint => address) public pool2userList; mapping (address => PoolUserStruct) public pool3users; mapping (uint => address) public pool3userList; mapping (address => PoolUserStruct) public pool4users; mapping (uint => address) public pool4userList; mapping (address => PoolUserStruct) public pool5users; mapping (uint => address) public pool5userList; mapping (address => PoolUserStruct) public pool6users; mapping (uint => address) public pool6userList; mapping (address => PoolUserStruct) public pool7users; mapping (uint => address) public pool7userList; mapping (address => PoolUserStruct) public pool8users; mapping (uint => address) public pool8userList; mapping (address => PoolUserStruct) public pool9users; mapping (uint => address) public pool9userList; mapping (address => PoolUserStruct) public pool10users; mapping (uint => address) public pool10userList; mapping (address => PoolUserStruct) public pool11users; mapping (uint => address) public pool11userList; mapping (address => PoolUserStruct) public pool12users; mapping (uint => address) public pool12userList; mapping(uint => uint) public LEVEL_PRICE; uint public unlimited_level_price = 0; uint REGESTRATION_FESS = 0.10 ether; uint pool1_price = 0.10 ether; uint pool2_price = 0.30 ether; uint pool3_price = 0.70 ether; uint pool4_price = 1.00 ether; uint pool5_price = 2.00 ether; uint pool6_price = 3.00 ether; uint pool7_price = 5.00 ether; uint pool8_price = 10.00 ether; uint pool9_price = 15.00 ether; uint pool10_price = 25.00 ether; uint pool11_price = 35.00 ether; uint pool12_price = 60.00 ether; event regLevelEvent(address indexed _user, address indexed _referrer, uint _time); event getMoneyForLevelEvent(address indexed _user, address indexed _referral, uint _level, uint _time); event regPoolEntry(address indexed _user,uint _level, uint _time); event getPoolPayment(address indexed _user,address indexed _receiver, uint _level, uint _time); event getMoneyForPoolEvent(address indexed _user, address indexed _referral,uint _level, uint _time); UserStruct[] public requests; uint public totalEarned = 0; constructor() public { } function regUser(uint _referrerID) public payable { } function payReferral(uint _level, address _user) internal { } function buyPool(uint poolNumber) public payable{ require(users[msg.sender].isExist, "User Not Registered"); bool isinpool = isInPool(poolNumber,msg.sender); require(<FILL_ME>) require(poolNumber>=1,"Pool number <0"); require(poolNumber<=12,"Pool number >12"); bool isPriceValid = checkPrice(poolNumber,msg.value); require(isPriceValid,"Price of Pool is Wrong"); PoolUserStruct memory userStruct; address poolCurrentuser=getPoolCurrentUser(poolNumber); increasePoolCurrentUserID(poolNumber); userStruct = PoolUserStruct({ isExist:true, id:getPoolCurrentUserID(poolNumber), payment_received:0 }); assignPoolUser(poolNumber,msg.sender,userStruct.id,userStruct); uint pool_price = getPoolPrice(poolNumber); bool sent = false; //direct fee for referer (15%) uint fee = (pool_price * 15) / 100; address referer; referer = userList[users[msg.sender].referrerID]; uint poolshare = pool_price - fee; if (address(uint160(referer)).send(fee)) sent = address(uint160(poolCurrentuser)).send(poolshare); if (sent) { totalEarned += poolshare; increasePoolPaymentReceive(poolNumber,poolCurrentuser); if(getPoolPaymentReceive(poolNumber,poolCurrentuser)>=getPoolPaymentNumber(poolNumber)) { increasePoolActiveUserID(poolNumber); } emit getMoneyForPoolEvent(referer, msg.sender,poolNumber, now); emit getPoolPayment(msg.sender,poolCurrentuser, poolNumber, now); emit regPoolEntry(msg.sender, poolNumber, now); } } function getPoolPaymentNumber(uint _poolNumber) internal pure returns (uint){ } function isInPool(uint _poolNumber,address _PoolMember) internal view returns (bool){ } function checkPrice(uint _poolNumber,uint256 Amount) internal view returns (bool){ } function getPoolCurrentUser(uint _poolNumber) internal view returns (address){ } function increasePoolCurrentUserID(uint _poolNumber) internal { } function getPoolCurrentUserID(uint _poolNumber) internal view returns (uint){ } function assignPoolUser(uint _poolNumber,address newPoolMember,uint poolCurrentUserID,PoolUserStruct memory userStruct) internal { } function getPoolPrice(uint _poolNumber) internal view returns (uint){ } function increasePoolPaymentReceive(uint _poolNumber, address CurrentUser) internal { } function getPoolPaymentReceive(uint _poolNumber, address CurrentUser) internal view returns(uint){ } function increasePoolActiveUserID(uint _poolNumber) internal { } function getEthBalance() public view returns(uint) { } function sendBalance() private { } }
!isinpool,"Already in AutoPool"
6,454
!isinpool
"Router: invalid sender"
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; pragma experimental ABIEncoderV2; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {Ownable} from "../utils/Ownable.sol"; import {StdQueue} from "../utils/Queue.sol"; import {IOperation} from "../operations/Operation.sol"; import {IOperationStore} from "../operations/OperationStore.sol"; import {IOperationFactory} from "../operations/OperationFactory.sol"; interface IRouter { // ======================= common ======================= // function init( IOperation.Type _type, address _operator, uint256 _amount, address _swapper, address _swapDest, bool _autoFinish ) external; function finish(address _operation) external; // ======================= deposit stable ======================= // function depositStable(uint256 _amount) external; function depositStable(address _operator, uint256 _amount) external; function initDepositStable(uint256 _amount) external; function finishDepositStable(address _operation) external; // ======================= redeem stable ======================= // function redeemStable(uint256 _amount) external; function redeemStable(address _operator, uint256 _amount) external; function initRedeemStable(uint256 _amount) external; function finishRedeemStable(address _operation) external; } interface IConversionRouter { // ======================= deposit stable ======================= // function depositStable( address _operator, uint256 _amount, address _swapper, address _swapDest ) external; function initDepositStable( uint256 _amount, address _swapper, address _swapDest ) external; // ======================= redeem stable ======================= // function redeemStable( address _operator, uint256 _amount, address _swapper, address _swapDest ) external; function initRedeemStable( uint256 _amount, address _swapper, address _swapDest ) external; } contract Router is IRouter, IConversionRouter, Context, Ownable, Initializable { using SafeMath for uint256; using SafeERC20 for IERC20; // operation address public optStore; uint256 public optStdId; address public optFactory; // constant address public wUST; address public aUST; // flags bool public isDepositAllowed = true; bool public isRedemptionAllowed = true; function initialize( address _optStore, uint256 _optStdId, address _optFactory, address _wUST, address _aUST ) public initializer { } function setOperationStore(address _store) public onlyOwner { } function setOperationId(uint256 _optStdId) public onlyOwner { } function setOperationFactory(address _factory) public onlyOwner { } function setDepositAllowance(bool _allow) public onlyOwner { } function setRedemptionAllowance(bool _allow) public onlyOwner { } function _init( IOperation.Type _typ, address _operator, uint256 _amount, address _swapper, address _swapDest, bool _autoFinish ) internal { } function _finish(address _opt) internal { IOperationStore.Status status = IOperationStore(optStore).getStatusOf(_opt); if (status == IOperationStore.Status.RUNNING_MANUAL) { // check sender require(<FILL_ME>) } else { revert("Router: invalid status for finish"); } IOperation(_opt).finish(); IOperationStore(optStore).finish(_opt); } // =================================== COMMON =================================== // function init( IOperation.Type _type, address _operator, uint256 _amount, address _swapper, address _swapDest, bool _autoFinish ) public override { } function finish(address _operation) public override { } // =================================== DEPOSIT STABLE =================================== // function depositStable(uint256 _amount) public override { } function depositStable(address _operator, uint256 _amount) public override { } function depositStable( address _operator, uint256 _amount, address _swapper, address _swapDest ) public override { } function initDepositStable(uint256 _amount) public override { } function initDepositStable( uint256 _amount, address _swapper, address _swapDest ) public override { } function finishDepositStable(address _operation) public override { } // =================================== REDEEM STABLE =================================== // function redeemStable(uint256 _amount) public override { } function redeemStable(address _operator, uint256 _amount) public override { } function redeemStable( address _operator, uint256 _amount, address _swapper, address _swapDest ) public override { } function initRedeemStable(uint256 _amount) public override { } function initRedeemStable( uint256 _amount, address _swapper, address _swapDest ) public override { } function finishRedeemStable(address _operation) public override { } }
IOperation(_opt).getCurrentStatus().operator==_msgSender(),"Router: invalid sender"
6,509
IOperation(_opt).getCurrentStatus().operator==_msgSender()
'Transfer already processed'
pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import './Itoken.sol'; contract BridgeBase is Ownable{ IToken public token; uint public nonce; mapping(uint => bool) public processedNonces; enum Step { Burn, Mint } event Transfer( address from, address to, uint amount, uint nonce, Step indexed step ); constructor (address _token) Ownable() { } function burn(uint amount) external { } function mint(address to, uint amount, uint otherChainNonce) external onlyOwner { require(<FILL_ME>) processedNonces[otherChainNonce] = true; token.mint(to, amount); emit Transfer( msg.sender, to, amount, otherChainNonce, Step.Mint ); } function transferTokenOwnership(address newOwner) external onlyOwner { } }
processedNonces[otherChainNonce]==false,'Transfer already processed'
6,547
processedNonces[otherChainNonce]==false
"Caller is not an minter"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/access/AccessControl.sol"; contract vcUSDToken is ERC20, AccessControl { bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); constructor( string memory _name, string memory _symbol, uint8 _decimals ) public ERC20(_name, _symbol) { } function mint(address to, uint256 amount) external { require(<FILL_ME>) _mint(to, amount); } function burn(address from, uint256 amount) external { } function _beforeTokenTransfer( address _from, address _to, uint256 _amount ) internal virtual override(ERC20) { } }
hasRole(MINTER_ROLE,msg.sender),"Caller is not an minter"
6,601
hasRole(MINTER_ROLE,msg.sender)
"Caller is not an burner"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/access/AccessControl.sol"; contract vcUSDToken is ERC20, AccessControl { bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); constructor( string memory _name, string memory _symbol, uint8 _decimals ) public ERC20(_name, _symbol) { } function mint(address to, uint256 amount) external { } function burn(address from, uint256 amount) external { require(<FILL_ME>) _burn(from, amount); } function _beforeTokenTransfer( address _from, address _to, uint256 _amount ) internal virtual override(ERC20) { } }
hasRole(BURNER_ROLE,msg.sender),"Caller is not an burner"
6,601
hasRole(BURNER_ROLE,msg.sender)
null
pragma solidity 0.4.18; contract ConversionRates is ConversionRatesInterface, VolumeImbalanceRecorder, Utils { // bps - basic rate steps. one step is 1 / 10000 of the rate. struct StepFunction { int256[] x; // quantity for each step. Quantity of each step includes previous steps. int256[] y; // rate change per quantity step in bps. } struct TokenData { bool listed; // was added to reserve bool enabled; // whether trade is enabled // position in the compact data uint256 compactDataArrayIndex; uint256 compactDataFieldIndex; // rate data. base and changes according to quantity and reserve balance. // generally speaking. Sell rate is 1 / buy rate i.e. the buy in the other direction. uint256 baseBuyRate; // in PRECISION units. see KyberConstants uint256 baseSellRate; // PRECISION units. without (sell / buy) spread it is 1 / baseBuyRate StepFunction buyRateQtyStepFunction; // in bps. higher quantity - bigger the rate. StepFunction sellRateQtyStepFunction; // in bps. higher the qua StepFunction buyRateImbalanceStepFunction; // in BPS. higher reserve imbalance - bigger the rate. StepFunction sellRateImbalanceStepFunction; } /* this is the data for tokenRatesCompactData but solidity compiler optimizer is sub-optimal, and cannot write this structure in a single storage write so we represent it as bytes32 and do the byte tricks ourselves. struct TokenRatesCompactData { bytes14 buy; // change buy rate of token from baseBuyRate in 10 bps bytes14 sell; // change sell rate of token from baseSellRate in 10 bps uint32 blockNumber; } */ uint256 public validRateDurationInBlocks = 10; // rates are valid for this amount of blocks ERC20[] internal listedTokens; mapping(address => TokenData) internal tokenData; bytes32[] internal tokenRatesCompactData; uint256 public numTokensInCurrentCompactData = 0; address public reserveContract; uint256 internal constant NUM_TOKENS_IN_COMPACT_DATA = 16; uint256 internal constant BYTES_14_OFFSET = (2 ** (8 * NUM_TOKENS_IN_COMPACT_DATA)); uint256 internal constant MAX_STEPS_IN_FUNCTION = 10; int256 internal constant MAX_BPS_ADJUSTMENT = 10**11; // 1B % int256 internal constant MIN_BPS_ADJUSTMENT = -100 * 100; // cannot go down by more than 100% function ConversionRates(address _admin) public VolumeImbalanceRecorder(_admin) {} // solhint-disable-line no-empty-blocks function addToken(ERC20 token) public onlyAdmin { require(<FILL_ME>) tokenData[token].listed = true; listedTokens.push(token); if (numTokensInCurrentCompactData == 0) { tokenRatesCompactData.length++; // add new structure } tokenData[token].compactDataArrayIndex = tokenRatesCompactData.length - 1; tokenData[token].compactDataFieldIndex = numTokensInCurrentCompactData; numTokensInCurrentCompactData = (numTokensInCurrentCompactData + 1) % NUM_TOKENS_IN_COMPACT_DATA; setGarbageToVolumeRecorder(token); setDecimals(token); } function setCompactData( bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { } function setBaseRate( ERC20[] tokens, uint256[] baseBuy, uint256[] baseSell, bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { } function setQtyStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setImbalanceStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setValidRateDurationInBlocks(uint256 duration) public onlyAdmin { } function enableTokenTrade(ERC20 token) public onlyAdmin { } function disableTokenTrade(ERC20 token) public onlyAlerter { } function setReserveAddress(address reserve) public onlyAdmin { } function recordImbalance( ERC20 token, int256 buyAmount, uint256 rateUpdateBlock, uint256 currentBlock ) public { } /* solhint-disable function-max-lines */ function getRate( ERC20 token, uint256 currentBlockNumber, bool buy, uint256 qty ) public view returns (uint256) { } /* solhint-enable function-max-lines */ function getBasicRate(ERC20 token, bool buy) public view returns (uint256) { } function getCompactData(ERC20 token) public view returns ( uint256, uint256, bytes1, bytes1 ) { } function getTokenBasicData(ERC20 token) public view returns (bool, bool) { } /* solhint-disable code-complexity */ function getStepFunctionData( ERC20 token, uint256 command, uint256 param ) public view returns (int256) { } /* solhint-enable code-complexity */ function getRateUpdateBlock(ERC20 token) public view returns (uint256) { } function getListedTokens() public view returns (ERC20[]) { } function getTokenQty( ERC20 token, uint256 ethQty, uint256 rate ) internal view returns (uint256) { } function getLast4Bytes(bytes32 b) internal pure returns (uint256) { } function getRateByteFromCompactData( bytes32 data, ERC20 token, bool buy ) internal view returns (int8) { } function executeStepFunction(StepFunction f, int256 x) internal pure returns (int256) { } function addBps(uint256 rate, int256 bps) internal pure returns (uint256) { } function abs(int256 x) internal pure returns (uint256) { } }
!tokenData[token].listed
6,677
!tokenData[token].listed
null
pragma solidity 0.4.18; contract ConversionRates is ConversionRatesInterface, VolumeImbalanceRecorder, Utils { // bps - basic rate steps. one step is 1 / 10000 of the rate. struct StepFunction { int256[] x; // quantity for each step. Quantity of each step includes previous steps. int256[] y; // rate change per quantity step in bps. } struct TokenData { bool listed; // was added to reserve bool enabled; // whether trade is enabled // position in the compact data uint256 compactDataArrayIndex; uint256 compactDataFieldIndex; // rate data. base and changes according to quantity and reserve balance. // generally speaking. Sell rate is 1 / buy rate i.e. the buy in the other direction. uint256 baseBuyRate; // in PRECISION units. see KyberConstants uint256 baseSellRate; // PRECISION units. without (sell / buy) spread it is 1 / baseBuyRate StepFunction buyRateQtyStepFunction; // in bps. higher quantity - bigger the rate. StepFunction sellRateQtyStepFunction; // in bps. higher the qua StepFunction buyRateImbalanceStepFunction; // in BPS. higher reserve imbalance - bigger the rate. StepFunction sellRateImbalanceStepFunction; } /* this is the data for tokenRatesCompactData but solidity compiler optimizer is sub-optimal, and cannot write this structure in a single storage write so we represent it as bytes32 and do the byte tricks ourselves. struct TokenRatesCompactData { bytes14 buy; // change buy rate of token from baseBuyRate in 10 bps bytes14 sell; // change sell rate of token from baseSellRate in 10 bps uint32 blockNumber; } */ uint256 public validRateDurationInBlocks = 10; // rates are valid for this amount of blocks ERC20[] internal listedTokens; mapping(address => TokenData) internal tokenData; bytes32[] internal tokenRatesCompactData; uint256 public numTokensInCurrentCompactData = 0; address public reserveContract; uint256 internal constant NUM_TOKENS_IN_COMPACT_DATA = 16; uint256 internal constant BYTES_14_OFFSET = (2 ** (8 * NUM_TOKENS_IN_COMPACT_DATA)); uint256 internal constant MAX_STEPS_IN_FUNCTION = 10; int256 internal constant MAX_BPS_ADJUSTMENT = 10**11; // 1B % int256 internal constant MIN_BPS_ADJUSTMENT = -100 * 100; // cannot go down by more than 100% function ConversionRates(address _admin) public VolumeImbalanceRecorder(_admin) {} // solhint-disable-line no-empty-blocks function addToken(ERC20 token) public onlyAdmin { } function setCompactData( bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { require(buy.length == sell.length); require(indices.length == buy.length); require(blockNumber <= 0xFFFFFFFF); uint256 bytes14Offset = BYTES_14_OFFSET; for (uint256 i = 0; i < indices.length; i++) { require(<FILL_ME>) uint256 data = uint256(buy[i]) | (uint256(sell[i]) * bytes14Offset) | (blockNumber * (bytes14Offset * bytes14Offset)); tokenRatesCompactData[indices[i]] = bytes32(data); } } function setBaseRate( ERC20[] tokens, uint256[] baseBuy, uint256[] baseSell, bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { } function setQtyStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setImbalanceStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setValidRateDurationInBlocks(uint256 duration) public onlyAdmin { } function enableTokenTrade(ERC20 token) public onlyAdmin { } function disableTokenTrade(ERC20 token) public onlyAlerter { } function setReserveAddress(address reserve) public onlyAdmin { } function recordImbalance( ERC20 token, int256 buyAmount, uint256 rateUpdateBlock, uint256 currentBlock ) public { } /* solhint-disable function-max-lines */ function getRate( ERC20 token, uint256 currentBlockNumber, bool buy, uint256 qty ) public view returns (uint256) { } /* solhint-enable function-max-lines */ function getBasicRate(ERC20 token, bool buy) public view returns (uint256) { } function getCompactData(ERC20 token) public view returns ( uint256, uint256, bytes1, bytes1 ) { } function getTokenBasicData(ERC20 token) public view returns (bool, bool) { } /* solhint-disable code-complexity */ function getStepFunctionData( ERC20 token, uint256 command, uint256 param ) public view returns (int256) { } /* solhint-enable code-complexity */ function getRateUpdateBlock(ERC20 token) public view returns (uint256) { } function getListedTokens() public view returns (ERC20[]) { } function getTokenQty( ERC20 token, uint256 ethQty, uint256 rate ) internal view returns (uint256) { } function getLast4Bytes(bytes32 b) internal pure returns (uint256) { } function getRateByteFromCompactData( bytes32 data, ERC20 token, bool buy ) internal view returns (int8) { } function executeStepFunction(StepFunction f, int256 x) internal pure returns (int256) { } function addBps(uint256 rate, int256 bps) internal pure returns (uint256) { } function abs(int256 x) internal pure returns (uint256) { } }
indices[i]<tokenRatesCompactData.length
6,677
indices[i]<tokenRatesCompactData.length
null
pragma solidity 0.4.18; contract ConversionRates is ConversionRatesInterface, VolumeImbalanceRecorder, Utils { // bps - basic rate steps. one step is 1 / 10000 of the rate. struct StepFunction { int256[] x; // quantity for each step. Quantity of each step includes previous steps. int256[] y; // rate change per quantity step in bps. } struct TokenData { bool listed; // was added to reserve bool enabled; // whether trade is enabled // position in the compact data uint256 compactDataArrayIndex; uint256 compactDataFieldIndex; // rate data. base and changes according to quantity and reserve balance. // generally speaking. Sell rate is 1 / buy rate i.e. the buy in the other direction. uint256 baseBuyRate; // in PRECISION units. see KyberConstants uint256 baseSellRate; // PRECISION units. without (sell / buy) spread it is 1 / baseBuyRate StepFunction buyRateQtyStepFunction; // in bps. higher quantity - bigger the rate. StepFunction sellRateQtyStepFunction; // in bps. higher the qua StepFunction buyRateImbalanceStepFunction; // in BPS. higher reserve imbalance - bigger the rate. StepFunction sellRateImbalanceStepFunction; } /* this is the data for tokenRatesCompactData but solidity compiler optimizer is sub-optimal, and cannot write this structure in a single storage write so we represent it as bytes32 and do the byte tricks ourselves. struct TokenRatesCompactData { bytes14 buy; // change buy rate of token from baseBuyRate in 10 bps bytes14 sell; // change sell rate of token from baseSellRate in 10 bps uint32 blockNumber; } */ uint256 public validRateDurationInBlocks = 10; // rates are valid for this amount of blocks ERC20[] internal listedTokens; mapping(address => TokenData) internal tokenData; bytes32[] internal tokenRatesCompactData; uint256 public numTokensInCurrentCompactData = 0; address public reserveContract; uint256 internal constant NUM_TOKENS_IN_COMPACT_DATA = 16; uint256 internal constant BYTES_14_OFFSET = (2 ** (8 * NUM_TOKENS_IN_COMPACT_DATA)); uint256 internal constant MAX_STEPS_IN_FUNCTION = 10; int256 internal constant MAX_BPS_ADJUSTMENT = 10**11; // 1B % int256 internal constant MIN_BPS_ADJUSTMENT = -100 * 100; // cannot go down by more than 100% function ConversionRates(address _admin) public VolumeImbalanceRecorder(_admin) {} // solhint-disable-line no-empty-blocks function addToken(ERC20 token) public onlyAdmin { } function setCompactData( bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { } function setBaseRate( ERC20[] tokens, uint256[] baseBuy, uint256[] baseSell, bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { require(tokens.length == baseBuy.length); require(tokens.length == baseSell.length); require(sell.length == buy.length); require(sell.length == indices.length); for (uint256 ind = 0; ind < tokens.length; ind++) { require(<FILL_ME>) tokenData[tokens[ind]].baseBuyRate = baseBuy[ind]; tokenData[tokens[ind]].baseSellRate = baseSell[ind]; } setCompactData(buy, sell, blockNumber, indices); } function setQtyStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setImbalanceStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setValidRateDurationInBlocks(uint256 duration) public onlyAdmin { } function enableTokenTrade(ERC20 token) public onlyAdmin { } function disableTokenTrade(ERC20 token) public onlyAlerter { } function setReserveAddress(address reserve) public onlyAdmin { } function recordImbalance( ERC20 token, int256 buyAmount, uint256 rateUpdateBlock, uint256 currentBlock ) public { } /* solhint-disable function-max-lines */ function getRate( ERC20 token, uint256 currentBlockNumber, bool buy, uint256 qty ) public view returns (uint256) { } /* solhint-enable function-max-lines */ function getBasicRate(ERC20 token, bool buy) public view returns (uint256) { } function getCompactData(ERC20 token) public view returns ( uint256, uint256, bytes1, bytes1 ) { } function getTokenBasicData(ERC20 token) public view returns (bool, bool) { } /* solhint-disable code-complexity */ function getStepFunctionData( ERC20 token, uint256 command, uint256 param ) public view returns (int256) { } /* solhint-enable code-complexity */ function getRateUpdateBlock(ERC20 token) public view returns (uint256) { } function getListedTokens() public view returns (ERC20[]) { } function getTokenQty( ERC20 token, uint256 ethQty, uint256 rate ) internal view returns (uint256) { } function getLast4Bytes(bytes32 b) internal pure returns (uint256) { } function getRateByteFromCompactData( bytes32 data, ERC20 token, bool buy ) internal view returns (int8) { } function executeStepFunction(StepFunction f, int256 x) internal pure returns (int256) { } function addBps(uint256 rate, int256 bps) internal pure returns (uint256) { } function abs(int256 x) internal pure returns (uint256) { } }
tokenData[tokens[ind]].listed
6,677
tokenData[tokens[ind]].listed
null
pragma solidity 0.4.18; contract ConversionRates is ConversionRatesInterface, VolumeImbalanceRecorder, Utils { // bps - basic rate steps. one step is 1 / 10000 of the rate. struct StepFunction { int256[] x; // quantity for each step. Quantity of each step includes previous steps. int256[] y; // rate change per quantity step in bps. } struct TokenData { bool listed; // was added to reserve bool enabled; // whether trade is enabled // position in the compact data uint256 compactDataArrayIndex; uint256 compactDataFieldIndex; // rate data. base and changes according to quantity and reserve balance. // generally speaking. Sell rate is 1 / buy rate i.e. the buy in the other direction. uint256 baseBuyRate; // in PRECISION units. see KyberConstants uint256 baseSellRate; // PRECISION units. without (sell / buy) spread it is 1 / baseBuyRate StepFunction buyRateQtyStepFunction; // in bps. higher quantity - bigger the rate. StepFunction sellRateQtyStepFunction; // in bps. higher the qua StepFunction buyRateImbalanceStepFunction; // in BPS. higher reserve imbalance - bigger the rate. StepFunction sellRateImbalanceStepFunction; } /* this is the data for tokenRatesCompactData but solidity compiler optimizer is sub-optimal, and cannot write this structure in a single storage write so we represent it as bytes32 and do the byte tricks ourselves. struct TokenRatesCompactData { bytes14 buy; // change buy rate of token from baseBuyRate in 10 bps bytes14 sell; // change sell rate of token from baseSellRate in 10 bps uint32 blockNumber; } */ uint256 public validRateDurationInBlocks = 10; // rates are valid for this amount of blocks ERC20[] internal listedTokens; mapping(address => TokenData) internal tokenData; bytes32[] internal tokenRatesCompactData; uint256 public numTokensInCurrentCompactData = 0; address public reserveContract; uint256 internal constant NUM_TOKENS_IN_COMPACT_DATA = 16; uint256 internal constant BYTES_14_OFFSET = (2 ** (8 * NUM_TOKENS_IN_COMPACT_DATA)); uint256 internal constant MAX_STEPS_IN_FUNCTION = 10; int256 internal constant MAX_BPS_ADJUSTMENT = 10**11; // 1B % int256 internal constant MIN_BPS_ADJUSTMENT = -100 * 100; // cannot go down by more than 100% function ConversionRates(address _admin) public VolumeImbalanceRecorder(_admin) {} // solhint-disable-line no-empty-blocks function addToken(ERC20 token) public onlyAdmin { } function setCompactData( bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { } function setBaseRate( ERC20[] tokens, uint256[] baseBuy, uint256[] baseSell, bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { } function setQtyStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { require(xBuy.length == yBuy.length); require(xSell.length == ySell.length); require(xBuy.length <= MAX_STEPS_IN_FUNCTION); require(xSell.length <= MAX_STEPS_IN_FUNCTION); require(<FILL_ME>) tokenData[token].buyRateQtyStepFunction = StepFunction(xBuy, yBuy); tokenData[token].sellRateQtyStepFunction = StepFunction(xSell, ySell); } function setImbalanceStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setValidRateDurationInBlocks(uint256 duration) public onlyAdmin { } function enableTokenTrade(ERC20 token) public onlyAdmin { } function disableTokenTrade(ERC20 token) public onlyAlerter { } function setReserveAddress(address reserve) public onlyAdmin { } function recordImbalance( ERC20 token, int256 buyAmount, uint256 rateUpdateBlock, uint256 currentBlock ) public { } /* solhint-disable function-max-lines */ function getRate( ERC20 token, uint256 currentBlockNumber, bool buy, uint256 qty ) public view returns (uint256) { } /* solhint-enable function-max-lines */ function getBasicRate(ERC20 token, bool buy) public view returns (uint256) { } function getCompactData(ERC20 token) public view returns ( uint256, uint256, bytes1, bytes1 ) { } function getTokenBasicData(ERC20 token) public view returns (bool, bool) { } /* solhint-disable code-complexity */ function getStepFunctionData( ERC20 token, uint256 command, uint256 param ) public view returns (int256) { } /* solhint-enable code-complexity */ function getRateUpdateBlock(ERC20 token) public view returns (uint256) { } function getListedTokens() public view returns (ERC20[]) { } function getTokenQty( ERC20 token, uint256 ethQty, uint256 rate ) internal view returns (uint256) { } function getLast4Bytes(bytes32 b) internal pure returns (uint256) { } function getRateByteFromCompactData( bytes32 data, ERC20 token, bool buy ) internal view returns (int8) { } function executeStepFunction(StepFunction f, int256 x) internal pure returns (int256) { } function addBps(uint256 rate, int256 bps) internal pure returns (uint256) { } function abs(int256 x) internal pure returns (uint256) { } }
tokenData[token].listed
6,677
tokenData[token].listed
null
pragma solidity 0.4.18; contract ConversionRates is ConversionRatesInterface, VolumeImbalanceRecorder, Utils { // bps - basic rate steps. one step is 1 / 10000 of the rate. struct StepFunction { int256[] x; // quantity for each step. Quantity of each step includes previous steps. int256[] y; // rate change per quantity step in bps. } struct TokenData { bool listed; // was added to reserve bool enabled; // whether trade is enabled // position in the compact data uint256 compactDataArrayIndex; uint256 compactDataFieldIndex; // rate data. base and changes according to quantity and reserve balance. // generally speaking. Sell rate is 1 / buy rate i.e. the buy in the other direction. uint256 baseBuyRate; // in PRECISION units. see KyberConstants uint256 baseSellRate; // PRECISION units. without (sell / buy) spread it is 1 / baseBuyRate StepFunction buyRateQtyStepFunction; // in bps. higher quantity - bigger the rate. StepFunction sellRateQtyStepFunction; // in bps. higher the qua StepFunction buyRateImbalanceStepFunction; // in BPS. higher reserve imbalance - bigger the rate. StepFunction sellRateImbalanceStepFunction; } /* this is the data for tokenRatesCompactData but solidity compiler optimizer is sub-optimal, and cannot write this structure in a single storage write so we represent it as bytes32 and do the byte tricks ourselves. struct TokenRatesCompactData { bytes14 buy; // change buy rate of token from baseBuyRate in 10 bps bytes14 sell; // change sell rate of token from baseSellRate in 10 bps uint32 blockNumber; } */ uint256 public validRateDurationInBlocks = 10; // rates are valid for this amount of blocks ERC20[] internal listedTokens; mapping(address => TokenData) internal tokenData; bytes32[] internal tokenRatesCompactData; uint256 public numTokensInCurrentCompactData = 0; address public reserveContract; uint256 internal constant NUM_TOKENS_IN_COMPACT_DATA = 16; uint256 internal constant BYTES_14_OFFSET = (2 ** (8 * NUM_TOKENS_IN_COMPACT_DATA)); uint256 internal constant MAX_STEPS_IN_FUNCTION = 10; int256 internal constant MAX_BPS_ADJUSTMENT = 10**11; // 1B % int256 internal constant MIN_BPS_ADJUSTMENT = -100 * 100; // cannot go down by more than 100% function ConversionRates(address _admin) public VolumeImbalanceRecorder(_admin) {} // solhint-disable-line no-empty-blocks function addToken(ERC20 token) public onlyAdmin { } function setCompactData( bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { } function setBaseRate( ERC20[] tokens, uint256[] baseBuy, uint256[] baseSell, bytes14[] buy, bytes14[] sell, uint256 blockNumber, uint256[] indices ) public onlyOperator { } function setQtyStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setImbalanceStepFunction( ERC20 token, int256[] xBuy, int256[] yBuy, int256[] xSell, int256[] ySell ) public onlyOperator { } function setValidRateDurationInBlocks(uint256 duration) public onlyAdmin { } function enableTokenTrade(ERC20 token) public onlyAdmin { require(tokenData[token].listed); require(<FILL_ME>) tokenData[token].enabled = true; } function disableTokenTrade(ERC20 token) public onlyAlerter { } function setReserveAddress(address reserve) public onlyAdmin { } function recordImbalance( ERC20 token, int256 buyAmount, uint256 rateUpdateBlock, uint256 currentBlock ) public { } /* solhint-disable function-max-lines */ function getRate( ERC20 token, uint256 currentBlockNumber, bool buy, uint256 qty ) public view returns (uint256) { } /* solhint-enable function-max-lines */ function getBasicRate(ERC20 token, bool buy) public view returns (uint256) { } function getCompactData(ERC20 token) public view returns ( uint256, uint256, bytes1, bytes1 ) { } function getTokenBasicData(ERC20 token) public view returns (bool, bool) { } /* solhint-disable code-complexity */ function getStepFunctionData( ERC20 token, uint256 command, uint256 param ) public view returns (int256) { } /* solhint-enable code-complexity */ function getRateUpdateBlock(ERC20 token) public view returns (uint256) { } function getListedTokens() public view returns (ERC20[]) { } function getTokenQty( ERC20 token, uint256 ethQty, uint256 rate ) internal view returns (uint256) { } function getLast4Bytes(bytes32 b) internal pure returns (uint256) { } function getRateByteFromCompactData( bytes32 data, ERC20 token, bool buy ) internal view returns (int8) { } function executeStepFunction(StepFunction f, int256 x) internal pure returns (int256) { } function addBps(uint256 rate, int256 bps) internal pure returns (uint256) { } function abs(int256 x) internal pure returns (uint256) { } }
tokenControlInfo[token].minimalRecordResolution!=0
6,677
tokenControlInfo[token].minimalRecordResolution!=0
null
//sol Wallet // Multi-sig, daily-limited account proxy/wallet. // @authors: // Gav Wood <g@ethdev.com> // inheritable "property" contract that enables methods to be protected by requiring the acquiescence of either a // single, or, crucially, each of a number of, designated owners. // usage: // use modifiers onlyowner (just own owned) or onlymanyowners(hash), whereby the same hash must be provided by // some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the // interior is executed. pragma solidity ^0.4.13; contract multiowned { // TYPES // struct for the status of a pending operation. struct PendingState { uint yetNeeded; uint ownersDone; uint index; } // EVENTS // this contract only has six types of events: it can accept a confirmation, in which case // we record owner and operation (hash) alongside it. event Confirmation(address owner, bytes32 operation); event Revoke(address owner, bytes32 operation); // some others are in the case of an owner changing. event OwnerChanged(address oldOwner, address newOwner); event OwnerAdded(address newOwner); event OwnerRemoved(address oldOwner); // the last one is emitted if the required signatures change event RequirementChanged(uint newRequirement); // MODIFIERS // simple single-sig function modifier. modifier onlyowner { } // multi-sig function modifier: the operation must have an intrinsic hash in order // that later attempts can be realised as the same underlying operation and // thus count as confirmations. modifier onlymanyowners(bytes32 _operation) { } // METHODS // constructor is given number of sigs required to do protected "onlymanyowners" transactions // as well as the selection of addresses capable of confirming them. function multiowned(address[] _owners, uint _required) { } // Revokes a prior confirmation of the given operation function revoke(bytes32 _operation) external { } // Replaces an owner `_from` with another `_to`. function changeOwner(address _from, address _to) onlymanyowners(sha3(msg.data)) external { } function addOwner(address _owner) onlymanyowners(sha3(msg.data)) external { } function removeOwner(address _owner) onlymanyowners(sha3(msg.data)) external { } function changeRequirement(uint _newRequired) onlymanyowners(sha3(msg.data)) external { } // Gets an owner by 0-indexed position (using numOwners as the count) function getOwner(uint ownerIndex) external constant returns (address) { } function isOwner(address _addr) returns (bool) { } function hasConfirmed(bytes32 _operation, address _owner) constant returns (bool) { } // INTERNAL METHODS function confirmAndCheck(bytes32 _operation) internal returns (bool) { } function reorganizeOwners() private { } function clearPending() internal { } // FIELDS // the number of owners that must confirm the same operation before it is run. uint public m_required; // pointer used to find a free slot in m_owners uint public m_numOwners; // list of owners uint[256] m_owners; uint constant c_maxOwners = 250; // index on the list of owners to allow reverse lookup mapping(uint => uint) m_ownerIndex; // the ongoing operations. mapping(bytes32 => PendingState) m_pending; bytes32[] m_pendingIndex; } // inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable) // on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method // uses is specified in the modifier. contract daylimit is multiowned { // METHODS // constructor - stores initial daily limit and records the present day's index. function daylimit(uint _limit) { } // (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today. function setDailyLimit(uint _newLimit) onlymanyowners(sha3(msg.data)) external { } // resets the amount already spent today. needs many of the owners to confirm. function resetSpentToday() onlymanyowners(sha3(msg.data)) external { } // INTERNAL METHODS // checks to see if there is at least `_value` left from the daily limit today. if there is, subtracts it and // returns true. otherwise just returns false. function underLimit(uint _value) internal onlyowner returns (bool) { } // determines today's index. function today() private constant returns (uint) { } // FIELDS uint public m_dailyLimit; uint public m_spentToday; uint public m_lastDay; } // interface contract for multisig proxy contracts; see below for docs. contract multisig { // EVENTS // logged events: // Funds has arrived into the wallet (record how much). event Deposit(address _from, uint value); // Single transaction going out of the wallet (record who signed for it, how much, and to whom it's going). event SingleTransact(address owner, uint value, address to, bytes data, address created); // Multi-sig transaction going out of the wallet (record who signed for it last, the operation hash, how much, and to whom it's going). event MultiTransact(address owner, bytes32 operation, uint value, address to, bytes data, address created); // Confirmation still needed for a transaction. event ConfirmationNeeded(bytes32 operation, address initiator, uint value, address to, bytes data); // FUNCTIONS // TODO: document function changeOwner(address _from, address _to) external; function execute(address _to, uint _value, bytes _data) external returns (bytes32 o_hash); function confirm(bytes32 _h) returns (bool o_success); } contract creator { function doCreate(uint _value, bytes _code) internal returns (address o_addr) { bool failed; assembly { o_addr := create(_value, add(_code, 0x20), mload(_code)) failed := iszero(extcodesize(o_addr)) } require(<FILL_ME>) } } // usage: // bytes32 h = Wallet(w).from(oneOwner).execute(to, value, data); // Wallet(w).from(anotherOwner).confirm(h); contract Wallet is multisig, multiowned, daylimit, creator { // TYPES // Transaction structure to remember details of transaction lest it need be saved for a later call. struct Transaction { address to; uint value; bytes data; } // METHODS // constructor - just pass on the owner array to the multiowned and // the limit to daylimit function Wallet(address[] _owners, uint _required, uint _daylimit) multiowned(_owners, _required) daylimit(_daylimit) { } // kills the contract sending everything to `_to`. function kill(address _to) onlymanyowners(sha3(msg.data)) external { } // gets called when no other function matches function() payable { } // Outside-visible transact entry point. Executes transaction immediately if below daily spend limit. // If not, goes into multisig process. We provide a hash on return to allow the sender to provide // shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value // and _data arguments). They still get the option of using them if they want, anyways. function execute(address _to, uint _value, bytes _data) external onlyowner returns (bytes32 o_hash) { } function create(uint _value, bytes _code) internal returns (address o_addr) { } // confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order // to determine the body of the transaction from the hash provided. function confirm(bytes32 _h) onlymanyowners(_h) returns (bool o_success) { } // INTERNAL METHODS function clearPending() internal { } // FIELDS // pending transactions we have at present. mapping (bytes32 => Transaction) m_txs; }
!failed
6,728
!failed
null
//sol Wallet // Multi-sig, daily-limited account proxy/wallet. // @authors: // Gav Wood <g@ethdev.com> // inheritable "property" contract that enables methods to be protected by requiring the acquiescence of either a // single, or, crucially, each of a number of, designated owners. // usage: // use modifiers onlyowner (just own owned) or onlymanyowners(hash), whereby the same hash must be provided by // some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the // interior is executed. pragma solidity ^0.4.13; contract multiowned { // TYPES // struct for the status of a pending operation. struct PendingState { uint yetNeeded; uint ownersDone; uint index; } // EVENTS // this contract only has six types of events: it can accept a confirmation, in which case // we record owner and operation (hash) alongside it. event Confirmation(address owner, bytes32 operation); event Revoke(address owner, bytes32 operation); // some others are in the case of an owner changing. event OwnerChanged(address oldOwner, address newOwner); event OwnerAdded(address newOwner); event OwnerRemoved(address oldOwner); // the last one is emitted if the required signatures change event RequirementChanged(uint newRequirement); // MODIFIERS // simple single-sig function modifier. modifier onlyowner { } // multi-sig function modifier: the operation must have an intrinsic hash in order // that later attempts can be realised as the same underlying operation and // thus count as confirmations. modifier onlymanyowners(bytes32 _operation) { } // METHODS // constructor is given number of sigs required to do protected "onlymanyowners" transactions // as well as the selection of addresses capable of confirming them. function multiowned(address[] _owners, uint _required) { } // Revokes a prior confirmation of the given operation function revoke(bytes32 _operation) external { } // Replaces an owner `_from` with another `_to`. function changeOwner(address _from, address _to) onlymanyowners(sha3(msg.data)) external { } function addOwner(address _owner) onlymanyowners(sha3(msg.data)) external { } function removeOwner(address _owner) onlymanyowners(sha3(msg.data)) external { } function changeRequirement(uint _newRequired) onlymanyowners(sha3(msg.data)) external { } // Gets an owner by 0-indexed position (using numOwners as the count) function getOwner(uint ownerIndex) external constant returns (address) { } function isOwner(address _addr) returns (bool) { } function hasConfirmed(bytes32 _operation, address _owner) constant returns (bool) { } // INTERNAL METHODS function confirmAndCheck(bytes32 _operation) internal returns (bool) { } function reorganizeOwners() private { } function clearPending() internal { } // FIELDS // the number of owners that must confirm the same operation before it is run. uint public m_required; // pointer used to find a free slot in m_owners uint public m_numOwners; // list of owners uint[256] m_owners; uint constant c_maxOwners = 250; // index on the list of owners to allow reverse lookup mapping(uint => uint) m_ownerIndex; // the ongoing operations. mapping(bytes32 => PendingState) m_pending; bytes32[] m_pendingIndex; } // inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable) // on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method // uses is specified in the modifier. contract daylimit is multiowned { // METHODS // constructor - stores initial daily limit and records the present day's index. function daylimit(uint _limit) { } // (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today. function setDailyLimit(uint _newLimit) onlymanyowners(sha3(msg.data)) external { } // resets the amount already spent today. needs many of the owners to confirm. function resetSpentToday() onlymanyowners(sha3(msg.data)) external { } // INTERNAL METHODS // checks to see if there is at least `_value` left from the daily limit today. if there is, subtracts it and // returns true. otherwise just returns false. function underLimit(uint _value) internal onlyowner returns (bool) { } // determines today's index. function today() private constant returns (uint) { } // FIELDS uint public m_dailyLimit; uint public m_spentToday; uint public m_lastDay; } // interface contract for multisig proxy contracts; see below for docs. contract multisig { // EVENTS // logged events: // Funds has arrived into the wallet (record how much). event Deposit(address _from, uint value); // Single transaction going out of the wallet (record who signed for it, how much, and to whom it's going). event SingleTransact(address owner, uint value, address to, bytes data, address created); // Multi-sig transaction going out of the wallet (record who signed for it last, the operation hash, how much, and to whom it's going). event MultiTransact(address owner, bytes32 operation, uint value, address to, bytes data, address created); // Confirmation still needed for a transaction. event ConfirmationNeeded(bytes32 operation, address initiator, uint value, address to, bytes data); // FUNCTIONS // TODO: document function changeOwner(address _from, address _to) external; function execute(address _to, uint _value, bytes _data) external returns (bytes32 o_hash); function confirm(bytes32 _h) returns (bool o_success); } contract creator { function doCreate(uint _value, bytes _code) internal returns (address o_addr) { } } // usage: // bytes32 h = Wallet(w).from(oneOwner).execute(to, value, data); // Wallet(w).from(anotherOwner).confirm(h); contract Wallet is multisig, multiowned, daylimit, creator { // TYPES // Transaction structure to remember details of transaction lest it need be saved for a later call. struct Transaction { address to; uint value; bytes data; } // METHODS // constructor - just pass on the owner array to the multiowned and // the limit to daylimit function Wallet(address[] _owners, uint _required, uint _daylimit) multiowned(_owners, _required) daylimit(_daylimit) { } // kills the contract sending everything to `_to`. function kill(address _to) onlymanyowners(sha3(msg.data)) external { } // gets called when no other function matches function() payable { } // Outside-visible transact entry point. Executes transaction immediately if below daily spend limit. // If not, goes into multisig process. We provide a hash on return to allow the sender to provide // shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value // and _data arguments). They still get the option of using them if they want, anyways. function execute(address _to, uint _value, bytes _data) external onlyowner returns (bytes32 o_hash) { // first, take the opportunity to check that we're under the daily limit. if ((_data.length == 0 && underLimit(_value)) || m_required == 1) { // yes - just execute the call. address created; if (_to == 0) { created = create(_value, _data); } else { require(<FILL_ME>) } SingleTransact(msg.sender, _value, _to, _data, created); } else { // determine our operation hash. o_hash = sha3(msg.data, block.number); // store if it's new if (m_txs[o_hash].to == 0 && m_txs[o_hash].value == 0 && m_txs[o_hash].data.length == 0) { m_txs[o_hash].to = _to; m_txs[o_hash].value = _value; m_txs[o_hash].data = _data; } if (!confirm(o_hash)) { ConfirmationNeeded(o_hash, msg.sender, _value, _to, _data); } } } function create(uint _value, bytes _code) internal returns (address o_addr) { } // confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order // to determine the body of the transaction from the hash provided. function confirm(bytes32 _h) onlymanyowners(_h) returns (bool o_success) { } // INTERNAL METHODS function clearPending() internal { } // FIELDS // pending transactions we have at present. mapping (bytes32 => Transaction) m_txs; }
_to.call.value(_value)(_data)
6,728
_to.call.value(_value)(_data)
null
//sol Wallet // Multi-sig, daily-limited account proxy/wallet. // @authors: // Gav Wood <g@ethdev.com> // inheritable "property" contract that enables methods to be protected by requiring the acquiescence of either a // single, or, crucially, each of a number of, designated owners. // usage: // use modifiers onlyowner (just own owned) or onlymanyowners(hash), whereby the same hash must be provided by // some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the // interior is executed. pragma solidity ^0.4.13; contract multiowned { // TYPES // struct for the status of a pending operation. struct PendingState { uint yetNeeded; uint ownersDone; uint index; } // EVENTS // this contract only has six types of events: it can accept a confirmation, in which case // we record owner and operation (hash) alongside it. event Confirmation(address owner, bytes32 operation); event Revoke(address owner, bytes32 operation); // some others are in the case of an owner changing. event OwnerChanged(address oldOwner, address newOwner); event OwnerAdded(address newOwner); event OwnerRemoved(address oldOwner); // the last one is emitted if the required signatures change event RequirementChanged(uint newRequirement); // MODIFIERS // simple single-sig function modifier. modifier onlyowner { } // multi-sig function modifier: the operation must have an intrinsic hash in order // that later attempts can be realised as the same underlying operation and // thus count as confirmations. modifier onlymanyowners(bytes32 _operation) { } // METHODS // constructor is given number of sigs required to do protected "onlymanyowners" transactions // as well as the selection of addresses capable of confirming them. function multiowned(address[] _owners, uint _required) { } // Revokes a prior confirmation of the given operation function revoke(bytes32 _operation) external { } // Replaces an owner `_from` with another `_to`. function changeOwner(address _from, address _to) onlymanyowners(sha3(msg.data)) external { } function addOwner(address _owner) onlymanyowners(sha3(msg.data)) external { } function removeOwner(address _owner) onlymanyowners(sha3(msg.data)) external { } function changeRequirement(uint _newRequired) onlymanyowners(sha3(msg.data)) external { } // Gets an owner by 0-indexed position (using numOwners as the count) function getOwner(uint ownerIndex) external constant returns (address) { } function isOwner(address _addr) returns (bool) { } function hasConfirmed(bytes32 _operation, address _owner) constant returns (bool) { } // INTERNAL METHODS function confirmAndCheck(bytes32 _operation) internal returns (bool) { } function reorganizeOwners() private { } function clearPending() internal { } // FIELDS // the number of owners that must confirm the same operation before it is run. uint public m_required; // pointer used to find a free slot in m_owners uint public m_numOwners; // list of owners uint[256] m_owners; uint constant c_maxOwners = 250; // index on the list of owners to allow reverse lookup mapping(uint => uint) m_ownerIndex; // the ongoing operations. mapping(bytes32 => PendingState) m_pending; bytes32[] m_pendingIndex; } // inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable) // on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method // uses is specified in the modifier. contract daylimit is multiowned { // METHODS // constructor - stores initial daily limit and records the present day's index. function daylimit(uint _limit) { } // (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today. function setDailyLimit(uint _newLimit) onlymanyowners(sha3(msg.data)) external { } // resets the amount already spent today. needs many of the owners to confirm. function resetSpentToday() onlymanyowners(sha3(msg.data)) external { } // INTERNAL METHODS // checks to see if there is at least `_value` left from the daily limit today. if there is, subtracts it and // returns true. otherwise just returns false. function underLimit(uint _value) internal onlyowner returns (bool) { } // determines today's index. function today() private constant returns (uint) { } // FIELDS uint public m_dailyLimit; uint public m_spentToday; uint public m_lastDay; } // interface contract for multisig proxy contracts; see below for docs. contract multisig { // EVENTS // logged events: // Funds has arrived into the wallet (record how much). event Deposit(address _from, uint value); // Single transaction going out of the wallet (record who signed for it, how much, and to whom it's going). event SingleTransact(address owner, uint value, address to, bytes data, address created); // Multi-sig transaction going out of the wallet (record who signed for it last, the operation hash, how much, and to whom it's going). event MultiTransact(address owner, bytes32 operation, uint value, address to, bytes data, address created); // Confirmation still needed for a transaction. event ConfirmationNeeded(bytes32 operation, address initiator, uint value, address to, bytes data); // FUNCTIONS // TODO: document function changeOwner(address _from, address _to) external; function execute(address _to, uint _value, bytes _data) external returns (bytes32 o_hash); function confirm(bytes32 _h) returns (bool o_success); } contract creator { function doCreate(uint _value, bytes _code) internal returns (address o_addr) { } } // usage: // bytes32 h = Wallet(w).from(oneOwner).execute(to, value, data); // Wallet(w).from(anotherOwner).confirm(h); contract Wallet is multisig, multiowned, daylimit, creator { // TYPES // Transaction structure to remember details of transaction lest it need be saved for a later call. struct Transaction { address to; uint value; bytes data; } // METHODS // constructor - just pass on the owner array to the multiowned and // the limit to daylimit function Wallet(address[] _owners, uint _required, uint _daylimit) multiowned(_owners, _required) daylimit(_daylimit) { } // kills the contract sending everything to `_to`. function kill(address _to) onlymanyowners(sha3(msg.data)) external { } // gets called when no other function matches function() payable { } // Outside-visible transact entry point. Executes transaction immediately if below daily spend limit. // If not, goes into multisig process. We provide a hash on return to allow the sender to provide // shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value // and _data arguments). They still get the option of using them if they want, anyways. function execute(address _to, uint _value, bytes _data) external onlyowner returns (bytes32 o_hash) { } function create(uint _value, bytes _code) internal returns (address o_addr) { } // confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order // to determine the body of the transaction from the hash provided. function confirm(bytes32 _h) onlymanyowners(_h) returns (bool o_success) { if (m_txs[_h].to != 0 || m_txs[_h].value != 0 || m_txs[_h].data.length != 0) { address created; if (m_txs[_h].to == 0) { created = create(m_txs[_h].value, m_txs[_h].data); } else { require(<FILL_ME>) } MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to, m_txs[_h].data, created); delete m_txs[_h]; return true; } } // INTERNAL METHODS function clearPending() internal { } // FIELDS // pending transactions we have at present. mapping (bytes32 => Transaction) m_txs; }
m_txs[_h].to.call.value(m_txs[_h].value)(m_txs[_h].data)
6,728
m_txs[_h].to.call.value(m_txs[_h].value)(m_txs[_h].data)
null
/* Finplether is The Most Unique Financial Hedging Instrument with 5.25% Guaranteed Daily Payments. Finplether is a financial hedging instrument to mitigate any cryptocurrency risks and get Guaranteed Daily Yield. Why the Finplether? 1. Your money safety. Your money is always yours. 2. No Risks. 5.25% Guaranteed Daily Payments. 3. Audited and Verified. 4. Real decentralized blockchain. Transactions security. 5. Decentralized Finance (DeFi). Staking, lending, borrowing. 6. Real Farming Yield. 7. The highest APY 1916.05%-8506.25%. The Average APY 5825% 8. The financial instrument non-changeable conditions 9. Instant transactions directly to your wallet 10. A fraud is not possible. No hidden risks CATCH THE MONEY TRAIN FINPLETHER!!! https://www.finplether.com */ pragma solidity ^0.5.0; interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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 ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; 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 _burnFrom(address account, uint256 value) internal { } } library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { } function remove(Role storage role, address account) internal { } function has(Role storage role, address account) internal view returns (bool) { } } contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { } modifier onlyMinter() { require(<FILL_ME>) _; } function isMinter(address account) public view returns (bool) { } function addMinter(address account) public onlyMinter { } function renounceMinter() public { } function _addMinter(address account) internal { } function _removeMinter(address account) internal { } } contract ERC20Mintable is ERC20, MinterRole { function mint(address to, uint256 value) public onlyMinter returns (bool) { } } contract FIN is ERC20Mintable { string public constant name = "Finplether"; string public constant symbol = "FIN"; uint8 public constant decimals = 5; }
isMinter(msg.sender)
6,736
isMinter(msg.sender)
"The master copy must be a valid address"
pragma solidity ^0.5.2; import "@gnosis.pm/util-contracts/contracts/Math.sol"; import "@gnosis.pm/util-contracts/contracts/GnosisStandardToken.sol"; import "@gnosis.pm/util-contracts/contracts/Proxy.sol"; contract TokenOWL is Proxied, GnosisStandardToken { using GnosisMath for *; string public constant name = "OWL Token"; string public constant symbol = "OWL"; uint8 public constant decimals = 18; struct masterCopyCountdownType { address masterCopy; uint timeWhenAvailable; } masterCopyCountdownType masterCopyCountdown; address public creator; address public minter; event Minted(address indexed to, uint256 amount); event Burnt(address indexed from, address indexed user, uint256 amount); modifier onlyCreator() { } /// @dev trickers the update process via the proxyMaster for a new address _masterCopy /// updating is only possible after 30 days function startMasterCopyCountdown(address _masterCopy) public onlyCreator { require(<FILL_ME>) // Update masterCopyCountdown masterCopyCountdown.masterCopy = _masterCopy; masterCopyCountdown.timeWhenAvailable = now + 30 days; } /// @dev executes the update process via the proxyMaster for a new address _masterCopy function updateMasterCopy() public onlyCreator { } function getMasterCopy() public view returns (address) { } /// @dev Set minter. Only the creator of this contract can call this. /// @param newMinter The new address authorized to mint this token function setMinter(address newMinter) public onlyCreator { } /// @dev change owner/creator of the contract. Only the creator/owner of this contract can call this. /// @param newOwner The new address, which should become the owner function setNewOwner(address newOwner) public onlyCreator { } /// @dev Mints OWL. /// @param to Address to which the minted token will be given /// @param amount Amount of OWL to be minted function mintOWL(address to, uint amount) public { } /// @dev Burns OWL. /// @param user Address of OWL owner /// @param amount Amount of OWL to be burnt function burnOWL(address user, uint amount) public { } function getMasterCopyCountdown() public view returns (address, uint) { } }
address(_masterCopy)!=address(0),"The master copy must be a valid address"
6,745
address(_masterCopy)!=address(0)
"The master copy must be a valid address"
pragma solidity ^0.5.2; import "@gnosis.pm/util-contracts/contracts/Math.sol"; import "@gnosis.pm/util-contracts/contracts/GnosisStandardToken.sol"; import "@gnosis.pm/util-contracts/contracts/Proxy.sol"; contract TokenOWL is Proxied, GnosisStandardToken { using GnosisMath for *; string public constant name = "OWL Token"; string public constant symbol = "OWL"; uint8 public constant decimals = 18; struct masterCopyCountdownType { address masterCopy; uint timeWhenAvailable; } masterCopyCountdownType masterCopyCountdown; address public creator; address public minter; event Minted(address indexed to, uint256 amount); event Burnt(address indexed from, address indexed user, uint256 amount); modifier onlyCreator() { } /// @dev trickers the update process via the proxyMaster for a new address _masterCopy /// updating is only possible after 30 days function startMasterCopyCountdown(address _masterCopy) public onlyCreator { } /// @dev executes the update process via the proxyMaster for a new address _masterCopy function updateMasterCopy() public onlyCreator { require(<FILL_ME>) require( block.timestamp >= masterCopyCountdown.timeWhenAvailable, "It's not possible to update the master copy during the waiting period" ); // Update masterCopy masterCopy = masterCopyCountdown.masterCopy; } function getMasterCopy() public view returns (address) { } /// @dev Set minter. Only the creator of this contract can call this. /// @param newMinter The new address authorized to mint this token function setMinter(address newMinter) public onlyCreator { } /// @dev change owner/creator of the contract. Only the creator/owner of this contract can call this. /// @param newOwner The new address, which should become the owner function setNewOwner(address newOwner) public onlyCreator { } /// @dev Mints OWL. /// @param to Address to which the minted token will be given /// @param amount Amount of OWL to be minted function mintOWL(address to, uint amount) public { } /// @dev Burns OWL. /// @param user Address of OWL owner /// @param amount Amount of OWL to be burnt function burnOWL(address user, uint amount) public { } function getMasterCopyCountdown() public view returns (address, uint) { } }
address(masterCopyCountdown.masterCopy)!=address(0),"The master copy must be a valid address"
6,745
address(masterCopyCountdown.masterCopy)!=address(0)
null
pragma solidity ^0.5.2; /// @title Math library - Allows calculation of logarithmic and exponential functions /// @author Alan Lu - <alan.lu@gnosis.pm> /// @author Stefan George - <stefan@gnosis.pm> library GnosisMath { /* * Constants */ // This is equal to 1 in our calculations uint public constant ONE = 0x10000000000000000; uint public constant LN2 = 0xb17217f7d1cf79ac; uint public constant LOG2_E = 0x171547652b82fe177; /* * Public functions */ /// @dev Returns natural exponential function value of given x /// @param x x /// @return e**x function exp(int x) public pure returns (uint) { } /// @dev Returns natural logarithm value of given x /// @param x x /// @return ln(x) function ln(uint x) public pure returns (int) { } /// @dev Returns base 2 logarithm value of given x /// @param x x /// @return logarithmic value function floorLog2(uint x) public pure returns (int lo) { } /// @dev Returns maximum of an array /// @param nums Numbers to look through /// @return Maximum number function max(int[] memory nums) public pure returns (int maxNum) { } /// @dev Returns whether an add operation causes an overflow /// @param a First addend /// @param b Second addend /// @return Did no overflow occur? function safeToAdd(uint a, uint b) internal pure returns (bool) { } /// @dev Returns whether a subtraction operation causes an underflow /// @param a Minuend /// @param b Subtrahend /// @return Did no underflow occur? function safeToSub(uint a, uint b) internal pure returns (bool) { } /// @dev Returns whether a multiply operation causes an overflow /// @param a First factor /// @param b Second factor /// @return Did no overflow occur? function safeToMul(uint a, uint b) internal pure returns (bool) { } /// @dev Returns sum if no overflow occurred /// @param a First addend /// @param b Second addend /// @return Sum function add(uint a, uint b) internal pure returns (uint) { require(<FILL_ME>) return a + b; } /// @dev Returns difference if no overflow occurred /// @param a Minuend /// @param b Subtrahend /// @return Difference function sub(uint a, uint b) internal pure returns (uint) { } /// @dev Returns product if no overflow occurred /// @param a First factor /// @param b Second factor /// @return Product function mul(uint a, uint b) internal pure returns (uint) { } /// @dev Returns whether an add operation causes an overflow /// @param a First addend /// @param b Second addend /// @return Did no overflow occur? function safeToAdd(int a, int b) internal pure returns (bool) { } /// @dev Returns whether a subtraction operation causes an underflow /// @param a Minuend /// @param b Subtrahend /// @return Did no underflow occur? function safeToSub(int a, int b) internal pure returns (bool) { } /// @dev Returns whether a multiply operation causes an overflow /// @param a First factor /// @param b Second factor /// @return Did no overflow occur? function safeToMul(int a, int b) internal pure returns (bool) { } /// @dev Returns sum if no overflow occurred /// @param a First addend /// @param b Second addend /// @return Sum function add(int a, int b) internal pure returns (int) { } /// @dev Returns difference if no overflow occurred /// @param a Minuend /// @param b Subtrahend /// @return Difference function sub(int a, int b) internal pure returns (int) { } /// @dev Returns product if no overflow occurred /// @param a First factor /// @param b Second factor /// @return Product function mul(int a, int b) internal pure returns (int) { } }
safeToAdd(a,b)
6,749
safeToAdd(a,b)
null
pragma solidity ^0.5.2; /// @title Math library - Allows calculation of logarithmic and exponential functions /// @author Alan Lu - <alan.lu@gnosis.pm> /// @author Stefan George - <stefan@gnosis.pm> library GnosisMath { /* * Constants */ // This is equal to 1 in our calculations uint public constant ONE = 0x10000000000000000; uint public constant LN2 = 0xb17217f7d1cf79ac; uint public constant LOG2_E = 0x171547652b82fe177; /* * Public functions */ /// @dev Returns natural exponential function value of given x /// @param x x /// @return e**x function exp(int x) public pure returns (uint) { } /// @dev Returns natural logarithm value of given x /// @param x x /// @return ln(x) function ln(uint x) public pure returns (int) { } /// @dev Returns base 2 logarithm value of given x /// @param x x /// @return logarithmic value function floorLog2(uint x) public pure returns (int lo) { } /// @dev Returns maximum of an array /// @param nums Numbers to look through /// @return Maximum number function max(int[] memory nums) public pure returns (int maxNum) { } /// @dev Returns whether an add operation causes an overflow /// @param a First addend /// @param b Second addend /// @return Did no overflow occur? function safeToAdd(uint a, uint b) internal pure returns (bool) { } /// @dev Returns whether a subtraction operation causes an underflow /// @param a Minuend /// @param b Subtrahend /// @return Did no underflow occur? function safeToSub(uint a, uint b) internal pure returns (bool) { } /// @dev Returns whether a multiply operation causes an overflow /// @param a First factor /// @param b Second factor /// @return Did no overflow occur? function safeToMul(uint a, uint b) internal pure returns (bool) { } /// @dev Returns sum if no overflow occurred /// @param a First addend /// @param b Second addend /// @return Sum function add(uint a, uint b) internal pure returns (uint) { } /// @dev Returns difference if no overflow occurred /// @param a Minuend /// @param b Subtrahend /// @return Difference function sub(uint a, uint b) internal pure returns (uint) { require(<FILL_ME>) return a - b; } /// @dev Returns product if no overflow occurred /// @param a First factor /// @param b Second factor /// @return Product function mul(uint a, uint b) internal pure returns (uint) { } /// @dev Returns whether an add operation causes an overflow /// @param a First addend /// @param b Second addend /// @return Did no overflow occur? function safeToAdd(int a, int b) internal pure returns (bool) { } /// @dev Returns whether a subtraction operation causes an underflow /// @param a Minuend /// @param b Subtrahend /// @return Did no underflow occur? function safeToSub(int a, int b) internal pure returns (bool) { } /// @dev Returns whether a multiply operation causes an overflow /// @param a First factor /// @param b Second factor /// @return Did no overflow occur? function safeToMul(int a, int b) internal pure returns (bool) { } /// @dev Returns sum if no overflow occurred /// @param a First addend /// @param b Second addend /// @return Sum function add(int a, int b) internal pure returns (int) { } /// @dev Returns difference if no overflow occurred /// @param a Minuend /// @param b Subtrahend /// @return Difference function sub(int a, int b) internal pure returns (int) { } /// @dev Returns product if no overflow occurred /// @param a First factor /// @param b Second factor /// @return Product function mul(int a, int b) internal pure returns (int) { } }
safeToSub(a,b)
6,749
safeToSub(a,b)