comment
stringlengths
1
211
βŒ€
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
null
/** *Submitted for verification at Etherscan.io on 2020-06-05 */ // Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity ^0.5.15; import "./provableAPI_0.5.sol"; contract Draft90TokenAbstract { function mint(address account, uint256 amount) public; function burn(address account, uint256 amount) public; function balanceOf(address tokenOwner) public view returns (uint balance); } contract Draft180TokenAbstract { function mint(address account, uint256 amount) public; function burn(address account, uint256 amount) public; function balanceOf(address tokenOwner) public view returns (uint balance); } contract Draft270TokenAbstract { function mint(address account, uint256 amount) public; function burn(address account, uint256 amount) public; function balanceOf(address tokenOwner) public view returns (uint balance); } contract ADVMainAbstract { function mintADVToken(address to, uint amount) external; function burnADVToken() external; } contract IERC20Token { function transferFrom(address from, address to, uint tokens) public returns (bool success); function allowance(address owner, address spender) external view returns (uint256); } contract DraftMain is usingProvable { Draft90TokenAbstract public d90Token = Draft90TokenAbstract(0x50c26bDD0cCB78Ad61c7224b951E8caCCbC40319); Draft180TokenAbstract public d180Token = Draft180TokenAbstract(0x11D25fd9bD9220564b0C942f950833Dc6ADd2D21); Draft270TokenAbstract public d270Token = Draft270TokenAbstract(0x8b7A5234CdbB856d0712D4c63cb31a5Ed6f8d3D8); address public easyMainAddr; address public advTokenAddr; address payable public owner; struct LockList { address account; uint256 amount; uint256 time; } uint256 public ethusd = 0; uint public updatePriceFreq = 30 hours; uint constant d90Limit = 256 * 10**18; uint constant d180Limit = 512 * 10**18; uint constant d270Limit = 768 * 10**18; LockList[] public d90LockList; LockList[] public d180LockList; LockList[] public d270LockList; address payable public xi; address payable public mariano; address payable public marketing; address payable public vault; uint public d90Index; uint public d180Index; uint public d270Index; uint public d90LockedAmount; uint public d180LockedAmount; uint public d270LockedAmount; event LogPriceUpdated(string price); event LogNewProvableQuery(string description); modifier onlyOwner { } constructor(address payable _xi, address payable _mariano, address payable _marketing, address payable _vault, uint256 _ethusd) public { } function setEasymainAddr(address _addr) public onlyOwner { } function setAdvTokenAddr(address _addr) public onlyOwner { } function buyDraftTokenByADV(uint amount, address payable sponsor) public { } function buyDraftTokenByETH(uint amount, address payable sponsor) public payable { } function getD90LockedAmount(address account) public view returns (uint) { } function getD180LockedAmount(address account) public view returns (uint) { } function getD270LockedAmount(address account) public view returns (uint) { } function getD90AvailableAmount(address account) public view returns(uint) { } function getD180AvailableAmount(address account) public view returns(uint) { } function getD270AvailableAmount(address account) public view returns(uint) { } function () external payable { } function claimD90Token(uint amount) public { } function claimD180Token(uint amount) public { require(<FILL_ME>) d180Token.burn(msg.sender, amount); address(msg.sender).transfer(amount * 750 / ethusd); } function claimD270Token(uint amount) public { } function updateETHPrice(uint price) public onlyOwner { } function unlockTimedToken() public onlyOwner { } function sendEth(address payable to, uint amount) public onlyOwner { } function setEthUsd(uint256 _ethusd) public onlyOwner { } function __callback(bytes32 myid, string memory result) public { } function updatePrice() public payable { } function withdrawBalance(uint amount) public onlyOwner { } }
getD180AvailableAmount(msg.sender)>=amount
291,988
getD180AvailableAmount(msg.sender)>=amount
null
/** *Submitted for verification at Etherscan.io on 2020-06-05 */ // Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity ^0.5.15; import "./provableAPI_0.5.sol"; contract Draft90TokenAbstract { function mint(address account, uint256 amount) public; function burn(address account, uint256 amount) public; function balanceOf(address tokenOwner) public view returns (uint balance); } contract Draft180TokenAbstract { function mint(address account, uint256 amount) public; function burn(address account, uint256 amount) public; function balanceOf(address tokenOwner) public view returns (uint balance); } contract Draft270TokenAbstract { function mint(address account, uint256 amount) public; function burn(address account, uint256 amount) public; function balanceOf(address tokenOwner) public view returns (uint balance); } contract ADVMainAbstract { function mintADVToken(address to, uint amount) external; function burnADVToken() external; } contract IERC20Token { function transferFrom(address from, address to, uint tokens) public returns (bool success); function allowance(address owner, address spender) external view returns (uint256); } contract DraftMain is usingProvable { Draft90TokenAbstract public d90Token = Draft90TokenAbstract(0x50c26bDD0cCB78Ad61c7224b951E8caCCbC40319); Draft180TokenAbstract public d180Token = Draft180TokenAbstract(0x11D25fd9bD9220564b0C942f950833Dc6ADd2D21); Draft270TokenAbstract public d270Token = Draft270TokenAbstract(0x8b7A5234CdbB856d0712D4c63cb31a5Ed6f8d3D8); address public easyMainAddr; address public advTokenAddr; address payable public owner; struct LockList { address account; uint256 amount; uint256 time; } uint256 public ethusd = 0; uint public updatePriceFreq = 30 hours; uint constant d90Limit = 256 * 10**18; uint constant d180Limit = 512 * 10**18; uint constant d270Limit = 768 * 10**18; LockList[] public d90LockList; LockList[] public d180LockList; LockList[] public d270LockList; address payable public xi; address payable public mariano; address payable public marketing; address payable public vault; uint public d90Index; uint public d180Index; uint public d270Index; uint public d90LockedAmount; uint public d180LockedAmount; uint public d270LockedAmount; event LogPriceUpdated(string price); event LogNewProvableQuery(string description); modifier onlyOwner { } constructor(address payable _xi, address payable _mariano, address payable _marketing, address payable _vault, uint256 _ethusd) public { } function setEasymainAddr(address _addr) public onlyOwner { } function setAdvTokenAddr(address _addr) public onlyOwner { } function buyDraftTokenByADV(uint amount, address payable sponsor) public { } function buyDraftTokenByETH(uint amount, address payable sponsor) public payable { } function getD90LockedAmount(address account) public view returns (uint) { } function getD180LockedAmount(address account) public view returns (uint) { } function getD270LockedAmount(address account) public view returns (uint) { } function getD90AvailableAmount(address account) public view returns(uint) { } function getD180AvailableAmount(address account) public view returns(uint) { } function getD270AvailableAmount(address account) public view returns(uint) { } function () external payable { } function claimD90Token(uint amount) public { } function claimD180Token(uint amount) public { } function claimD270Token(uint amount) public { require(<FILL_ME>) d270Token.burn(msg.sender, amount); address(msg.sender).transfer(amount * 750 / ethusd); } function updateETHPrice(uint price) public onlyOwner { } function unlockTimedToken() public onlyOwner { } function sendEth(address payable to, uint amount) public onlyOwner { } function setEthUsd(uint256 _ethusd) public onlyOwner { } function __callback(bytes32 myid, string memory result) public { } function updatePrice() public payable { } function withdrawBalance(uint amount) public onlyOwner { } }
getD270AvailableAmount(msg.sender)>=amount
291,988
getD270AvailableAmount(msg.sender)>=amount
"unauthorized"
// SPDX_License_Identifier: MIT pragma solidity >=0.7.0; abstract contract LazyInitCapableElement is ILazyInitCapableElement { using ReflectionUtilities for address; address public override initializer; address public override host; constructor(bytes memory lazyInitData) { } function lazyInit(bytes calldata lazyInitData) override external returns (bytes memory lazyInitResponse) { } function supportsInterface(bytes4 interfaceId) override external view returns(bool) { } function setHost(address newValue) external override authorizedOnly returns(address oldValue) { } function subjectIsAuthorizedFor(address subject, address location, bytes4 selector, bytes calldata payload, uint256 value) public override virtual view returns(bool) { } function _privateLazyInit(bytes memory lazyInitData) private returns (bytes memory lazyInitResponse) { } function _lazyInit(bytes memory) internal virtual returns (bytes memory) { } function _supportsInterface(bytes4 selector) internal virtual view returns (bool); function _subjectIsAuthorizedFor(address, address, bytes4, bytes calldata, uint256) internal virtual view returns(bool, bool) { } modifier authorizedOnly { require(<FILL_ME>) _; } function _authorizedOnly() internal returns(bool) { } }
_authorizedOnly(),"unauthorized"
292,001
_authorizedOnly()
"reached max supply"
/** *Submitted for verification at Etherscan.io on 2022-03-25 */ /** *Submitted for verification at Etherscan.io on 2022-03-23 */ /** *Submitted for verification at Etherscan.io on 2022-03-11 */ /** *Submitted for verification at Etherscan.io on 2022-02-21 */ /** *Submitted for verification at Etherscan.io on 2022-02-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract ReentrancyGuard { uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { } modifier nonReentrant() { } } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; function toString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function _transferOwnership(address newOwner) internal virtual { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { } } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { } } interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); } interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 private currentIndex = 0; uint256 internal immutable collectionSize; uint256 internal immutable maxBatchSize; string private _name; string private _symbol; mapping(uint256 => TokenOwnership) private _ownerships; mapping(address => AddressData) private _addressData; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; constructor( string memory name_, string memory symbol_, uint256 maxBatchSize_, uint256 collectionSize_ ) { } function totalSupply() public view override returns (uint256) { } function tokenByIndex(uint256 index) public view override returns (uint256) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } function ownerOf(uint256 tokenId) public view override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function _baseURI() internal view virtual returns (string memory) { } function _getUriExtension() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public override { } function getApproved(uint256 tokenId) public view override returns (address) { } function setApprovalForAll(address operator, bool approved) public override { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public override { } function safeTransferFrom( address from, address to, uint256 tokenId ) public override { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override { } function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } function _transfer( address from, address to, uint256 tokenId ) private { } function _approve( address to, uint256 tokenId, address owner ) private { } uint256 public nextOwnerToExplicitlySet = 0; function _setOwnersExplicit(uint256 quantity) internal { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } contract CarGyz is Ownable, ERC721A, ReentrancyGuard { using Strings for uint256; uint256 public MAX_PER_Transtion = 40; // maximam amount that user can mint uint256 public MAX_PER_Address = 40; // maximam amount that user can mint uint256 public PRICE = 0.07 ether; uint256 private constant TotalCollectionSize_ = 10000; // total number of nfts uint256 private constant MaxMintPerBatch_ = 50; //max mint per traction bool public _revelNFT = false; string private _baseTokenURI; string private _uriBeforeRevel; uint private stopat = 2500; uint private reserve = 200; uint public status = 0; //0-pause 1-whitelist 2-public // mapping(address => bool) private whitelistedAddresses; constructor() ERC721A("CarGyz","CarGyz", MaxMintPerBatch_, TotalCollectionSize_) { } modifier callerIsUser() { } function mint(uint256 quantity) external payable callerIsUser { require(status == 2 , "Sale is not Active"); require(<FILL_ME>) require( ( numberMinted(msg.sender) + quantity <= MAX_PER_Address ) , "Quantity exceeds allowed Mints" ); require( quantity <= MAX_PER_Transtion,"can not mint this many"); require(msg.value >= PRICE * quantity, "Need to send more ETH."); _safeMint(msg.sender, quantity); if( totalSupply() >=stopat) { status=0; } } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setURIbeforeRevel(string memory URI) external onlyOwner { } function setBaseURI(string memory baseURI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function numberMinted(address owner) public view returns (uint256) { } function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) { } function withdrawMoney() external onlyOwner nonReentrant { } function changeRevelStatus() external onlyOwner { } function changeMintPrice(uint256 _newPrice) external onlyOwner { } function changeMAX_PER_Transtion(uint256 q) external onlyOwner { } function changeMAX_PER_Address(uint256 q) external onlyOwner { } function setStatus(uint256 s)external onlyOwner{ } function getStatus()public view returns(uint){ } function getPrice()public view returns(uint){ } function giveaway(address a, uint q)public onlyOwner{ } function setReserve(uint256 r)external onlyOwner{ } function conf(uint256 s , uint256 MPA , uint256 MPW , uint256 P ,uint256 st )external onlyOwner{ } }
totalSupply()+quantity<=collectionSize-reserve,"reached max supply"
292,108
totalSupply()+quantity<=collectionSize-reserve
"Quantity exceeds allowed Mints"
/** *Submitted for verification at Etherscan.io on 2022-03-25 */ /** *Submitted for verification at Etherscan.io on 2022-03-23 */ /** *Submitted for verification at Etherscan.io on 2022-03-11 */ /** *Submitted for verification at Etherscan.io on 2022-02-21 */ /** *Submitted for verification at Etherscan.io on 2022-02-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract ReentrancyGuard { uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { } modifier nonReentrant() { } } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; function toString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function _transferOwnership(address newOwner) internal virtual { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { } } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { } } interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); } interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 private currentIndex = 0; uint256 internal immutable collectionSize; uint256 internal immutable maxBatchSize; string private _name; string private _symbol; mapping(uint256 => TokenOwnership) private _ownerships; mapping(address => AddressData) private _addressData; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; constructor( string memory name_, string memory symbol_, uint256 maxBatchSize_, uint256 collectionSize_ ) { } function totalSupply() public view override returns (uint256) { } function tokenByIndex(uint256 index) public view override returns (uint256) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } function ownerOf(uint256 tokenId) public view override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function _baseURI() internal view virtual returns (string memory) { } function _getUriExtension() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public override { } function getApproved(uint256 tokenId) public view override returns (address) { } function setApprovalForAll(address operator, bool approved) public override { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public override { } function safeTransferFrom( address from, address to, uint256 tokenId ) public override { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override { } function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } function _transfer( address from, address to, uint256 tokenId ) private { } function _approve( address to, uint256 tokenId, address owner ) private { } uint256 public nextOwnerToExplicitlySet = 0; function _setOwnersExplicit(uint256 quantity) internal { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } contract CarGyz is Ownable, ERC721A, ReentrancyGuard { using Strings for uint256; uint256 public MAX_PER_Transtion = 40; // maximam amount that user can mint uint256 public MAX_PER_Address = 40; // maximam amount that user can mint uint256 public PRICE = 0.07 ether; uint256 private constant TotalCollectionSize_ = 10000; // total number of nfts uint256 private constant MaxMintPerBatch_ = 50; //max mint per traction bool public _revelNFT = false; string private _baseTokenURI; string private _uriBeforeRevel; uint private stopat = 2500; uint private reserve = 200; uint public status = 0; //0-pause 1-whitelist 2-public // mapping(address => bool) private whitelistedAddresses; constructor() ERC721A("CarGyz","CarGyz", MaxMintPerBatch_, TotalCollectionSize_) { } modifier callerIsUser() { } function mint(uint256 quantity) external payable callerIsUser { require(status == 2 , "Sale is not Active"); require(totalSupply() + quantity <= collectionSize - reserve, "reached max supply"); require(<FILL_ME>) require( quantity <= MAX_PER_Transtion,"can not mint this many"); require(msg.value >= PRICE * quantity, "Need to send more ETH."); _safeMint(msg.sender, quantity); if( totalSupply() >=stopat) { status=0; } } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setURIbeforeRevel(string memory URI) external onlyOwner { } function setBaseURI(string memory baseURI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function numberMinted(address owner) public view returns (uint256) { } function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) { } function withdrawMoney() external onlyOwner nonReentrant { } function changeRevelStatus() external onlyOwner { } function changeMintPrice(uint256 _newPrice) external onlyOwner { } function changeMAX_PER_Transtion(uint256 q) external onlyOwner { } function changeMAX_PER_Address(uint256 q) external onlyOwner { } function setStatus(uint256 s)external onlyOwner{ } function getStatus()public view returns(uint){ } function getPrice()public view returns(uint){ } function giveaway(address a, uint q)public onlyOwner{ } function setReserve(uint256 r)external onlyOwner{ } function conf(uint256 s , uint256 MPA , uint256 MPW , uint256 P ,uint256 st )external onlyOwner{ } }
(numberMinted(msg.sender)+quantity<=MAX_PER_Address),"Quantity exceeds allowed Mints"
292,108
(numberMinted(msg.sender)+quantity<=MAX_PER_Address)
'yfie + value == YFIE.balanceOf(_to)'
pragma solidity >=0.4.22 <0.6.0; contract ERC20 { mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; function transfer(address _to, uint256 _value) public; function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success) ; } contract YFIE_LOCK_POOL{ uint32 startTime; uint32 constant StopTime_A=30; uint32 constant StopTime_B=30; uint32 constant StopTime_C=30; uint32 constant rateSetFreeA=150; uint32 constant rateSetFreeB=100; uint32 constant rateSetFreeC=500; uint256 constant MinA=1000 ether; uint256 constant MinB=500 ether; uint256 constant MinC=200 ether; uint256 constant YFIE_A=1000 ether; uint256 constant YFIE_B=1000 ether; uint256 constant YFIE_C=1000 ether; uint256 constant FIE_A = 1000000 ether; uint256 constant FIE_B = 500000 ether; uint256 constant FIE_C = 200000 ether; ERC20 public YFIE = ERC20(0xA1B3E61c15b97E85febA33b8F15485389d7836Db); ERC20 public FIE = ERC20(0x301416B8792B9c2adE82D9D87773251C8AD8c89e); struct LOCK_POOL{ uint256 TotalInput_A;//ζ€»ζŠ•ε…₯ uint256 TotalInput_B;//ζ€»ζŠ•ε…₯ uint256 TotalInput_C;//ζ€»ζŠ•ε…₯ } struct USER_POOL{ uint256 InputYfie; uint32 InputTime; uint32 TakeOutTime; } LOCK_POOL public pool; mapping(address => USER_POOL) public userA; mapping(address => USER_POOL) public userB; mapping(address => USER_POOL) public userC; mapping(uint32 => address) public userID; mapping(address => uint32) public userAD; uint32 public userCount; address public admin; constructor()public{ } function register(address addr)internal { } function input_transfer(address _from,address _to ,uint256 value)internal{ uint256 yfie=YFIE.balanceOf(_to); YFIE.transferFrom(_from,_to,value); require(<FILL_ME>) } function output_yfie_transfer(address _to,uint256 value)internal{ } function output_fie_transfer(address _to,uint256 value)internal{ } function InputToPoolA(uint256 value)public{ } function InputToPoolB(uint256 value)public{ } function InputToPoolC(uint256 value)public{ } function OutputFromPoolA()public{ } function OutputFromPoolC()public{ } function OutputFromPoolB()public{ } function OutputOfYFIE(address addr,uint256 value)public{ } function OutputOfFIE(address addr,uint256 value)public{ } }
yfie+value==YFIE.balanceOf(_to),'yfie + value == YFIE.balanceOf(_to)'
292,207
yfie+value==YFIE.balanceOf(_to)
'principal + value == YFIE.balanceOf(_to)'
pragma solidity >=0.4.22 <0.6.0; contract ERC20 { mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; function transfer(address _to, uint256 _value) public; function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success) ; } contract YFIE_LOCK_POOL{ uint32 startTime; uint32 constant StopTime_A=30; uint32 constant StopTime_B=30; uint32 constant StopTime_C=30; uint32 constant rateSetFreeA=150; uint32 constant rateSetFreeB=100; uint32 constant rateSetFreeC=500; uint256 constant MinA=1000 ether; uint256 constant MinB=500 ether; uint256 constant MinC=200 ether; uint256 constant YFIE_A=1000 ether; uint256 constant YFIE_B=1000 ether; uint256 constant YFIE_C=1000 ether; uint256 constant FIE_A = 1000000 ether; uint256 constant FIE_B = 500000 ether; uint256 constant FIE_C = 200000 ether; ERC20 public YFIE = ERC20(0xA1B3E61c15b97E85febA33b8F15485389d7836Db); ERC20 public FIE = ERC20(0x301416B8792B9c2adE82D9D87773251C8AD8c89e); struct LOCK_POOL{ uint256 TotalInput_A;//ζ€»ζŠ•ε…₯ uint256 TotalInput_B;//ζ€»ζŠ•ε…₯ uint256 TotalInput_C;//ζ€»ζŠ•ε…₯ } struct USER_POOL{ uint256 InputYfie; uint32 InputTime; uint32 TakeOutTime; } LOCK_POOL public pool; mapping(address => USER_POOL) public userA; mapping(address => USER_POOL) public userB; mapping(address => USER_POOL) public userC; mapping(uint32 => address) public userID; mapping(address => uint32) public userAD; uint32 public userCount; address public admin; constructor()public{ } function register(address addr)internal { } function input_transfer(address _from,address _to ,uint256 value)internal{ } function output_yfie_transfer(address _to,uint256 value)internal{ uint256 principal=YFIE.balanceOf(_to); YFIE.transfer(_to,value); require(<FILL_ME>) } function output_fie_transfer(address _to,uint256 value)internal{ } function InputToPoolA(uint256 value)public{ } function InputToPoolB(uint256 value)public{ } function InputToPoolC(uint256 value)public{ } function OutputFromPoolA()public{ } function OutputFromPoolC()public{ } function OutputFromPoolB()public{ } function OutputOfYFIE(address addr,uint256 value)public{ } function OutputOfFIE(address addr,uint256 value)public{ } }
principal+value==YFIE.balanceOf(_to),'principal + value == YFIE.balanceOf(_to)'
292,207
principal+value==YFIE.balanceOf(_to)
'principal + value == FIE.balanceOf(_to)'
pragma solidity >=0.4.22 <0.6.0; contract ERC20 { mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; function transfer(address _to, uint256 _value) public; function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success) ; } contract YFIE_LOCK_POOL{ uint32 startTime; uint32 constant StopTime_A=30; uint32 constant StopTime_B=30; uint32 constant StopTime_C=30; uint32 constant rateSetFreeA=150; uint32 constant rateSetFreeB=100; uint32 constant rateSetFreeC=500; uint256 constant MinA=1000 ether; uint256 constant MinB=500 ether; uint256 constant MinC=200 ether; uint256 constant YFIE_A=1000 ether; uint256 constant YFIE_B=1000 ether; uint256 constant YFIE_C=1000 ether; uint256 constant FIE_A = 1000000 ether; uint256 constant FIE_B = 500000 ether; uint256 constant FIE_C = 200000 ether; ERC20 public YFIE = ERC20(0xA1B3E61c15b97E85febA33b8F15485389d7836Db); ERC20 public FIE = ERC20(0x301416B8792B9c2adE82D9D87773251C8AD8c89e); struct LOCK_POOL{ uint256 TotalInput_A;//ζ€»ζŠ•ε…₯ uint256 TotalInput_B;//ζ€»ζŠ•ε…₯ uint256 TotalInput_C;//ζ€»ζŠ•ε…₯ } struct USER_POOL{ uint256 InputYfie; uint32 InputTime; uint32 TakeOutTime; } LOCK_POOL public pool; mapping(address => USER_POOL) public userA; mapping(address => USER_POOL) public userB; mapping(address => USER_POOL) public userC; mapping(uint32 => address) public userID; mapping(address => uint32) public userAD; uint32 public userCount; address public admin; constructor()public{ } function register(address addr)internal { } function input_transfer(address _from,address _to ,uint256 value)internal{ } function output_yfie_transfer(address _to,uint256 value)internal{ } function output_fie_transfer(address _to,uint256 value)internal{ uint256 principal=FIE.balanceOf(_to); FIE.transfer(_to,value); require(<FILL_ME>) } function InputToPoolA(uint256 value)public{ } function InputToPoolB(uint256 value)public{ } function InputToPoolC(uint256 value)public{ } function OutputFromPoolA()public{ } function OutputFromPoolC()public{ } function OutputFromPoolB()public{ } function OutputOfYFIE(address addr,uint256 value)public{ } function OutputOfFIE(address addr,uint256 value)public{ } }
principal+value==FIE.balanceOf(_to),'principal + value == FIE.balanceOf(_to)'
292,207
principal+value==FIE.balanceOf(_to)
"Either sale is currently active or cooking is inactive"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract SympathyForTheDevils is ERC721, ERC721Enumerable, ERC721Burnable, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; uint256 public maxTokenSupply; uint256 public constant MAX_MINTS_PER_TXN = 16; uint256 public mintPrice = 66600000 gwei; // 0.0666 ETH bool public saleIsActive = false; bool public cookingIsActive = false; string public baseURI; string public provenance; uint256 public startingIndexBlock; uint256 public startingIndex; address[3] private _shareholders; uint[3] private _shares; address private _manager; // Mapping from token ID to the amount of claimable eth in gwei mapping(uint256 => uint256) private _claimableEth; event DevilCooked(uint256 firstTokenId, uint256 secondTokenId, uint256 cookedDevilTokenId); event PaymentReleased(address to, uint256 amount); event EthDeposited(uint256 amount); event EthClaimed(address to, uint256 amount); constructor(string memory name, string memory symbol, uint256 maxDevilSupply) ERC721(name, symbol) { } function setMaxTokenSupply(uint256 maxDevilSupply) public onlyOwner { } function setMintPrice(uint256 newPrice) public onlyOwner { } function withdrawForGiveaway(uint256 amount, address payable to) public onlyOwner { } function withdraw(uint256 amount) public onlyOwner { } /* * Mint reserved NFTs for giveaways, devs, etc. */ function reserveMint(uint256 reservedAmount) public onlyOwner { } /* * Mint reserved NFTs for giveaways, devs, etc. */ function reserveMint(uint256 reservedAmount, address mintAddress) public onlyOwner { } /* * Pause sale if active, make active if paused. */ function flipSaleState() public onlyOwner { } /* * Pause cooking if active, make active if paused. */ function flipCookingState() public onlyOwner { } /* * Mint Devil NFTs, woo! */ function mintDevils(uint256 numberOfTokens) public payable { } /* * Set the manager address for deposits. */ function setManager(address manager) public onlyOwner { } /** * @dev Throws if called by any account other than the owner or manager. */ modifier onlyOwnerOrManager() { } /* * Deposit eth for distribution to token owners. */ function deposit() public payable onlyOwnerOrManager { } /* * Get the claimable balance of a token ID. */ function claimableBalanceOfTokenId(uint256 tokenId) public view returns (uint256) { } /* * Get the total claimable balance for an owner. */ function claimableBalance(address owner) public view returns (uint256) { } function claim() public { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory newBaseURI) public onlyOwner { } /** * Set the starting index for the collection. */ function setStartingIndex() public onlyOwner { } /** * Set the starting index block for the collection. Usually, this will be set after the first sale mint. */ function emergencySetStartingIndexBlock() public onlyOwner { } /* * Set provenance once it's calculated. */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } function cookDevil(uint256 firstTokenId, uint256 secondTokenId) public { require(<FILL_ME>) require(_isApprovedOrOwner(_msgSender(), firstTokenId) && _isApprovedOrOwner(_msgSender(), secondTokenId), "Caller is not owner nor approved"); // burn the 2 tokens _burn(firstTokenId); _burn(secondTokenId); // mint new token uint256 cookedDevilTokenId = _tokenIdCounter.current() + 1; _safeMint(msg.sender, cookedDevilTokenId); _tokenIdCounter.increment(); // fire event in logs emit DevilCooked(firstTokenId, secondTokenId, cookedDevilTokenId); } }
cookingIsActive&&!saleIsActive,"Either sale is currently active or cooking is inactive"
292,227
cookingIsActive&&!saleIsActive
"Caller is not owner nor approved"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract SympathyForTheDevils is ERC721, ERC721Enumerable, ERC721Burnable, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; uint256 public maxTokenSupply; uint256 public constant MAX_MINTS_PER_TXN = 16; uint256 public mintPrice = 66600000 gwei; // 0.0666 ETH bool public saleIsActive = false; bool public cookingIsActive = false; string public baseURI; string public provenance; uint256 public startingIndexBlock; uint256 public startingIndex; address[3] private _shareholders; uint[3] private _shares; address private _manager; // Mapping from token ID to the amount of claimable eth in gwei mapping(uint256 => uint256) private _claimableEth; event DevilCooked(uint256 firstTokenId, uint256 secondTokenId, uint256 cookedDevilTokenId); event PaymentReleased(address to, uint256 amount); event EthDeposited(uint256 amount); event EthClaimed(address to, uint256 amount); constructor(string memory name, string memory symbol, uint256 maxDevilSupply) ERC721(name, symbol) { } function setMaxTokenSupply(uint256 maxDevilSupply) public onlyOwner { } function setMintPrice(uint256 newPrice) public onlyOwner { } function withdrawForGiveaway(uint256 amount, address payable to) public onlyOwner { } function withdraw(uint256 amount) public onlyOwner { } /* * Mint reserved NFTs for giveaways, devs, etc. */ function reserveMint(uint256 reservedAmount) public onlyOwner { } /* * Mint reserved NFTs for giveaways, devs, etc. */ function reserveMint(uint256 reservedAmount, address mintAddress) public onlyOwner { } /* * Pause sale if active, make active if paused. */ function flipSaleState() public onlyOwner { } /* * Pause cooking if active, make active if paused. */ function flipCookingState() public onlyOwner { } /* * Mint Devil NFTs, woo! */ function mintDevils(uint256 numberOfTokens) public payable { } /* * Set the manager address for deposits. */ function setManager(address manager) public onlyOwner { } /** * @dev Throws if called by any account other than the owner or manager. */ modifier onlyOwnerOrManager() { } /* * Deposit eth for distribution to token owners. */ function deposit() public payable onlyOwnerOrManager { } /* * Get the claimable balance of a token ID. */ function claimableBalanceOfTokenId(uint256 tokenId) public view returns (uint256) { } /* * Get the total claimable balance for an owner. */ function claimableBalance(address owner) public view returns (uint256) { } function claim() public { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory newBaseURI) public onlyOwner { } /** * Set the starting index for the collection. */ function setStartingIndex() public onlyOwner { } /** * Set the starting index block for the collection. Usually, this will be set after the first sale mint. */ function emergencySetStartingIndexBlock() public onlyOwner { } /* * Set provenance once it's calculated. */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } function cookDevil(uint256 firstTokenId, uint256 secondTokenId) public { require(cookingIsActive && !saleIsActive, "Either sale is currently active or cooking is inactive"); require(<FILL_ME>) // burn the 2 tokens _burn(firstTokenId); _burn(secondTokenId); // mint new token uint256 cookedDevilTokenId = _tokenIdCounter.current() + 1; _safeMint(msg.sender, cookedDevilTokenId); _tokenIdCounter.increment(); // fire event in logs emit DevilCooked(firstTokenId, secondTokenId, cookedDevilTokenId); } }
_isApprovedOrOwner(_msgSender(),firstTokenId)&&_isApprovedOrOwner(_msgSender(),secondTokenId),"Caller is not owner nor approved"
292,227
_isApprovedOrOwner(_msgSender(),firstTokenId)&&_isApprovedOrOwner(_msgSender(),secondTokenId)
'you can only unstake if you have some staked'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/interfaces/IERC721.sol'; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import './interfaces/IConditional.sol'; import './interfaces/IMultiplier.sol'; import './OKLGWithdrawable.sol'; contract OKLGDividendDistributor is OKLGWithdrawable { using SafeMath for uint256; struct Dividend { uint256 totalExcluded; // excluded dividend uint256 totalRealised; uint256 lastClaim; // used for boosting logic } struct Share { uint256 amount; uint256 amountBase; uint256[] nftBoostTokenIds; } address public shareholderToken; address public nftBoosterToken; uint256 public totalSharesBoosted; uint256 public totalSharesDeposited; // will only be actual deposited tokens without handling any reflections or otherwise address wrappedNative; IUniswapV2Router02 router; // used to fetch in a frontend to get full list // of tokens that dividends can be claimed address[] public tokens; mapping(address => bool) tokenAwareness; mapping(address => uint256) shareholderClaims; // amount of shares a user has mapping(address => Share) shares; // dividend information per user mapping(address => mapping(address => Dividend)) public dividends; address public boostContract; address public boostMultiplierContract; // per token dividends mapping(address => uint256) public totalDividends; mapping(address => uint256) public totalDistributed; // to be shown in UI mapping(address => uint256) public dividendsPerShare; uint256 public constant ACC_FACTOR = 10**36; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; constructor( address _dexRouter, address _shareholderToken, address _nftBoosterToken, address _wrappedNative ) { } function stake( address token, uint256 amount, uint256[] memory nftTokenIds ) external { } function _stake( address shareholder, address token, uint256 amount, uint256[] memory nftTokenIds, bool contractOverride ) private { } function unstake(address token, uint256 boostedAmount) external { require(<FILL_ME>) distributeDividend(token, msg.sender, false); IERC20 shareContract = IERC20(shareholderToken); uint256 boostedAmountToUnstake = boostedAmount == 0 ? shares[msg.sender].amount : boostedAmount; // NOTE: temporarily setting shares[shareholder].amount to base deposited to get elevated shares. // They depend on shares[shareholder].amount being populated, but we're simply reversing this // after calculating boosted amount uint256 currentAmountWithBoost = shares[msg.sender].amount; shares[msg.sender].amount = shares[msg.sender].amountBase; uint256 baseAmount = getBaseSharesFromBoosted( msg.sender, boostedAmountToUnstake ); shares[msg.sender].amount = currentAmountWithBoost; // handle reflections tokens uint256 finalWithdrawAmount = getAppreciatedShares(baseAmount); if (boostedAmount == 0) { uint256[] memory tokenIds = shares[msg.sender].nftBoostTokenIds; IERC721 nftContract = IERC721(nftBoosterToken); for (uint256 i = 0; i < tokenIds.length; i++) { nftContract.safeTransferFrom(address(this), msg.sender, tokenIds[i]); } delete shares[msg.sender].nftBoostTokenIds; } shareContract.transfer(msg.sender, finalWithdrawAmount); totalSharesDeposited = totalSharesDeposited.sub(baseAmount); totalSharesBoosted = totalSharesBoosted.sub(boostedAmountToUnstake); shares[msg.sender].amountBase -= baseAmount; shares[msg.sender].amount -= boostedAmountToUnstake; dividends[msg.sender][token].totalExcluded = getCumulativeDividends( token, shares[msg.sender].amount ); } // tokenAddress == address(0) means native token // any other token should be ERC20 listed on DEX router provided in constructor // // NOTE: Using this function will add tokens to the core rewards/dividends to be // distributed to all shareholders. However, to implement boosting, the token // should be directly transferred to this contract. Anything above and // beyond the totalDividends[tokenAddress] amount will be used for boosting. function depositDividends(address tokenAddress, uint256 erc20DirectAmount) external payable { } function distributeDividend( address token, address shareholder, bool compound ) internal { } function claimDividend(address token, bool compound) external { } function getAppreciatedShares(uint256 amount) public view returns (uint256) { } function getDividendTokens() external view returns (address[] memory) { } // getElevatedSharesWithBooster: // A + Ax = B // ------------------------ // getBaseSharesFromBoosted: // A + Ax = B // A(1 + x) = B // A = B/(1 + x) function getElevatedSharesWithBooster(address shareholder, uint256 baseAmount) internal view returns (uint256) { } function getBaseSharesFromBoosted(address shareholder, uint256 boostedAmount) public view returns (uint256) { } // NOTE: 2022-01-31 LW: new boost contract assumes OKLG and booster NFTs are staked in this contract function getBoostMultiplier(address wallet) public view returns (uint256) { } // NOTE: 2022-01-31 LW: new boost contract assumes OKLG and booster NFTs are staked in this contract function eligibleForRewardBooster(address shareholder) public view returns (bool) { } // returns the unpaid earnings function getUnpaidEarnings(address token, address shareholder) public view returns (uint256) { } function getCumulativeDividends(address token, uint256 share) internal view returns (uint256) { } function getBaseShares(address user) external view returns (uint256) { } function getShares(address user) external view returns (uint256) { } function getBoostNfts(address user) external view returns (uint256[] memory) { } function setShareholderToken(address _token) external onlyOwner { } function setBoostContract(address _contract) external onlyOwner { } function setBoostMultiplierContract(address _contract) external onlyOwner { } function withdrawNfts(address nftContractAddy, uint256[] memory _tokenIds) external onlyOwner { } receive() external payable {} }
shares[msg.sender].amount>0&&(boostedAmount==0||boostedAmount<=shares[msg.sender].amount),'you can only unstake if you have some staked'
292,258
shares[msg.sender].amount>0&&(boostedAmount==0||boostedAmount<=shares[msg.sender].amount)
'contract does not implement interface'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/interfaces/IERC721.sol'; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import './interfaces/IConditional.sol'; import './interfaces/IMultiplier.sol'; import './OKLGWithdrawable.sol'; contract OKLGDividendDistributor is OKLGWithdrawable { using SafeMath for uint256; struct Dividend { uint256 totalExcluded; // excluded dividend uint256 totalRealised; uint256 lastClaim; // used for boosting logic } struct Share { uint256 amount; uint256 amountBase; uint256[] nftBoostTokenIds; } address public shareholderToken; address public nftBoosterToken; uint256 public totalSharesBoosted; uint256 public totalSharesDeposited; // will only be actual deposited tokens without handling any reflections or otherwise address wrappedNative; IUniswapV2Router02 router; // used to fetch in a frontend to get full list // of tokens that dividends can be claimed address[] public tokens; mapping(address => bool) tokenAwareness; mapping(address => uint256) shareholderClaims; // amount of shares a user has mapping(address => Share) shares; // dividend information per user mapping(address => mapping(address => Dividend)) public dividends; address public boostContract; address public boostMultiplierContract; // per token dividends mapping(address => uint256) public totalDividends; mapping(address => uint256) public totalDistributed; // to be shown in UI mapping(address => uint256) public dividendsPerShare; uint256 public constant ACC_FACTOR = 10**36; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; constructor( address _dexRouter, address _shareholderToken, address _nftBoosterToken, address _wrappedNative ) { } function stake( address token, uint256 amount, uint256[] memory nftTokenIds ) external { } function _stake( address shareholder, address token, uint256 amount, uint256[] memory nftTokenIds, bool contractOverride ) private { } function unstake(address token, uint256 boostedAmount) external { } // tokenAddress == address(0) means native token // any other token should be ERC20 listed on DEX router provided in constructor // // NOTE: Using this function will add tokens to the core rewards/dividends to be // distributed to all shareholders. However, to implement boosting, the token // should be directly transferred to this contract. Anything above and // beyond the totalDividends[tokenAddress] amount will be used for boosting. function depositDividends(address tokenAddress, uint256 erc20DirectAmount) external payable { } function distributeDividend( address token, address shareholder, bool compound ) internal { } function claimDividend(address token, bool compound) external { } function getAppreciatedShares(uint256 amount) public view returns (uint256) { } function getDividendTokens() external view returns (address[] memory) { } // getElevatedSharesWithBooster: // A + Ax = B // ------------------------ // getBaseSharesFromBoosted: // A + Ax = B // A(1 + x) = B // A = B/(1 + x) function getElevatedSharesWithBooster(address shareholder, uint256 baseAmount) internal view returns (uint256) { } function getBaseSharesFromBoosted(address shareholder, uint256 boostedAmount) public view returns (uint256) { } // NOTE: 2022-01-31 LW: new boost contract assumes OKLG and booster NFTs are staked in this contract function getBoostMultiplier(address wallet) public view returns (uint256) { } // NOTE: 2022-01-31 LW: new boost contract assumes OKLG and booster NFTs are staked in this contract function eligibleForRewardBooster(address shareholder) public view returns (bool) { } // returns the unpaid earnings function getUnpaidEarnings(address token, address shareholder) public view returns (uint256) { } function getCumulativeDividends(address token, uint256 share) internal view returns (uint256) { } function getBaseShares(address user) external view returns (uint256) { } function getShares(address user) external view returns (uint256) { } function getBoostNfts(address user) external view returns (uint256[] memory) { } function setShareholderToken(address _token) external onlyOwner { } function setBoostContract(address _contract) external onlyOwner { if (_contract != address(0)) { IConditional _contCheck = IConditional(_contract); // allow setting to zero address to effectively turn off check logic require(<FILL_ME>) } boostContract = _contract; } function setBoostMultiplierContract(address _contract) external onlyOwner { } function withdrawNfts(address nftContractAddy, uint256[] memory _tokenIds) external onlyOwner { } receive() external payable {} }
_contCheck.passesTest(address(0))==true||_contCheck.passesTest(address(0))==false,'contract does not implement interface'
292,258
_contCheck.passesTest(address(0))==true||_contCheck.passesTest(address(0))==false
'contract does not implement interface'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/interfaces/IERC721.sol'; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import './interfaces/IConditional.sol'; import './interfaces/IMultiplier.sol'; import './OKLGWithdrawable.sol'; contract OKLGDividendDistributor is OKLGWithdrawable { using SafeMath for uint256; struct Dividend { uint256 totalExcluded; // excluded dividend uint256 totalRealised; uint256 lastClaim; // used for boosting logic } struct Share { uint256 amount; uint256 amountBase; uint256[] nftBoostTokenIds; } address public shareholderToken; address public nftBoosterToken; uint256 public totalSharesBoosted; uint256 public totalSharesDeposited; // will only be actual deposited tokens without handling any reflections or otherwise address wrappedNative; IUniswapV2Router02 router; // used to fetch in a frontend to get full list // of tokens that dividends can be claimed address[] public tokens; mapping(address => bool) tokenAwareness; mapping(address => uint256) shareholderClaims; // amount of shares a user has mapping(address => Share) shares; // dividend information per user mapping(address => mapping(address => Dividend)) public dividends; address public boostContract; address public boostMultiplierContract; // per token dividends mapping(address => uint256) public totalDividends; mapping(address => uint256) public totalDistributed; // to be shown in UI mapping(address => uint256) public dividendsPerShare; uint256 public constant ACC_FACTOR = 10**36; address public constant DEAD = 0x000000000000000000000000000000000000dEaD; constructor( address _dexRouter, address _shareholderToken, address _nftBoosterToken, address _wrappedNative ) { } function stake( address token, uint256 amount, uint256[] memory nftTokenIds ) external { } function _stake( address shareholder, address token, uint256 amount, uint256[] memory nftTokenIds, bool contractOverride ) private { } function unstake(address token, uint256 boostedAmount) external { } // tokenAddress == address(0) means native token // any other token should be ERC20 listed on DEX router provided in constructor // // NOTE: Using this function will add tokens to the core rewards/dividends to be // distributed to all shareholders. However, to implement boosting, the token // should be directly transferred to this contract. Anything above and // beyond the totalDividends[tokenAddress] amount will be used for boosting. function depositDividends(address tokenAddress, uint256 erc20DirectAmount) external payable { } function distributeDividend( address token, address shareholder, bool compound ) internal { } function claimDividend(address token, bool compound) external { } function getAppreciatedShares(uint256 amount) public view returns (uint256) { } function getDividendTokens() external view returns (address[] memory) { } // getElevatedSharesWithBooster: // A + Ax = B // ------------------------ // getBaseSharesFromBoosted: // A + Ax = B // A(1 + x) = B // A = B/(1 + x) function getElevatedSharesWithBooster(address shareholder, uint256 baseAmount) internal view returns (uint256) { } function getBaseSharesFromBoosted(address shareholder, uint256 boostedAmount) public view returns (uint256) { } // NOTE: 2022-01-31 LW: new boost contract assumes OKLG and booster NFTs are staked in this contract function getBoostMultiplier(address wallet) public view returns (uint256) { } // NOTE: 2022-01-31 LW: new boost contract assumes OKLG and booster NFTs are staked in this contract function eligibleForRewardBooster(address shareholder) public view returns (bool) { } // returns the unpaid earnings function getUnpaidEarnings(address token, address shareholder) public view returns (uint256) { } function getCumulativeDividends(address token, uint256 share) internal view returns (uint256) { } function getBaseShares(address user) external view returns (uint256) { } function getShares(address user) external view returns (uint256) { } function getBoostNfts(address user) external view returns (uint256[] memory) { } function setShareholderToken(address _token) external onlyOwner { } function setBoostContract(address _contract) external onlyOwner { } function setBoostMultiplierContract(address _contract) external onlyOwner { if (_contract != address(0)) { IMultiplier _contCheck = IMultiplier(_contract); // allow setting to zero address to effectively turn off check logic require(<FILL_ME>) } boostMultiplierContract = _contract; } function withdrawNfts(address nftContractAddy, uint256[] memory _tokenIds) external onlyOwner { } receive() external payable {} }
_contCheck.getMultiplier(address(0))>=0,'contract does not implement interface'
292,258
_contCheck.getMultiplier(address(0))>=0
null
interface ITweedentityStore { function isUpgradable(address _address, string _uid) public constant returns (bool); function setIdentity(address _address, string _uid) external; function unsetIdentity(address _address) external; function getAppNickname() external constant returns (bytes32); function getAppId() external constant returns (uint); function getAddressLastUpdate(address _address) external constant returns (uint); function isUid(string _uid) public pure returns (bool); } /** * @title TweedentityManager * @author Francesco Sullo <[email protected]> * @dev Sets and removes tweedentities in the store, * adding more logic to the simple logic of the store */ contract TweedentityManager is Pausable, HasNoEther { string public version = "1.3.0"; struct Store { ITweedentityStore store; address addr; } mapping(uint => Store) private __stores; mapping(uint => bytes32) public appNicknames32; mapping(uint => string) public appNicknames; mapping(string => uint) private __appIds; address public claimer; address public newClaimer; mapping(address => bool) public customerService; address[] private __customerServiceAddress; uint public upgradable = 0; uint public notUpgradableInStore = 1; uint public addressNotUpgradable = 2; uint public minimumTimeBeforeUpdate = 1 hours; // events event IdentityNotUpgradable( string appNickname, address indexed addr, string uid ); // config /** * @dev Sets a store to be used by the manager * @param _appNickname The nickname of the app for which the store's been configured * @param _address The address of the store */ function setAStore( string _appNickname, address _address ) public onlyOwner { require(<FILL_ME>) bytes32 _appNickname32 = keccak256(_appNickname); require(_address != address(0)); ITweedentityStore _store = ITweedentityStore(_address); require(_store.getAppNickname() == _appNickname32); uint _appId = _store.getAppId(); require(appNicknames32[_appId] == 0x0); appNicknames32[_appId] = _appNickname32; appNicknames[_appId] = _appNickname; __appIds[_appNickname] = _appId; __stores[_appId] = Store( ITweedentityStore(_address), _address ); } /** * @dev Sets the claimer which will verify the ownership and call to set a tweedentity * @param _address Address of the claimer */ function setClaimer( address _address ) public onlyOwner { } /** * @dev Sets a new claimer during updates * @param _address Address of the new claimer */ function setNewClaimer( address _address ) public onlyOwner { } /** * @dev Sets new manager */ function switchClaimerAndRemoveOldOne() external onlyOwner { } /** * @dev Sets a wallet as customer service to perform emergency removal of wrong, abused, squatted tweedentities (due, for example, to hacking of the Twitter account) * @param _address The customer service wallet * @param _status The status (true is set, false is unset) */ function setCustomerService( address _address, bool _status ) public onlyOwner { } //modifiers modifier onlyClaimer() { } modifier onlyCustomerService() { } modifier whenStoreSet( uint _appId ) { } // internal getters function __getStore( uint _appId ) internal constant returns (ITweedentityStore) { } // helpers function isAddressUpgradable( ITweedentityStore _store, address _address ) internal constant returns (bool) { } function isUpgradable( ITweedentityStore _store, address _address, string _uid ) internal constant returns (bool) { } // getters /** * @dev Gets the app-id associated to a nickname * @param _appNickname The nickname of a configured app */ function getAppId( string _appNickname ) external constant returns (uint) { } /** * @dev Allows other contracts to check if a store is set * @param _appNickname The nickname of a configured app */ function isStoreSet( string _appNickname ) public constant returns (bool){ } /** * @dev Return a numeric code about the upgradability of a couple wallet-uid in a certain app * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function getUpgradability( uint _appId, address _address, string _uid ) external constant returns (uint) { } /** * @dev Returns the address of a store * @param _appNickname The app nickname */ function getStoreAddress( string _appNickname ) external constant returns (address) { } /** * @dev Returns the address of any customerService account */ function getCustomerServiceAddress() external constant returns (address[]) { } // primary methods /** * @dev Sets a new identity * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function setIdentity( uint _appId, address _address, string _uid ) external onlyClaimer whenStoreSet(_appId) whenNotPaused { } /** * @dev Unsets an existent identity * @param _appId The id of the app * @param _address The address of the wallet */ function unsetIdentity( uint _appId, address _address ) external onlyCustomerService whenStoreSet(_appId) whenNotPaused { } /** * @dev Allow the sender to unset its existent identity * @param _appId The id of the app */ function unsetMyIdentity( uint _appId ) external whenStoreSet(_appId) whenNotPaused { } /** * @dev Update the minimum time before allowing a wallet to update its data * @param _newMinimumTime The new minimum time in seconds */ function changeMinimumTimeBeforeUpdate( uint _newMinimumTime ) external onlyOwner { } // private methods function __stringToUint( string s ) internal pure returns (uint result) { } function __uintToBytes(uint x) internal pure returns (bytes b) { } }
bytes(_appNickname).length>0
292,287
bytes(_appNickname).length>0
null
interface ITweedentityStore { function isUpgradable(address _address, string _uid) public constant returns (bool); function setIdentity(address _address, string _uid) external; function unsetIdentity(address _address) external; function getAppNickname() external constant returns (bytes32); function getAppId() external constant returns (uint); function getAddressLastUpdate(address _address) external constant returns (uint); function isUid(string _uid) public pure returns (bool); } /** * @title TweedentityManager * @author Francesco Sullo <[email protected]> * @dev Sets and removes tweedentities in the store, * adding more logic to the simple logic of the store */ contract TweedentityManager is Pausable, HasNoEther { string public version = "1.3.0"; struct Store { ITweedentityStore store; address addr; } mapping(uint => Store) private __stores; mapping(uint => bytes32) public appNicknames32; mapping(uint => string) public appNicknames; mapping(string => uint) private __appIds; address public claimer; address public newClaimer; mapping(address => bool) public customerService; address[] private __customerServiceAddress; uint public upgradable = 0; uint public notUpgradableInStore = 1; uint public addressNotUpgradable = 2; uint public minimumTimeBeforeUpdate = 1 hours; // events event IdentityNotUpgradable( string appNickname, address indexed addr, string uid ); // config /** * @dev Sets a store to be used by the manager * @param _appNickname The nickname of the app for which the store's been configured * @param _address The address of the store */ function setAStore( string _appNickname, address _address ) public onlyOwner { require(bytes(_appNickname).length > 0); bytes32 _appNickname32 = keccak256(_appNickname); require(_address != address(0)); ITweedentityStore _store = ITweedentityStore(_address); require(<FILL_ME>) uint _appId = _store.getAppId(); require(appNicknames32[_appId] == 0x0); appNicknames32[_appId] = _appNickname32; appNicknames[_appId] = _appNickname; __appIds[_appNickname] = _appId; __stores[_appId] = Store( ITweedentityStore(_address), _address ); } /** * @dev Sets the claimer which will verify the ownership and call to set a tweedentity * @param _address Address of the claimer */ function setClaimer( address _address ) public onlyOwner { } /** * @dev Sets a new claimer during updates * @param _address Address of the new claimer */ function setNewClaimer( address _address ) public onlyOwner { } /** * @dev Sets new manager */ function switchClaimerAndRemoveOldOne() external onlyOwner { } /** * @dev Sets a wallet as customer service to perform emergency removal of wrong, abused, squatted tweedentities (due, for example, to hacking of the Twitter account) * @param _address The customer service wallet * @param _status The status (true is set, false is unset) */ function setCustomerService( address _address, bool _status ) public onlyOwner { } //modifiers modifier onlyClaimer() { } modifier onlyCustomerService() { } modifier whenStoreSet( uint _appId ) { } // internal getters function __getStore( uint _appId ) internal constant returns (ITweedentityStore) { } // helpers function isAddressUpgradable( ITweedentityStore _store, address _address ) internal constant returns (bool) { } function isUpgradable( ITweedentityStore _store, address _address, string _uid ) internal constant returns (bool) { } // getters /** * @dev Gets the app-id associated to a nickname * @param _appNickname The nickname of a configured app */ function getAppId( string _appNickname ) external constant returns (uint) { } /** * @dev Allows other contracts to check if a store is set * @param _appNickname The nickname of a configured app */ function isStoreSet( string _appNickname ) public constant returns (bool){ } /** * @dev Return a numeric code about the upgradability of a couple wallet-uid in a certain app * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function getUpgradability( uint _appId, address _address, string _uid ) external constant returns (uint) { } /** * @dev Returns the address of a store * @param _appNickname The app nickname */ function getStoreAddress( string _appNickname ) external constant returns (address) { } /** * @dev Returns the address of any customerService account */ function getCustomerServiceAddress() external constant returns (address[]) { } // primary methods /** * @dev Sets a new identity * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function setIdentity( uint _appId, address _address, string _uid ) external onlyClaimer whenStoreSet(_appId) whenNotPaused { } /** * @dev Unsets an existent identity * @param _appId The id of the app * @param _address The address of the wallet */ function unsetIdentity( uint _appId, address _address ) external onlyCustomerService whenStoreSet(_appId) whenNotPaused { } /** * @dev Allow the sender to unset its existent identity * @param _appId The id of the app */ function unsetMyIdentity( uint _appId ) external whenStoreSet(_appId) whenNotPaused { } /** * @dev Update the minimum time before allowing a wallet to update its data * @param _newMinimumTime The new minimum time in seconds */ function changeMinimumTimeBeforeUpdate( uint _newMinimumTime ) external onlyOwner { } // private methods function __stringToUint( string s ) internal pure returns (uint result) { } function __uintToBytes(uint x) internal pure returns (bytes b) { } }
_store.getAppNickname()==_appNickname32
292,287
_store.getAppNickname()==_appNickname32
null
interface ITweedentityStore { function isUpgradable(address _address, string _uid) public constant returns (bool); function setIdentity(address _address, string _uid) external; function unsetIdentity(address _address) external; function getAppNickname() external constant returns (bytes32); function getAppId() external constant returns (uint); function getAddressLastUpdate(address _address) external constant returns (uint); function isUid(string _uid) public pure returns (bool); } /** * @title TweedentityManager * @author Francesco Sullo <[email protected]> * @dev Sets and removes tweedentities in the store, * adding more logic to the simple logic of the store */ contract TweedentityManager is Pausable, HasNoEther { string public version = "1.3.0"; struct Store { ITweedentityStore store; address addr; } mapping(uint => Store) private __stores; mapping(uint => bytes32) public appNicknames32; mapping(uint => string) public appNicknames; mapping(string => uint) private __appIds; address public claimer; address public newClaimer; mapping(address => bool) public customerService; address[] private __customerServiceAddress; uint public upgradable = 0; uint public notUpgradableInStore = 1; uint public addressNotUpgradable = 2; uint public minimumTimeBeforeUpdate = 1 hours; // events event IdentityNotUpgradable( string appNickname, address indexed addr, string uid ); // config /** * @dev Sets a store to be used by the manager * @param _appNickname The nickname of the app for which the store's been configured * @param _address The address of the store */ function setAStore( string _appNickname, address _address ) public onlyOwner { require(bytes(_appNickname).length > 0); bytes32 _appNickname32 = keccak256(_appNickname); require(_address != address(0)); ITweedentityStore _store = ITweedentityStore(_address); require(_store.getAppNickname() == _appNickname32); uint _appId = _store.getAppId(); require(<FILL_ME>) appNicknames32[_appId] = _appNickname32; appNicknames[_appId] = _appNickname; __appIds[_appNickname] = _appId; __stores[_appId] = Store( ITweedentityStore(_address), _address ); } /** * @dev Sets the claimer which will verify the ownership and call to set a tweedentity * @param _address Address of the claimer */ function setClaimer( address _address ) public onlyOwner { } /** * @dev Sets a new claimer during updates * @param _address Address of the new claimer */ function setNewClaimer( address _address ) public onlyOwner { } /** * @dev Sets new manager */ function switchClaimerAndRemoveOldOne() external onlyOwner { } /** * @dev Sets a wallet as customer service to perform emergency removal of wrong, abused, squatted tweedentities (due, for example, to hacking of the Twitter account) * @param _address The customer service wallet * @param _status The status (true is set, false is unset) */ function setCustomerService( address _address, bool _status ) public onlyOwner { } //modifiers modifier onlyClaimer() { } modifier onlyCustomerService() { } modifier whenStoreSet( uint _appId ) { } // internal getters function __getStore( uint _appId ) internal constant returns (ITweedentityStore) { } // helpers function isAddressUpgradable( ITweedentityStore _store, address _address ) internal constant returns (bool) { } function isUpgradable( ITweedentityStore _store, address _address, string _uid ) internal constant returns (bool) { } // getters /** * @dev Gets the app-id associated to a nickname * @param _appNickname The nickname of a configured app */ function getAppId( string _appNickname ) external constant returns (uint) { } /** * @dev Allows other contracts to check if a store is set * @param _appNickname The nickname of a configured app */ function isStoreSet( string _appNickname ) public constant returns (bool){ } /** * @dev Return a numeric code about the upgradability of a couple wallet-uid in a certain app * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function getUpgradability( uint _appId, address _address, string _uid ) external constant returns (uint) { } /** * @dev Returns the address of a store * @param _appNickname The app nickname */ function getStoreAddress( string _appNickname ) external constant returns (address) { } /** * @dev Returns the address of any customerService account */ function getCustomerServiceAddress() external constant returns (address[]) { } // primary methods /** * @dev Sets a new identity * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function setIdentity( uint _appId, address _address, string _uid ) external onlyClaimer whenStoreSet(_appId) whenNotPaused { } /** * @dev Unsets an existent identity * @param _appId The id of the app * @param _address The address of the wallet */ function unsetIdentity( uint _appId, address _address ) external onlyCustomerService whenStoreSet(_appId) whenNotPaused { } /** * @dev Allow the sender to unset its existent identity * @param _appId The id of the app */ function unsetMyIdentity( uint _appId ) external whenStoreSet(_appId) whenNotPaused { } /** * @dev Update the minimum time before allowing a wallet to update its data * @param _newMinimumTime The new minimum time in seconds */ function changeMinimumTimeBeforeUpdate( uint _newMinimumTime ) external onlyOwner { } // private methods function __stringToUint( string s ) internal pure returns (uint result) { } function __uintToBytes(uint x) internal pure returns (bytes b) { } }
appNicknames32[_appId]==0x0
292,287
appNicknames32[_appId]==0x0
null
interface ITweedentityStore { function isUpgradable(address _address, string _uid) public constant returns (bool); function setIdentity(address _address, string _uid) external; function unsetIdentity(address _address) external; function getAppNickname() external constant returns (bytes32); function getAppId() external constant returns (uint); function getAddressLastUpdate(address _address) external constant returns (uint); function isUid(string _uid) public pure returns (bool); } /** * @title TweedentityManager * @author Francesco Sullo <[email protected]> * @dev Sets and removes tweedentities in the store, * adding more logic to the simple logic of the store */ contract TweedentityManager is Pausable, HasNoEther { string public version = "1.3.0"; struct Store { ITweedentityStore store; address addr; } mapping(uint => Store) private __stores; mapping(uint => bytes32) public appNicknames32; mapping(uint => string) public appNicknames; mapping(string => uint) private __appIds; address public claimer; address public newClaimer; mapping(address => bool) public customerService; address[] private __customerServiceAddress; uint public upgradable = 0; uint public notUpgradableInStore = 1; uint public addressNotUpgradable = 2; uint public minimumTimeBeforeUpdate = 1 hours; // events event IdentityNotUpgradable( string appNickname, address indexed addr, string uid ); // config /** * @dev Sets a store to be used by the manager * @param _appNickname The nickname of the app for which the store's been configured * @param _address The address of the store */ function setAStore( string _appNickname, address _address ) public onlyOwner { } /** * @dev Sets the claimer which will verify the ownership and call to set a tweedentity * @param _address Address of the claimer */ function setClaimer( address _address ) public onlyOwner { } /** * @dev Sets a new claimer during updates * @param _address Address of the new claimer */ function setNewClaimer( address _address ) public onlyOwner { } /** * @dev Sets new manager */ function switchClaimerAndRemoveOldOne() external onlyOwner { } /** * @dev Sets a wallet as customer service to perform emergency removal of wrong, abused, squatted tweedentities (due, for example, to hacking of the Twitter account) * @param _address The customer service wallet * @param _status The status (true is set, false is unset) */ function setCustomerService( address _address, bool _status ) public onlyOwner { } //modifiers modifier onlyClaimer() { } modifier onlyCustomerService() { } modifier whenStoreSet( uint _appId ) { require(<FILL_ME>) _; } // internal getters function __getStore( uint _appId ) internal constant returns (ITweedentityStore) { } // helpers function isAddressUpgradable( ITweedentityStore _store, address _address ) internal constant returns (bool) { } function isUpgradable( ITweedentityStore _store, address _address, string _uid ) internal constant returns (bool) { } // getters /** * @dev Gets the app-id associated to a nickname * @param _appNickname The nickname of a configured app */ function getAppId( string _appNickname ) external constant returns (uint) { } /** * @dev Allows other contracts to check if a store is set * @param _appNickname The nickname of a configured app */ function isStoreSet( string _appNickname ) public constant returns (bool){ } /** * @dev Return a numeric code about the upgradability of a couple wallet-uid in a certain app * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function getUpgradability( uint _appId, address _address, string _uid ) external constant returns (uint) { } /** * @dev Returns the address of a store * @param _appNickname The app nickname */ function getStoreAddress( string _appNickname ) external constant returns (address) { } /** * @dev Returns the address of any customerService account */ function getCustomerServiceAddress() external constant returns (address[]) { } // primary methods /** * @dev Sets a new identity * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function setIdentity( uint _appId, address _address, string _uid ) external onlyClaimer whenStoreSet(_appId) whenNotPaused { } /** * @dev Unsets an existent identity * @param _appId The id of the app * @param _address The address of the wallet */ function unsetIdentity( uint _appId, address _address ) external onlyCustomerService whenStoreSet(_appId) whenNotPaused { } /** * @dev Allow the sender to unset its existent identity * @param _appId The id of the app */ function unsetMyIdentity( uint _appId ) external whenStoreSet(_appId) whenNotPaused { } /** * @dev Update the minimum time before allowing a wallet to update its data * @param _newMinimumTime The new minimum time in seconds */ function changeMinimumTimeBeforeUpdate( uint _newMinimumTime ) external onlyOwner { } // private methods function __stringToUint( string s ) internal pure returns (uint result) { } function __uintToBytes(uint x) internal pure returns (bytes b) { } }
appNicknames32[_appId]!=0x0
292,287
appNicknames32[_appId]!=0x0
null
interface ITweedentityStore { function isUpgradable(address _address, string _uid) public constant returns (bool); function setIdentity(address _address, string _uid) external; function unsetIdentity(address _address) external; function getAppNickname() external constant returns (bytes32); function getAppId() external constant returns (uint); function getAddressLastUpdate(address _address) external constant returns (uint); function isUid(string _uid) public pure returns (bool); } /** * @title TweedentityManager * @author Francesco Sullo <[email protected]> * @dev Sets and removes tweedentities in the store, * adding more logic to the simple logic of the store */ contract TweedentityManager is Pausable, HasNoEther { string public version = "1.3.0"; struct Store { ITweedentityStore store; address addr; } mapping(uint => Store) private __stores; mapping(uint => bytes32) public appNicknames32; mapping(uint => string) public appNicknames; mapping(string => uint) private __appIds; address public claimer; address public newClaimer; mapping(address => bool) public customerService; address[] private __customerServiceAddress; uint public upgradable = 0; uint public notUpgradableInStore = 1; uint public addressNotUpgradable = 2; uint public minimumTimeBeforeUpdate = 1 hours; // events event IdentityNotUpgradable( string appNickname, address indexed addr, string uid ); // config /** * @dev Sets a store to be used by the manager * @param _appNickname The nickname of the app for which the store's been configured * @param _address The address of the store */ function setAStore( string _appNickname, address _address ) public onlyOwner { } /** * @dev Sets the claimer which will verify the ownership and call to set a tweedentity * @param _address Address of the claimer */ function setClaimer( address _address ) public onlyOwner { } /** * @dev Sets a new claimer during updates * @param _address Address of the new claimer */ function setNewClaimer( address _address ) public onlyOwner { } /** * @dev Sets new manager */ function switchClaimerAndRemoveOldOne() external onlyOwner { } /** * @dev Sets a wallet as customer service to perform emergency removal of wrong, abused, squatted tweedentities (due, for example, to hacking of the Twitter account) * @param _address The customer service wallet * @param _status The status (true is set, false is unset) */ function setCustomerService( address _address, bool _status ) public onlyOwner { } //modifiers modifier onlyClaimer() { } modifier onlyCustomerService() { } modifier whenStoreSet( uint _appId ) { } // internal getters function __getStore( uint _appId ) internal constant returns (ITweedentityStore) { } // helpers function isAddressUpgradable( ITweedentityStore _store, address _address ) internal constant returns (bool) { } function isUpgradable( ITweedentityStore _store, address _address, string _uid ) internal constant returns (bool) { } // getters /** * @dev Gets the app-id associated to a nickname * @param _appNickname The nickname of a configured app */ function getAppId( string _appNickname ) external constant returns (uint) { } /** * @dev Allows other contracts to check if a store is set * @param _appNickname The nickname of a configured app */ function isStoreSet( string _appNickname ) public constant returns (bool){ } /** * @dev Return a numeric code about the upgradability of a couple wallet-uid in a certain app * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function getUpgradability( uint _appId, address _address, string _uid ) external constant returns (uint) { } /** * @dev Returns the address of a store * @param _appNickname The app nickname */ function getStoreAddress( string _appNickname ) external constant returns (address) { } /** * @dev Returns the address of any customerService account */ function getCustomerServiceAddress() external constant returns (address[]) { } // primary methods /** * @dev Sets a new identity * @param _appId The id of the app * @param _address The address of the wallet * @param _uid The user-id */ function setIdentity( uint _appId, address _address, string _uid ) external onlyClaimer whenStoreSet(_appId) whenNotPaused { require(_address != address(0)); ITweedentityStore _store = __getStore(_appId); require(<FILL_ME>) if (isUpgradable(_store, _address, _uid)) { _store.setIdentity(_address, _uid); } else { IdentityNotUpgradable(appNicknames[_appId], _address, _uid); } } /** * @dev Unsets an existent identity * @param _appId The id of the app * @param _address The address of the wallet */ function unsetIdentity( uint _appId, address _address ) external onlyCustomerService whenStoreSet(_appId) whenNotPaused { } /** * @dev Allow the sender to unset its existent identity * @param _appId The id of the app */ function unsetMyIdentity( uint _appId ) external whenStoreSet(_appId) whenNotPaused { } /** * @dev Update the minimum time before allowing a wallet to update its data * @param _newMinimumTime The new minimum time in seconds */ function changeMinimumTimeBeforeUpdate( uint _newMinimumTime ) external onlyOwner { } // private methods function __stringToUint( string s ) internal pure returns (uint result) { } function __uintToBytes(uint x) internal pure returns (bytes b) { } }
_store.isUid(_uid)
292,287
_store.isUid(_uid)
null
/* ==================================================================== */ /* Copyright (c) 2018 The CryptoRacing Project. All rights reserved. /* /* The first idle car race game of blockchain /* ==================================================================== */ pragma solidity ^0.4.20; interface ERC20 { function totalSupply() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spender) public view returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } // RaceCoin - Crypto Idle Raceing Game // https://cryptoracing.online contract AccessAdmin { bool public isPaused = false; address public addrAdmin; event AdminTransferred(address indexed preAdmin, address indexed newAdmin); function AccessAdmin() public { } modifier onlyAdmin() { } modifier whenNotPaused() { } modifier whenPaused { } function setAdmin(address _newAdmin) external onlyAdmin { } function doPause() external onlyAdmin whenNotPaused { } function doUnpause() external onlyAdmin whenPaused { } } interface IRaceCoin { function addTotalEtherPool(uint256 amount) external; function addPlayerToList(address player) external; function increasePlayersAttribute(address player, uint16[13] param) external; function reducePlayersAttribute(address player, uint16[13] param) external; } contract RaceCoin is ERC20, AccessAdmin, IRaceCoin { using SafeMath for uint256; string public constant name = "Race Coin"; string public constant symbol = "Coin"; uint8 public constant decimals = 0; uint256 private roughSupply; uint256 public totalRaceCoinProduction; //Daily dividend ratio uint256 public bonusDivPercent = 20; //Recommendation ratio uint256 constant refererPercent = 5; address[] public playerList; //Verifying whether duplication is repeated // mapping(address => uint256) public isProduction; uint256 public totalEtherPool; // Eth dividends to be split between players' race coin production uint256[] private totalRaceCoinProductionSnapshots; // The total race coin production for each prior day past uint256[] private allocatedRaceCoinSnapshots; // The amount of EHT that can be allocated daily uint256[] private totalRaceCoinSnapshots; // The total race coin for each prior day past uint256 public nextSnapshotTime; // Balances for each player mapping(address => uint256) private ethBalance; mapping(address => uint256) private raceCoinBalance; mapping(address => uint256) private refererDivsBalance; mapping(address => uint256) private productionBaseValue; //Player production base value mapping(address => uint256) private productionMultiplier; //Player production multiplier mapping(address => uint256) private attackBaseValue; //Player attack base value mapping(address => uint256) private attackMultiplier; //Player attack multiplier mapping(address => uint256) private attackPower; //Player attack Power mapping(address => uint256) private defendBaseValue; //Player defend base value mapping(address => uint256) private defendMultiplier; //Player defend multiplier mapping(address => uint256) private defendPower; //Player defend Power mapping(address => uint256) private plunderBaseValue; //Player plunder base value mapping(address => uint256) private plunderMultiplier; //Player plunder multiplier mapping(address => uint256) private plunderPower; //Player plunder Power mapping(address => mapping(uint256 => uint256)) private raceCoinProductionSnapshots; // Store player's race coin production for given day (snapshot) mapping(address => mapping(uint256 => bool)) private raceCoinProductionZeroedSnapshots; // This isn't great but we need know difference between 0 production and an unused/inactive day. mapping(address => mapping(uint256 => uint256)) private raceCoinSnapshots;// Store player's race coin for given day (snapshot) mapping(address => uint256) private lastRaceCoinSaveTime; // Seconds (last time player claimed their produced race coin) mapping(address => uint256) public lastRaceCoinProductionUpdate; // Days (last snapshot player updated their production) mapping(address => uint256) private lastRaceCoinFundClaim; // Days (snapshot number) mapping(address => uint256) private battleCooldown; // If user attacks they cannot attack again for short time // Computational correlation // Mapping of approved ERC20 transfers (by player) mapping(address => mapping(address => uint256)) private allowed; event ReferalGain(address referal, address player, uint256 amount); event PlayerAttacked(address attacker, address target, bool success, uint256 raceCoinPlunder); /// @dev Trust contract mapping (address => bool) actionContracts; function setActionContract(address _actionAddr, bool _useful) external onlyAdmin { } function getActionContract(address _actionAddr) external view onlyAdmin returns(bool) { } function RaceCoin() public { } function() external payable { } function beginWork(uint256 firstDivsTime) external onlyAdmin { } // We will adjust to achieve a balance. function adjustDailyDividends(uint256 newBonusPercent) external onlyAdmin whenNotPaused { } // Stored race coin (rough supply as it ignores earned/unclaimed RaceCoin) function totalSupply() public view returns(uint256) { } function balanceOf(address player) public view returns(uint256) { } function balanceOfUnclaimedRaceCoin(address player) internal view returns (uint256) { } function getRaceCoinProduction(address player) public view returns (uint256){ } function etherBalanceOf(address player) public view returns(uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function transferFrom(address player, address recipient, uint256 amount) public returns (bool) { } function approve(address approvee, uint256 amount) public returns (bool){ } function allowance(address player, address approvee) public view returns(uint256){ } function addPlayerToList(address player) external{ require(<FILL_ME>) require(player != address(0)); bool b = false; //Judge whether or not to repeat for (uint256 i = 0; i < playerList.length; i++) { if(playerList[i] == player){ b = true; break; } } if(!b){ playerList.push(player); } } function getPlayerList() external view returns ( address[] ){ } function updatePlayersRaceCoin(address player) internal { } //Increase attribute function increasePlayersAttribute(address player, uint16[13] param) external{ } //Reduce attribute function reducePlayersAttribute(address player, uint16[13] param) external{ } function attackPlayer(address player,address target) external { } function getPlayersBattleStats(address player) external view returns (uint256, uint256, uint256, uint256){ } function getPlayersAttributesInt(address player) external view returns (uint256, uint256, uint256, uint256){ } function getPlayersAttributesMult(address player) external view returns (uint256, uint256, uint256, uint256){ } function withdrawEther(uint256 amount) external { } function getBalance() external view returns(uint256) { } function addTotalEtherPool(uint256 amount) external{ } // To display function getGameInfo(address player) external view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256){ } function claimRaceCoinDividends(address referer, uint256 startSnapshot, uint256 endSnapShot) external { } // To display function viewUnclaimedRaceCoinDividends(address player) external view returns (uint256, uint256, uint256) { } function getRefererDivsBalance(address player) external view returns (uint256){ } // Allocate divs for the day (00:00 cron job) function snapshotDailyRaceCoinFunding() external onlyAdmin whenNotPaused { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
actionContracts[msg.sender]
292,299
actionContracts[msg.sender]
null
/* ==================================================================== */ /* Copyright (c) 2018 The CryptoRacing Project. All rights reserved. /* /* The first idle car race game of blockchain /* ==================================================================== */ pragma solidity ^0.4.20; interface ERC20 { function totalSupply() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spender) public view returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } // RaceCoin - Crypto Idle Raceing Game // https://cryptoracing.online contract AccessAdmin { bool public isPaused = false; address public addrAdmin; event AdminTransferred(address indexed preAdmin, address indexed newAdmin); function AccessAdmin() public { } modifier onlyAdmin() { } modifier whenNotPaused() { } modifier whenPaused { } function setAdmin(address _newAdmin) external onlyAdmin { } function doPause() external onlyAdmin whenNotPaused { } function doUnpause() external onlyAdmin whenPaused { } } interface IRaceCoin { function addTotalEtherPool(uint256 amount) external; function addPlayerToList(address player) external; function increasePlayersAttribute(address player, uint16[13] param) external; function reducePlayersAttribute(address player, uint16[13] param) external; } contract RaceCoin is ERC20, AccessAdmin, IRaceCoin { using SafeMath for uint256; string public constant name = "Race Coin"; string public constant symbol = "Coin"; uint8 public constant decimals = 0; uint256 private roughSupply; uint256 public totalRaceCoinProduction; //Daily dividend ratio uint256 public bonusDivPercent = 20; //Recommendation ratio uint256 constant refererPercent = 5; address[] public playerList; //Verifying whether duplication is repeated // mapping(address => uint256) public isProduction; uint256 public totalEtherPool; // Eth dividends to be split between players' race coin production uint256[] private totalRaceCoinProductionSnapshots; // The total race coin production for each prior day past uint256[] private allocatedRaceCoinSnapshots; // The amount of EHT that can be allocated daily uint256[] private totalRaceCoinSnapshots; // The total race coin for each prior day past uint256 public nextSnapshotTime; // Balances for each player mapping(address => uint256) private ethBalance; mapping(address => uint256) private raceCoinBalance; mapping(address => uint256) private refererDivsBalance; mapping(address => uint256) private productionBaseValue; //Player production base value mapping(address => uint256) private productionMultiplier; //Player production multiplier mapping(address => uint256) private attackBaseValue; //Player attack base value mapping(address => uint256) private attackMultiplier; //Player attack multiplier mapping(address => uint256) private attackPower; //Player attack Power mapping(address => uint256) private defendBaseValue; //Player defend base value mapping(address => uint256) private defendMultiplier; //Player defend multiplier mapping(address => uint256) private defendPower; //Player defend Power mapping(address => uint256) private plunderBaseValue; //Player plunder base value mapping(address => uint256) private plunderMultiplier; //Player plunder multiplier mapping(address => uint256) private plunderPower; //Player plunder Power mapping(address => mapping(uint256 => uint256)) private raceCoinProductionSnapshots; // Store player's race coin production for given day (snapshot) mapping(address => mapping(uint256 => bool)) private raceCoinProductionZeroedSnapshots; // This isn't great but we need know difference between 0 production and an unused/inactive day. mapping(address => mapping(uint256 => uint256)) private raceCoinSnapshots;// Store player's race coin for given day (snapshot) mapping(address => uint256) private lastRaceCoinSaveTime; // Seconds (last time player claimed their produced race coin) mapping(address => uint256) public lastRaceCoinProductionUpdate; // Days (last snapshot player updated their production) mapping(address => uint256) private lastRaceCoinFundClaim; // Days (snapshot number) mapping(address => uint256) private battleCooldown; // If user attacks they cannot attack again for short time // Computational correlation // Mapping of approved ERC20 transfers (by player) mapping(address => mapping(address => uint256)) private allowed; event ReferalGain(address referal, address player, uint256 amount); event PlayerAttacked(address attacker, address target, bool success, uint256 raceCoinPlunder); /// @dev Trust contract mapping (address => bool) actionContracts; function setActionContract(address _actionAddr, bool _useful) external onlyAdmin { } function getActionContract(address _actionAddr) external view onlyAdmin returns(bool) { } function RaceCoin() public { } function() external payable { } function beginWork(uint256 firstDivsTime) external onlyAdmin { } // We will adjust to achieve a balance. function adjustDailyDividends(uint256 newBonusPercent) external onlyAdmin whenNotPaused { } // Stored race coin (rough supply as it ignores earned/unclaimed RaceCoin) function totalSupply() public view returns(uint256) { } function balanceOf(address player) public view returns(uint256) { } function balanceOfUnclaimedRaceCoin(address player) internal view returns (uint256) { } function getRaceCoinProduction(address player) public view returns (uint256){ } function etherBalanceOf(address player) public view returns(uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function transferFrom(address player, address recipient, uint256 amount) public returns (bool) { } function approve(address approvee, uint256 amount) public returns (bool){ } function allowance(address player, address approvee) public view returns(uint256){ } function addPlayerToList(address player) external{ } function getPlayerList() external view returns ( address[] ){ } function updatePlayersRaceCoin(address player) internal { } //Increase attribute function increasePlayersAttribute(address player, uint16[13] param) external{ } //Reduce attribute function reducePlayersAttribute(address player, uint16[13] param) external{ } function attackPlayer(address player,address target) external { require(<FILL_ME>) require(target != player); updatePlayersRaceCoin(target); require(balanceOf(target) > 0); uint256 attackerAttackPower = attackPower[player]; uint256 attackerplunderPower = plunderPower[player]; uint256 defenderDefendPower = defendPower[target]; if (battleCooldown[target] > block.timestamp) { // When on battle cooldown, the defense is reduced by 50% defenderDefendPower = defenderDefendPower.div(2); } if (attackerAttackPower > defenderDefendPower) { battleCooldown[player] = block.timestamp + 30 minutes; if (balanceOf(target) > attackerplunderPower) { uint256 unclaimedRaceCoin = balanceOfUnclaimedRaceCoin(target); if (attackerplunderPower > unclaimedRaceCoin) { uint256 raceCoinDecrease = attackerplunderPower - unclaimedRaceCoin; raceCoinBalance[target] -= raceCoinDecrease; roughSupply -= raceCoinDecrease; } else { uint256 raceCoinGain = unclaimedRaceCoin - attackerplunderPower; raceCoinBalance[target] += raceCoinGain; roughSupply += raceCoinGain; } raceCoinBalance[player] += attackerplunderPower; emit PlayerAttacked(player, target, true, attackerplunderPower); } else { emit PlayerAttacked(player, target, true, balanceOf(target)); raceCoinBalance[player] += balanceOf(target); raceCoinBalance[target] = 0; } lastRaceCoinSaveTime[target] = block.timestamp; lastRaceCoinSaveTime[player] = block.timestamp; } else { battleCooldown[player] = block.timestamp + 10 minutes; emit PlayerAttacked(player, target, false, 0); } } function getPlayersBattleStats(address player) external view returns (uint256, uint256, uint256, uint256){ } function getPlayersAttributesInt(address player) external view returns (uint256, uint256, uint256, uint256){ } function getPlayersAttributesMult(address player) external view returns (uint256, uint256, uint256, uint256){ } function withdrawEther(uint256 amount) external { } function getBalance() external view returns(uint256) { } function addTotalEtherPool(uint256 amount) external{ } // To display function getGameInfo(address player) external view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256){ } function claimRaceCoinDividends(address referer, uint256 startSnapshot, uint256 endSnapShot) external { } // To display function viewUnclaimedRaceCoinDividends(address player) external view returns (uint256, uint256, uint256) { } function getRefererDivsBalance(address player) external view returns (uint256){ } // Allocate divs for the day (00:00 cron job) function snapshotDailyRaceCoinFunding() external onlyAdmin whenNotPaused { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
battleCooldown[player]<block.timestamp
292,299
battleCooldown[player]<block.timestamp
null
/* ==================================================================== */ /* Copyright (c) 2018 The CryptoRacing Project. All rights reserved. /* /* The first idle car race game of blockchain /* ==================================================================== */ pragma solidity ^0.4.20; interface ERC20 { function totalSupply() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spender) public view returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } // RaceCoin - Crypto Idle Raceing Game // https://cryptoracing.online contract AccessAdmin { bool public isPaused = false; address public addrAdmin; event AdminTransferred(address indexed preAdmin, address indexed newAdmin); function AccessAdmin() public { } modifier onlyAdmin() { } modifier whenNotPaused() { } modifier whenPaused { } function setAdmin(address _newAdmin) external onlyAdmin { } function doPause() external onlyAdmin whenNotPaused { } function doUnpause() external onlyAdmin whenPaused { } } interface IRaceCoin { function addTotalEtherPool(uint256 amount) external; function addPlayerToList(address player) external; function increasePlayersAttribute(address player, uint16[13] param) external; function reducePlayersAttribute(address player, uint16[13] param) external; } contract RaceCoin is ERC20, AccessAdmin, IRaceCoin { using SafeMath for uint256; string public constant name = "Race Coin"; string public constant symbol = "Coin"; uint8 public constant decimals = 0; uint256 private roughSupply; uint256 public totalRaceCoinProduction; //Daily dividend ratio uint256 public bonusDivPercent = 20; //Recommendation ratio uint256 constant refererPercent = 5; address[] public playerList; //Verifying whether duplication is repeated // mapping(address => uint256) public isProduction; uint256 public totalEtherPool; // Eth dividends to be split between players' race coin production uint256[] private totalRaceCoinProductionSnapshots; // The total race coin production for each prior day past uint256[] private allocatedRaceCoinSnapshots; // The amount of EHT that can be allocated daily uint256[] private totalRaceCoinSnapshots; // The total race coin for each prior day past uint256 public nextSnapshotTime; // Balances for each player mapping(address => uint256) private ethBalance; mapping(address => uint256) private raceCoinBalance; mapping(address => uint256) private refererDivsBalance; mapping(address => uint256) private productionBaseValue; //Player production base value mapping(address => uint256) private productionMultiplier; //Player production multiplier mapping(address => uint256) private attackBaseValue; //Player attack base value mapping(address => uint256) private attackMultiplier; //Player attack multiplier mapping(address => uint256) private attackPower; //Player attack Power mapping(address => uint256) private defendBaseValue; //Player defend base value mapping(address => uint256) private defendMultiplier; //Player defend multiplier mapping(address => uint256) private defendPower; //Player defend Power mapping(address => uint256) private plunderBaseValue; //Player plunder base value mapping(address => uint256) private plunderMultiplier; //Player plunder multiplier mapping(address => uint256) private plunderPower; //Player plunder Power mapping(address => mapping(uint256 => uint256)) private raceCoinProductionSnapshots; // Store player's race coin production for given day (snapshot) mapping(address => mapping(uint256 => bool)) private raceCoinProductionZeroedSnapshots; // This isn't great but we need know difference between 0 production and an unused/inactive day. mapping(address => mapping(uint256 => uint256)) private raceCoinSnapshots;// Store player's race coin for given day (snapshot) mapping(address => uint256) private lastRaceCoinSaveTime; // Seconds (last time player claimed their produced race coin) mapping(address => uint256) public lastRaceCoinProductionUpdate; // Days (last snapshot player updated their production) mapping(address => uint256) private lastRaceCoinFundClaim; // Days (snapshot number) mapping(address => uint256) private battleCooldown; // If user attacks they cannot attack again for short time // Computational correlation // Mapping of approved ERC20 transfers (by player) mapping(address => mapping(address => uint256)) private allowed; event ReferalGain(address referal, address player, uint256 amount); event PlayerAttacked(address attacker, address target, bool success, uint256 raceCoinPlunder); /// @dev Trust contract mapping (address => bool) actionContracts; function setActionContract(address _actionAddr, bool _useful) external onlyAdmin { } function getActionContract(address _actionAddr) external view onlyAdmin returns(bool) { } function RaceCoin() public { } function() external payable { } function beginWork(uint256 firstDivsTime) external onlyAdmin { } // We will adjust to achieve a balance. function adjustDailyDividends(uint256 newBonusPercent) external onlyAdmin whenNotPaused { } // Stored race coin (rough supply as it ignores earned/unclaimed RaceCoin) function totalSupply() public view returns(uint256) { } function balanceOf(address player) public view returns(uint256) { } function balanceOfUnclaimedRaceCoin(address player) internal view returns (uint256) { } function getRaceCoinProduction(address player) public view returns (uint256){ } function etherBalanceOf(address player) public view returns(uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function transferFrom(address player, address recipient, uint256 amount) public returns (bool) { } function approve(address approvee, uint256 amount) public returns (bool){ } function allowance(address player, address approvee) public view returns(uint256){ } function addPlayerToList(address player) external{ } function getPlayerList() external view returns ( address[] ){ } function updatePlayersRaceCoin(address player) internal { } //Increase attribute function increasePlayersAttribute(address player, uint16[13] param) external{ } //Reduce attribute function reducePlayersAttribute(address player, uint16[13] param) external{ } function attackPlayer(address player,address target) external { require(battleCooldown[player] < block.timestamp); require(target != player); updatePlayersRaceCoin(target); require(<FILL_ME>) uint256 attackerAttackPower = attackPower[player]; uint256 attackerplunderPower = plunderPower[player]; uint256 defenderDefendPower = defendPower[target]; if (battleCooldown[target] > block.timestamp) { // When on battle cooldown, the defense is reduced by 50% defenderDefendPower = defenderDefendPower.div(2); } if (attackerAttackPower > defenderDefendPower) { battleCooldown[player] = block.timestamp + 30 minutes; if (balanceOf(target) > attackerplunderPower) { uint256 unclaimedRaceCoin = balanceOfUnclaimedRaceCoin(target); if (attackerplunderPower > unclaimedRaceCoin) { uint256 raceCoinDecrease = attackerplunderPower - unclaimedRaceCoin; raceCoinBalance[target] -= raceCoinDecrease; roughSupply -= raceCoinDecrease; } else { uint256 raceCoinGain = unclaimedRaceCoin - attackerplunderPower; raceCoinBalance[target] += raceCoinGain; roughSupply += raceCoinGain; } raceCoinBalance[player] += attackerplunderPower; emit PlayerAttacked(player, target, true, attackerplunderPower); } else { emit PlayerAttacked(player, target, true, balanceOf(target)); raceCoinBalance[player] += balanceOf(target); raceCoinBalance[target] = 0; } lastRaceCoinSaveTime[target] = block.timestamp; lastRaceCoinSaveTime[player] = block.timestamp; } else { battleCooldown[player] = block.timestamp + 10 minutes; emit PlayerAttacked(player, target, false, 0); } } function getPlayersBattleStats(address player) external view returns (uint256, uint256, uint256, uint256){ } function getPlayersAttributesInt(address player) external view returns (uint256, uint256, uint256, uint256){ } function getPlayersAttributesMult(address player) external view returns (uint256, uint256, uint256, uint256){ } function withdrawEther(uint256 amount) external { } function getBalance() external view returns(uint256) { } function addTotalEtherPool(uint256 amount) external{ } // To display function getGameInfo(address player) external view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256){ } function claimRaceCoinDividends(address referer, uint256 startSnapshot, uint256 endSnapShot) external { } // To display function viewUnclaimedRaceCoinDividends(address player) external view returns (uint256, uint256, uint256) { } function getRefererDivsBalance(address player) external view returns (uint256){ } // Allocate divs for the day (00:00 cron job) function snapshotDailyRaceCoinFunding() external onlyAdmin whenNotPaused { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
balanceOf(target)>0
292,299
balanceOf(target)>0
"Sold Out"
pragma solidity 0.8.0; interface OGDoodsContract { function ownerOf(uint256 id) external view returns (address); function balanceOf(address owner) external view returns (uint256); } contract DoodlePets is ERC721, Ownable { uint256 private _totalSupply = 1; uint256 private _maxSupply = 10000; uint256 public price = 0.03 ether; uint256 public txLimit = 10; bool public saleActive = true; mapping(uint256 => bool) private claimedDoods; address private _petowner = 0x09D5b8c6421b171E03bf7Ef31Bec0d2Af7a6bCBb; address private _ogDoodsContract = 0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e; string public baseURI = "ipfs://Qmd8hqejUh85ScGncDo5dJTgErxfohkeTBgaWhQYLcuD74/"; constructor() ERC721("Doodle Pets", "DOODLEPETS") { } function mint(uint256 count) external payable { } function claimFree(uint256[] calldata doodleIDs) external { require(saleActive, "Minting not active"); require(<FILL_ME>) OGDoodsContract doodsContract = OGDoodsContract(_ogDoodsContract); for (uint256 i = 0; i < doodleIDs.length; i++) { require(!claimedDoods[doodleIDs[i]], "Doodle ID Already Claimed"); require(msg.sender == doodsContract.ownerOf(doodleIDs[i]), "You dont own this Doodle"); claimedDoods[doodleIDs[i]] = true; _mint(msg.sender, _totalSupply); _totalSupply++; } } function ownerMint(uint256 count) external onlyOwner { } function toggleSaleState() external onlyOwner { } function setPrice(uint256 newPrice) external onlyOwner { } function setBaseURI(string memory newBaseURI) public onlyOwner { } function _baseURI() internal view override returns (string memory) { } function maxSupply() public view returns (uint256) { } function totalSupply() public view returns (uint256) { } function isDoodleClaimed(uint256 _token) public view returns (bool) { } function getOGDoodsByAddress(address _owner) public view returns(uint256[] memory ownerTokens) { } }
_totalSupply+doodleIDs.length<=_maxSupply,"Sold Out"
292,327
_totalSupply+doodleIDs.length<=_maxSupply
"Doodle ID Already Claimed"
pragma solidity 0.8.0; interface OGDoodsContract { function ownerOf(uint256 id) external view returns (address); function balanceOf(address owner) external view returns (uint256); } contract DoodlePets is ERC721, Ownable { uint256 private _totalSupply = 1; uint256 private _maxSupply = 10000; uint256 public price = 0.03 ether; uint256 public txLimit = 10; bool public saleActive = true; mapping(uint256 => bool) private claimedDoods; address private _petowner = 0x09D5b8c6421b171E03bf7Ef31Bec0d2Af7a6bCBb; address private _ogDoodsContract = 0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e; string public baseURI = "ipfs://Qmd8hqejUh85ScGncDo5dJTgErxfohkeTBgaWhQYLcuD74/"; constructor() ERC721("Doodle Pets", "DOODLEPETS") { } function mint(uint256 count) external payable { } function claimFree(uint256[] calldata doodleIDs) external { require(saleActive, "Minting not active"); require(_totalSupply + doodleIDs.length <= _maxSupply, "Sold Out"); OGDoodsContract doodsContract = OGDoodsContract(_ogDoodsContract); for (uint256 i = 0; i < doodleIDs.length; i++) { require(<FILL_ME>) require(msg.sender == doodsContract.ownerOf(doodleIDs[i]), "You dont own this Doodle"); claimedDoods[doodleIDs[i]] = true; _mint(msg.sender, _totalSupply); _totalSupply++; } } function ownerMint(uint256 count) external onlyOwner { } function toggleSaleState() external onlyOwner { } function setPrice(uint256 newPrice) external onlyOwner { } function setBaseURI(string memory newBaseURI) public onlyOwner { } function _baseURI() internal view override returns (string memory) { } function maxSupply() public view returns (uint256) { } function totalSupply() public view returns (uint256) { } function isDoodleClaimed(uint256 _token) public view returns (bool) { } function getOGDoodsByAddress(address _owner) public view returns(uint256[] memory ownerTokens) { } }
!claimedDoods[doodleIDs[i]],"Doodle ID Already Claimed"
292,327
!claimedDoods[doodleIDs[i]]
"Not in HTLC group"
/* Copyright 2019 Wanchain Foundation. 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. */ // _ _ _ // __ ____ _ _ __ ___| |__ __ _(_)_ __ __| | _____ __ // \ \ /\ / / _` | '_ \ / __| '_ \ / _` | | '_ \@/ _` |/ _ \ \ / / // \ V V / (_| | | | | (__| | | | (_| | | | | | (_| | __/\ V / // \_/\_/ \__,_|_| |_|\___|_| |_|\__,_|_|_| |_|\__,_|\___| \_/ // // pragma solidity 0.4.26; contract QuotaStorage is BasicStorage { /// @dev Math operations with safety checks using SafeMath for uint; struct Quota { /// amount of original token to be received, equals to amount of WAN token to be minted uint debt_receivable; /// amount of WAN token to be burnt uint debt_payable; /// amount of original token has been exchanged to the wanchain uint _debt; /// amount of original token to be received, equals to amount of WAN token to be minted uint asset_receivable; /// amount of WAN token to be burnt uint asset_payable; /// amount of original token has been exchanged to the wanchain uint _asset; /// data is active bool _active; } /// @dev the denominator of deposit rate value uint public constant DENOMINATOR = 10000; /// @dev mapping: tokenId => storemanPk => Quota mapping(uint => mapping(bytes32 => Quota)) quotaMap; /// @dev mapping: storemanPk => tokenIndex => tokenId, tokenIndex:0,1,2,3... mapping(bytes32 => mapping(uint => uint)) storemanTokensMap; /// @dev mapping: storemanPk => token count mapping(bytes32 => uint) storemanTokenCountMap; /// @dev mapping: htlcAddress => exist mapping(address => bool) public htlcGroupMap; /// @dev save deposit oracle address (storeman admin or oracle) address public depositOracleAddress; /// @dev save price oracle address address public priceOracleAddress; /// @dev deposit rate use for deposit amount calculate uint public depositRate; /// @dev deposit token's symbol string public depositTokenSymbol; /// @dev token manger contract address address public tokenManagerAddress; /// @dev oracle address for check other chain's debt clean address public debtOracleAddress; /// @dev limit the minimize value of fast cross chain uint public fastCrossMinValue; modifier onlyHtlc() { require(<FILL_ME>) _; } }
htlcGroupMap[msg.sender],"Not in HTLC group"
292,365
htlcGroupMap[msg.sender]
"Rewards: Balance Changed Since Hash Generated"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ECDSA.sol"; import "./Ownable.sol"; import "./Context.sol"; import "./SafeMath.sol"; import "./Token.sol"; import "./VerifySignature.sol"; contract Rewards is Context, Ownable { using SafeMath for uint256; struct RewardClaim { /* Account Key & Signature */ address accountKey; uint128 gameUuid; uint256 oldBalance; uint256 newBalance; string signature; } // Game UUID > Rewarded mapping (uint128 => uint256) private _gameRewarded; // Account > Running Balance mapping (address => uint256) private _balances; Token _rewardToken; // Total Reward Supply (All Games) uint256 private _totalRewardSupply; // Total Rewarded (All Games) uint256 private _totalRewarded; /** * Event for a Reward Claim */ event RewardClaimed(address indexed receiver, address indexed account, uint256 value); /** * Event for a Reward Withdrawal */ event RewardWithdrawn(address indexed receiver, uint256 value); constructor(address rewardToken, uint256 totalSupply) { } /** * @dev Returns the contract owner. */ function getOwner() external view returns (address) { } /** * Claim Reward via Hash & Signature */ function claimReward(RewardClaim[] memory rewardClaims) public returns (uint256) { // Receiver of Reward Tokens address receiver = _msgSender(); // For transfer at the end uint256 totalReward = 0; for (uint i=0; i<rewardClaims.length; i++) { RewardClaim memory rewardClaim = rewardClaims[i]; bool signatureVerified = VerifySignature.verify( rewardClaim.accountKey, receiver, rewardClaim.gameUuid, rewardClaim.oldBalance, rewardClaim.newBalance, rewardClaim.signature ); // New Balance must be Greater than the Old require( rewardClaim.newBalance > rewardClaim.oldBalance, "Rewards: New Balance must be Greater than Old Balance" ); // Verify that the Signature Matches require( signatureVerified, "Rewards: Signature Invalid" ); // Verify that the balance hasn't changed since the hash was generated. require(<FILL_ME>) // Get Reward (newBalance - oldBalance) uint256 reward = rewardClaim.newBalance.sub(rewardClaim.oldBalance); // Update Total Rewarded _totalRewarded = _totalRewarded.add(reward); // Update Game Rewarded Total _gameRewarded[rewardClaim.gameUuid] = _gameRewarded[rewardClaim.gameUuid].add(reward); // Add to Historical Balances _balances[rewardClaim.accountKey] = _balances[rewardClaim.accountKey].add(reward); // Verify that the new Balance is in expected state require( _balances[rewardClaim.accountKey] == rewardClaim.newBalance, "Rewards: New Balance is not in Expected State" ); // Add to Total Reward (for Transfer at the end) totalReward = totalReward.add(reward); // Emit Success Claimed (for Account & Receiver) emit RewardClaimed(receiver, rewardClaim.accountKey, reward); } // Emit Success (for Receiver) emit RewardWithdrawn(receiver, totalReward); _rewardToken.transfer(receiver, totalReward); return totalReward; } /** * Total Rewards Claimed by Account */ function accountBalance(address accountKey) external view returns (uint256) { } /** * Retrieve Game Rewarded Supply */ function gameRewardedSupply(uint128 gameUuid) external view returns (uint256) { } /** * Retrieve Total Token Reward Supply */ function totalRewardSupply() external view returns (uint256) { } /** * Retrieve Total Tokens Rewarded */ function totalRewarded() external view returns (uint256) { } /** * Retrieve Total Game Remaining Supply */ function totalRemainingSupply() external view returns (uint256) { } /* * Return Tokens back to Owner (useful if a contract upgrade takes place) */ function transferBackToOwner() public onlyOwner returns (uint256) { } }
_balances[rewardClaim.accountKey]==rewardClaim.oldBalance,"Rewards: Balance Changed Since Hash Generated"
292,380
_balances[rewardClaim.accountKey]==rewardClaim.oldBalance
"Rewards: New Balance is not in Expected State"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ECDSA.sol"; import "./Ownable.sol"; import "./Context.sol"; import "./SafeMath.sol"; import "./Token.sol"; import "./VerifySignature.sol"; contract Rewards is Context, Ownable { using SafeMath for uint256; struct RewardClaim { /* Account Key & Signature */ address accountKey; uint128 gameUuid; uint256 oldBalance; uint256 newBalance; string signature; } // Game UUID > Rewarded mapping (uint128 => uint256) private _gameRewarded; // Account > Running Balance mapping (address => uint256) private _balances; Token _rewardToken; // Total Reward Supply (All Games) uint256 private _totalRewardSupply; // Total Rewarded (All Games) uint256 private _totalRewarded; /** * Event for a Reward Claim */ event RewardClaimed(address indexed receiver, address indexed account, uint256 value); /** * Event for a Reward Withdrawal */ event RewardWithdrawn(address indexed receiver, uint256 value); constructor(address rewardToken, uint256 totalSupply) { } /** * @dev Returns the contract owner. */ function getOwner() external view returns (address) { } /** * Claim Reward via Hash & Signature */ function claimReward(RewardClaim[] memory rewardClaims) public returns (uint256) { // Receiver of Reward Tokens address receiver = _msgSender(); // For transfer at the end uint256 totalReward = 0; for (uint i=0; i<rewardClaims.length; i++) { RewardClaim memory rewardClaim = rewardClaims[i]; bool signatureVerified = VerifySignature.verify( rewardClaim.accountKey, receiver, rewardClaim.gameUuid, rewardClaim.oldBalance, rewardClaim.newBalance, rewardClaim.signature ); // New Balance must be Greater than the Old require( rewardClaim.newBalance > rewardClaim.oldBalance, "Rewards: New Balance must be Greater than Old Balance" ); // Verify that the Signature Matches require( signatureVerified, "Rewards: Signature Invalid" ); // Verify that the balance hasn't changed since the hash was generated. require( _balances[rewardClaim.accountKey] == rewardClaim.oldBalance, "Rewards: Balance Changed Since Hash Generated" ); // Get Reward (newBalance - oldBalance) uint256 reward = rewardClaim.newBalance.sub(rewardClaim.oldBalance); // Update Total Rewarded _totalRewarded = _totalRewarded.add(reward); // Update Game Rewarded Total _gameRewarded[rewardClaim.gameUuid] = _gameRewarded[rewardClaim.gameUuid].add(reward); // Add to Historical Balances _balances[rewardClaim.accountKey] = _balances[rewardClaim.accountKey].add(reward); // Verify that the new Balance is in expected state require(<FILL_ME>) // Add to Total Reward (for Transfer at the end) totalReward = totalReward.add(reward); // Emit Success Claimed (for Account & Receiver) emit RewardClaimed(receiver, rewardClaim.accountKey, reward); } // Emit Success (for Receiver) emit RewardWithdrawn(receiver, totalReward); _rewardToken.transfer(receiver, totalReward); return totalReward; } /** * Total Rewards Claimed by Account */ function accountBalance(address accountKey) external view returns (uint256) { } /** * Retrieve Game Rewarded Supply */ function gameRewardedSupply(uint128 gameUuid) external view returns (uint256) { } /** * Retrieve Total Token Reward Supply */ function totalRewardSupply() external view returns (uint256) { } /** * Retrieve Total Tokens Rewarded */ function totalRewarded() external view returns (uint256) { } /** * Retrieve Total Game Remaining Supply */ function totalRemainingSupply() external view returns (uint256) { } /* * Return Tokens back to Owner (useful if a contract upgrade takes place) */ function transferBackToOwner() public onlyOwner returns (uint256) { } }
_balances[rewardClaim.accountKey]==rewardClaim.newBalance,"Rewards: New Balance is not in Expected State"
292,380
_balances[rewardClaim.accountKey]==rewardClaim.newBalance
null
/** * @title Wallet to hold and trade ERC20 tokens and ether * @author Adam Lemmon <[email protected]> * @dev User wallet to interact with the exchange. * all tokens and ether held in this wallet, 1 to 1 mapping to user EOAs. */ contract WalletV2 is LoggingErrors { /** * Storage */ // Vars included in wallet logic "lib", the order must match between Wallet and Logic address public owner_; address public exchange_; mapping(address => uint256) public tokenBalances_; address public logic_; // storage location 0x3 loaded for delegatecalls so this var must remain at index 3 uint256 public birthBlock_; WalletConnector private connector_; /** * Events */ event LogDeposit(address token, uint256 amount, uint256 balance); event LogWithdrawal(address token, uint256 amount, uint256 balance); /** * @dev Contract constructor. Set user as owner and connector address. * @param _owner The address of the user's EOA, wallets created from the exchange * so must past in the owner address, msg.sender == exchange. * @param _connector The wallet connector to be used to retrieve the wallet logic */ function WalletV2(address _owner, address _connector) public { } /** * @dev Fallback - Only enable funds to be sent from the exchange. * Ensures balances will be consistent. */ function () external payable { } /** * External */ /** * @dev Deposit ether into this wallet, default to address 0 for consistent token lookup. */ function depositEther() external payable { require(<FILL_ME>) } /** * @dev Deposit any ERC20 token into this wallet. * @param _token The address of the existing token contract. * @param _amount The amount of tokens to deposit. * @return Bool if the deposit was successful. */ function depositERC20Token ( address _token, uint256 _amount ) external returns(bool) { } /** * @dev The result of an order, update the balance of this wallet. * @param _token The address of the token balance to update. * @param _amount The amount to update the balance by. * @param _subtractionFlag If true then subtract the token amount else add. * @return Bool if the update was successful. */ function updateBalance ( address _token, uint256 _amount, bool _subtractionFlag ) external returns(bool) { } /** * User may update to the latest version of the exchange contract. * Note that multiple versions are NOT supported at this time and therefore if a * user does not wish to update they will no longer be able to use the exchange. * @param _exchange The new exchange. * @return Success of this transaction. */ function updateExchange(address _exchange) external returns(bool) { } /** * User may update to a new or older version of the logic contract. * @param _version The versin to update to. * @return Success of this transaction. */ function updateLogic(uint256 _version) external returns(bool) { } /** * @dev Verify an order that the Exchange has received involving this wallet. * Internal checks and then authorize the exchange to move the tokens. * If sending ether will transfer to the exchange to broker the trade. * @param _token The address of the token contract being sold. * @param _amount The amount of tokens the order is for. * @param _fee The fee for the current trade. * @param _feeToken The token of which the fee is to be paid in. * @return If the order was verified or not. */ function verifyOrder ( address _token, uint256 _amount, uint256 _fee, address _feeToken ) external returns(bool) { } /** * @dev Withdraw any token, including ether from this wallet to an EOA. * @param _token The address of the token to withdraw. * @param _amount The amount to withdraw. * @return Success of the withdrawal. */ function withdraw(address _token, uint256 _amount) external returns(bool) { } /** * Constants */ /** * @dev Get the balance for a specific token. * @param _token The address of the token contract to retrieve the balance of. * @return The current balance within this contract. */ function balanceOf(address _token) public view returns(uint) { } }
logic_.delegatecall(bytes4(sha3('deposit(address,uint256)')),0,msg.value)
292,449
logic_.delegatecall(bytes4(sha3('deposit(address,uint256)')),0,msg.value)
null
/** * @title Wallet to hold and trade ERC20 tokens and ether * @author Adam Lemmon <[email protected]> * @dev User wallet to interact with the exchange. * all tokens and ether held in this wallet, 1 to 1 mapping to user EOAs. */ contract WalletV2 is LoggingErrors { /** * Storage */ // Vars included in wallet logic "lib", the order must match between Wallet and Logic address public owner_; address public exchange_; mapping(address => uint256) public tokenBalances_; address public logic_; // storage location 0x3 loaded for delegatecalls so this var must remain at index 3 uint256 public birthBlock_; WalletConnector private connector_; /** * Events */ event LogDeposit(address token, uint256 amount, uint256 balance); event LogWithdrawal(address token, uint256 amount, uint256 balance); /** * @dev Contract constructor. Set user as owner and connector address. * @param _owner The address of the user's EOA, wallets created from the exchange * so must past in the owner address, msg.sender == exchange. * @param _connector The wallet connector to be used to retrieve the wallet logic */ function WalletV2(address _owner, address _connector) public { } /** * @dev Fallback - Only enable funds to be sent from the exchange. * Ensures balances will be consistent. */ function () external payable { } /** * External */ /** * @dev Deposit ether into this wallet, default to address 0 for consistent token lookup. */ function depositEther() external payable { } /** * @dev Deposit any ERC20 token into this wallet. * @param _token The address of the existing token contract. * @param _amount The amount of tokens to deposit. * @return Bool if the deposit was successful. */ function depositERC20Token ( address _token, uint256 _amount ) external returns(bool) { // ether if (_token == 0) return error('Cannot deposit ether via depositERC20, Wallet.depositERC20Token()'); require(<FILL_ME>) return true; } /** * @dev The result of an order, update the balance of this wallet. * @param _token The address of the token balance to update. * @param _amount The amount to update the balance by. * @param _subtractionFlag If true then subtract the token amount else add. * @return Bool if the update was successful. */ function updateBalance ( address _token, uint256 _amount, bool _subtractionFlag ) external returns(bool) { } /** * User may update to the latest version of the exchange contract. * Note that multiple versions are NOT supported at this time and therefore if a * user does not wish to update they will no longer be able to use the exchange. * @param _exchange The new exchange. * @return Success of this transaction. */ function updateExchange(address _exchange) external returns(bool) { } /** * User may update to a new or older version of the logic contract. * @param _version The versin to update to. * @return Success of this transaction. */ function updateLogic(uint256 _version) external returns(bool) { } /** * @dev Verify an order that the Exchange has received involving this wallet. * Internal checks and then authorize the exchange to move the tokens. * If sending ether will transfer to the exchange to broker the trade. * @param _token The address of the token contract being sold. * @param _amount The amount of tokens the order is for. * @param _fee The fee for the current trade. * @param _feeToken The token of which the fee is to be paid in. * @return If the order was verified or not. */ function verifyOrder ( address _token, uint256 _amount, uint256 _fee, address _feeToken ) external returns(bool) { } /** * @dev Withdraw any token, including ether from this wallet to an EOA. * @param _token The address of the token to withdraw. * @param _amount The amount to withdraw. * @return Success of the withdrawal. */ function withdraw(address _token, uint256 _amount) external returns(bool) { } /** * Constants */ /** * @dev Get the balance for a specific token. * @param _token The address of the token contract to retrieve the balance of. * @return The current balance within this contract. */ function balanceOf(address _token) public view returns(uint) { } }
logic_.delegatecall(bytes4(sha3('deposit(address,uint256)')),_token,_amount)
292,449
logic_.delegatecall(bytes4(sha3('deposit(address,uint256)')),_token,_amount)
"Error: this will increase staking amount pass the cap"
pragma solidity 0.6.12; contract SpiderDAONest3 is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; mapping(address => uint256) private _stakes; string public name; uint256 public immutable stakingStarts; uint256 public immutable stakingEnds; uint256 public stakedTotal; uint256 public immutable stakingCap; uint256 public totalReward; uint256 public rewardBalance; uint256 public stakedBalance; uint256 public constant ONE_MONTH = 30 days; uint256 public immutable DEPOSIT_TIME; uint256 public constant REWARD_PERC = 15; //15 % address public rewardAddress = 0x9486a25530fF059aA8Bd6D1AB74E4c65527140fC; bool private depositEnabled = true; IERC20 immutable SpiderDAOToken; mapping(address => uint256) public deposited; event Staked( address indexed token, address indexed staker_, uint256 requestedAmount_, uint256 stakedAmount_ ); event PaidOut( address indexed token, address indexed staker_, uint256 amount_, uint256 reward_ ); event Refunded( address indexed token, address indexed staker_, uint256 amount_ ); modifier _positive(uint256 amount) { } modifier _after(uint256 eventTime) { } modifier _before(uint256 eventTime) { } constructor(string memory name_) public { } function stakeOf(address account) public view returns (uint256) { } function timeStaked(address account) public view returns (uint256) { } function canWithdraw(address _addy) public view returns (bool) { } /** * Requirements: * - `amount` Amount to be staked */ function stake(uint256 amount) external _positive(amount) { } function withdraw(uint256 amount) external _positive(amount) { } function _withdrawAfterClose(address from, uint256 amount) private { } function _stake(address staker, uint256 amount) private _after(stakingStarts) _before(stakingEnds) { // check the remaining amount to be staked uint256 remaining = amount; if (remaining > (stakingCap.sub(stakedBalance))) { remaining = stakingCap.sub(stakedBalance); } // These requires are not necessary, because it will never happen, but won't hurt to double check // this is because stakedTotal and stakedBalance are only modified in this method during the staking period require(remaining > 0, "Error: Staking cap is filled"); require(<FILL_ME>) SpiderDAOToken.safeTransferFrom(staker, address(this), remaining); if (remaining < amount) { // Return the unstaked amount to sender (from allowance) uint256 refund = amount.sub(remaining); SpiderDAOToken.safeTransferFrom(address(this), staker, refund); emit Refunded(address(SpiderDAOToken), staker, refund); } // Transfer is completed stakedBalance = stakedBalance.add(remaining); stakedTotal = stakedTotal.add(remaining); _stakes[staker] = _stakes[staker].add(remaining); deposited[msg.sender] = block.timestamp; emit Staked(address(SpiderDAOToken), staker, amount, remaining); } function emergencyWithdraw() external { } function emergencyWithdrawAdmin() external onlyOwner { } function setDepositEnabled() external onlyOwner { } }
(remaining.add(stakedTotal))<=stakingCap,"Error: this will increase staking amount pass the cap"
292,452
(remaining.add(stakedTotal))<=stakingCap
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "./Ownable.sol"; import "./WojekHelper.sol"; contract Wojek is ERC721, Ownable { struct Attribute { string value; uint40[] svg; } string private _additionalColors; uint256 private constant _traitCount = 9; uint256 private constant _hashLength = 30; Attribute[][] private _attributes; mapping(uint256 => bool) private _mintedTokens; //Hash => Is minted mapping(uint256 => uint256) private _tokenHashes; //Id => Hash uint256 private _totalSupply; uint256 private constant _maxSupply = 10000; uint256 private _mintCost; uint256 private _mintsLeft; uint256[] _seriesRanges; constructor() ERC721("Wojek", "WOJEK") { } receive() external payable { } function withdraw() public onlyOwner { } function totalSupply() public view returns (uint256) { } function maxSupply() public pure returns (uint256) { } function mintsLeft() public view returns (uint256) { } function mintCost() public view returns (uint256) { } function addColors(string memory colors) public onlyOwner returns (bool) { } function finishSeries() public onlyOwner returns (bool) { } function startMint(uint256 amount, uint256 cost) public onlyOwner returns (bool) { require(<FILL_ME>) _mintCost = cost; _mintsLeft = amount; return true; } function endMint() public onlyOwner returns (bool) { } function mint() public payable returns (bool) { } function addAttributes(uint256 attributeType, Attribute[] memory newAttributes) public onlyOwner returns(bool) { } function tokenURI(uint256 id) public view override returns (string memory) { } function _generateSvg(uint256 hash) private view returns(string memory result) { } function _hashMetadata(uint256 hash, uint256 id) private view returns(string memory) { } }
_totalSupply+amount<=_maxSupply
292,518
_totalSupply+amount<=_maxSupply
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "./Ownable.sol"; import "./WojekHelper.sol"; contract Wojek is ERC721, Ownable { struct Attribute { string value; uint40[] svg; } string private _additionalColors; uint256 private constant _traitCount = 9; uint256 private constant _hashLength = 30; Attribute[][] private _attributes; mapping(uint256 => bool) private _mintedTokens; //Hash => Is minted mapping(uint256 => uint256) private _tokenHashes; //Id => Hash uint256 private _totalSupply; uint256 private constant _maxSupply = 10000; uint256 private _mintCost; uint256 private _mintsLeft; uint256[] _seriesRanges; constructor() ERC721("Wojek", "WOJEK") { } receive() external payable { } function withdraw() public onlyOwner { } function totalSupply() public view returns (uint256) { } function maxSupply() public pure returns (uint256) { } function mintsLeft() public view returns (uint256) { } function mintCost() public view returns (uint256) { } function addColors(string memory colors) public onlyOwner returns (bool) { } function finishSeries() public onlyOwner returns (bool) { } function startMint(uint256 amount, uint256 cost) public onlyOwner returns (bool) { } function endMint() public onlyOwner returns (bool) { } function mint() public payable returns (bool) { uint256 value = msg.value; require(value >= _mintCost); uint256 mintAmount = value / _mintCost; require(<FILL_ME>) require(_mintsLeft - mintAmount >= 0); address sender = _msgSender(); uint256[] memory safeHashes = new uint256[](mintAmount); //Memory for(uint256 i = 0; i < mintAmount; i++) { uint256 id = _totalSupply + i; uint256 randomNumber = WojekHelper.dirtyRandom(id, sender); uint256 hash = 10 ** _hashLength; for(uint256 a = 0; a < _traitCount; a++) { hash += (10 ** (_hashLength - (a * 3) - 3)) * (randomNumber % _attributes[a].length); randomNumber >>= 8; } if(randomNumber % 100 < 5) { hash += 1; } require(_mintedTokens[hash] == false); safeHashes[i] = hash; } //Storage for(uint256 i = 0; i < mintAmount; i++) { uint256 id = _totalSupply + i; _mintedTokens[safeHashes[i]] = true; _tokenHashes[id] = safeHashes[i]; _safeMint(sender, id); } _mintsLeft -= mintAmount; _totalSupply += mintAmount; return true; } function addAttributes(uint256 attributeType, Attribute[] memory newAttributes) public onlyOwner returns(bool) { } function tokenURI(uint256 id) public view override returns (string memory) { } function _generateSvg(uint256 hash) private view returns(string memory result) { } function _hashMetadata(uint256 hash, uint256 id) private view returns(string memory) { } }
_totalSupply+mintAmount<=_maxSupply
292,518
_totalSupply+mintAmount<=_maxSupply
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "./Ownable.sol"; import "./WojekHelper.sol"; contract Wojek is ERC721, Ownable { struct Attribute { string value; uint40[] svg; } string private _additionalColors; uint256 private constant _traitCount = 9; uint256 private constant _hashLength = 30; Attribute[][] private _attributes; mapping(uint256 => bool) private _mintedTokens; //Hash => Is minted mapping(uint256 => uint256) private _tokenHashes; //Id => Hash uint256 private _totalSupply; uint256 private constant _maxSupply = 10000; uint256 private _mintCost; uint256 private _mintsLeft; uint256[] _seriesRanges; constructor() ERC721("Wojek", "WOJEK") { } receive() external payable { } function withdraw() public onlyOwner { } function totalSupply() public view returns (uint256) { } function maxSupply() public pure returns (uint256) { } function mintsLeft() public view returns (uint256) { } function mintCost() public view returns (uint256) { } function addColors(string memory colors) public onlyOwner returns (bool) { } function finishSeries() public onlyOwner returns (bool) { } function startMint(uint256 amount, uint256 cost) public onlyOwner returns (bool) { } function endMint() public onlyOwner returns (bool) { } function mint() public payable returns (bool) { uint256 value = msg.value; require(value >= _mintCost); uint256 mintAmount = value / _mintCost; require(_totalSupply + mintAmount <= _maxSupply); require(<FILL_ME>) address sender = _msgSender(); uint256[] memory safeHashes = new uint256[](mintAmount); //Memory for(uint256 i = 0; i < mintAmount; i++) { uint256 id = _totalSupply + i; uint256 randomNumber = WojekHelper.dirtyRandom(id, sender); uint256 hash = 10 ** _hashLength; for(uint256 a = 0; a < _traitCount; a++) { hash += (10 ** (_hashLength - (a * 3) - 3)) * (randomNumber % _attributes[a].length); randomNumber >>= 8; } if(randomNumber % 100 < 5) { hash += 1; } require(_mintedTokens[hash] == false); safeHashes[i] = hash; } //Storage for(uint256 i = 0; i < mintAmount; i++) { uint256 id = _totalSupply + i; _mintedTokens[safeHashes[i]] = true; _tokenHashes[id] = safeHashes[i]; _safeMint(sender, id); } _mintsLeft -= mintAmount; _totalSupply += mintAmount; return true; } function addAttributes(uint256 attributeType, Attribute[] memory newAttributes) public onlyOwner returns(bool) { } function tokenURI(uint256 id) public view override returns (string memory) { } function _generateSvg(uint256 hash) private view returns(string memory result) { } function _hashMetadata(uint256 hash, uint256 id) private view returns(string memory) { } }
_mintsLeft-mintAmount>=0
292,518
_mintsLeft-mintAmount>=0
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "./Ownable.sol"; import "./WojekHelper.sol"; contract Wojek is ERC721, Ownable { struct Attribute { string value; uint40[] svg; } string private _additionalColors; uint256 private constant _traitCount = 9; uint256 private constant _hashLength = 30; Attribute[][] private _attributes; mapping(uint256 => bool) private _mintedTokens; //Hash => Is minted mapping(uint256 => uint256) private _tokenHashes; //Id => Hash uint256 private _totalSupply; uint256 private constant _maxSupply = 10000; uint256 private _mintCost; uint256 private _mintsLeft; uint256[] _seriesRanges; constructor() ERC721("Wojek", "WOJEK") { } receive() external payable { } function withdraw() public onlyOwner { } function totalSupply() public view returns (uint256) { } function maxSupply() public pure returns (uint256) { } function mintsLeft() public view returns (uint256) { } function mintCost() public view returns (uint256) { } function addColors(string memory colors) public onlyOwner returns (bool) { } function finishSeries() public onlyOwner returns (bool) { } function startMint(uint256 amount, uint256 cost) public onlyOwner returns (bool) { } function endMint() public onlyOwner returns (bool) { } function mint() public payable returns (bool) { uint256 value = msg.value; require(value >= _mintCost); uint256 mintAmount = value / _mintCost; require(_totalSupply + mintAmount <= _maxSupply); require(_mintsLeft - mintAmount >= 0); address sender = _msgSender(); uint256[] memory safeHashes = new uint256[](mintAmount); //Memory for(uint256 i = 0; i < mintAmount; i++) { uint256 id = _totalSupply + i; uint256 randomNumber = WojekHelper.dirtyRandom(id, sender); uint256 hash = 10 ** _hashLength; for(uint256 a = 0; a < _traitCount; a++) { hash += (10 ** (_hashLength - (a * 3) - 3)) * (randomNumber % _attributes[a].length); randomNumber >>= 8; } if(randomNumber % 100 < 5) { hash += 1; } require(<FILL_ME>) safeHashes[i] = hash; } //Storage for(uint256 i = 0; i < mintAmount; i++) { uint256 id = _totalSupply + i; _mintedTokens[safeHashes[i]] = true; _tokenHashes[id] = safeHashes[i]; _safeMint(sender, id); } _mintsLeft -= mintAmount; _totalSupply += mintAmount; return true; } function addAttributes(uint256 attributeType, Attribute[] memory newAttributes) public onlyOwner returns(bool) { } function tokenURI(uint256 id) public view override returns (string memory) { } function _generateSvg(uint256 hash) private view returns(string memory result) { } function _hashMetadata(uint256 hash, uint256 id) private view returns(string memory) { } }
_mintedTokens[hash]==false
292,518
_mintedTokens[hash]==false
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "./Ownable.sol"; import "./WojekHelper.sol"; contract Wojek is ERC721, Ownable { struct Attribute { string value; uint40[] svg; } string private _additionalColors; uint256 private constant _traitCount = 9; uint256 private constant _hashLength = 30; Attribute[][] private _attributes; mapping(uint256 => bool) private _mintedTokens; //Hash => Is minted mapping(uint256 => uint256) private _tokenHashes; //Id => Hash uint256 private _totalSupply; uint256 private constant _maxSupply = 10000; uint256 private _mintCost; uint256 private _mintsLeft; uint256[] _seriesRanges; constructor() ERC721("Wojek", "WOJEK") { } receive() external payable { } function withdraw() public onlyOwner { } function totalSupply() public view returns (uint256) { } function maxSupply() public pure returns (uint256) { } function mintsLeft() public view returns (uint256) { } function mintCost() public view returns (uint256) { } function addColors(string memory colors) public onlyOwner returns (bool) { } function finishSeries() public onlyOwner returns (bool) { } function startMint(uint256 amount, uint256 cost) public onlyOwner returns (bool) { } function endMint() public onlyOwner returns (bool) { } function mint() public payable returns (bool) { } function addAttributes(uint256 attributeType, Attribute[] memory newAttributes) public onlyOwner returns(bool) { } function tokenURI(uint256 id) public view override returns (string memory) { require(_exists(id)); uint256 hash = _tokenHashes[id]; require(<FILL_ME>) return string(abi.encodePacked( "data:application/json;base64,", WojekHelper.encode(bytes(string( abi.encodePacked( '{"name": "Wojek #', WojekHelper.toString(id), '", "description": "', "Wojeks are a completely onchain collection of images that display a wide variety of emotions, even the feelsbad ones.", '", "image": "data:image/svg+xml;base64,', WojekHelper.encode(bytes(_generateSvg(hash))), '", "attributes":', _hashMetadata(hash, id), "}" ) ))) )); } function _generateSvg(uint256 hash) private view returns(string memory result) { } function _hashMetadata(uint256 hash, uint256 id) private view returns(string memory) { } }
_mintedTokens[hash]==true
292,518
_mintedTokens[hash]==true
"error_overwrite"
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); 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); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * Abstract contract, requires implementation to specify who can commit blocks and what * happens when a successful proof is presented * Verifies Merkle-tree inclusion proofs that show that certain address has * certain earnings balance, according to hash published ("signed") by a * sidechain operator or similar authority * * ABOUT Merkle-tree inclusion proof: Merkle-tree inclusion proof is an algorithm to prove memebership * in a set using minimal [ie log(N)] inputs. The hashes of the items are arranged by hash value in a binary Merkle tree where * each node contains a hash of the hashes of nodes below. The root node (ie "root hash") contains hash information * about the entire set, and that is the data that BalanceVerifier posts to the blockchain. To prove membership, you walk up the * tree from the node in question, and use the supplied hashes (the "proof") to fill in the hashes from the adjacent nodes. The proof * succeeds iff you end up with the known root hash when you get to the top of the tree. * See https://medium.com/crypto-0-nite/merkle-proofs-explained-6dd429623dc5 * * Merkle-tree inclusion proof is a RELATED concept to the blockchain Merkle tree, but a somewhat DIFFERENT application. * BalanceVerifier posts the root hash of the CURRENT ledger only, and this does NOT depend on the hash of previous ledgers. * This is different from the blockchain, where each block contains the hash of the previous block. * * TODO: see if it could be turned into a library, so many contracts could use it */ contract BalanceVerifier { event BlockCreated(uint blockNumber, bytes32 rootHash, string ipfsHash); /** * Sidechain "blocks" are simply root hashes of merkle-trees constructed from its balances * @param uint root-chain block number after which the balances were recorded * @return bytes32 root of the balances merkle-tree at that time */ mapping (uint => bytes32) public blockHash; /** * Handler for proof of sidechain balances * It is up to the implementing contract to actually distribute out the balances * @param blockNumber the block whose hash was used for verification * @param account whose balances were successfully verified * @param balance the side-chain account balance */ function onVerifySuccess(uint blockNumber, address account, uint balance) internal; /** * Implementing contract should should do access checks for committing */ function onCommit(uint blockNumber, bytes32 rootHash, string ipfsHash) internal; /** * Side-chain operator submits commitments to main chain. These * For convenience, also publish the ipfsHash of the balance book JSON object * @param blockNumber the block after which the balances were recorded * @param rootHash root of the balances merkle-tree * @param ipfsHash where the whole balances object can be retrieved in JSON format */ function commit(uint blockNumber, bytes32 rootHash, string ipfsHash) external { require(<FILL_ME>) string memory _hash = ipfsHash; onCommit(blockNumber, rootHash, _hash); blockHash[blockNumber] = rootHash; emit BlockCreated(blockNumber, rootHash, _hash); } /** * Proving can be used to record the sidechain balances permanently into root chain * @param blockNumber the block after which the balances were recorded * @param account whose balances will be verified * @param balance side-chain account balance * @param proof list of hashes to prove the totalEarnings */ function prove(uint blockNumber, address account, uint balance, bytes32[] memory proof) public { } /** * Check the merkle proof of balance in the given side-chain block for given account */ function proofIsCorrect(uint blockNumber, address account, uint balance, bytes32[] memory proof) public view returns(bool) { } /** * Calculate root hash of a Merkle tree, given * @param hash of the leaf to verify * @param others list of hashes of "other" branches */ function calculateRootHash(bytes32 hash, bytes32[] memory others) public pure returns (bytes32 root) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; address public pendingOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() public { } } /** * Monoplasma that is managed by an owner, likely the side-chain operator * Owner can add and remove recipients. */ contract Monoplasma is BalanceVerifier, Ownable { using SafeMath for uint256; event OperatorChanged(address indexed newOperator); event AdminFeeChanged(uint adminFee); /** * Freeze period during which all side-chain participants should be able to * acquire the whole balance book from IPFS (or HTTP server, or elsewhere) * and validate that the published rootHash is correct * In case of incorrect rootHash, all members should issue withdrawals from the * latest block they have validated (that is older than blockFreezeSeconds) * So: too short freeze period + bad availability => ether (needlessly) spent withdrawing earnings * long freeze period == lag between purchase and withdrawal => bad UX * Blocks older than blockFreezeSeconds can be used to withdraw funds */ uint public blockFreezeSeconds; /** * Block number => timestamp * Publish time of a block, where the block freeze period starts from. * Note that block number points to the block after which the root hash is calculated, * not the block where BlockCreated was emitted (event must come later) */ mapping (uint => uint) public blockTimestamp; address public operator; //fee fraction = adminFee/10^18 uint public adminFee; IERC20 public token; mapping (address => uint) public earnings; mapping (address => uint) public withdrawn; uint public totalWithdrawn; uint public totalProven; constructor(address tokenAddress, uint blockFreezePeriodSeconds, uint _adminFee) public { } function setOperator(address newOperator) public onlyOwner { } /** * Admin fee as a fraction of revenue * Fixed-point decimal in the same way as ether: 50% === 0.5 ether * Smart contract doesn't use it, it's here just for storing purposes */ function setAdminFee(uint _adminFee) public onlyOwner { } /** * Operator creates the side-chain blocks */ function onCommit(uint blockNumber, bytes32, string) internal { } /** * Called from BalanceVerifier.prove * Prove can be called directly to withdraw less than the whole share, * or just "cement" the earnings so far into root chain even without withdrawing */ function onVerifySuccess(uint blockNumber, address account, uint newEarnings) internal { } /** * Prove and withdraw the whole revenue share from sidechain in one transaction * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAll(uint blockNumber, uint totalEarnings, bytes32[] proof) external { } /** * Prove and withdraw the whole revenue share for someone else * Validator needs to exit those it's watching out for, in case * it detects Operator malfunctioning * @param recipient the address we're proving and withdrawing * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAllFor(address recipient, uint blockNumber, uint totalEarnings, bytes32[] proof) public { } /** * "Donate withdraw" function that allows you to prove and transfer * your earnings to a another address in one transaction * @param recipient the address the tokens will be sent to (instead of msg.sender) * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAllTo(address recipient, uint blockNumber, uint totalEarnings, bytes32[] proof) external { } /** * Withdraw a specified amount of your own proven earnings (see `function prove`) */ function withdraw(uint amount) public { } /** * Do the withdrawal on behalf of someone else * Validator needs to exit those it's watching out for, in case * it detects Operator malfunctioning */ function withdrawFor(address recipient, uint amount) public { } /** * Execute token withdrawal into specified recipient address from specified member account * @dev It is up to the sidechain implementation to make sure * @dev always token balance >= sum of earnings - sum of withdrawn */ function withdrawTo(address recipient, address account, uint amount) public { } } contract CommunityProduct is Monoplasma { string public joinPartStream; constructor(address operator, string joinPartStreamId, address tokenAddress, uint blockFreezePeriodSeconds, uint adminFeeFraction) Monoplasma(tokenAddress, blockFreezePeriodSeconds, adminFeeFraction) public { } }
blockHash[blockNumber]==0,"error_overwrite"
292,542
blockHash[blockNumber]==0
"error_proof"
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); 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); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * Abstract contract, requires implementation to specify who can commit blocks and what * happens when a successful proof is presented * Verifies Merkle-tree inclusion proofs that show that certain address has * certain earnings balance, according to hash published ("signed") by a * sidechain operator or similar authority * * ABOUT Merkle-tree inclusion proof: Merkle-tree inclusion proof is an algorithm to prove memebership * in a set using minimal [ie log(N)] inputs. The hashes of the items are arranged by hash value in a binary Merkle tree where * each node contains a hash of the hashes of nodes below. The root node (ie "root hash") contains hash information * about the entire set, and that is the data that BalanceVerifier posts to the blockchain. To prove membership, you walk up the * tree from the node in question, and use the supplied hashes (the "proof") to fill in the hashes from the adjacent nodes. The proof * succeeds iff you end up with the known root hash when you get to the top of the tree. * See https://medium.com/crypto-0-nite/merkle-proofs-explained-6dd429623dc5 * * Merkle-tree inclusion proof is a RELATED concept to the blockchain Merkle tree, but a somewhat DIFFERENT application. * BalanceVerifier posts the root hash of the CURRENT ledger only, and this does NOT depend on the hash of previous ledgers. * This is different from the blockchain, where each block contains the hash of the previous block. * * TODO: see if it could be turned into a library, so many contracts could use it */ contract BalanceVerifier { event BlockCreated(uint blockNumber, bytes32 rootHash, string ipfsHash); /** * Sidechain "blocks" are simply root hashes of merkle-trees constructed from its balances * @param uint root-chain block number after which the balances were recorded * @return bytes32 root of the balances merkle-tree at that time */ mapping (uint => bytes32) public blockHash; /** * Handler for proof of sidechain balances * It is up to the implementing contract to actually distribute out the balances * @param blockNumber the block whose hash was used for verification * @param account whose balances were successfully verified * @param balance the side-chain account balance */ function onVerifySuccess(uint blockNumber, address account, uint balance) internal; /** * Implementing contract should should do access checks for committing */ function onCommit(uint blockNumber, bytes32 rootHash, string ipfsHash) internal; /** * Side-chain operator submits commitments to main chain. These * For convenience, also publish the ipfsHash of the balance book JSON object * @param blockNumber the block after which the balances were recorded * @param rootHash root of the balances merkle-tree * @param ipfsHash where the whole balances object can be retrieved in JSON format */ function commit(uint blockNumber, bytes32 rootHash, string ipfsHash) external { } /** * Proving can be used to record the sidechain balances permanently into root chain * @param blockNumber the block after which the balances were recorded * @param account whose balances will be verified * @param balance side-chain account balance * @param proof list of hashes to prove the totalEarnings */ function prove(uint blockNumber, address account, uint balance, bytes32[] memory proof) public { require(<FILL_ME>) onVerifySuccess(blockNumber, account, balance); } /** * Check the merkle proof of balance in the given side-chain block for given account */ function proofIsCorrect(uint blockNumber, address account, uint balance, bytes32[] memory proof) public view returns(bool) { } /** * Calculate root hash of a Merkle tree, given * @param hash of the leaf to verify * @param others list of hashes of "other" branches */ function calculateRootHash(bytes32 hash, bytes32[] memory others) public pure returns (bytes32 root) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; address public pendingOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() public { } } /** * Monoplasma that is managed by an owner, likely the side-chain operator * Owner can add and remove recipients. */ contract Monoplasma is BalanceVerifier, Ownable { using SafeMath for uint256; event OperatorChanged(address indexed newOperator); event AdminFeeChanged(uint adminFee); /** * Freeze period during which all side-chain participants should be able to * acquire the whole balance book from IPFS (or HTTP server, or elsewhere) * and validate that the published rootHash is correct * In case of incorrect rootHash, all members should issue withdrawals from the * latest block they have validated (that is older than blockFreezeSeconds) * So: too short freeze period + bad availability => ether (needlessly) spent withdrawing earnings * long freeze period == lag between purchase and withdrawal => bad UX * Blocks older than blockFreezeSeconds can be used to withdraw funds */ uint public blockFreezeSeconds; /** * Block number => timestamp * Publish time of a block, where the block freeze period starts from. * Note that block number points to the block after which the root hash is calculated, * not the block where BlockCreated was emitted (event must come later) */ mapping (uint => uint) public blockTimestamp; address public operator; //fee fraction = adminFee/10^18 uint public adminFee; IERC20 public token; mapping (address => uint) public earnings; mapping (address => uint) public withdrawn; uint public totalWithdrawn; uint public totalProven; constructor(address tokenAddress, uint blockFreezePeriodSeconds, uint _adminFee) public { } function setOperator(address newOperator) public onlyOwner { } /** * Admin fee as a fraction of revenue * Fixed-point decimal in the same way as ether: 50% === 0.5 ether * Smart contract doesn't use it, it's here just for storing purposes */ function setAdminFee(uint _adminFee) public onlyOwner { } /** * Operator creates the side-chain blocks */ function onCommit(uint blockNumber, bytes32, string) internal { } /** * Called from BalanceVerifier.prove * Prove can be called directly to withdraw less than the whole share, * or just "cement" the earnings so far into root chain even without withdrawing */ function onVerifySuccess(uint blockNumber, address account, uint newEarnings) internal { } /** * Prove and withdraw the whole revenue share from sidechain in one transaction * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAll(uint blockNumber, uint totalEarnings, bytes32[] proof) external { } /** * Prove and withdraw the whole revenue share for someone else * Validator needs to exit those it's watching out for, in case * it detects Operator malfunctioning * @param recipient the address we're proving and withdrawing * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAllFor(address recipient, uint blockNumber, uint totalEarnings, bytes32[] proof) public { } /** * "Donate withdraw" function that allows you to prove and transfer * your earnings to a another address in one transaction * @param recipient the address the tokens will be sent to (instead of msg.sender) * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAllTo(address recipient, uint blockNumber, uint totalEarnings, bytes32[] proof) external { } /** * Withdraw a specified amount of your own proven earnings (see `function prove`) */ function withdraw(uint amount) public { } /** * Do the withdrawal on behalf of someone else * Validator needs to exit those it's watching out for, in case * it detects Operator malfunctioning */ function withdrawFor(address recipient, uint amount) public { } /** * Execute token withdrawal into specified recipient address from specified member account * @dev It is up to the sidechain implementation to make sure * @dev always token balance >= sum of earnings - sum of withdrawn */ function withdrawTo(address recipient, address account, uint amount) public { } } contract CommunityProduct is Monoplasma { string public joinPartStream; constructor(address operator, string joinPartStreamId, address tokenAddress, uint blockFreezePeriodSeconds, uint adminFeeFraction) Monoplasma(tokenAddress, blockFreezePeriodSeconds, adminFeeFraction) public { } }
proofIsCorrect(blockNumber,account,balance,proof),"error_proof"
292,542
proofIsCorrect(blockNumber,account,balance,proof)
"error_oldEarnings"
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); 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); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * Abstract contract, requires implementation to specify who can commit blocks and what * happens when a successful proof is presented * Verifies Merkle-tree inclusion proofs that show that certain address has * certain earnings balance, according to hash published ("signed") by a * sidechain operator or similar authority * * ABOUT Merkle-tree inclusion proof: Merkle-tree inclusion proof is an algorithm to prove memebership * in a set using minimal [ie log(N)] inputs. The hashes of the items are arranged by hash value in a binary Merkle tree where * each node contains a hash of the hashes of nodes below. The root node (ie "root hash") contains hash information * about the entire set, and that is the data that BalanceVerifier posts to the blockchain. To prove membership, you walk up the * tree from the node in question, and use the supplied hashes (the "proof") to fill in the hashes from the adjacent nodes. The proof * succeeds iff you end up with the known root hash when you get to the top of the tree. * See https://medium.com/crypto-0-nite/merkle-proofs-explained-6dd429623dc5 * * Merkle-tree inclusion proof is a RELATED concept to the blockchain Merkle tree, but a somewhat DIFFERENT application. * BalanceVerifier posts the root hash of the CURRENT ledger only, and this does NOT depend on the hash of previous ledgers. * This is different from the blockchain, where each block contains the hash of the previous block. * * TODO: see if it could be turned into a library, so many contracts could use it */ contract BalanceVerifier { event BlockCreated(uint blockNumber, bytes32 rootHash, string ipfsHash); /** * Sidechain "blocks" are simply root hashes of merkle-trees constructed from its balances * @param uint root-chain block number after which the balances were recorded * @return bytes32 root of the balances merkle-tree at that time */ mapping (uint => bytes32) public blockHash; /** * Handler for proof of sidechain balances * It is up to the implementing contract to actually distribute out the balances * @param blockNumber the block whose hash was used for verification * @param account whose balances were successfully verified * @param balance the side-chain account balance */ function onVerifySuccess(uint blockNumber, address account, uint balance) internal; /** * Implementing contract should should do access checks for committing */ function onCommit(uint blockNumber, bytes32 rootHash, string ipfsHash) internal; /** * Side-chain operator submits commitments to main chain. These * For convenience, also publish the ipfsHash of the balance book JSON object * @param blockNumber the block after which the balances were recorded * @param rootHash root of the balances merkle-tree * @param ipfsHash where the whole balances object can be retrieved in JSON format */ function commit(uint blockNumber, bytes32 rootHash, string ipfsHash) external { } /** * Proving can be used to record the sidechain balances permanently into root chain * @param blockNumber the block after which the balances were recorded * @param account whose balances will be verified * @param balance side-chain account balance * @param proof list of hashes to prove the totalEarnings */ function prove(uint blockNumber, address account, uint balance, bytes32[] memory proof) public { } /** * Check the merkle proof of balance in the given side-chain block for given account */ function proofIsCorrect(uint blockNumber, address account, uint balance, bytes32[] memory proof) public view returns(bool) { } /** * Calculate root hash of a Merkle tree, given * @param hash of the leaf to verify * @param others list of hashes of "other" branches */ function calculateRootHash(bytes32 hash, bytes32[] memory others) public pure returns (bytes32 root) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; address public pendingOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() public { } } /** * Monoplasma that is managed by an owner, likely the side-chain operator * Owner can add and remove recipients. */ contract Monoplasma is BalanceVerifier, Ownable { using SafeMath for uint256; event OperatorChanged(address indexed newOperator); event AdminFeeChanged(uint adminFee); /** * Freeze period during which all side-chain participants should be able to * acquire the whole balance book from IPFS (or HTTP server, or elsewhere) * and validate that the published rootHash is correct * In case of incorrect rootHash, all members should issue withdrawals from the * latest block they have validated (that is older than blockFreezeSeconds) * So: too short freeze period + bad availability => ether (needlessly) spent withdrawing earnings * long freeze period == lag between purchase and withdrawal => bad UX * Blocks older than blockFreezeSeconds can be used to withdraw funds */ uint public blockFreezeSeconds; /** * Block number => timestamp * Publish time of a block, where the block freeze period starts from. * Note that block number points to the block after which the root hash is calculated, * not the block where BlockCreated was emitted (event must come later) */ mapping (uint => uint) public blockTimestamp; address public operator; //fee fraction = adminFee/10^18 uint public adminFee; IERC20 public token; mapping (address => uint) public earnings; mapping (address => uint) public withdrawn; uint public totalWithdrawn; uint public totalProven; constructor(address tokenAddress, uint blockFreezePeriodSeconds, uint _adminFee) public { } function setOperator(address newOperator) public onlyOwner { } /** * Admin fee as a fraction of revenue * Fixed-point decimal in the same way as ether: 50% === 0.5 ether * Smart contract doesn't use it, it's here just for storing purposes */ function setAdminFee(uint _adminFee) public onlyOwner { } /** * Operator creates the side-chain blocks */ function onCommit(uint blockNumber, bytes32, string) internal { } /** * Called from BalanceVerifier.prove * Prove can be called directly to withdraw less than the whole share, * or just "cement" the earnings so far into root chain even without withdrawing */ function onVerifySuccess(uint blockNumber, address account, uint newEarnings) internal { uint blockFreezeStart = blockTimestamp[blockNumber]; require(now > blockFreezeStart + blockFreezeSeconds, "error_frozen"); require(<FILL_ME>) totalProven = totalProven.add(newEarnings).sub(earnings[account]); require(totalProven.sub(totalWithdrawn) <= token.balanceOf(this), "error_missingBalance"); earnings[account] = newEarnings; } /** * Prove and withdraw the whole revenue share from sidechain in one transaction * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAll(uint blockNumber, uint totalEarnings, bytes32[] proof) external { } /** * Prove and withdraw the whole revenue share for someone else * Validator needs to exit those it's watching out for, in case * it detects Operator malfunctioning * @param recipient the address we're proving and withdrawing * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAllFor(address recipient, uint blockNumber, uint totalEarnings, bytes32[] proof) public { } /** * "Donate withdraw" function that allows you to prove and transfer * your earnings to a another address in one transaction * @param recipient the address the tokens will be sent to (instead of msg.sender) * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAllTo(address recipient, uint blockNumber, uint totalEarnings, bytes32[] proof) external { } /** * Withdraw a specified amount of your own proven earnings (see `function prove`) */ function withdraw(uint amount) public { } /** * Do the withdrawal on behalf of someone else * Validator needs to exit those it's watching out for, in case * it detects Operator malfunctioning */ function withdrawFor(address recipient, uint amount) public { } /** * Execute token withdrawal into specified recipient address from specified member account * @dev It is up to the sidechain implementation to make sure * @dev always token balance >= sum of earnings - sum of withdrawn */ function withdrawTo(address recipient, address account, uint amount) public { } } contract CommunityProduct is Monoplasma { string public joinPartStream; constructor(address operator, string joinPartStreamId, address tokenAddress, uint blockFreezePeriodSeconds, uint adminFeeFraction) Monoplasma(tokenAddress, blockFreezePeriodSeconds, adminFeeFraction) public { } }
earnings[account]<newEarnings,"error_oldEarnings"
292,542
earnings[account]<newEarnings
"error_missingBalance"
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); 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); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * Abstract contract, requires implementation to specify who can commit blocks and what * happens when a successful proof is presented * Verifies Merkle-tree inclusion proofs that show that certain address has * certain earnings balance, according to hash published ("signed") by a * sidechain operator or similar authority * * ABOUT Merkle-tree inclusion proof: Merkle-tree inclusion proof is an algorithm to prove memebership * in a set using minimal [ie log(N)] inputs. The hashes of the items are arranged by hash value in a binary Merkle tree where * each node contains a hash of the hashes of nodes below. The root node (ie "root hash") contains hash information * about the entire set, and that is the data that BalanceVerifier posts to the blockchain. To prove membership, you walk up the * tree from the node in question, and use the supplied hashes (the "proof") to fill in the hashes from the adjacent nodes. The proof * succeeds iff you end up with the known root hash when you get to the top of the tree. * See https://medium.com/crypto-0-nite/merkle-proofs-explained-6dd429623dc5 * * Merkle-tree inclusion proof is a RELATED concept to the blockchain Merkle tree, but a somewhat DIFFERENT application. * BalanceVerifier posts the root hash of the CURRENT ledger only, and this does NOT depend on the hash of previous ledgers. * This is different from the blockchain, where each block contains the hash of the previous block. * * TODO: see if it could be turned into a library, so many contracts could use it */ contract BalanceVerifier { event BlockCreated(uint blockNumber, bytes32 rootHash, string ipfsHash); /** * Sidechain "blocks" are simply root hashes of merkle-trees constructed from its balances * @param uint root-chain block number after which the balances were recorded * @return bytes32 root of the balances merkle-tree at that time */ mapping (uint => bytes32) public blockHash; /** * Handler for proof of sidechain balances * It is up to the implementing contract to actually distribute out the balances * @param blockNumber the block whose hash was used for verification * @param account whose balances were successfully verified * @param balance the side-chain account balance */ function onVerifySuccess(uint blockNumber, address account, uint balance) internal; /** * Implementing contract should should do access checks for committing */ function onCommit(uint blockNumber, bytes32 rootHash, string ipfsHash) internal; /** * Side-chain operator submits commitments to main chain. These * For convenience, also publish the ipfsHash of the balance book JSON object * @param blockNumber the block after which the balances were recorded * @param rootHash root of the balances merkle-tree * @param ipfsHash where the whole balances object can be retrieved in JSON format */ function commit(uint blockNumber, bytes32 rootHash, string ipfsHash) external { } /** * Proving can be used to record the sidechain balances permanently into root chain * @param blockNumber the block after which the balances were recorded * @param account whose balances will be verified * @param balance side-chain account balance * @param proof list of hashes to prove the totalEarnings */ function prove(uint blockNumber, address account, uint balance, bytes32[] memory proof) public { } /** * Check the merkle proof of balance in the given side-chain block for given account */ function proofIsCorrect(uint blockNumber, address account, uint balance, bytes32[] memory proof) public view returns(bool) { } /** * Calculate root hash of a Merkle tree, given * @param hash of the leaf to verify * @param others list of hashes of "other" branches */ function calculateRootHash(bytes32 hash, bytes32[] memory others) public pure returns (bytes32 root) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; address public pendingOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() public { } } /** * Monoplasma that is managed by an owner, likely the side-chain operator * Owner can add and remove recipients. */ contract Monoplasma is BalanceVerifier, Ownable { using SafeMath for uint256; event OperatorChanged(address indexed newOperator); event AdminFeeChanged(uint adminFee); /** * Freeze period during which all side-chain participants should be able to * acquire the whole balance book from IPFS (or HTTP server, or elsewhere) * and validate that the published rootHash is correct * In case of incorrect rootHash, all members should issue withdrawals from the * latest block they have validated (that is older than blockFreezeSeconds) * So: too short freeze period + bad availability => ether (needlessly) spent withdrawing earnings * long freeze period == lag between purchase and withdrawal => bad UX * Blocks older than blockFreezeSeconds can be used to withdraw funds */ uint public blockFreezeSeconds; /** * Block number => timestamp * Publish time of a block, where the block freeze period starts from. * Note that block number points to the block after which the root hash is calculated, * not the block where BlockCreated was emitted (event must come later) */ mapping (uint => uint) public blockTimestamp; address public operator; //fee fraction = adminFee/10^18 uint public adminFee; IERC20 public token; mapping (address => uint) public earnings; mapping (address => uint) public withdrawn; uint public totalWithdrawn; uint public totalProven; constructor(address tokenAddress, uint blockFreezePeriodSeconds, uint _adminFee) public { } function setOperator(address newOperator) public onlyOwner { } /** * Admin fee as a fraction of revenue * Fixed-point decimal in the same way as ether: 50% === 0.5 ether * Smart contract doesn't use it, it's here just for storing purposes */ function setAdminFee(uint _adminFee) public onlyOwner { } /** * Operator creates the side-chain blocks */ function onCommit(uint blockNumber, bytes32, string) internal { } /** * Called from BalanceVerifier.prove * Prove can be called directly to withdraw less than the whole share, * or just "cement" the earnings so far into root chain even without withdrawing */ function onVerifySuccess(uint blockNumber, address account, uint newEarnings) internal { uint blockFreezeStart = blockTimestamp[blockNumber]; require(now > blockFreezeStart + blockFreezeSeconds, "error_frozen"); require(earnings[account] < newEarnings, "error_oldEarnings"); totalProven = totalProven.add(newEarnings).sub(earnings[account]); require(<FILL_ME>) earnings[account] = newEarnings; } /** * Prove and withdraw the whole revenue share from sidechain in one transaction * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAll(uint blockNumber, uint totalEarnings, bytes32[] proof) external { } /** * Prove and withdraw the whole revenue share for someone else * Validator needs to exit those it's watching out for, in case * it detects Operator malfunctioning * @param recipient the address we're proving and withdrawing * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAllFor(address recipient, uint blockNumber, uint totalEarnings, bytes32[] proof) public { } /** * "Donate withdraw" function that allows you to prove and transfer * your earnings to a another address in one transaction * @param recipient the address the tokens will be sent to (instead of msg.sender) * @param blockNumber of the leaf to verify * @param totalEarnings in the side-chain * @param proof list of hashes to prove the totalEarnings */ function withdrawAllTo(address recipient, uint blockNumber, uint totalEarnings, bytes32[] proof) external { } /** * Withdraw a specified amount of your own proven earnings (see `function prove`) */ function withdraw(uint amount) public { } /** * Do the withdrawal on behalf of someone else * Validator needs to exit those it's watching out for, in case * it detects Operator malfunctioning */ function withdrawFor(address recipient, uint amount) public { } /** * Execute token withdrawal into specified recipient address from specified member account * @dev It is up to the sidechain implementation to make sure * @dev always token balance >= sum of earnings - sum of withdrawn */ function withdrawTo(address recipient, address account, uint amount) public { } } contract CommunityProduct is Monoplasma { string public joinPartStream; constructor(address operator, string joinPartStreamId, address tokenAddress, uint blockFreezePeriodSeconds, uint adminFeeFraction) Monoplasma(tokenAddress, blockFreezePeriodSeconds, adminFeeFraction) public { } }
totalProven.sub(totalWithdrawn)<=token.balanceOf(this),"error_missingBalance"
292,542
totalProven.sub(totalWithdrawn)<=token.balanceOf(this)
"escrow already exists"
pragma solidity ^0.5.0; /** * Creates an EscrowLibrary contract and allows for creating new escrows linked * to that library * @dev The factory contract can be self-destructed by the owner to prevent * new escrows from being created without affecting the library and the ability * to close already existing escrows */ contract EscrowFactory is Ownable { EscrowLibrary public escrowLibrary; mapping(bytes32 => bool) internal escrowsCreated; constructor () public { } event EscrowCreated( bytes32 indexed escrowParams, address escrowAddress ); function createEthEscrow( uint escrowAmount, uint timelock, address payable escrowerReserve, address escrowerTrade, address escrowerRefund, address payable payeeReserve, address payeeTrade ) public { bytes32 escrowParamsHash = keccak256(abi.encodePacked( address(this), escrowAmount, timelock, escrowerReserve, escrowerTrade, escrowerRefund, payeeReserve, payeeTrade )); require(<FILL_ME>) EthEscrow escrow = new EthEscrow( address(escrowLibrary) ); escrowLibrary.newEscrow( address(escrow), escrowAmount, timelock, escrowerReserve, escrowerTrade, escrowerRefund, payeeReserve, payeeTrade ); escrowsCreated[escrowParamsHash] = true; emit EscrowCreated(escrowParamsHash, address(escrow)); } function selfDestruct() public onlyOwner { } }
!escrowsCreated[escrowParamsHash],"escrow already exists"
292,701
!escrowsCreated[escrowParamsHash]
null
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } contract B0xAccount is Ownable { using SafeMath for uint; mapping (address => Withdraw[]) public withdrawals; address public receiver1; address public receiver2; uint public numerator = 3; uint public denominator = 7; struct Withdraw { address receiver; uint amount; uint blockNumber; uint blockTimestamp; } function() public payable { require(msg.value > 0); uint toSend = msg.value.mul(numerator).div(denominator); require(<FILL_ME>) require(receiver2.send(toSend)); } constructor( address _receiver1, address _receiver2) public { } function deposit() public payable returns(bool) {} function withdraw( uint _value) public returns(bool) { } function withdrawTo( uint _value, address _to) public returns(bool) { } function transferToken( address _tokenAddress, address _to, uint _value) public onlyOwner returns (bool) { } function setReceiver1( address _receiver ) public onlyOwner { } function setReceiver2( address _receiver ) public onlyOwner { } function setNumeratorDenominator( uint _numerator, uint _denominator ) public onlyOwner { } function getBalance() public view returns (uint) { } }
receiver1.send(toSend)
292,703
receiver1.send(toSend)
null
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } contract B0xAccount is Ownable { using SafeMath for uint; mapping (address => Withdraw[]) public withdrawals; address public receiver1; address public receiver2; uint public numerator = 3; uint public denominator = 7; struct Withdraw { address receiver; uint amount; uint blockNumber; uint blockTimestamp; } function() public payable { require(msg.value > 0); uint toSend = msg.value.mul(numerator).div(denominator); require(receiver1.send(toSend)); require(<FILL_ME>) } constructor( address _receiver1, address _receiver2) public { } function deposit() public payable returns(bool) {} function withdraw( uint _value) public returns(bool) { } function withdrawTo( uint _value, address _to) public returns(bool) { } function transferToken( address _tokenAddress, address _to, uint _value) public onlyOwner returns (bool) { } function setReceiver1( address _receiver ) public onlyOwner { } function setReceiver2( address _receiver ) public onlyOwner { } function setNumeratorDenominator( uint _numerator, uint _denominator ) public onlyOwner { } function getBalance() public view returns (uint) { } }
receiver2.send(toSend)
292,703
receiver2.send(toSend)
null
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } contract B0xAccount is Ownable { using SafeMath for uint; mapping (address => Withdraw[]) public withdrawals; address public receiver1; address public receiver2; uint public numerator = 3; uint public denominator = 7; struct Withdraw { address receiver; uint amount; uint blockNumber; uint blockTimestamp; } function() public payable { } constructor( address _receiver1, address _receiver2) public { } function deposit() public payable returns(bool) {} function withdraw( uint _value) public returns(bool) { } function withdrawTo( uint _value, address _to) public returns(bool) { } function transferToken( address _tokenAddress, address _to, uint _value) public onlyOwner returns (bool) { // bytes4(keccak256("transfer(address,uint256)")) == 0xa9059cbb require(<FILL_ME>) return true; } function setReceiver1( address _receiver ) public onlyOwner { } function setReceiver2( address _receiver ) public onlyOwner { } function setNumeratorDenominator( uint _numerator, uint _denominator ) public onlyOwner { } function getBalance() public view returns (uint) { } }
_tokenAddress.call(0xa9059cbb,_to,_value)
292,703
_tokenAddress.call(0xa9059cbb,_to,_value)
null
pragma solidity ^0.7.0; /** * @title CryptoRick contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract CryptoRick is ERC721, Ownable { using SafeMath for uint256; string public RICK_PROVENANCE = ""; uint256 public startingIndexBlock; uint256 public startingIndex; uint256 public constant rickPrice = 50000000000000000; //0.05 ETH uint public constant maxRickPurchase = 5; uint256 public MAX_RICK; bool public saleIsActive = false; uint256 public REVEAL_TIMESTAMP; constructor(string memory name, string memory symbol, uint256 maxNftSupply, uint256 saleStart) ERC721(name, symbol) { } address[] withdrawAddresses = [0x3DcCb509199B52C21f60489D421080eA9167674D, 0xADDaF99990b665D8553f08653966fa8995Cc1209]; uint256[] withdrawPercents = [90, 10]; // Withdraw function sends the ETH to multiple addresses divided by percentages. function withdrawAll() public onlyOwner { uint256 contractBalance = address(this).balance; for(uint256 i=0;i<withdrawAddresses.length;i++) { uint256 amount = contractBalance * withdrawPercents[i] / 100; require(<FILL_ME>) } } /** * Set some Ricks aside */ function reserveRick() public onlyOwner { } /** * CryptoRick NFTs. */ function setRevealTimestamp(uint256 revealTimeStamp) public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } /* * Pause sale if active, make active if paused */ function flipSaleState() public onlyOwner { } /** * Mints CryptoRick */ function mintRick(uint numberOfTokens) public payable { } /** * Set the starting index for the collection */ function setStartingIndex() public { } /** * Set the starting index block for the collection, essentially unblocking * setting starting index */ function emergencySetStartingIndexBlock() public onlyOwner { } }
payable(withdrawAddresses[i]).send(amount)
292,732
payable(withdrawAddresses[i]).send(amount)
"Purchase would exceed max supply of Ricks"
pragma solidity ^0.7.0; /** * @title CryptoRick contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract CryptoRick is ERC721, Ownable { using SafeMath for uint256; string public RICK_PROVENANCE = ""; uint256 public startingIndexBlock; uint256 public startingIndex; uint256 public constant rickPrice = 50000000000000000; //0.05 ETH uint public constant maxRickPurchase = 5; uint256 public MAX_RICK; bool public saleIsActive = false; uint256 public REVEAL_TIMESTAMP; constructor(string memory name, string memory symbol, uint256 maxNftSupply, uint256 saleStart) ERC721(name, symbol) { } address[] withdrawAddresses = [0x3DcCb509199B52C21f60489D421080eA9167674D, 0xADDaF99990b665D8553f08653966fa8995Cc1209]; uint256[] withdrawPercents = [90, 10]; // Withdraw function sends the ETH to multiple addresses divided by percentages. function withdrawAll() public onlyOwner { } /** * Set some Ricks aside */ function reserveRick() public onlyOwner { } /** * CryptoRick NFTs. */ function setRevealTimestamp(uint256 revealTimeStamp) public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } /* * Pause sale if active, make active if paused */ function flipSaleState() public onlyOwner { } /** * Mints CryptoRick */ function mintRick(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint Ricks"); require(numberOfTokens <= maxRickPurchase, "Can only mint 20 tokens at a time"); require(<FILL_ME>) require(rickPrice.mul(numberOfTokens) <= msg.value, "Ether value sent is not correct"); for(uint i = 0; i < numberOfTokens; i++) { uint mintIndex = totalSupply(); if (totalSupply() < MAX_RICK) { _safeMint(msg.sender, mintIndex); } } // If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after // the end of pre-sale, set the starting index block if (startingIndexBlock == 0 && (totalSupply() == MAX_RICK || block.timestamp >= REVEAL_TIMESTAMP)) { startingIndexBlock = block.number; } } /** * Set the starting index for the collection */ function setStartingIndex() public { } /** * Set the starting index block for the collection, essentially unblocking * setting starting index */ function emergencySetStartingIndexBlock() public onlyOwner { } }
totalSupply().add(numberOfTokens)<=MAX_RICK,"Purchase would exceed max supply of Ricks"
292,732
totalSupply().add(numberOfTokens)<=MAX_RICK
"Ether value sent is not correct"
pragma solidity ^0.7.0; /** * @title CryptoRick contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract CryptoRick is ERC721, Ownable { using SafeMath for uint256; string public RICK_PROVENANCE = ""; uint256 public startingIndexBlock; uint256 public startingIndex; uint256 public constant rickPrice = 50000000000000000; //0.05 ETH uint public constant maxRickPurchase = 5; uint256 public MAX_RICK; bool public saleIsActive = false; uint256 public REVEAL_TIMESTAMP; constructor(string memory name, string memory symbol, uint256 maxNftSupply, uint256 saleStart) ERC721(name, symbol) { } address[] withdrawAddresses = [0x3DcCb509199B52C21f60489D421080eA9167674D, 0xADDaF99990b665D8553f08653966fa8995Cc1209]; uint256[] withdrawPercents = [90, 10]; // Withdraw function sends the ETH to multiple addresses divided by percentages. function withdrawAll() public onlyOwner { } /** * Set some Ricks aside */ function reserveRick() public onlyOwner { } /** * CryptoRick NFTs. */ function setRevealTimestamp(uint256 revealTimeStamp) public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } /* * Pause sale if active, make active if paused */ function flipSaleState() public onlyOwner { } /** * Mints CryptoRick */ function mintRick(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint Ricks"); require(numberOfTokens <= maxRickPurchase, "Can only mint 20 tokens at a time"); require(totalSupply().add(numberOfTokens) <= MAX_RICK, "Purchase would exceed max supply of Ricks"); require(<FILL_ME>) for(uint i = 0; i < numberOfTokens; i++) { uint mintIndex = totalSupply(); if (totalSupply() < MAX_RICK) { _safeMint(msg.sender, mintIndex); } } // If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after // the end of pre-sale, set the starting index block if (startingIndexBlock == 0 && (totalSupply() == MAX_RICK || block.timestamp >= REVEAL_TIMESTAMP)) { startingIndexBlock = block.number; } } /** * Set the starting index for the collection */ function setStartingIndex() public { } /** * Set the starting index block for the collection, essentially unblocking * setting starting index */ function emergencySetStartingIndexBlock() public onlyOwner { } }
rickPrice.mul(numberOfTokens)<=msg.value,"Ether value sent is not correct"
292,732
rickPrice.mul(numberOfTokens)<=msg.value
ERROR_NOT_OWNER
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { require(<FILL_ME>) _; } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { } function takeAllEarnings(address tokenAddress) public onlyOwner { } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
operators.has(msg.sender)||owner()==msg.sender,ERROR_NOT_OWNER
292,828
operators.has(msg.sender)||owner()==msg.sender
ERROR_NO_STAKE
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { require(<FILL_ME>) _; } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { } function takeAllEarnings(address tokenAddress) public onlyOwner { } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
stakes[staker][tokenAddress].TokenAddress==tokenAddress,ERROR_NO_STAKE
292,828
stakes[staker][tokenAddress].TokenAddress==tokenAddress
ERROR_TOKEN_EXISTS
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { require(<FILL_ME>) TokenList.push(TokenAddress); TokenStructs[TokenAddress].listPointer = TokenList.length.sub(1); emit WhitelistToken(TokenAddress); } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { } function takeAllEarnings(address tokenAddress) public onlyOwner { } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
!isToken(TokenAddress),ERROR_TOKEN_EXISTS
292,828
!isToken(TokenAddress)
ERROR_TOKEN_NOT_FOUND
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { require(<FILL_ME>) uint256 rowToDelete = TokenStructs[TokenAddress].listPointer; delete TokenList[rowToDelete]; delete TokenStructs[TokenAddress]; emit DiscardToken(TokenAddress); return; } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { } function takeAllEarnings(address tokenAddress) public onlyOwner { } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
isToken(TokenAddress),ERROR_TOKEN_NOT_FOUND
292,828
isToken(TokenAddress)
ERROR_TOKEN_NOT_FOUND
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { require(<FILL_ME>) require(hasStake(staker, tokenAddress), ERROR_NO_STAKE); require(amount > 0, ERROR_AMOUNT_ZERO); // Get Stake Types.Stake memory memStake = stakes[staker][tokenAddress]; IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); require(balance >= amount, ERROR_NOT_ENOUGH_BALANCE); uint256 tBalance = memStake.TokenBalance; require(tBalance >= amount, ERROR_NOT_ENOUGH_BALANCE); require(tBalance > 0, ERROR_NOT_ENOUGH_BALANCE); // Calculate Remaining Balance uint256 remainingAmount = tBalance.sub(amount); require(remainingAmount >= 0, ERROR_NOT_ENOUGH_BALANCE); _updateStakeForToken(staker, tokenAddress, remainingAmount); // Transfer Amount require(token.transfer(staker, amount), ERROR_TOKEN_TRANSFER); emit Redeem(staker, tokenAddress, amount); } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { } function takeAllEarnings(address tokenAddress) public onlyOwner { } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
isToken(tokenAddress),ERROR_TOKEN_NOT_FOUND
292,828
isToken(tokenAddress)
ERROR_NO_STAKE
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { require(isToken(tokenAddress), ERROR_TOKEN_NOT_FOUND); require(<FILL_ME>) require(amount > 0, ERROR_AMOUNT_ZERO); // Get Stake Types.Stake memory memStake = stakes[staker][tokenAddress]; IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); require(balance >= amount, ERROR_NOT_ENOUGH_BALANCE); uint256 tBalance = memStake.TokenBalance; require(tBalance >= amount, ERROR_NOT_ENOUGH_BALANCE); require(tBalance > 0, ERROR_NOT_ENOUGH_BALANCE); // Calculate Remaining Balance uint256 remainingAmount = tBalance.sub(amount); require(remainingAmount >= 0, ERROR_NOT_ENOUGH_BALANCE); _updateStakeForToken(staker, tokenAddress, remainingAmount); // Transfer Amount require(token.transfer(staker, amount), ERROR_TOKEN_TRANSFER); emit Redeem(staker, tokenAddress, amount); } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { } function takeAllEarnings(address tokenAddress) public onlyOwner { } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
hasStake(staker,tokenAddress),ERROR_NO_STAKE
292,828
hasStake(staker,tokenAddress)
ERROR_TOKEN_TRANSFER
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { require(isToken(tokenAddress), ERROR_TOKEN_NOT_FOUND); require(hasStake(staker, tokenAddress), ERROR_NO_STAKE); require(amount > 0, ERROR_AMOUNT_ZERO); // Get Stake Types.Stake memory memStake = stakes[staker][tokenAddress]; IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); require(balance >= amount, ERROR_NOT_ENOUGH_BALANCE); uint256 tBalance = memStake.TokenBalance; require(tBalance >= amount, ERROR_NOT_ENOUGH_BALANCE); require(tBalance > 0, ERROR_NOT_ENOUGH_BALANCE); // Calculate Remaining Balance uint256 remainingAmount = tBalance.sub(amount); require(remainingAmount >= 0, ERROR_NOT_ENOUGH_BALANCE); _updateStakeForToken(staker, tokenAddress, remainingAmount); // Transfer Amount require(<FILL_ME>) emit Redeem(staker, tokenAddress, amount); } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { } function takeAllEarnings(address tokenAddress) public onlyOwner { } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
token.transfer(staker,amount),ERROR_TOKEN_TRANSFER
292,828
token.transfer(staker,amount)
null
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); require(balance >= amount, ERROR_NOT_ENOUGH_BALANCE); require(<FILL_ME>) emit TakeEarnings(tokenAddress, amount); } function takeAllEarnings(address tokenAddress) public onlyOwner { } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
IERC20(tokenAddress).transfer(msg.sender,amount)
292,828
IERC20(tokenAddress).transfer(msg.sender,amount)
null
pragma solidity ^0.6.12; contract Stake is StakingInterface, Ownable, TokenErrorReporter { using SafeMath for uint256; using Roles for Roles.Role; Roles.Role operators; event WhitelistToken(address indexed tokenAddress); event DiscardToken(address indexed tokenAddress); event StakeEvent( address indexed staker, address indexed tokenAddress, uint256 tokenBalance ); event Redeem( address indexed staker, address indexed tokenAddress, uint256 tokenWithdrawal ); event TakeEarnings(address indexed tokenAddress, uint256 indexed amount); address[] public TokenList; mapping(address => Types.Token) public TokenStructs; mapping(address => mapping(address => Types.Stake)) public stakes; string private constant ERROR_AMOUNT_ZERO = "STAKING_AMOUNT_ZERO"; string private constant ERROR_AMOUNT_NEGATIVE = "STAKING_AMOUNT_NEGATIVE"; string private constant ERROR_TOKEN_TRANSFER = "STAKING_TOKEN_TRANSFER_FAILED"; string private constant ERROR_NOT_ENOUGH_BALANCE = "STAKING_NOT_ENOUGH_BALANCE"; string private constant ERROR_NOT_ENOUGH_ALLOWANCE = "STAKING_NOT_ENOUGH_ALLOWANCE"; string private constant ERROR_TOKEN_NOT_WHITELISTED = "STAKING_TOKEN_NOT_WHITELISTED"; string private constant ERROR_NOT_OWNER = "SEND_IS_NOT_OWNER"; string private constant ERROR_NO_STAKE = "STAKING_NOT_FOUND"; string private constant ERROR_TOKEN_EXISTS = "TOKEN_EXISTS"; string private constant ERROR_TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND"; string private constant ERROR_LENGTH_NOT_EQUAL = "LENGTH_NOT_EQUAL"; string private constant ERROR_TRANSFER_FAILED = "TOKEN_TRANSFER_FAILED"; constructor(address[] memory TokenAddress) public { } modifier onlyOperatorOrOwner() { } modifier onlyStakerOrOwner(address staker) { } modifier stakeExists(address staker, address tokenAddress) { } function addOperator(address _operator) public onlyOwner { } function removeOperator(address _operator) public onlyOwner { } function balanceOf(address staker, address tokenAddress) public view override returns (uint256) { } function isToken(address tokenAddress) public view returns (bool) { } function isStake(address staker, address tokenAddress) public view returns (bool) { } function hasStake(address staker, address tokenAddress) public view returns (bool) { } function whitelistToken(address TokenAddress) public override onlyOwner { } function bulkWhitelistToken(address[] memory TokenAddress) public { } function removeToken(address TokenAddress) public override onlyOwner { } function bulkRemoveToken(address[] memory TokenAddress) public { } function stake(address tokenAddress, uint256 amount) public override { } function stakeFor(address staker, address tokenAddress, uint256 amount) public onlyOperatorOrOwner { } function bulkStakeFor(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function bulkRedeem(address[] memory staker, address tokenAddress, uint256[] memory amount) public onlyOperatorOrOwner { } function redeem(address staker, address tokenAddress, uint256 amount) public override onlyOperatorOrOwner { } function takeEarnings(address tokenAddress, uint256 amount) public override onlyOwner { } function takeAllEarnings(address tokenAddress) public onlyOwner { IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); require(balance > 0, ERROR_NOT_ENOUGH_BALANCE); require(<FILL_ME>) emit TakeEarnings(tokenAddress, balance); } function addStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } function _updateStakeForToken(address staker, address TokenAddress, uint256 amount) internal { } }
token.transfer(msg.sender,balance)
292,828
token.transfer(msg.sender,balance)
null
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract BasicToken { string private token_name; string private token_symbol; uint256 private token_decimals; uint256 private total_supply; uint256 private remaining_supply; mapping (address => uint256) private balance_of; mapping (address => mapping(address => uint256)) private allowance_of; event Transfer(address indexed from, address indexed to, uint256 value); event Approve(address indexed target, address indexed spender, uint256 value); function BasicToken ( string tokenName, string tokenSymbol, uint256 tokenDecimals, uint256 tokenSupply ) public { } function name() public view returns (string) { } function symbol() public view returns (string) { } function decimals() public view returns (uint256) { } function totalSupply() public view returns (uint256) { } function remainingSupply() internal view returns (uint256) { } function balanceOf( address client_address ) public view returns (uint256) { } function setBalance( address client_address, uint256 value ) internal returns (bool) { } function allowance( address target_address, address spender_address ) public view returns (uint256) { } function approve( address spender_address, uint256 value ) public returns (bool) { } function setApprove( address target_address, address spender_address, uint256 value ) internal returns (bool) { } function changeTokenName( string newTokenName ) internal returns (bool) { } function changeTokenSymbol( string newTokenSymbol ) internal returns (bool) { } function changeTokenDecimals( uint256 newTokenDecimals ) internal returns (bool) { } function changeTotalSupply( uint256 newTotalSupply ) internal returns (bool) { } function changeRemainingSupply( uint256 newRemainingSupply ) internal returns (bool) { } } contract VoltOwned { mapping (address => uint) private voltOwners; address[] private ownerList; mapping (address => uint256) private voltFreeze; modifier onlyOwner { require(<FILL_ME>) _; } modifier noFreeze { } function VoltOwned(address firstOwner) public { } function isOwner(address who) internal view returns (bool) { } function addOwner(address newVoltOwnerAddress) public onlyOwner noFreeze { } function removeOwner(address removeVoltOwnerAddress) public onlyOwner noFreeze { } function getOwners() public onlyOwner noFreeze returns (address[]) { } function isFreeze(address who) internal view returns (bool) { } function setFreeze( address freezeAddress, uint256 timestamp ) public onlyOwner noFreeze returns (bool) { } function getFreezeTimestamp( address who ) public onlyOwner noFreeze returns (uint256) { } } contract VoltToken is BasicToken, VoltOwned { using SafeMath for uint256; bool private mintStatus; event Deposit(address indexed from, address indexed to, uint256 value); event Mint(address indexed to, uint256 value); event Burn(address indexed target, uint256 value); function VoltToken () public BasicToken ( "VOLT", "ACDC", 18, 4000000000 ) VoltOwned( msg.sender ) { } modifier canMint { } function mint( address to, uint256 value, uint256 freezeTimestamp ) public onlyOwner noFreeze canMint { } function superMint(address to, uint256 value) public onlyOwner noFreeze { } function mintOpen() public onlyOwner noFreeze returns (bool) { } function mintClose() public onlyOwner noFreeze returns (bool) { } function transfer( address to, uint256 value ) public noFreeze returns (bool) { } function transferFrom( address from, address to, uint256 value ) public noFreeze returns(bool) { } function voltTransfer( address from, address to, uint256 value ) private noFreeze returns (bool) { } function setTokenName( string newTokenName ) public onlyOwner noFreeze returns (bool) { } function setTokenSymbol( string newTokenSymbol ) public onlyOwner noFreeze returns (bool) { } function setTotalSupply( uint256 newTotalSupply ) public onlyOwner noFreeze returns (bool) { } function setRemainingSupply( uint256 newRemainingSupply ) public onlyOwner noFreeze returns (bool) { } function getRemainingSupply() public onlyOwner noFreeze returns (uint256) { } }
voltOwners[msg.sender]==99
293,080
voltOwners[msg.sender]==99
null
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract BasicToken { string private token_name; string private token_symbol; uint256 private token_decimals; uint256 private total_supply; uint256 private remaining_supply; mapping (address => uint256) private balance_of; mapping (address => mapping(address => uint256)) private allowance_of; event Transfer(address indexed from, address indexed to, uint256 value); event Approve(address indexed target, address indexed spender, uint256 value); function BasicToken ( string tokenName, string tokenSymbol, uint256 tokenDecimals, uint256 tokenSupply ) public { } function name() public view returns (string) { } function symbol() public view returns (string) { } function decimals() public view returns (uint256) { } function totalSupply() public view returns (uint256) { } function remainingSupply() internal view returns (uint256) { } function balanceOf( address client_address ) public view returns (uint256) { } function setBalance( address client_address, uint256 value ) internal returns (bool) { } function allowance( address target_address, address spender_address ) public view returns (uint256) { } function approve( address spender_address, uint256 value ) public returns (bool) { } function setApprove( address target_address, address spender_address, uint256 value ) internal returns (bool) { } function changeTokenName( string newTokenName ) internal returns (bool) { } function changeTokenSymbol( string newTokenSymbol ) internal returns (bool) { } function changeTokenDecimals( uint256 newTokenDecimals ) internal returns (bool) { } function changeTotalSupply( uint256 newTotalSupply ) internal returns (bool) { } function changeRemainingSupply( uint256 newRemainingSupply ) internal returns (bool) { } } contract VoltOwned { mapping (address => uint) private voltOwners; address[] private ownerList; mapping (address => uint256) private voltFreeze; modifier onlyOwner { } modifier noFreeze { } function VoltOwned(address firstOwner) public { } function isOwner(address who) internal view returns (bool) { } function addOwner(address newVoltOwnerAddress) public onlyOwner noFreeze { } function removeOwner(address removeVoltOwnerAddress) public onlyOwner noFreeze { } function getOwners() public onlyOwner noFreeze returns (address[]) { } function isFreeze(address who) internal view returns (bool) { } function setFreeze( address freezeAddress, uint256 timestamp ) public onlyOwner noFreeze returns (bool) { } function getFreezeTimestamp( address who ) public onlyOwner noFreeze returns (uint256) { } } contract VoltToken is BasicToken, VoltOwned { using SafeMath for uint256; bool private mintStatus; event Deposit(address indexed from, address indexed to, uint256 value); event Mint(address indexed to, uint256 value); event Burn(address indexed target, uint256 value); function VoltToken () public BasicToken ( "VOLT", "ACDC", 18, 4000000000 ) VoltOwned( msg.sender ) { } modifier canMint { } function mint( address to, uint256 value, uint256 freezeTimestamp ) public onlyOwner noFreeze canMint { } function superMint(address to, uint256 value) public onlyOwner noFreeze { } function mintOpen() public onlyOwner noFreeze returns (bool) { } function mintClose() public onlyOwner noFreeze returns (bool) { } function transfer( address to, uint256 value ) public noFreeze returns (bool) { require(value > 0); require(msg.sender != address(0)); require(to != address(0)); require(balanceOf(msg.sender) >= value); require(<FILL_ME>) voltTransfer(msg.sender, to, value); return true; } function transferFrom( address from, address to, uint256 value ) public noFreeze returns(bool) { } function voltTransfer( address from, address to, uint256 value ) private noFreeze returns (bool) { } function setTokenName( string newTokenName ) public onlyOwner noFreeze returns (bool) { } function setTokenSymbol( string newTokenSymbol ) public onlyOwner noFreeze returns (bool) { } function setTotalSupply( uint256 newTotalSupply ) public onlyOwner noFreeze returns (bool) { } function setRemainingSupply( uint256 newRemainingSupply ) public onlyOwner noFreeze returns (bool) { } function getRemainingSupply() public onlyOwner noFreeze returns (uint256) { } }
balanceOf(to).add(value)>=balanceOf(to)
293,080
balanceOf(to).add(value)>=balanceOf(to)
null
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract BasicToken { string private token_name; string private token_symbol; uint256 private token_decimals; uint256 private total_supply; uint256 private remaining_supply; mapping (address => uint256) private balance_of; mapping (address => mapping(address => uint256)) private allowance_of; event Transfer(address indexed from, address indexed to, uint256 value); event Approve(address indexed target, address indexed spender, uint256 value); function BasicToken ( string tokenName, string tokenSymbol, uint256 tokenDecimals, uint256 tokenSupply ) public { } function name() public view returns (string) { } function symbol() public view returns (string) { } function decimals() public view returns (uint256) { } function totalSupply() public view returns (uint256) { } function remainingSupply() internal view returns (uint256) { } function balanceOf( address client_address ) public view returns (uint256) { } function setBalance( address client_address, uint256 value ) internal returns (bool) { } function allowance( address target_address, address spender_address ) public view returns (uint256) { } function approve( address spender_address, uint256 value ) public returns (bool) { } function setApprove( address target_address, address spender_address, uint256 value ) internal returns (bool) { } function changeTokenName( string newTokenName ) internal returns (bool) { } function changeTokenSymbol( string newTokenSymbol ) internal returns (bool) { } function changeTokenDecimals( uint256 newTokenDecimals ) internal returns (bool) { } function changeTotalSupply( uint256 newTotalSupply ) internal returns (bool) { } function changeRemainingSupply( uint256 newRemainingSupply ) internal returns (bool) { } } contract VoltOwned { mapping (address => uint) private voltOwners; address[] private ownerList; mapping (address => uint256) private voltFreeze; modifier onlyOwner { } modifier noFreeze { } function VoltOwned(address firstOwner) public { } function isOwner(address who) internal view returns (bool) { } function addOwner(address newVoltOwnerAddress) public onlyOwner noFreeze { } function removeOwner(address removeVoltOwnerAddress) public onlyOwner noFreeze { } function getOwners() public onlyOwner noFreeze returns (address[]) { } function isFreeze(address who) internal view returns (bool) { } function setFreeze( address freezeAddress, uint256 timestamp ) public onlyOwner noFreeze returns (bool) { } function getFreezeTimestamp( address who ) public onlyOwner noFreeze returns (uint256) { } } contract VoltToken is BasicToken, VoltOwned { using SafeMath for uint256; bool private mintStatus; event Deposit(address indexed from, address indexed to, uint256 value); event Mint(address indexed to, uint256 value); event Burn(address indexed target, uint256 value); function VoltToken () public BasicToken ( "VOLT", "ACDC", 18, 4000000000 ) VoltOwned( msg.sender ) { } modifier canMint { } function mint( address to, uint256 value, uint256 freezeTimestamp ) public onlyOwner noFreeze canMint { } function superMint(address to, uint256 value) public onlyOwner noFreeze { } function mintOpen() public onlyOwner noFreeze returns (bool) { } function mintClose() public onlyOwner noFreeze returns (bool) { } function transfer( address to, uint256 value ) public noFreeze returns (bool) { } function transferFrom( address from, address to, uint256 value ) public noFreeze returns(bool) { require(value > 0); require(msg.sender != address(0)); require(from != address(0)); require(to != address(0)); require(<FILL_ME>) require(allowance(from, msg.sender) >= value); require(balanceOf(from) >= value); require(balanceOf(to).add(value) >= balanceOf(to)); voltTransfer(from, to, value); uint256 remaining = allowance(from, msg.sender).sub(value); setApprove(from, msg.sender, remaining); return true; } function voltTransfer( address from, address to, uint256 value ) private noFreeze returns (bool) { } function setTokenName( string newTokenName ) public onlyOwner noFreeze returns (bool) { } function setTokenSymbol( string newTokenSymbol ) public onlyOwner noFreeze returns (bool) { } function setTotalSupply( uint256 newTotalSupply ) public onlyOwner noFreeze returns (bool) { } function setRemainingSupply( uint256 newRemainingSupply ) public onlyOwner noFreeze returns (bool) { } function getRemainingSupply() public onlyOwner noFreeze returns (uint256) { } }
isFreeze(from)==false
293,080
isFreeze(from)==false
null
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract BasicToken { string private token_name; string private token_symbol; uint256 private token_decimals; uint256 private total_supply; uint256 private remaining_supply; mapping (address => uint256) private balance_of; mapping (address => mapping(address => uint256)) private allowance_of; event Transfer(address indexed from, address indexed to, uint256 value); event Approve(address indexed target, address indexed spender, uint256 value); function BasicToken ( string tokenName, string tokenSymbol, uint256 tokenDecimals, uint256 tokenSupply ) public { } function name() public view returns (string) { } function symbol() public view returns (string) { } function decimals() public view returns (uint256) { } function totalSupply() public view returns (uint256) { } function remainingSupply() internal view returns (uint256) { } function balanceOf( address client_address ) public view returns (uint256) { } function setBalance( address client_address, uint256 value ) internal returns (bool) { } function allowance( address target_address, address spender_address ) public view returns (uint256) { } function approve( address spender_address, uint256 value ) public returns (bool) { } function setApprove( address target_address, address spender_address, uint256 value ) internal returns (bool) { } function changeTokenName( string newTokenName ) internal returns (bool) { } function changeTokenSymbol( string newTokenSymbol ) internal returns (bool) { } function changeTokenDecimals( uint256 newTokenDecimals ) internal returns (bool) { } function changeTotalSupply( uint256 newTotalSupply ) internal returns (bool) { } function changeRemainingSupply( uint256 newRemainingSupply ) internal returns (bool) { } } contract VoltOwned { mapping (address => uint) private voltOwners; address[] private ownerList; mapping (address => uint256) private voltFreeze; modifier onlyOwner { } modifier noFreeze { } function VoltOwned(address firstOwner) public { } function isOwner(address who) internal view returns (bool) { } function addOwner(address newVoltOwnerAddress) public onlyOwner noFreeze { } function removeOwner(address removeVoltOwnerAddress) public onlyOwner noFreeze { } function getOwners() public onlyOwner noFreeze returns (address[]) { } function isFreeze(address who) internal view returns (bool) { } function setFreeze( address freezeAddress, uint256 timestamp ) public onlyOwner noFreeze returns (bool) { } function getFreezeTimestamp( address who ) public onlyOwner noFreeze returns (uint256) { } } contract VoltToken is BasicToken, VoltOwned { using SafeMath for uint256; bool private mintStatus; event Deposit(address indexed from, address indexed to, uint256 value); event Mint(address indexed to, uint256 value); event Burn(address indexed target, uint256 value); function VoltToken () public BasicToken ( "VOLT", "ACDC", 18, 4000000000 ) VoltOwned( msg.sender ) { } modifier canMint { } function mint( address to, uint256 value, uint256 freezeTimestamp ) public onlyOwner noFreeze canMint { } function superMint(address to, uint256 value) public onlyOwner noFreeze { } function mintOpen() public onlyOwner noFreeze returns (bool) { } function mintClose() public onlyOwner noFreeze returns (bool) { } function transfer( address to, uint256 value ) public noFreeze returns (bool) { } function transferFrom( address from, address to, uint256 value ) public noFreeze returns(bool) { require(value > 0); require(msg.sender != address(0)); require(from != address(0)); require(to != address(0)); require(isFreeze(from) == false); require(<FILL_ME>) require(balanceOf(from) >= value); require(balanceOf(to).add(value) >= balanceOf(to)); voltTransfer(from, to, value); uint256 remaining = allowance(from, msg.sender).sub(value); setApprove(from, msg.sender, remaining); return true; } function voltTransfer( address from, address to, uint256 value ) private noFreeze returns (bool) { } function setTokenName( string newTokenName ) public onlyOwner noFreeze returns (bool) { } function setTokenSymbol( string newTokenSymbol ) public onlyOwner noFreeze returns (bool) { } function setTotalSupply( uint256 newTotalSupply ) public onlyOwner noFreeze returns (bool) { } function setRemainingSupply( uint256 newRemainingSupply ) public onlyOwner noFreeze returns (bool) { } function getRemainingSupply() public onlyOwner noFreeze returns (uint256) { } }
allowance(from,msg.sender)>=value
293,080
allowance(from,msg.sender)>=value
'!signatory'
// SPDX-License-Identifier: MIT // Copyright (c) 2021 Varia LLC /// Wet Code by Erich Dylus & Sarah Brennan /// Dry Code by LexDAO LLC pragma solidity 0.8.6; /// @notice This contract manages function access control, adapted from @boringcrypto (https://github.com/boringcrypto/BoringSolidity). contract Ownable { address public owner; address public pendingOwner; event TransferOwnership(address indexed from, address indexed to); event TransferOwnershipClaim(address indexed from, address indexed to); /// @notice Initialize contract. constructor() { } /// @notice Access control modifier that requires modified function to be called by `owner` account. modifier onlyOwner { } /// @notice The `pendingOwner` can claim `owner` account. function claimOwner() external { } /// @notice Transfer `owner` account. /// @param to Account granted `owner` access control. /// @param direct If 'true', ownership is directly transferred. function transferOwnership(address to, bool direct) external onlyOwner { } } /// @notice This contract allows potential delegates of DAO voting power to ethSign disclosures. contract VoteDelegateDisclosure is Ownable { uint8 public version; // counter for ricardian template versions uint256 public signatures; // counter for ricardian signatures - registration `id` string public template; // string stored for ricardian template signature - amendable by `owner` mapping(address => uint256) public registrations; // maps signatures to registration `id` (revocation, composability, etc.) event Amend(string template); event Sign(uint256 indexed id, string details); event Revoke(uint256 indexed id, string details); constructor(string memory _template) { } function amend(string calldata _template) external onlyOwner { } function sign(string calldata details) external returns (uint256 id) { } function revoke(uint256 id, string calldata details) external { require(<FILL_ME>) // confirm caller is `id` signatory registrations[msg.sender] = 0; // nullify registration id emit Revoke(id, details); // emit revocation details in event for apps } }
registrations[msg.sender]==id,'!signatory'
293,103
registrations[msg.sender]==id
null
pragma solidity ^0.4.12; contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } function assert(bool assertion) internal { } } contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StandardToken is ERC20, SafeMath { mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract UBetCoin is Ownable, StandardToken { string public name = "UBetCoin"; // name of the token string public symbol = "UBET"; // ERC20 compliant 4 digit token code uint public decimals = 2; // token has 2 digit precision uint256 public totalSupply = 400000000000; // 4 BILLION INITIAL SUPPLY uint256 public tokenSupplyFromCheck = 0; // Total from check! uint256 public tokenSupplyBackedByGold = 4000000000; // Supply Backed By Gold string public constant YOU_BET_MINE_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/GOLD-MINES-assigned+TO-SAINT-NICOLAS-SNADCO-03-22-2016.pdf"; string public constant YOU_BET_MINE_DOCUMENT_SHA512 = "7e9dc6362c5bf85ff19d75df9140b033c4121ba8aaef7e5837b276d657becf0a0d68fcf26b95e76023a33251ac94f35492f2f0af882af4b87b1b1b626b325cf8"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/LEDGER-TO-LEDGER+ENTRY-FOR-UBETCOIN+03-20-2018.pdf"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_SHA512 = "c8f0ae2602005dd88ef908624cf59f3956107d0890d67d3baf9c885b64544a8140e282366cae6a3af7bfbc96d17f856b55fc4960e2287d4a03d67e646e0e88c6"; /// Base exchange rate is set uint256 public ratePerOneEther = 962; uint256 public totalUBetCheckAmounts = 0; /// Issue event index starting from 0. uint64 public issueIndex = 0; /// Emitted for each sucuessful token purchase. event Issue(uint64 issueIndex, address addr, uint256 tokenAmount); // All funds will be transferred in this wallet. address public moneyWallet = 0xe5688167Cb7aBcE4355F63943aAaC8bb269dc953; /// Emitted for each UBETCHECKS register. event UbetCheckIssue(string chequeIndex); struct UBetCheck { string accountId; string accountNumber; string fullName; string routingNumber; string institution; uint256 amount; uint256 tokens; string checkFilePath; string digitalCheckFingerPrint; } mapping (address => UBetCheck) UBetChecks; address[] public uBetCheckAccts; /// @dev Initializes the contract and allocates all initial tokens to the owner function UBetCoin() { } //////////////// owner only functions below /// @dev To transfer token contract ownership /// @param _newOwner The address of the new owner of this contract function transferOwnership(address _newOwner) onlyOwner { } /// check functionality /// @dev Register UBetCheck to the chain /// @param _beneficiary recipient ether address /// @param _accountId the id generated from the db /// @param _accountNumber the account number stated in the check /// @param _routingNumber the routing number stated in the check /// @param _institution the name of the institution / bank in the check /// @param _fullname the name printed on the check /// @param _amount the amount in currency in the chek /// @param _checkFilePath the url path where the cheque has been uploaded /// @param _digitalCheckFingerPrint the hash of the file /// @param _tokens number of tokens issued to the beneficiary function registerUBetCheck(address _beneficiary, string _accountId, string _accountNumber, string _routingNumber, string _institution, string _fullname, uint256 _amount, string _checkFilePath, string _digitalCheckFingerPrint, uint256 _tokens) public payable onlyOwner { require(_beneficiary != address(0)); require(<FILL_ME>) require(bytes(_accountNumber).length != 0); require(bytes(_routingNumber).length != 0); require(bytes(_institution).length != 0); require(bytes(_fullname).length != 0); require(_amount > 0); require(_tokens > 0); require(bytes(_checkFilePath).length != 0); require(bytes(_digitalCheckFingerPrint).length != 0); var __conToken = _tokens * (10**(decimals)); var uBetCheck = UBetChecks[_beneficiary]; uBetCheck.accountId = _accountId; uBetCheck.accountNumber = _accountNumber; uBetCheck.routingNumber = _routingNumber; uBetCheck.institution = _institution; uBetCheck.fullName = _fullname; uBetCheck.amount = _amount; uBetCheck.tokens = _tokens; uBetCheck.checkFilePath = _checkFilePath; uBetCheck.digitalCheckFingerPrint = _digitalCheckFingerPrint; totalUBetCheckAmounts = safeAdd(totalUBetCheckAmounts, _amount); tokenSupplyFromCheck = safeAdd(tokenSupplyFromCheck, _tokens); uBetCheckAccts.push(_beneficiary) -1; // Issue token when registered UBetCheck is complete to the _beneficiary doIssueTokens(_beneficiary, __conToken); // Fire Event UbetCheckIssue UbetCheckIssue(_accountId); } /// @dev List all the checks in the function getUBetChecks() public returns (address[]) { } /// @dev Return UBetCheck information by supplying beneficiary adddress function getUBetCheck(address _address) public returns(string, string, string, string, uint256, string, string) { } /// @dev This default function allows token to be purchased by directly /// sending ether to this smart contract. function () public payable { } /// @dev return total count of registered UBet Checks function countUBetChecks() public returns (uint) { } /// @dev issue tokens for a single buyer /// @param _beneficiary addresses that the tokens will be sent to. /// @param _tokens the amount of tokens, with decimals expanded (full). function doIssueTokens(address _beneficiary, uint256 _tokens) internal { } /// @dev Issue token based on Ether received. /// @param _beneficiary Address that newly issued token will be sent to. function purchaseTokens(address _beneficiary) public payable { } /// @dev Change money wallet owner /// @param _address new address to received the ether function setMoneyWallet(address _address) public onlyOwner { } /// @dev Change Rate per token in one ether /// @param _value the amount of tokens, with decimals expanded (full). function setRatePerOneEther(uint256 _value) public onlyOwner { } }
bytes(_accountId).length!=0
293,110
bytes(_accountId).length!=0
null
pragma solidity ^0.4.12; contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } function assert(bool assertion) internal { } } contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StandardToken is ERC20, SafeMath { mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract UBetCoin is Ownable, StandardToken { string public name = "UBetCoin"; // name of the token string public symbol = "UBET"; // ERC20 compliant 4 digit token code uint public decimals = 2; // token has 2 digit precision uint256 public totalSupply = 400000000000; // 4 BILLION INITIAL SUPPLY uint256 public tokenSupplyFromCheck = 0; // Total from check! uint256 public tokenSupplyBackedByGold = 4000000000; // Supply Backed By Gold string public constant YOU_BET_MINE_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/GOLD-MINES-assigned+TO-SAINT-NICOLAS-SNADCO-03-22-2016.pdf"; string public constant YOU_BET_MINE_DOCUMENT_SHA512 = "7e9dc6362c5bf85ff19d75df9140b033c4121ba8aaef7e5837b276d657becf0a0d68fcf26b95e76023a33251ac94f35492f2f0af882af4b87b1b1b626b325cf8"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/LEDGER-TO-LEDGER+ENTRY-FOR-UBETCOIN+03-20-2018.pdf"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_SHA512 = "c8f0ae2602005dd88ef908624cf59f3956107d0890d67d3baf9c885b64544a8140e282366cae6a3af7bfbc96d17f856b55fc4960e2287d4a03d67e646e0e88c6"; /// Base exchange rate is set uint256 public ratePerOneEther = 962; uint256 public totalUBetCheckAmounts = 0; /// Issue event index starting from 0. uint64 public issueIndex = 0; /// Emitted for each sucuessful token purchase. event Issue(uint64 issueIndex, address addr, uint256 tokenAmount); // All funds will be transferred in this wallet. address public moneyWallet = 0xe5688167Cb7aBcE4355F63943aAaC8bb269dc953; /// Emitted for each UBETCHECKS register. event UbetCheckIssue(string chequeIndex); struct UBetCheck { string accountId; string accountNumber; string fullName; string routingNumber; string institution; uint256 amount; uint256 tokens; string checkFilePath; string digitalCheckFingerPrint; } mapping (address => UBetCheck) UBetChecks; address[] public uBetCheckAccts; /// @dev Initializes the contract and allocates all initial tokens to the owner function UBetCoin() { } //////////////// owner only functions below /// @dev To transfer token contract ownership /// @param _newOwner The address of the new owner of this contract function transferOwnership(address _newOwner) onlyOwner { } /// check functionality /// @dev Register UBetCheck to the chain /// @param _beneficiary recipient ether address /// @param _accountId the id generated from the db /// @param _accountNumber the account number stated in the check /// @param _routingNumber the routing number stated in the check /// @param _institution the name of the institution / bank in the check /// @param _fullname the name printed on the check /// @param _amount the amount in currency in the chek /// @param _checkFilePath the url path where the cheque has been uploaded /// @param _digitalCheckFingerPrint the hash of the file /// @param _tokens number of tokens issued to the beneficiary function registerUBetCheck(address _beneficiary, string _accountId, string _accountNumber, string _routingNumber, string _institution, string _fullname, uint256 _amount, string _checkFilePath, string _digitalCheckFingerPrint, uint256 _tokens) public payable onlyOwner { require(_beneficiary != address(0)); require(bytes(_accountId).length != 0); require(<FILL_ME>) require(bytes(_routingNumber).length != 0); require(bytes(_institution).length != 0); require(bytes(_fullname).length != 0); require(_amount > 0); require(_tokens > 0); require(bytes(_checkFilePath).length != 0); require(bytes(_digitalCheckFingerPrint).length != 0); var __conToken = _tokens * (10**(decimals)); var uBetCheck = UBetChecks[_beneficiary]; uBetCheck.accountId = _accountId; uBetCheck.accountNumber = _accountNumber; uBetCheck.routingNumber = _routingNumber; uBetCheck.institution = _institution; uBetCheck.fullName = _fullname; uBetCheck.amount = _amount; uBetCheck.tokens = _tokens; uBetCheck.checkFilePath = _checkFilePath; uBetCheck.digitalCheckFingerPrint = _digitalCheckFingerPrint; totalUBetCheckAmounts = safeAdd(totalUBetCheckAmounts, _amount); tokenSupplyFromCheck = safeAdd(tokenSupplyFromCheck, _tokens); uBetCheckAccts.push(_beneficiary) -1; // Issue token when registered UBetCheck is complete to the _beneficiary doIssueTokens(_beneficiary, __conToken); // Fire Event UbetCheckIssue UbetCheckIssue(_accountId); } /// @dev List all the checks in the function getUBetChecks() public returns (address[]) { } /// @dev Return UBetCheck information by supplying beneficiary adddress function getUBetCheck(address _address) public returns(string, string, string, string, uint256, string, string) { } /// @dev This default function allows token to be purchased by directly /// sending ether to this smart contract. function () public payable { } /// @dev return total count of registered UBet Checks function countUBetChecks() public returns (uint) { } /// @dev issue tokens for a single buyer /// @param _beneficiary addresses that the tokens will be sent to. /// @param _tokens the amount of tokens, with decimals expanded (full). function doIssueTokens(address _beneficiary, uint256 _tokens) internal { } /// @dev Issue token based on Ether received. /// @param _beneficiary Address that newly issued token will be sent to. function purchaseTokens(address _beneficiary) public payable { } /// @dev Change money wallet owner /// @param _address new address to received the ether function setMoneyWallet(address _address) public onlyOwner { } /// @dev Change Rate per token in one ether /// @param _value the amount of tokens, with decimals expanded (full). function setRatePerOneEther(uint256 _value) public onlyOwner { } }
bytes(_accountNumber).length!=0
293,110
bytes(_accountNumber).length!=0
null
pragma solidity ^0.4.12; contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } function assert(bool assertion) internal { } } contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StandardToken is ERC20, SafeMath { mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract UBetCoin is Ownable, StandardToken { string public name = "UBetCoin"; // name of the token string public symbol = "UBET"; // ERC20 compliant 4 digit token code uint public decimals = 2; // token has 2 digit precision uint256 public totalSupply = 400000000000; // 4 BILLION INITIAL SUPPLY uint256 public tokenSupplyFromCheck = 0; // Total from check! uint256 public tokenSupplyBackedByGold = 4000000000; // Supply Backed By Gold string public constant YOU_BET_MINE_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/GOLD-MINES-assigned+TO-SAINT-NICOLAS-SNADCO-03-22-2016.pdf"; string public constant YOU_BET_MINE_DOCUMENT_SHA512 = "7e9dc6362c5bf85ff19d75df9140b033c4121ba8aaef7e5837b276d657becf0a0d68fcf26b95e76023a33251ac94f35492f2f0af882af4b87b1b1b626b325cf8"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/LEDGER-TO-LEDGER+ENTRY-FOR-UBETCOIN+03-20-2018.pdf"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_SHA512 = "c8f0ae2602005dd88ef908624cf59f3956107d0890d67d3baf9c885b64544a8140e282366cae6a3af7bfbc96d17f856b55fc4960e2287d4a03d67e646e0e88c6"; /// Base exchange rate is set uint256 public ratePerOneEther = 962; uint256 public totalUBetCheckAmounts = 0; /// Issue event index starting from 0. uint64 public issueIndex = 0; /// Emitted for each sucuessful token purchase. event Issue(uint64 issueIndex, address addr, uint256 tokenAmount); // All funds will be transferred in this wallet. address public moneyWallet = 0xe5688167Cb7aBcE4355F63943aAaC8bb269dc953; /// Emitted for each UBETCHECKS register. event UbetCheckIssue(string chequeIndex); struct UBetCheck { string accountId; string accountNumber; string fullName; string routingNumber; string institution; uint256 amount; uint256 tokens; string checkFilePath; string digitalCheckFingerPrint; } mapping (address => UBetCheck) UBetChecks; address[] public uBetCheckAccts; /// @dev Initializes the contract and allocates all initial tokens to the owner function UBetCoin() { } //////////////// owner only functions below /// @dev To transfer token contract ownership /// @param _newOwner The address of the new owner of this contract function transferOwnership(address _newOwner) onlyOwner { } /// check functionality /// @dev Register UBetCheck to the chain /// @param _beneficiary recipient ether address /// @param _accountId the id generated from the db /// @param _accountNumber the account number stated in the check /// @param _routingNumber the routing number stated in the check /// @param _institution the name of the institution / bank in the check /// @param _fullname the name printed on the check /// @param _amount the amount in currency in the chek /// @param _checkFilePath the url path where the cheque has been uploaded /// @param _digitalCheckFingerPrint the hash of the file /// @param _tokens number of tokens issued to the beneficiary function registerUBetCheck(address _beneficiary, string _accountId, string _accountNumber, string _routingNumber, string _institution, string _fullname, uint256 _amount, string _checkFilePath, string _digitalCheckFingerPrint, uint256 _tokens) public payable onlyOwner { require(_beneficiary != address(0)); require(bytes(_accountId).length != 0); require(bytes(_accountNumber).length != 0); require(<FILL_ME>) require(bytes(_institution).length != 0); require(bytes(_fullname).length != 0); require(_amount > 0); require(_tokens > 0); require(bytes(_checkFilePath).length != 0); require(bytes(_digitalCheckFingerPrint).length != 0); var __conToken = _tokens * (10**(decimals)); var uBetCheck = UBetChecks[_beneficiary]; uBetCheck.accountId = _accountId; uBetCheck.accountNumber = _accountNumber; uBetCheck.routingNumber = _routingNumber; uBetCheck.institution = _institution; uBetCheck.fullName = _fullname; uBetCheck.amount = _amount; uBetCheck.tokens = _tokens; uBetCheck.checkFilePath = _checkFilePath; uBetCheck.digitalCheckFingerPrint = _digitalCheckFingerPrint; totalUBetCheckAmounts = safeAdd(totalUBetCheckAmounts, _amount); tokenSupplyFromCheck = safeAdd(tokenSupplyFromCheck, _tokens); uBetCheckAccts.push(_beneficiary) -1; // Issue token when registered UBetCheck is complete to the _beneficiary doIssueTokens(_beneficiary, __conToken); // Fire Event UbetCheckIssue UbetCheckIssue(_accountId); } /// @dev List all the checks in the function getUBetChecks() public returns (address[]) { } /// @dev Return UBetCheck information by supplying beneficiary adddress function getUBetCheck(address _address) public returns(string, string, string, string, uint256, string, string) { } /// @dev This default function allows token to be purchased by directly /// sending ether to this smart contract. function () public payable { } /// @dev return total count of registered UBet Checks function countUBetChecks() public returns (uint) { } /// @dev issue tokens for a single buyer /// @param _beneficiary addresses that the tokens will be sent to. /// @param _tokens the amount of tokens, with decimals expanded (full). function doIssueTokens(address _beneficiary, uint256 _tokens) internal { } /// @dev Issue token based on Ether received. /// @param _beneficiary Address that newly issued token will be sent to. function purchaseTokens(address _beneficiary) public payable { } /// @dev Change money wallet owner /// @param _address new address to received the ether function setMoneyWallet(address _address) public onlyOwner { } /// @dev Change Rate per token in one ether /// @param _value the amount of tokens, with decimals expanded (full). function setRatePerOneEther(uint256 _value) public onlyOwner { } }
bytes(_routingNumber).length!=0
293,110
bytes(_routingNumber).length!=0
null
pragma solidity ^0.4.12; contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } function assert(bool assertion) internal { } } contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StandardToken is ERC20, SafeMath { mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract UBetCoin is Ownable, StandardToken { string public name = "UBetCoin"; // name of the token string public symbol = "UBET"; // ERC20 compliant 4 digit token code uint public decimals = 2; // token has 2 digit precision uint256 public totalSupply = 400000000000; // 4 BILLION INITIAL SUPPLY uint256 public tokenSupplyFromCheck = 0; // Total from check! uint256 public tokenSupplyBackedByGold = 4000000000; // Supply Backed By Gold string public constant YOU_BET_MINE_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/GOLD-MINES-assigned+TO-SAINT-NICOLAS-SNADCO-03-22-2016.pdf"; string public constant YOU_BET_MINE_DOCUMENT_SHA512 = "7e9dc6362c5bf85ff19d75df9140b033c4121ba8aaef7e5837b276d657becf0a0d68fcf26b95e76023a33251ac94f35492f2f0af882af4b87b1b1b626b325cf8"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/LEDGER-TO-LEDGER+ENTRY-FOR-UBETCOIN+03-20-2018.pdf"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_SHA512 = "c8f0ae2602005dd88ef908624cf59f3956107d0890d67d3baf9c885b64544a8140e282366cae6a3af7bfbc96d17f856b55fc4960e2287d4a03d67e646e0e88c6"; /// Base exchange rate is set uint256 public ratePerOneEther = 962; uint256 public totalUBetCheckAmounts = 0; /// Issue event index starting from 0. uint64 public issueIndex = 0; /// Emitted for each sucuessful token purchase. event Issue(uint64 issueIndex, address addr, uint256 tokenAmount); // All funds will be transferred in this wallet. address public moneyWallet = 0xe5688167Cb7aBcE4355F63943aAaC8bb269dc953; /// Emitted for each UBETCHECKS register. event UbetCheckIssue(string chequeIndex); struct UBetCheck { string accountId; string accountNumber; string fullName; string routingNumber; string institution; uint256 amount; uint256 tokens; string checkFilePath; string digitalCheckFingerPrint; } mapping (address => UBetCheck) UBetChecks; address[] public uBetCheckAccts; /// @dev Initializes the contract and allocates all initial tokens to the owner function UBetCoin() { } //////////////// owner only functions below /// @dev To transfer token contract ownership /// @param _newOwner The address of the new owner of this contract function transferOwnership(address _newOwner) onlyOwner { } /// check functionality /// @dev Register UBetCheck to the chain /// @param _beneficiary recipient ether address /// @param _accountId the id generated from the db /// @param _accountNumber the account number stated in the check /// @param _routingNumber the routing number stated in the check /// @param _institution the name of the institution / bank in the check /// @param _fullname the name printed on the check /// @param _amount the amount in currency in the chek /// @param _checkFilePath the url path where the cheque has been uploaded /// @param _digitalCheckFingerPrint the hash of the file /// @param _tokens number of tokens issued to the beneficiary function registerUBetCheck(address _beneficiary, string _accountId, string _accountNumber, string _routingNumber, string _institution, string _fullname, uint256 _amount, string _checkFilePath, string _digitalCheckFingerPrint, uint256 _tokens) public payable onlyOwner { require(_beneficiary != address(0)); require(bytes(_accountId).length != 0); require(bytes(_accountNumber).length != 0); require(bytes(_routingNumber).length != 0); require(<FILL_ME>) require(bytes(_fullname).length != 0); require(_amount > 0); require(_tokens > 0); require(bytes(_checkFilePath).length != 0); require(bytes(_digitalCheckFingerPrint).length != 0); var __conToken = _tokens * (10**(decimals)); var uBetCheck = UBetChecks[_beneficiary]; uBetCheck.accountId = _accountId; uBetCheck.accountNumber = _accountNumber; uBetCheck.routingNumber = _routingNumber; uBetCheck.institution = _institution; uBetCheck.fullName = _fullname; uBetCheck.amount = _amount; uBetCheck.tokens = _tokens; uBetCheck.checkFilePath = _checkFilePath; uBetCheck.digitalCheckFingerPrint = _digitalCheckFingerPrint; totalUBetCheckAmounts = safeAdd(totalUBetCheckAmounts, _amount); tokenSupplyFromCheck = safeAdd(tokenSupplyFromCheck, _tokens); uBetCheckAccts.push(_beneficiary) -1; // Issue token when registered UBetCheck is complete to the _beneficiary doIssueTokens(_beneficiary, __conToken); // Fire Event UbetCheckIssue UbetCheckIssue(_accountId); } /// @dev List all the checks in the function getUBetChecks() public returns (address[]) { } /// @dev Return UBetCheck information by supplying beneficiary adddress function getUBetCheck(address _address) public returns(string, string, string, string, uint256, string, string) { } /// @dev This default function allows token to be purchased by directly /// sending ether to this smart contract. function () public payable { } /// @dev return total count of registered UBet Checks function countUBetChecks() public returns (uint) { } /// @dev issue tokens for a single buyer /// @param _beneficiary addresses that the tokens will be sent to. /// @param _tokens the amount of tokens, with decimals expanded (full). function doIssueTokens(address _beneficiary, uint256 _tokens) internal { } /// @dev Issue token based on Ether received. /// @param _beneficiary Address that newly issued token will be sent to. function purchaseTokens(address _beneficiary) public payable { } /// @dev Change money wallet owner /// @param _address new address to received the ether function setMoneyWallet(address _address) public onlyOwner { } /// @dev Change Rate per token in one ether /// @param _value the amount of tokens, with decimals expanded (full). function setRatePerOneEther(uint256 _value) public onlyOwner { } }
bytes(_institution).length!=0
293,110
bytes(_institution).length!=0
null
pragma solidity ^0.4.12; contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } function assert(bool assertion) internal { } } contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StandardToken is ERC20, SafeMath { mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract UBetCoin is Ownable, StandardToken { string public name = "UBetCoin"; // name of the token string public symbol = "UBET"; // ERC20 compliant 4 digit token code uint public decimals = 2; // token has 2 digit precision uint256 public totalSupply = 400000000000; // 4 BILLION INITIAL SUPPLY uint256 public tokenSupplyFromCheck = 0; // Total from check! uint256 public tokenSupplyBackedByGold = 4000000000; // Supply Backed By Gold string public constant YOU_BET_MINE_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/GOLD-MINES-assigned+TO-SAINT-NICOLAS-SNADCO-03-22-2016.pdf"; string public constant YOU_BET_MINE_DOCUMENT_SHA512 = "7e9dc6362c5bf85ff19d75df9140b033c4121ba8aaef7e5837b276d657becf0a0d68fcf26b95e76023a33251ac94f35492f2f0af882af4b87b1b1b626b325cf8"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/LEDGER-TO-LEDGER+ENTRY-FOR-UBETCOIN+03-20-2018.pdf"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_SHA512 = "c8f0ae2602005dd88ef908624cf59f3956107d0890d67d3baf9c885b64544a8140e282366cae6a3af7bfbc96d17f856b55fc4960e2287d4a03d67e646e0e88c6"; /// Base exchange rate is set uint256 public ratePerOneEther = 962; uint256 public totalUBetCheckAmounts = 0; /// Issue event index starting from 0. uint64 public issueIndex = 0; /// Emitted for each sucuessful token purchase. event Issue(uint64 issueIndex, address addr, uint256 tokenAmount); // All funds will be transferred in this wallet. address public moneyWallet = 0xe5688167Cb7aBcE4355F63943aAaC8bb269dc953; /// Emitted for each UBETCHECKS register. event UbetCheckIssue(string chequeIndex); struct UBetCheck { string accountId; string accountNumber; string fullName; string routingNumber; string institution; uint256 amount; uint256 tokens; string checkFilePath; string digitalCheckFingerPrint; } mapping (address => UBetCheck) UBetChecks; address[] public uBetCheckAccts; /// @dev Initializes the contract and allocates all initial tokens to the owner function UBetCoin() { } //////////////// owner only functions below /// @dev To transfer token contract ownership /// @param _newOwner The address of the new owner of this contract function transferOwnership(address _newOwner) onlyOwner { } /// check functionality /// @dev Register UBetCheck to the chain /// @param _beneficiary recipient ether address /// @param _accountId the id generated from the db /// @param _accountNumber the account number stated in the check /// @param _routingNumber the routing number stated in the check /// @param _institution the name of the institution / bank in the check /// @param _fullname the name printed on the check /// @param _amount the amount in currency in the chek /// @param _checkFilePath the url path where the cheque has been uploaded /// @param _digitalCheckFingerPrint the hash of the file /// @param _tokens number of tokens issued to the beneficiary function registerUBetCheck(address _beneficiary, string _accountId, string _accountNumber, string _routingNumber, string _institution, string _fullname, uint256 _amount, string _checkFilePath, string _digitalCheckFingerPrint, uint256 _tokens) public payable onlyOwner { require(_beneficiary != address(0)); require(bytes(_accountId).length != 0); require(bytes(_accountNumber).length != 0); require(bytes(_routingNumber).length != 0); require(bytes(_institution).length != 0); require(<FILL_ME>) require(_amount > 0); require(_tokens > 0); require(bytes(_checkFilePath).length != 0); require(bytes(_digitalCheckFingerPrint).length != 0); var __conToken = _tokens * (10**(decimals)); var uBetCheck = UBetChecks[_beneficiary]; uBetCheck.accountId = _accountId; uBetCheck.accountNumber = _accountNumber; uBetCheck.routingNumber = _routingNumber; uBetCheck.institution = _institution; uBetCheck.fullName = _fullname; uBetCheck.amount = _amount; uBetCheck.tokens = _tokens; uBetCheck.checkFilePath = _checkFilePath; uBetCheck.digitalCheckFingerPrint = _digitalCheckFingerPrint; totalUBetCheckAmounts = safeAdd(totalUBetCheckAmounts, _amount); tokenSupplyFromCheck = safeAdd(tokenSupplyFromCheck, _tokens); uBetCheckAccts.push(_beneficiary) -1; // Issue token when registered UBetCheck is complete to the _beneficiary doIssueTokens(_beneficiary, __conToken); // Fire Event UbetCheckIssue UbetCheckIssue(_accountId); } /// @dev List all the checks in the function getUBetChecks() public returns (address[]) { } /// @dev Return UBetCheck information by supplying beneficiary adddress function getUBetCheck(address _address) public returns(string, string, string, string, uint256, string, string) { } /// @dev This default function allows token to be purchased by directly /// sending ether to this smart contract. function () public payable { } /// @dev return total count of registered UBet Checks function countUBetChecks() public returns (uint) { } /// @dev issue tokens for a single buyer /// @param _beneficiary addresses that the tokens will be sent to. /// @param _tokens the amount of tokens, with decimals expanded (full). function doIssueTokens(address _beneficiary, uint256 _tokens) internal { } /// @dev Issue token based on Ether received. /// @param _beneficiary Address that newly issued token will be sent to. function purchaseTokens(address _beneficiary) public payable { } /// @dev Change money wallet owner /// @param _address new address to received the ether function setMoneyWallet(address _address) public onlyOwner { } /// @dev Change Rate per token in one ether /// @param _value the amount of tokens, with decimals expanded (full). function setRatePerOneEther(uint256 _value) public onlyOwner { } }
bytes(_fullname).length!=0
293,110
bytes(_fullname).length!=0
null
pragma solidity ^0.4.12; contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } function assert(bool assertion) internal { } } contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StandardToken is ERC20, SafeMath { mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract UBetCoin is Ownable, StandardToken { string public name = "UBetCoin"; // name of the token string public symbol = "UBET"; // ERC20 compliant 4 digit token code uint public decimals = 2; // token has 2 digit precision uint256 public totalSupply = 400000000000; // 4 BILLION INITIAL SUPPLY uint256 public tokenSupplyFromCheck = 0; // Total from check! uint256 public tokenSupplyBackedByGold = 4000000000; // Supply Backed By Gold string public constant YOU_BET_MINE_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/GOLD-MINES-assigned+TO-SAINT-NICOLAS-SNADCO-03-22-2016.pdf"; string public constant YOU_BET_MINE_DOCUMENT_SHA512 = "7e9dc6362c5bf85ff19d75df9140b033c4121ba8aaef7e5837b276d657becf0a0d68fcf26b95e76023a33251ac94f35492f2f0af882af4b87b1b1b626b325cf8"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/LEDGER-TO-LEDGER+ENTRY-FOR-UBETCOIN+03-20-2018.pdf"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_SHA512 = "c8f0ae2602005dd88ef908624cf59f3956107d0890d67d3baf9c885b64544a8140e282366cae6a3af7bfbc96d17f856b55fc4960e2287d4a03d67e646e0e88c6"; /// Base exchange rate is set uint256 public ratePerOneEther = 962; uint256 public totalUBetCheckAmounts = 0; /// Issue event index starting from 0. uint64 public issueIndex = 0; /// Emitted for each sucuessful token purchase. event Issue(uint64 issueIndex, address addr, uint256 tokenAmount); // All funds will be transferred in this wallet. address public moneyWallet = 0xe5688167Cb7aBcE4355F63943aAaC8bb269dc953; /// Emitted for each UBETCHECKS register. event UbetCheckIssue(string chequeIndex); struct UBetCheck { string accountId; string accountNumber; string fullName; string routingNumber; string institution; uint256 amount; uint256 tokens; string checkFilePath; string digitalCheckFingerPrint; } mapping (address => UBetCheck) UBetChecks; address[] public uBetCheckAccts; /// @dev Initializes the contract and allocates all initial tokens to the owner function UBetCoin() { } //////////////// owner only functions below /// @dev To transfer token contract ownership /// @param _newOwner The address of the new owner of this contract function transferOwnership(address _newOwner) onlyOwner { } /// check functionality /// @dev Register UBetCheck to the chain /// @param _beneficiary recipient ether address /// @param _accountId the id generated from the db /// @param _accountNumber the account number stated in the check /// @param _routingNumber the routing number stated in the check /// @param _institution the name of the institution / bank in the check /// @param _fullname the name printed on the check /// @param _amount the amount in currency in the chek /// @param _checkFilePath the url path where the cheque has been uploaded /// @param _digitalCheckFingerPrint the hash of the file /// @param _tokens number of tokens issued to the beneficiary function registerUBetCheck(address _beneficiary, string _accountId, string _accountNumber, string _routingNumber, string _institution, string _fullname, uint256 _amount, string _checkFilePath, string _digitalCheckFingerPrint, uint256 _tokens) public payable onlyOwner { require(_beneficiary != address(0)); require(bytes(_accountId).length != 0); require(bytes(_accountNumber).length != 0); require(bytes(_routingNumber).length != 0); require(bytes(_institution).length != 0); require(bytes(_fullname).length != 0); require(_amount > 0); require(_tokens > 0); require(<FILL_ME>) require(bytes(_digitalCheckFingerPrint).length != 0); var __conToken = _tokens * (10**(decimals)); var uBetCheck = UBetChecks[_beneficiary]; uBetCheck.accountId = _accountId; uBetCheck.accountNumber = _accountNumber; uBetCheck.routingNumber = _routingNumber; uBetCheck.institution = _institution; uBetCheck.fullName = _fullname; uBetCheck.amount = _amount; uBetCheck.tokens = _tokens; uBetCheck.checkFilePath = _checkFilePath; uBetCheck.digitalCheckFingerPrint = _digitalCheckFingerPrint; totalUBetCheckAmounts = safeAdd(totalUBetCheckAmounts, _amount); tokenSupplyFromCheck = safeAdd(tokenSupplyFromCheck, _tokens); uBetCheckAccts.push(_beneficiary) -1; // Issue token when registered UBetCheck is complete to the _beneficiary doIssueTokens(_beneficiary, __conToken); // Fire Event UbetCheckIssue UbetCheckIssue(_accountId); } /// @dev List all the checks in the function getUBetChecks() public returns (address[]) { } /// @dev Return UBetCheck information by supplying beneficiary adddress function getUBetCheck(address _address) public returns(string, string, string, string, uint256, string, string) { } /// @dev This default function allows token to be purchased by directly /// sending ether to this smart contract. function () public payable { } /// @dev return total count of registered UBet Checks function countUBetChecks() public returns (uint) { } /// @dev issue tokens for a single buyer /// @param _beneficiary addresses that the tokens will be sent to. /// @param _tokens the amount of tokens, with decimals expanded (full). function doIssueTokens(address _beneficiary, uint256 _tokens) internal { } /// @dev Issue token based on Ether received. /// @param _beneficiary Address that newly issued token will be sent to. function purchaseTokens(address _beneficiary) public payable { } /// @dev Change money wallet owner /// @param _address new address to received the ether function setMoneyWallet(address _address) public onlyOwner { } /// @dev Change Rate per token in one ether /// @param _value the amount of tokens, with decimals expanded (full). function setRatePerOneEther(uint256 _value) public onlyOwner { } }
bytes(_checkFilePath).length!=0
293,110
bytes(_checkFilePath).length!=0
null
pragma solidity ^0.4.12; contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } function assert(bool assertion) internal { } } contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StandardToken is ERC20, SafeMath { mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract UBetCoin is Ownable, StandardToken { string public name = "UBetCoin"; // name of the token string public symbol = "UBET"; // ERC20 compliant 4 digit token code uint public decimals = 2; // token has 2 digit precision uint256 public totalSupply = 400000000000; // 4 BILLION INITIAL SUPPLY uint256 public tokenSupplyFromCheck = 0; // Total from check! uint256 public tokenSupplyBackedByGold = 4000000000; // Supply Backed By Gold string public constant YOU_BET_MINE_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/GOLD-MINES-assigned+TO-SAINT-NICOLAS-SNADCO-03-22-2016.pdf"; string public constant YOU_BET_MINE_DOCUMENT_SHA512 = "7e9dc6362c5bf85ff19d75df9140b033c4121ba8aaef7e5837b276d657becf0a0d68fcf26b95e76023a33251ac94f35492f2f0af882af4b87b1b1b626b325cf8"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_PATH = "https://s3.amazonaws.com/s3-ubetcoin-user-signatures/document/LEDGER-TO-LEDGER+ENTRY-FOR-UBETCOIN+03-20-2018.pdf"; string public constant UBETCOIN_LEDGER_TO_LEDGER_ENTRY_DOCUMENT_SHA512 = "c8f0ae2602005dd88ef908624cf59f3956107d0890d67d3baf9c885b64544a8140e282366cae6a3af7bfbc96d17f856b55fc4960e2287d4a03d67e646e0e88c6"; /// Base exchange rate is set uint256 public ratePerOneEther = 962; uint256 public totalUBetCheckAmounts = 0; /// Issue event index starting from 0. uint64 public issueIndex = 0; /// Emitted for each sucuessful token purchase. event Issue(uint64 issueIndex, address addr, uint256 tokenAmount); // All funds will be transferred in this wallet. address public moneyWallet = 0xe5688167Cb7aBcE4355F63943aAaC8bb269dc953; /// Emitted for each UBETCHECKS register. event UbetCheckIssue(string chequeIndex); struct UBetCheck { string accountId; string accountNumber; string fullName; string routingNumber; string institution; uint256 amount; uint256 tokens; string checkFilePath; string digitalCheckFingerPrint; } mapping (address => UBetCheck) UBetChecks; address[] public uBetCheckAccts; /// @dev Initializes the contract and allocates all initial tokens to the owner function UBetCoin() { } //////////////// owner only functions below /// @dev To transfer token contract ownership /// @param _newOwner The address of the new owner of this contract function transferOwnership(address _newOwner) onlyOwner { } /// check functionality /// @dev Register UBetCheck to the chain /// @param _beneficiary recipient ether address /// @param _accountId the id generated from the db /// @param _accountNumber the account number stated in the check /// @param _routingNumber the routing number stated in the check /// @param _institution the name of the institution / bank in the check /// @param _fullname the name printed on the check /// @param _amount the amount in currency in the chek /// @param _checkFilePath the url path where the cheque has been uploaded /// @param _digitalCheckFingerPrint the hash of the file /// @param _tokens number of tokens issued to the beneficiary function registerUBetCheck(address _beneficiary, string _accountId, string _accountNumber, string _routingNumber, string _institution, string _fullname, uint256 _amount, string _checkFilePath, string _digitalCheckFingerPrint, uint256 _tokens) public payable onlyOwner { require(_beneficiary != address(0)); require(bytes(_accountId).length != 0); require(bytes(_accountNumber).length != 0); require(bytes(_routingNumber).length != 0); require(bytes(_institution).length != 0); require(bytes(_fullname).length != 0); require(_amount > 0); require(_tokens > 0); require(bytes(_checkFilePath).length != 0); require(<FILL_ME>) var __conToken = _tokens * (10**(decimals)); var uBetCheck = UBetChecks[_beneficiary]; uBetCheck.accountId = _accountId; uBetCheck.accountNumber = _accountNumber; uBetCheck.routingNumber = _routingNumber; uBetCheck.institution = _institution; uBetCheck.fullName = _fullname; uBetCheck.amount = _amount; uBetCheck.tokens = _tokens; uBetCheck.checkFilePath = _checkFilePath; uBetCheck.digitalCheckFingerPrint = _digitalCheckFingerPrint; totalUBetCheckAmounts = safeAdd(totalUBetCheckAmounts, _amount); tokenSupplyFromCheck = safeAdd(tokenSupplyFromCheck, _tokens); uBetCheckAccts.push(_beneficiary) -1; // Issue token when registered UBetCheck is complete to the _beneficiary doIssueTokens(_beneficiary, __conToken); // Fire Event UbetCheckIssue UbetCheckIssue(_accountId); } /// @dev List all the checks in the function getUBetChecks() public returns (address[]) { } /// @dev Return UBetCheck information by supplying beneficiary adddress function getUBetCheck(address _address) public returns(string, string, string, string, uint256, string, string) { } /// @dev This default function allows token to be purchased by directly /// sending ether to this smart contract. function () public payable { } /// @dev return total count of registered UBet Checks function countUBetChecks() public returns (uint) { } /// @dev issue tokens for a single buyer /// @param _beneficiary addresses that the tokens will be sent to. /// @param _tokens the amount of tokens, with decimals expanded (full). function doIssueTokens(address _beneficiary, uint256 _tokens) internal { } /// @dev Issue token based on Ether received. /// @param _beneficiary Address that newly issued token will be sent to. function purchaseTokens(address _beneficiary) public payable { } /// @dev Change money wallet owner /// @param _address new address to received the ether function setMoneyWallet(address _address) public onlyOwner { } /// @dev Change Rate per token in one ether /// @param _value the amount of tokens, with decimals expanded (full). function setRatePerOneEther(uint256 _value) public onlyOwner { } }
bytes(_digitalCheckFingerPrint).length!=0
293,110
bytes(_digitalCheckFingerPrint).length!=0
"Error sending tokens"
contract KyberConverter is TokenConverter, AvailableProvider, Ownable { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); KyberNetworkProxy kyber; event Swap(address indexed sender, ERC20 srcToken, ERC20 destToken, uint amount); event WithdrawTokens(address _token, address _to, uint256 _amount); event WithdrawEth(address _to, uint256 _amount); event SetKyber(address _kyber); constructor (KyberNetworkProxy _kyber) public { } function setKyber(KyberNetworkProxy _kyber) external onlyOwner returns (bool) { } function isAvailable(Token, Token, uint256) external view returns (bool) { } function getReturn( Token from, Token to, uint256 srcQty ) external view returns (uint256) { } function convert( Token from, Token to, uint256 srcQty, uint256 minReturn ) external payable returns (uint256 destAmount) { } /* @dev Swap the user's ETH to ERC20 token @param token destination token contract address @param destAddress address to send swapped tokens to */ function execSwapEtherToToken( ERC20 token, uint srcQty, address destAddress ) internal returns (uint) { // Swap the ETH to ERC20 token uint destAmount = kyber.swapEtherToToken.value(srcQty)(token, 0); // Send the swapped tokens to the destination address require(<FILL_ME>) return destAmount; } /* @dev Swap the user's ERC20 token to ETH @param token source token contract address @param tokenQty amount of source tokens @param destAddress address to send swapped ETH to */ function execSwapTokenToEther( ERC20 token, uint256 tokenQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to another ERC20 token @param srcToken source token contract address @param srcQty amount of source tokens @param destToken destination token contract address @param destAddress address to send swapped tokens to */ function execSwapTokenToToken( ERC20 srcToken, uint256 srcQty, ERC20 destToken, address destAddress ) internal returns (uint) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function setConverter( KyberNetworkProxy _converter ) public onlyOwner returns (bool) { } function getConverter() public view returns (address) { } function() external payable {} }
token.transfer(destAddress,destAmount),"Error sending tokens"
293,241
token.transfer(destAddress,destAmount)
"Error pulling tokens"
contract KyberConverter is TokenConverter, AvailableProvider, Ownable { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); KyberNetworkProxy kyber; event Swap(address indexed sender, ERC20 srcToken, ERC20 destToken, uint amount); event WithdrawTokens(address _token, address _to, uint256 _amount); event WithdrawEth(address _to, uint256 _amount); event SetKyber(address _kyber); constructor (KyberNetworkProxy _kyber) public { } function setKyber(KyberNetworkProxy _kyber) external onlyOwner returns (bool) { } function isAvailable(Token, Token, uint256) external view returns (bool) { } function getReturn( Token from, Token to, uint256 srcQty ) external view returns (uint256) { } function convert( Token from, Token to, uint256 srcQty, uint256 minReturn ) external payable returns (uint256 destAmount) { } /* @dev Swap the user's ETH to ERC20 token @param token destination token contract address @param destAddress address to send swapped tokens to */ function execSwapEtherToToken( ERC20 token, uint srcQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to ETH @param token source token contract address @param tokenQty amount of source tokens @param destAddress address to send swapped ETH to */ function execSwapTokenToEther( ERC20 token, uint256 tokenQty, address destAddress ) internal returns (uint) { // Check that the player has transferred the token to this contract require(<FILL_ME>) // Set the spender's token allowance to tokenQty require(token.approve(kyber, tokenQty), "Error pulling tokens"); // Swap the ERC20 token to ETH uint destAmount = kyber.swapTokenToEther(token, tokenQty, 0); // Send the swapped ETH to the destination address require(destAddress.send(destAmount), "Error sending ETH"); return destAmount; } /* @dev Swap the user's ERC20 token to another ERC20 token @param srcToken source token contract address @param srcQty amount of source tokens @param destToken destination token contract address @param destAddress address to send swapped tokens to */ function execSwapTokenToToken( ERC20 srcToken, uint256 srcQty, ERC20 destToken, address destAddress ) internal returns (uint) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function setConverter( KyberNetworkProxy _converter ) public onlyOwner returns (bool) { } function getConverter() public view returns (address) { } function() external payable {} }
token.transferFrom(msg.sender,this,tokenQty),"Error pulling tokens"
293,241
token.transferFrom(msg.sender,this,tokenQty)
"Error pulling tokens"
contract KyberConverter is TokenConverter, AvailableProvider, Ownable { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); KyberNetworkProxy kyber; event Swap(address indexed sender, ERC20 srcToken, ERC20 destToken, uint amount); event WithdrawTokens(address _token, address _to, uint256 _amount); event WithdrawEth(address _to, uint256 _amount); event SetKyber(address _kyber); constructor (KyberNetworkProxy _kyber) public { } function setKyber(KyberNetworkProxy _kyber) external onlyOwner returns (bool) { } function isAvailable(Token, Token, uint256) external view returns (bool) { } function getReturn( Token from, Token to, uint256 srcQty ) external view returns (uint256) { } function convert( Token from, Token to, uint256 srcQty, uint256 minReturn ) external payable returns (uint256 destAmount) { } /* @dev Swap the user's ETH to ERC20 token @param token destination token contract address @param destAddress address to send swapped tokens to */ function execSwapEtherToToken( ERC20 token, uint srcQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to ETH @param token source token contract address @param tokenQty amount of source tokens @param destAddress address to send swapped ETH to */ function execSwapTokenToEther( ERC20 token, uint256 tokenQty, address destAddress ) internal returns (uint) { // Check that the player has transferred the token to this contract require(token.transferFrom(msg.sender, this, tokenQty), "Error pulling tokens"); // Set the spender's token allowance to tokenQty require(<FILL_ME>) // Swap the ERC20 token to ETH uint destAmount = kyber.swapTokenToEther(token, tokenQty, 0); // Send the swapped ETH to the destination address require(destAddress.send(destAmount), "Error sending ETH"); return destAmount; } /* @dev Swap the user's ERC20 token to another ERC20 token @param srcToken source token contract address @param srcQty amount of source tokens @param destToken destination token contract address @param destAddress address to send swapped tokens to */ function execSwapTokenToToken( ERC20 srcToken, uint256 srcQty, ERC20 destToken, address destAddress ) internal returns (uint) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function setConverter( KyberNetworkProxy _converter ) public onlyOwner returns (bool) { } function getConverter() public view returns (address) { } function() external payable {} }
token.approve(kyber,tokenQty),"Error pulling tokens"
293,241
token.approve(kyber,tokenQty)
"Error sending ETH"
contract KyberConverter is TokenConverter, AvailableProvider, Ownable { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); KyberNetworkProxy kyber; event Swap(address indexed sender, ERC20 srcToken, ERC20 destToken, uint amount); event WithdrawTokens(address _token, address _to, uint256 _amount); event WithdrawEth(address _to, uint256 _amount); event SetKyber(address _kyber); constructor (KyberNetworkProxy _kyber) public { } function setKyber(KyberNetworkProxy _kyber) external onlyOwner returns (bool) { } function isAvailable(Token, Token, uint256) external view returns (bool) { } function getReturn( Token from, Token to, uint256 srcQty ) external view returns (uint256) { } function convert( Token from, Token to, uint256 srcQty, uint256 minReturn ) external payable returns (uint256 destAmount) { } /* @dev Swap the user's ETH to ERC20 token @param token destination token contract address @param destAddress address to send swapped tokens to */ function execSwapEtherToToken( ERC20 token, uint srcQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to ETH @param token source token contract address @param tokenQty amount of source tokens @param destAddress address to send swapped ETH to */ function execSwapTokenToEther( ERC20 token, uint256 tokenQty, address destAddress ) internal returns (uint) { // Check that the player has transferred the token to this contract require(token.transferFrom(msg.sender, this, tokenQty), "Error pulling tokens"); // Set the spender's token allowance to tokenQty require(token.approve(kyber, tokenQty), "Error pulling tokens"); // Swap the ERC20 token to ETH uint destAmount = kyber.swapTokenToEther(token, tokenQty, 0); // Send the swapped ETH to the destination address require(<FILL_ME>) return destAmount; } /* @dev Swap the user's ERC20 token to another ERC20 token @param srcToken source token contract address @param srcQty amount of source tokens @param destToken destination token contract address @param destAddress address to send swapped tokens to */ function execSwapTokenToToken( ERC20 srcToken, uint256 srcQty, ERC20 destToken, address destAddress ) internal returns (uint) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function setConverter( KyberNetworkProxy _converter ) public onlyOwner returns (bool) { } function getConverter() public view returns (address) { } function() external payable {} }
destAddress.send(destAmount),"Error sending ETH"
293,241
destAddress.send(destAmount)
"Error pulling tokens"
contract KyberConverter is TokenConverter, AvailableProvider, Ownable { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); KyberNetworkProxy kyber; event Swap(address indexed sender, ERC20 srcToken, ERC20 destToken, uint amount); event WithdrawTokens(address _token, address _to, uint256 _amount); event WithdrawEth(address _to, uint256 _amount); event SetKyber(address _kyber); constructor (KyberNetworkProxy _kyber) public { } function setKyber(KyberNetworkProxy _kyber) external onlyOwner returns (bool) { } function isAvailable(Token, Token, uint256) external view returns (bool) { } function getReturn( Token from, Token to, uint256 srcQty ) external view returns (uint256) { } function convert( Token from, Token to, uint256 srcQty, uint256 minReturn ) external payable returns (uint256 destAmount) { } /* @dev Swap the user's ETH to ERC20 token @param token destination token contract address @param destAddress address to send swapped tokens to */ function execSwapEtherToToken( ERC20 token, uint srcQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to ETH @param token source token contract address @param tokenQty amount of source tokens @param destAddress address to send swapped ETH to */ function execSwapTokenToEther( ERC20 token, uint256 tokenQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to another ERC20 token @param srcToken source token contract address @param srcQty amount of source tokens @param destToken destination token contract address @param destAddress address to send swapped tokens to */ function execSwapTokenToToken( ERC20 srcToken, uint256 srcQty, ERC20 destToken, address destAddress ) internal returns (uint) { // Check that the player has transferred the token to this contract require(<FILL_ME>) // Set the spender's token allowance to tokenQty require(srcToken.approve(kyber, srcQty), "Error approve transfer tokens"); // Swap the ERC20 token to ERC20 uint destAmount = kyber.swapTokenToToken(srcToken, srcQty, destToken, 0); // Send the swapped tokens to the destination address require(destToken.transfer(destAddress, destAmount), "Error sending tokens"); return destAmount; } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function setConverter( KyberNetworkProxy _converter ) public onlyOwner returns (bool) { } function getConverter() public view returns (address) { } function() external payable {} }
srcToken.transferFrom(msg.sender,this,srcQty),"Error pulling tokens"
293,241
srcToken.transferFrom(msg.sender,this,srcQty)
"Error approve transfer tokens"
contract KyberConverter is TokenConverter, AvailableProvider, Ownable { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); KyberNetworkProxy kyber; event Swap(address indexed sender, ERC20 srcToken, ERC20 destToken, uint amount); event WithdrawTokens(address _token, address _to, uint256 _amount); event WithdrawEth(address _to, uint256 _amount); event SetKyber(address _kyber); constructor (KyberNetworkProxy _kyber) public { } function setKyber(KyberNetworkProxy _kyber) external onlyOwner returns (bool) { } function isAvailable(Token, Token, uint256) external view returns (bool) { } function getReturn( Token from, Token to, uint256 srcQty ) external view returns (uint256) { } function convert( Token from, Token to, uint256 srcQty, uint256 minReturn ) external payable returns (uint256 destAmount) { } /* @dev Swap the user's ETH to ERC20 token @param token destination token contract address @param destAddress address to send swapped tokens to */ function execSwapEtherToToken( ERC20 token, uint srcQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to ETH @param token source token contract address @param tokenQty amount of source tokens @param destAddress address to send swapped ETH to */ function execSwapTokenToEther( ERC20 token, uint256 tokenQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to another ERC20 token @param srcToken source token contract address @param srcQty amount of source tokens @param destToken destination token contract address @param destAddress address to send swapped tokens to */ function execSwapTokenToToken( ERC20 srcToken, uint256 srcQty, ERC20 destToken, address destAddress ) internal returns (uint) { // Check that the player has transferred the token to this contract require(srcToken.transferFrom(msg.sender, this, srcQty), "Error pulling tokens"); // Set the spender's token allowance to tokenQty require(<FILL_ME>) // Swap the ERC20 token to ERC20 uint destAmount = kyber.swapTokenToToken(srcToken, srcQty, destToken, 0); // Send the swapped tokens to the destination address require(destToken.transfer(destAddress, destAmount), "Error sending tokens"); return destAmount; } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function setConverter( KyberNetworkProxy _converter ) public onlyOwner returns (bool) { } function getConverter() public view returns (address) { } function() external payable {} }
srcToken.approve(kyber,srcQty),"Error approve transfer tokens"
293,241
srcToken.approve(kyber,srcQty)
"Error sending tokens"
contract KyberConverter is TokenConverter, AvailableProvider, Ownable { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); KyberNetworkProxy kyber; event Swap(address indexed sender, ERC20 srcToken, ERC20 destToken, uint amount); event WithdrawTokens(address _token, address _to, uint256 _amount); event WithdrawEth(address _to, uint256 _amount); event SetKyber(address _kyber); constructor (KyberNetworkProxy _kyber) public { } function setKyber(KyberNetworkProxy _kyber) external onlyOwner returns (bool) { } function isAvailable(Token, Token, uint256) external view returns (bool) { } function getReturn( Token from, Token to, uint256 srcQty ) external view returns (uint256) { } function convert( Token from, Token to, uint256 srcQty, uint256 minReturn ) external payable returns (uint256 destAmount) { } /* @dev Swap the user's ETH to ERC20 token @param token destination token contract address @param destAddress address to send swapped tokens to */ function execSwapEtherToToken( ERC20 token, uint srcQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to ETH @param token source token contract address @param tokenQty amount of source tokens @param destAddress address to send swapped ETH to */ function execSwapTokenToEther( ERC20 token, uint256 tokenQty, address destAddress ) internal returns (uint) { } /* @dev Swap the user's ERC20 token to another ERC20 token @param srcToken source token contract address @param srcQty amount of source tokens @param destToken destination token contract address @param destAddress address to send swapped tokens to */ function execSwapTokenToToken( ERC20 srcToken, uint256 srcQty, ERC20 destToken, address destAddress ) internal returns (uint) { // Check that the player has transferred the token to this contract require(srcToken.transferFrom(msg.sender, this, srcQty), "Error pulling tokens"); // Set the spender's token allowance to tokenQty require(srcToken.approve(kyber, srcQty), "Error approve transfer tokens"); // Swap the ERC20 token to ERC20 uint destAmount = kyber.swapTokenToToken(srcToken, srcQty, destToken, 0); // Send the swapped tokens to the destination address require(<FILL_ME>) return destAmount; } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function setConverter( KyberNetworkProxy _converter ) public onlyOwner returns (bool) { } function getConverter() public view returns (address) { } function() external payable {} }
destToken.transfer(destAddress,destAmount),"Error sending tokens"
293,241
destToken.transfer(destAddress,destAmount)
'You are not whitelisted'
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ 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 SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function _callOptionalReturn(IERC20 token, bytes memory data) private { } } 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() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } contract Whitelist is Ownable { // 1 => whitelisted; 0 => NOT whitelisted mapping (address => uint8) public whitelistedMap; // true => whitelist is activated; false => whitelist is deactivated bool public WhitelistStatus; event WhitelistStatusChanged(bool indexed Status); constructor() { } modifier Whitelisted() { require(<FILL_ME>) _;} function whitelistAddress(address[] calldata AddressList) public onlyOwner { } function blacklistAddress(address[] calldata AdressList) public onlyOwner { } function changeWhitelistStatus() public onlyOwner { } } contract IFOV3 is Whitelist{ using SafeERC20 for IERC20; // The LP token used IERC20 public lpToken; // The offering token IERC20 public offeringToken; // Number of pools uint8 public constant numberPools = 3; uint public HarvestDelay; // The block number when IFO starts uint256 public startBlock; // The block number when IFO ends uint256 public endBlock; PoolCharacteristics[numberPools] private _poolInformation; mapping(address => mapping(uint8 => uint256)) private amountPool; struct PoolCharacteristics { uint256 offeringAmountPool; uint256 priceA; uint256 priceB; uint256 totalAmountPool; } event AdminWithdraw(uint256 amountLP, uint256 amountOfferingToken, uint256 amountWei); event AdminTokenRecovery(address tokenAddress, uint256 amountTokens); event Deposit(address indexed user, uint256 amount, uint8 indexed pid); event Harvest(address indexed user, uint256 offeringAmount, uint256 excessAmount, uint8 indexed pid); event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock); event PoolParametersSet(uint256 offeringAmountPool, uint priceA_, uint priceB_, uint8 pid); modifier TimeLock() { } constructor( IERC20 _lpToken, IERC20 _offeringToken, uint256 _startBlock, uint256 _endBlock, uint _harvestdelay ) { } function depositPool(uint256 _amount, uint8 _pid) external { } function harvestPool(uint8 _pid) external { } function finalWithdraw(uint256 _lpAmount, uint256 _offerAmount, uint256 _weiAmount) external onlyOwner TimeLock { } function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner { } function setPool( uint256 _offeringAmountPool, uint256 _priceA, uint _priceB, uint8 _pid ) external onlyOwner TimeLock { } function updateStartAndEndBlocks(uint256 _startBlock, uint256 _endBlock) external onlyOwner TimeLock { } function viewPoolInformation(uint256 _pid) external view returns ( uint256, uint256, uint256, uint256 ) { } function viewUserAllocationPools(address _user, uint8[] calldata _pids) external view returns (uint256[] memory) { } function viewUserAmount(address _user, uint8[] calldata _pids) external view returns (uint256[] memory) { } function viewUserOfferingAndRefundingAmountsForPools(address _user, uint8[] calldata _pids) external view returns (uint256[2][] memory) { } function _calculateOfferingAndRefundingAmountsPool(address _user, uint8 _pid) internal view returns ( uint256, uint256 ) { } function _getUserAllocationPool(address _user, uint8 _pid) internal view returns (uint256) { } function SetHarvestDelay(uint _HarvestDelay) external onlyOwner { } fallback() external payable{} }
whitelistedMap[msg.sender]==1||WhitelistStatus==false,'You are not whitelisted'
293,255
whitelistedMap[msg.sender]==1||WhitelistStatus==false
"Pool not set"
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ 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 SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function _callOptionalReturn(IERC20 token, bytes memory data) private { } } 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() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } contract Whitelist is Ownable { // 1 => whitelisted; 0 => NOT whitelisted mapping (address => uint8) public whitelistedMap; // true => whitelist is activated; false => whitelist is deactivated bool public WhitelistStatus; event WhitelistStatusChanged(bool indexed Status); constructor() { } modifier Whitelisted() { } function whitelistAddress(address[] calldata AddressList) public onlyOwner { } function blacklistAddress(address[] calldata AdressList) public onlyOwner { } function changeWhitelistStatus() public onlyOwner { } } contract IFOV3 is Whitelist{ using SafeERC20 for IERC20; // The LP token used IERC20 public lpToken; // The offering token IERC20 public offeringToken; // Number of pools uint8 public constant numberPools = 3; uint public HarvestDelay; // The block number when IFO starts uint256 public startBlock; // The block number when IFO ends uint256 public endBlock; PoolCharacteristics[numberPools] private _poolInformation; mapping(address => mapping(uint8 => uint256)) private amountPool; struct PoolCharacteristics { uint256 offeringAmountPool; uint256 priceA; uint256 priceB; uint256 totalAmountPool; } event AdminWithdraw(uint256 amountLP, uint256 amountOfferingToken, uint256 amountWei); event AdminTokenRecovery(address tokenAddress, uint256 amountTokens); event Deposit(address indexed user, uint256 amount, uint8 indexed pid); event Harvest(address indexed user, uint256 offeringAmount, uint256 excessAmount, uint8 indexed pid); event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock); event PoolParametersSet(uint256 offeringAmountPool, uint priceA_, uint priceB_, uint8 pid); modifier TimeLock() { } constructor( IERC20 _lpToken, IERC20 _offeringToken, uint256 _startBlock, uint256 _endBlock, uint _harvestdelay ) { } function depositPool(uint256 _amount, uint8 _pid) external { require(_pid < numberPools, "Non valid pool id"); require(<FILL_ME>) require(block.number > startBlock, "Too early"); require(block.number < endBlock, "Too late"); require(_amount > 0, "Amount must be > 0"); if(_pid == 0){ require( _poolInformation[_pid].offeringAmountPool >= (_poolInformation[_pid].totalAmountPool + (_amount)) * (_poolInformation[_pid].priceA), 'not enough Offering Tokens left in Pool1'); } lpToken.safeTransferFrom(address(msg.sender), address(this), _amount); amountPool[msg.sender][_pid] += _amount; _poolInformation[_pid].totalAmountPool += _amount; emit Deposit(msg.sender, _amount, _pid); } function harvestPool(uint8 _pid) external { } function finalWithdraw(uint256 _lpAmount, uint256 _offerAmount, uint256 _weiAmount) external onlyOwner TimeLock { } function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner { } function setPool( uint256 _offeringAmountPool, uint256 _priceA, uint _priceB, uint8 _pid ) external onlyOwner TimeLock { } function updateStartAndEndBlocks(uint256 _startBlock, uint256 _endBlock) external onlyOwner TimeLock { } function viewPoolInformation(uint256 _pid) external view returns ( uint256, uint256, uint256, uint256 ) { } function viewUserAllocationPools(address _user, uint8[] calldata _pids) external view returns (uint256[] memory) { } function viewUserAmount(address _user, uint8[] calldata _pids) external view returns (uint256[] memory) { } function viewUserOfferingAndRefundingAmountsForPools(address _user, uint8[] calldata _pids) external view returns (uint256[2][] memory) { } function _calculateOfferingAndRefundingAmountsPool(address _user, uint8 _pid) internal view returns ( uint256, uint256 ) { } function _getUserAllocationPool(address _user, uint8 _pid) internal view returns (uint256) { } function SetHarvestDelay(uint _HarvestDelay) external onlyOwner { } fallback() external payable{} }
_poolInformation[_pid].offeringAmountPool>0,"Pool not set"
293,255
_poolInformation[_pid].offeringAmountPool>0
'not enough Offering Tokens left in Pool1'
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ 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 SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function _callOptionalReturn(IERC20 token, bytes memory data) private { } } 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() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } contract Whitelist is Ownable { // 1 => whitelisted; 0 => NOT whitelisted mapping (address => uint8) public whitelistedMap; // true => whitelist is activated; false => whitelist is deactivated bool public WhitelistStatus; event WhitelistStatusChanged(bool indexed Status); constructor() { } modifier Whitelisted() { } function whitelistAddress(address[] calldata AddressList) public onlyOwner { } function blacklistAddress(address[] calldata AdressList) public onlyOwner { } function changeWhitelistStatus() public onlyOwner { } } contract IFOV3 is Whitelist{ using SafeERC20 for IERC20; // The LP token used IERC20 public lpToken; // The offering token IERC20 public offeringToken; // Number of pools uint8 public constant numberPools = 3; uint public HarvestDelay; // The block number when IFO starts uint256 public startBlock; // The block number when IFO ends uint256 public endBlock; PoolCharacteristics[numberPools] private _poolInformation; mapping(address => mapping(uint8 => uint256)) private amountPool; struct PoolCharacteristics { uint256 offeringAmountPool; uint256 priceA; uint256 priceB; uint256 totalAmountPool; } event AdminWithdraw(uint256 amountLP, uint256 amountOfferingToken, uint256 amountWei); event AdminTokenRecovery(address tokenAddress, uint256 amountTokens); event Deposit(address indexed user, uint256 amount, uint8 indexed pid); event Harvest(address indexed user, uint256 offeringAmount, uint256 excessAmount, uint8 indexed pid); event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock); event PoolParametersSet(uint256 offeringAmountPool, uint priceA_, uint priceB_, uint8 pid); modifier TimeLock() { } constructor( IERC20 _lpToken, IERC20 _offeringToken, uint256 _startBlock, uint256 _endBlock, uint _harvestdelay ) { } function depositPool(uint256 _amount, uint8 _pid) external { require(_pid < numberPools, "Non valid pool id"); require(_poolInformation[_pid].offeringAmountPool > 0, "Pool not set"); require(block.number > startBlock, "Too early"); require(block.number < endBlock, "Too late"); require(_amount > 0, "Amount must be > 0"); if(_pid == 0){ require(<FILL_ME>) } lpToken.safeTransferFrom(address(msg.sender), address(this), _amount); amountPool[msg.sender][_pid] += _amount; _poolInformation[_pid].totalAmountPool += _amount; emit Deposit(msg.sender, _amount, _pid); } function harvestPool(uint8 _pid) external { } function finalWithdraw(uint256 _lpAmount, uint256 _offerAmount, uint256 _weiAmount) external onlyOwner TimeLock { } function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner { } function setPool( uint256 _offeringAmountPool, uint256 _priceA, uint _priceB, uint8 _pid ) external onlyOwner TimeLock { } function updateStartAndEndBlocks(uint256 _startBlock, uint256 _endBlock) external onlyOwner TimeLock { } function viewPoolInformation(uint256 _pid) external view returns ( uint256, uint256, uint256, uint256 ) { } function viewUserAllocationPools(address _user, uint8[] calldata _pids) external view returns (uint256[] memory) { } function viewUserAmount(address _user, uint8[] calldata _pids) external view returns (uint256[] memory) { } function viewUserOfferingAndRefundingAmountsForPools(address _user, uint8[] calldata _pids) external view returns (uint256[2][] memory) { } function _calculateOfferingAndRefundingAmountsPool(address _user, uint8 _pid) internal view returns ( uint256, uint256 ) { } function _getUserAllocationPool(address _user, uint8 _pid) internal view returns (uint256) { } function SetHarvestDelay(uint _HarvestDelay) external onlyOwner { } fallback() external payable{} }
_poolInformation[_pid].offeringAmountPool>=(_poolInformation[_pid].totalAmountPool+(_amount))*(_poolInformation[_pid].priceA),'not enough Offering Tokens left in Pool1'
293,255
_poolInformation[_pid].offeringAmountPool>=(_poolInformation[_pid].totalAmountPool+(_amount))*(_poolInformation[_pid].priceA)
"Did not participate"
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ 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 SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function _callOptionalReturn(IERC20 token, bytes memory data) private { } } 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() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } contract Whitelist is Ownable { // 1 => whitelisted; 0 => NOT whitelisted mapping (address => uint8) public whitelistedMap; // true => whitelist is activated; false => whitelist is deactivated bool public WhitelistStatus; event WhitelistStatusChanged(bool indexed Status); constructor() { } modifier Whitelisted() { } function whitelistAddress(address[] calldata AddressList) public onlyOwner { } function blacklistAddress(address[] calldata AdressList) public onlyOwner { } function changeWhitelistStatus() public onlyOwner { } } contract IFOV3 is Whitelist{ using SafeERC20 for IERC20; // The LP token used IERC20 public lpToken; // The offering token IERC20 public offeringToken; // Number of pools uint8 public constant numberPools = 3; uint public HarvestDelay; // The block number when IFO starts uint256 public startBlock; // The block number when IFO ends uint256 public endBlock; PoolCharacteristics[numberPools] private _poolInformation; mapping(address => mapping(uint8 => uint256)) private amountPool; struct PoolCharacteristics { uint256 offeringAmountPool; uint256 priceA; uint256 priceB; uint256 totalAmountPool; } event AdminWithdraw(uint256 amountLP, uint256 amountOfferingToken, uint256 amountWei); event AdminTokenRecovery(address tokenAddress, uint256 amountTokens); event Deposit(address indexed user, uint256 amount, uint8 indexed pid); event Harvest(address indexed user, uint256 offeringAmount, uint256 excessAmount, uint8 indexed pid); event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock); event PoolParametersSet(uint256 offeringAmountPool, uint priceA_, uint priceB_, uint8 pid); modifier TimeLock() { } constructor( IERC20 _lpToken, IERC20 _offeringToken, uint256 _startBlock, uint256 _endBlock, uint _harvestdelay ) { } function depositPool(uint256 _amount, uint8 _pid) external { } function harvestPool(uint8 _pid) external { require(block.number > endBlock + HarvestDelay, "Too early to harvest"); require(_pid < numberPools, "Non valid pool id"); require(<FILL_ME>) if(whitelistedMap[msg.sender] != 1 && WhitelistStatus == true){ uint amount = amountPool[msg.sender][_pid]; amountPool[msg.sender][_pid] = 0; lpToken.safeTransfer(address(msg.sender), amount); emit Harvest(msg.sender, 0, amount, _pid); }else{ uint256 offeringTokenAmount; uint256 refundingTokenAmount; (offeringTokenAmount, refundingTokenAmount) = _calculateOfferingAndRefundingAmountsPool( msg.sender, _pid ); amountPool[msg.sender][_pid] = 0; if (offeringTokenAmount > 0) { offeringToken.safeTransfer(address(msg.sender), offeringTokenAmount); } if (refundingTokenAmount > 0) { lpToken.safeTransfer(address(msg.sender), refundingTokenAmount); } emit Harvest(msg.sender, offeringTokenAmount, refundingTokenAmount, _pid); } } function finalWithdraw(uint256 _lpAmount, uint256 _offerAmount, uint256 _weiAmount) external onlyOwner TimeLock { } function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner { } function setPool( uint256 _offeringAmountPool, uint256 _priceA, uint _priceB, uint8 _pid ) external onlyOwner TimeLock { } function updateStartAndEndBlocks(uint256 _startBlock, uint256 _endBlock) external onlyOwner TimeLock { } function viewPoolInformation(uint256 _pid) external view returns ( uint256, uint256, uint256, uint256 ) { } function viewUserAllocationPools(address _user, uint8[] calldata _pids) external view returns (uint256[] memory) { } function viewUserAmount(address _user, uint8[] calldata _pids) external view returns (uint256[] memory) { } function viewUserOfferingAndRefundingAmountsForPools(address _user, uint8[] calldata _pids) external view returns (uint256[2][] memory) { } function _calculateOfferingAndRefundingAmountsPool(address _user, uint8 _pid) internal view returns ( uint256, uint256 ) { } function _getUserAllocationPool(address _user, uint8 _pid) internal view returns (uint256) { } function SetHarvestDelay(uint _HarvestDelay) external onlyOwner { } fallback() external payable{} }
amountPool[msg.sender][_pid]>0,"Did not participate"
293,255
amountPool[msg.sender][_pid]>0
"Your address not allowed. Please contact with owner."
// SPDX-License-Identifier: MIT; pragma solidity >=0.8.0; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol'; contract ICO is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; using SafeMath for uint; struct ICOStateSchema { uint256 currentIteration; uint256 currentPrice; uint256 ICOAllocatedTokensAmount; uint256 tokensLeft; } uint256 public oneIterationTokenAmount = 10 * 10 ** 6 * 10 ** 10; bool public icoCompleted; uint256 public icoStartTime; uint256 public icoEndTime; address public tokenAddress; uint256 public currentIterationOfICO; uint256 public current_allocatedTokens; uint256 public minLimit = 1 * 10 ** 10; uint256 public maxLimit = 1 * 10 ** 8 * 10 ** 10; uint256 private referralBonus = 20; uint256 private commission = 8 * 10 ** 15; uint256 private maxRoundICO = 200; AggregatorV3Interface private priceFeed; uint256 public usdPrice; uint256 private startPriceInUSD = 5; // since this value is 0.0005 . Multiplying it by 10000 uint256 private stepPriceInUSD; mapping(address => bool) allowedInvestors; event Allocated(uint256 amount); event WithdrawedETH(address user, uint256 amount); event MinLimitUpdated(uint256 newLimit); event MaxLimitUpdated(uint256 newLimit); event Bought(address buyer, uint256 amount, uint256 usdPrice); modifier allowedInvestor { require(<FILL_ME>) _; } modifier whenIcoStart { } constructor(address _tokenAddress, address owner){ } /// can be accessed only by owner function startICO() public onlyOwner { } /// can be accessed only by owner function setMinLimit(uint256 newLimit) public onlyOwner { } /// can be accessed only by owner function setMaxLimit(uint256 newLimit) public onlyOwner { } /// can be accessed only by owner function setReferralBonus(uint256 _bonus) external onlyOwner { } /// can be accessed only by owner function getReferralBonus() external view returns (uint256) { } /// can be accessed only by owner function setCommission(uint256 _commission) external onlyOwner { } /// read only /// returns uint256 function getCommission() external view returns (uint256) { } /// can be accessed only by owner function addAddressToAllowed(address client) public onlyOwner { } /// can be accessed only by owner function removeAddressFromAllowed(address client) public onlyOwner { } function _allocate() private { } receive() external payable { } function _getAmountForETH(uint amountETH) private view returns (uint256){ } /// get cost is calculating price including switch to different price range /// read only /// returns uint256 function getCost(uint amount) public view returns (uint256){ } function _changeCurrentAllocatedTokens(uint256 amount, uint256 ethForTokens) private { } function _completeICO() private { } function _sendTokens(address client, uint256 amountToken) private nonReentrant { } function withdrawReward() public nonReentrant onlyOwner { } /// read only /// returns ICOStateSchema function getCurrentICOState() public view returns (ICOStateSchema memory currentState) { } /// available only after start of ICO /// accessible only by allowed investors /// payable /// returns uint256 function buy() public payable whenIcoStart allowedInvestor { } /// payable /// accessible only by allowed investors function buyWithReferral(address payable referral) external payable allowedInvestor whenIcoStart { } /// available only after start of ICO /// payable /// can be accessed only by owner function buyFor(address buyer) public payable onlyOwner whenIcoStart { } /// available only after start of ICO /// payable /// can be accessed only by owner function buyForWithReferral(address buyer, address payable referral) external payable onlyOwner whenIcoStart { } /// read only /// returns int function getLatestPrice() public view returns (int) { } /// returns uint256 function getPriceInETH(uint256 amount, int exchangeRate) public pure returns (uint256) { } /// read only /// returns uint256 function getTokenPrice(uint256 icoIteration) public view returns (uint256, uint256) { } /// read only /// returns uint256 function getTokensPerIteration(uint256 icoIteration) public view returns (uint256) { } }
allowedInvestors[msg.sender],"Your address not allowed. Please contact with owner."
293,323
allowedInvestors[msg.sender]
'ICO completed'
// SPDX-License-Identifier: MIT; pragma solidity >=0.8.0; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol'; contract ICO is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; using SafeMath for uint; struct ICOStateSchema { uint256 currentIteration; uint256 currentPrice; uint256 ICOAllocatedTokensAmount; uint256 tokensLeft; } uint256 public oneIterationTokenAmount = 10 * 10 ** 6 * 10 ** 10; bool public icoCompleted; uint256 public icoStartTime; uint256 public icoEndTime; address public tokenAddress; uint256 public currentIterationOfICO; uint256 public current_allocatedTokens; uint256 public minLimit = 1 * 10 ** 10; uint256 public maxLimit = 1 * 10 ** 8 * 10 ** 10; uint256 private referralBonus = 20; uint256 private commission = 8 * 10 ** 15; uint256 private maxRoundICO = 200; AggregatorV3Interface private priceFeed; uint256 public usdPrice; uint256 private startPriceInUSD = 5; // since this value is 0.0005 . Multiplying it by 10000 uint256 private stepPriceInUSD; mapping(address => bool) allowedInvestors; event Allocated(uint256 amount); event WithdrawedETH(address user, uint256 amount); event MinLimitUpdated(uint256 newLimit); event MaxLimitUpdated(uint256 newLimit); event Bought(address buyer, uint256 amount, uint256 usdPrice); modifier allowedInvestor { } modifier whenIcoStart { require(<FILL_ME>) require(icoStartTime != 0, 'ICO has not started yet'); _; } constructor(address _tokenAddress, address owner){ } /// can be accessed only by owner function startICO() public onlyOwner { } /// can be accessed only by owner function setMinLimit(uint256 newLimit) public onlyOwner { } /// can be accessed only by owner function setMaxLimit(uint256 newLimit) public onlyOwner { } /// can be accessed only by owner function setReferralBonus(uint256 _bonus) external onlyOwner { } /// can be accessed only by owner function getReferralBonus() external view returns (uint256) { } /// can be accessed only by owner function setCommission(uint256 _commission) external onlyOwner { } /// read only /// returns uint256 function getCommission() external view returns (uint256) { } /// can be accessed only by owner function addAddressToAllowed(address client) public onlyOwner { } /// can be accessed only by owner function removeAddressFromAllowed(address client) public onlyOwner { } function _allocate() private { } receive() external payable { } function _getAmountForETH(uint amountETH) private view returns (uint256){ } /// get cost is calculating price including switch to different price range /// read only /// returns uint256 function getCost(uint amount) public view returns (uint256){ } function _changeCurrentAllocatedTokens(uint256 amount, uint256 ethForTokens) private { } function _completeICO() private { } function _sendTokens(address client, uint256 amountToken) private nonReentrant { } function withdrawReward() public nonReentrant onlyOwner { } /// read only /// returns ICOStateSchema function getCurrentICOState() public view returns (ICOStateSchema memory currentState) { } /// available only after start of ICO /// accessible only by allowed investors /// payable /// returns uint256 function buy() public payable whenIcoStart allowedInvestor { } /// payable /// accessible only by allowed investors function buyWithReferral(address payable referral) external payable allowedInvestor whenIcoStart { } /// available only after start of ICO /// payable /// can be accessed only by owner function buyFor(address buyer) public payable onlyOwner whenIcoStart { } /// available only after start of ICO /// payable /// can be accessed only by owner function buyForWithReferral(address buyer, address payable referral) external payable onlyOwner whenIcoStart { } /// read only /// returns int function getLatestPrice() public view returns (int) { } /// returns uint256 function getPriceInETH(uint256 amount, int exchangeRate) public pure returns (uint256) { } /// read only /// returns uint256 function getTokenPrice(uint256 icoIteration) public view returns (uint256, uint256) { } /// read only /// returns uint256 function getTokensPerIteration(uint256 icoIteration) public view returns (uint256) { } }
!icoCompleted,'ICO completed'
293,323
!icoCompleted
"User stake% share too high. Leave some for the smaller guys ;-)"
/** * @dev Delegated Farming Contract. * Implements a conditoin on the DFT-DFT farming pool for users to generate more rewards */ contract DeFiat_EXTFarming_V2 { using SafeMath for uint256; //Structs struct PoolMetrics { address stakedToken; uint256 staked; // sum of tokens staked in the contract uint256 stakingFee; // entry fee uint256 stakingPoints; address rewardToken; uint256 rewards; // current rewards in the pool uint256 totalRewards; uint256 startTime; // when the pool opens uint256 closingTime; // when the pool closes. uint256 duration; // duration of the staking uint256 lastEvent; // last time metrics were updated. uint256 ratePerToken; // CALCULATED pool reward Rate per Token (calculated based on total stake and time) address DftDungeon; // used to calculate the DeFiatScore bool boostedRewards; } PoolMetrics public poolMetrics; struct UserMetrics { uint256 stake; // native token stake (balanceOf) uint256 stakingPoints; // staking points at lastEvent uint256 poolPoints; // pool point at lastEvent uint256 lastEvent; uint256 rewardAccrued; // accrued rewards over time based on staking points uint256 rewardsPaid; // for information only uint256 lastTxBlock; // latest transaction from the user (antiSpam) } mapping(address => UserMetrics) public userMetrics; address public poolOperator; address public owner; //== constructor constructor(address _stakedToken, address _rewardToken, uint256 _feeBase1000, uint256 _durationHours) public { } //==Events event PoolInitalized(uint256 amountAdded, string _desc); event RewardTaken(address indexed user, uint256 reward, string _desc); event userStaking(address indexed user, uint256 amount, string _desc); event userWithdrawal(address indexed user, uint256 amount, string _desc); modifier poolLive() { } modifier poolStarted() { } modifier poolEnded() { } modifier antiSpam(uint256 _blocks) { } modifier onlyPoolOperator() { } modifier onlyOwner() { } modifier antiWhale(address _address) { require(<FILL_ME>) //max 20% _; } // avoids stakes being deposited once a user reached 20%. // Simplistic implementation as if we calculate "futureStake" value very 1st stakers will not be able to deposit. //==Basics function currentTime() public view returns (uint256) { } // SafeMath.min(now, endTime) //==DeFiat Boost function setDungeon(address _dungeon) public onlyOwner { } /** * @dev Function gets the amount of DFT in the DFT dungeon farm * to calculate a score that boosts the StakingRewards calculation * DFT requirements to get a boost are hard coded into the contract * 0DFT to 100 DFT staked respectfully generate a 0% to 100% bonus on Staking. * returned is a number between 50 and 100 */ function viewDftBoost(address _address) public view returns(uint256) { } //==Points locking function viewPoolPoints() public view returns(uint256) { } function lockPoolPoints() internal returns (uint256) { } function viewPointsOf(address _address) public view returns(uint256) { } function lockPointsOf(address _address) internal returns (uint256) { } function pointsSnapshot(address _address) public returns (bool) { } //==Rewards function viewTrancheReward(uint256 _period) internal view returns(uint256) { } function userRateOnPeriod(address _address) public view returns (uint256){ } function viewAdditionalRewardOf(address _address) public view returns(uint256) { } function lockRewardOf(address _address) public returns(uint256) { } function takeRewards() public poolStarted antiSpam(1) { } //==staking & unstaking function stake(uint256 _amount) public poolLive antiSpam(1) antiWhale(msg.sender){ } function unStake(uint256 _amount) public poolStarted antiSpam(1) { } function myStake(address _address) public view returns(uint256) { } function myStakeShare(address _address) public view returns(uint256) { } //base 100,000 function myPointsShare(address _address) public view returns(uint256) { } //base 100,000. Drops when taking rewards.=> Refills after (favors strong hands) function myRewards(address _address) public view returns(uint256) { } //== OPERATOR FUNCTIONS == function setBoostedRewards(bool _bool) public onlyPoolOperator { } function loadRewards(uint256 _amount, uint256 _preStake) public onlyPoolOperator { } function flushPool(address _recipient, address _ERC20address) external onlyPoolOperator poolEnded { } //get tokens sent by error to contract function setPoolOperator(address _address) public onlyPoolOperator { } function setFee(uint256 _fee) public onlyOwner { } function killPool() public onlyOwner poolEnded returns(bool) { } //frees space on the ETH chain }
myStakeShare(_address)<20000,"User stake% share too high. Leave some for the smaller guys ;-)"
293,348
myStakeShare(_address)<20000
"HLBICO: account is blacklisted"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./SafeMath.sol"; import "./CappedTimedCrowdsale.sol"; import "./RefundPostdevCrowdsale.sol"; /** ** ICO Contract for the LBC crowdsale */ contract HLBICO is CappedTimedCrowdsale, RefundablePostDeliveryCrowdsale { using SafeMath for uint256; /* ** Global State */ bool public initialized; // default : false /* ** Addresses */ address public _deployingAddress; // should remain the same as deployer's address address public _whitelistingAddress; // should be oracle address public _reserveAddress; // should be deployer then humble reserve /* ** Events */ event InitializedContract(address indexed changerAddress, address indexed whitelistingAddress); event ChangedWhitelisterAddress(address indexed whitelisterAddress, address indexed changerAddress); event ChangedReserveAddress(address indexed reserveAddress, address indexed changerAddress); event ChangedDeployerAddress(address indexed deployerAddress, address indexed changerAddress); event BlacklistedAdded(address indexed account); event BlacklistedRemoved(address indexed account); event UpdatedCaps(uint256 newGoal, uint256 newCap, uint256 newTranche, uint256 newMaxInvest, uint256 newRate, uint256 newRateCoef); /* ** Attrs */ uint256 private _currentRate; uint256 private _rateCoef; mapping(address => bool) private _blacklistedAddrs; mapping(address => uint256) private _investmentAddrs; uint256 private _weiMaxInvest; uint256 private _etherTranche; uint256 private _currentWeiTranche; // Holds the current invested value for a tranche uint256 private _deliverToReserve; uint256 private _minimumInvest; /* * initialRateReceived : Number of token units a buyer gets per wei for the first investment slice. Should be 5000 (diving by 1000 for 3 decimals). * walletReceived : Wallet that will get the invested eth at the end of the crowdsale * tokenReceived : Address of the LBC token being sold * openingTimeReceived : Starting date of the ICO * closingtimeReceived : Ending date of the ICO * capReceived : Max amount of wei to be contributed * goalReceived : Funding goal * etherMaxInvestReceived : Maximum ether that can be invested */ constructor(uint256 initialRateReceived, uint256 rateCoefficientReceived, address payable walletReceived, LBCToken tokenReceived, uint256 openingTimeReceived, uint256 closingTimeReceived, uint256 capReceived, uint256 goalReceived) CrowdsaleMint(initialRateReceived, walletReceived, tokenReceived) TimedCrowdsale(openingTimeReceived, closingTimeReceived) CappedTimedCrowdsale(capReceived) RefundableCrowdsale(goalReceived) { } /* ** Initializes the contract address and affects addresses to their roles. */ function init( address whitelistingAddress, address reserveAddress ) public isNotInitialized onlyDeployingAddress { } /** * @dev Returns the rate of tokens per wei at the present time and computes rate depending on tranche. * @param weiAmount The value in wei to be converted into tokens * @return The number of tokens a buyer gets per wei for a given tranche */ function _getCustomAmount(uint256 weiAmount) internal returns (uint256) { } /* ** Adjusts all parameters influenced by Ether value based on a percentage coefficient ** coef is based on 4 digits for decimal representation with 1 precision ** i.e : 934 -> 93.4%; 1278 -> 127.8% */ function adjustEtherValue(uint256 coef) public onlyDeployingAddress { } function rate() public view override returns (uint256) { } function getNextRate() public view returns (uint256) { } /* ** Changes the address of the token contract. Must only be callable by deployer */ function changeToken(LBCToken newToken) public onlyDeployingAddress { } /* ** Changes the address with whitelisting role and can only be called by deployer */ function changeWhitelister(address newWhitelisterAddress) public onlyDeployingAddress { } /* ** Changes the address with deployer role and can only be called by deployer */ function changeDeployer(address newDeployerAddress) public onlyDeployingAddress { } /* ** Changes the address with pause role and can only be called by deployer */ function changeReserveAddress(address newReserveAddress) public onlyDeployingAddress { } /** * @dev Escrow finalization task, called when finalize() is called. */ function _finalization() override virtual internal { } /* ** Checks if an adress has been blacklisted before letting them withdraw their funds */ function withdrawTokens(address beneficiary) override virtual public { require(<FILL_ME>) super.withdrawTokens(beneficiary); } /** * @dev Overrides parent method taking into account variable rate. * @param weiAmount The value in wei to be converted into tokens * @return The number of tokens _weiAmount wei will buy at present time */ function _getTokenAmount(uint256 weiAmount) internal override returns (uint256) { } function _forwardFunds() internal override(CrowdsaleMint, RefundablePostDeliveryCrowdsale) { } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal override(TimedCrowdsale, CappedTimedCrowdsale) view { } function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal override { } function _processPurchase(address beneficiary, uint256 tokenAmount) internal override(CrowdsaleMint, RefundablePostDeliveryCrowdsale) { } function hasClosed() public view override(TimedCrowdsale, CappedTimedCrowdsale) returns (bool) { } function etherTranche() public view returns (uint256) { } function maxInvest() public view returns (uint256) { } function addBlacklisted(address account) public onlyWhitelistingAddress { } function removeBlacklisted(address account) public onlyWhitelistingAddress { } function isBlacklisted(address account) public view returns (bool) { } function _addBlacklisted(address account) internal { } function _removeBlacklisted(address account) internal { } function _dontExceedAmount(address beneficiary, uint256 weiAmount) internal view { } modifier onlyWhitelistingAddress() { } /* ** Checks if the contract hasn't already been initialized */ modifier isNotInitialized() { } /* ** Checks if the sender is the minter controller address */ modifier onlyDeployingAddress() { } }
!isBlacklisted(beneficiary),"HLBICO: account is blacklisted"
293,395
!isBlacklisted(beneficiary)
"HLBICO: account is not blacklisted"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./SafeMath.sol"; import "./CappedTimedCrowdsale.sol"; import "./RefundPostdevCrowdsale.sol"; /** ** ICO Contract for the LBC crowdsale */ contract HLBICO is CappedTimedCrowdsale, RefundablePostDeliveryCrowdsale { using SafeMath for uint256; /* ** Global State */ bool public initialized; // default : false /* ** Addresses */ address public _deployingAddress; // should remain the same as deployer's address address public _whitelistingAddress; // should be oracle address public _reserveAddress; // should be deployer then humble reserve /* ** Events */ event InitializedContract(address indexed changerAddress, address indexed whitelistingAddress); event ChangedWhitelisterAddress(address indexed whitelisterAddress, address indexed changerAddress); event ChangedReserveAddress(address indexed reserveAddress, address indexed changerAddress); event ChangedDeployerAddress(address indexed deployerAddress, address indexed changerAddress); event BlacklistedAdded(address indexed account); event BlacklistedRemoved(address indexed account); event UpdatedCaps(uint256 newGoal, uint256 newCap, uint256 newTranche, uint256 newMaxInvest, uint256 newRate, uint256 newRateCoef); /* ** Attrs */ uint256 private _currentRate; uint256 private _rateCoef; mapping(address => bool) private _blacklistedAddrs; mapping(address => uint256) private _investmentAddrs; uint256 private _weiMaxInvest; uint256 private _etherTranche; uint256 private _currentWeiTranche; // Holds the current invested value for a tranche uint256 private _deliverToReserve; uint256 private _minimumInvest; /* * initialRateReceived : Number of token units a buyer gets per wei for the first investment slice. Should be 5000 (diving by 1000 for 3 decimals). * walletReceived : Wallet that will get the invested eth at the end of the crowdsale * tokenReceived : Address of the LBC token being sold * openingTimeReceived : Starting date of the ICO * closingtimeReceived : Ending date of the ICO * capReceived : Max amount of wei to be contributed * goalReceived : Funding goal * etherMaxInvestReceived : Maximum ether that can be invested */ constructor(uint256 initialRateReceived, uint256 rateCoefficientReceived, address payable walletReceived, LBCToken tokenReceived, uint256 openingTimeReceived, uint256 closingTimeReceived, uint256 capReceived, uint256 goalReceived) CrowdsaleMint(initialRateReceived, walletReceived, tokenReceived) TimedCrowdsale(openingTimeReceived, closingTimeReceived) CappedTimedCrowdsale(capReceived) RefundableCrowdsale(goalReceived) { } /* ** Initializes the contract address and affects addresses to their roles. */ function init( address whitelistingAddress, address reserveAddress ) public isNotInitialized onlyDeployingAddress { } /** * @dev Returns the rate of tokens per wei at the present time and computes rate depending on tranche. * @param weiAmount The value in wei to be converted into tokens * @return The number of tokens a buyer gets per wei for a given tranche */ function _getCustomAmount(uint256 weiAmount) internal returns (uint256) { } /* ** Adjusts all parameters influenced by Ether value based on a percentage coefficient ** coef is based on 4 digits for decimal representation with 1 precision ** i.e : 934 -> 93.4%; 1278 -> 127.8% */ function adjustEtherValue(uint256 coef) public onlyDeployingAddress { } function rate() public view override returns (uint256) { } function getNextRate() public view returns (uint256) { } /* ** Changes the address of the token contract. Must only be callable by deployer */ function changeToken(LBCToken newToken) public onlyDeployingAddress { } /* ** Changes the address with whitelisting role and can only be called by deployer */ function changeWhitelister(address newWhitelisterAddress) public onlyDeployingAddress { } /* ** Changes the address with deployer role and can only be called by deployer */ function changeDeployer(address newDeployerAddress) public onlyDeployingAddress { } /* ** Changes the address with pause role and can only be called by deployer */ function changeReserveAddress(address newReserveAddress) public onlyDeployingAddress { } /** * @dev Escrow finalization task, called when finalize() is called. */ function _finalization() override virtual internal { } /* ** Checks if an adress has been blacklisted before letting them withdraw their funds */ function withdrawTokens(address beneficiary) override virtual public { } /** * @dev Overrides parent method taking into account variable rate. * @param weiAmount The value in wei to be converted into tokens * @return The number of tokens _weiAmount wei will buy at present time */ function _getTokenAmount(uint256 weiAmount) internal override returns (uint256) { } function _forwardFunds() internal override(CrowdsaleMint, RefundablePostDeliveryCrowdsale) { } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal override(TimedCrowdsale, CappedTimedCrowdsale) view { } function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal override { } function _processPurchase(address beneficiary, uint256 tokenAmount) internal override(CrowdsaleMint, RefundablePostDeliveryCrowdsale) { } function hasClosed() public view override(TimedCrowdsale, CappedTimedCrowdsale) returns (bool) { } function etherTranche() public view returns (uint256) { } function maxInvest() public view returns (uint256) { } function addBlacklisted(address account) public onlyWhitelistingAddress { } function removeBlacklisted(address account) public onlyWhitelistingAddress { } function isBlacklisted(address account) public view returns (bool) { } function _addBlacklisted(address account) internal { } function _removeBlacklisted(address account) internal { require(<FILL_ME>) _blacklistedAddrs[account] = true; emit BlacklistedRemoved(account); } function _dontExceedAmount(address beneficiary, uint256 weiAmount) internal view { } modifier onlyWhitelistingAddress() { } /* ** Checks if the contract hasn't already been initialized */ modifier isNotInitialized() { } /* ** Checks if the sender is the minter controller address */ modifier onlyDeployingAddress() { } }
isBlacklisted(account),"HLBICO: account is not blacklisted"
293,395
isBlacklisted(account)
"HLBICO: Cannot invest more than KYC limit."
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./SafeMath.sol"; import "./CappedTimedCrowdsale.sol"; import "./RefundPostdevCrowdsale.sol"; /** ** ICO Contract for the LBC crowdsale */ contract HLBICO is CappedTimedCrowdsale, RefundablePostDeliveryCrowdsale { using SafeMath for uint256; /* ** Global State */ bool public initialized; // default : false /* ** Addresses */ address public _deployingAddress; // should remain the same as deployer's address address public _whitelistingAddress; // should be oracle address public _reserveAddress; // should be deployer then humble reserve /* ** Events */ event InitializedContract(address indexed changerAddress, address indexed whitelistingAddress); event ChangedWhitelisterAddress(address indexed whitelisterAddress, address indexed changerAddress); event ChangedReserveAddress(address indexed reserveAddress, address indexed changerAddress); event ChangedDeployerAddress(address indexed deployerAddress, address indexed changerAddress); event BlacklistedAdded(address indexed account); event BlacklistedRemoved(address indexed account); event UpdatedCaps(uint256 newGoal, uint256 newCap, uint256 newTranche, uint256 newMaxInvest, uint256 newRate, uint256 newRateCoef); /* ** Attrs */ uint256 private _currentRate; uint256 private _rateCoef; mapping(address => bool) private _blacklistedAddrs; mapping(address => uint256) private _investmentAddrs; uint256 private _weiMaxInvest; uint256 private _etherTranche; uint256 private _currentWeiTranche; // Holds the current invested value for a tranche uint256 private _deliverToReserve; uint256 private _minimumInvest; /* * initialRateReceived : Number of token units a buyer gets per wei for the first investment slice. Should be 5000 (diving by 1000 for 3 decimals). * walletReceived : Wallet that will get the invested eth at the end of the crowdsale * tokenReceived : Address of the LBC token being sold * openingTimeReceived : Starting date of the ICO * closingtimeReceived : Ending date of the ICO * capReceived : Max amount of wei to be contributed * goalReceived : Funding goal * etherMaxInvestReceived : Maximum ether that can be invested */ constructor(uint256 initialRateReceived, uint256 rateCoefficientReceived, address payable walletReceived, LBCToken tokenReceived, uint256 openingTimeReceived, uint256 closingTimeReceived, uint256 capReceived, uint256 goalReceived) CrowdsaleMint(initialRateReceived, walletReceived, tokenReceived) TimedCrowdsale(openingTimeReceived, closingTimeReceived) CappedTimedCrowdsale(capReceived) RefundableCrowdsale(goalReceived) { } /* ** Initializes the contract address and affects addresses to their roles. */ function init( address whitelistingAddress, address reserveAddress ) public isNotInitialized onlyDeployingAddress { } /** * @dev Returns the rate of tokens per wei at the present time and computes rate depending on tranche. * @param weiAmount The value in wei to be converted into tokens * @return The number of tokens a buyer gets per wei for a given tranche */ function _getCustomAmount(uint256 weiAmount) internal returns (uint256) { } /* ** Adjusts all parameters influenced by Ether value based on a percentage coefficient ** coef is based on 4 digits for decimal representation with 1 precision ** i.e : 934 -> 93.4%; 1278 -> 127.8% */ function adjustEtherValue(uint256 coef) public onlyDeployingAddress { } function rate() public view override returns (uint256) { } function getNextRate() public view returns (uint256) { } /* ** Changes the address of the token contract. Must only be callable by deployer */ function changeToken(LBCToken newToken) public onlyDeployingAddress { } /* ** Changes the address with whitelisting role and can only be called by deployer */ function changeWhitelister(address newWhitelisterAddress) public onlyDeployingAddress { } /* ** Changes the address with deployer role and can only be called by deployer */ function changeDeployer(address newDeployerAddress) public onlyDeployingAddress { } /* ** Changes the address with pause role and can only be called by deployer */ function changeReserveAddress(address newReserveAddress) public onlyDeployingAddress { } /** * @dev Escrow finalization task, called when finalize() is called. */ function _finalization() override virtual internal { } /* ** Checks if an adress has been blacklisted before letting them withdraw their funds */ function withdrawTokens(address beneficiary) override virtual public { } /** * @dev Overrides parent method taking into account variable rate. * @param weiAmount The value in wei to be converted into tokens * @return The number of tokens _weiAmount wei will buy at present time */ function _getTokenAmount(uint256 weiAmount) internal override returns (uint256) { } function _forwardFunds() internal override(CrowdsaleMint, RefundablePostDeliveryCrowdsale) { } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal override(TimedCrowdsale, CappedTimedCrowdsale) view { } function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal override { } function _processPurchase(address beneficiary, uint256 tokenAmount) internal override(CrowdsaleMint, RefundablePostDeliveryCrowdsale) { } function hasClosed() public view override(TimedCrowdsale, CappedTimedCrowdsale) returns (bool) { } function etherTranche() public view returns (uint256) { } function maxInvest() public view returns (uint256) { } function addBlacklisted(address account) public onlyWhitelistingAddress { } function removeBlacklisted(address account) public onlyWhitelistingAddress { } function isBlacklisted(address account) public view returns (bool) { } function _addBlacklisted(address account) internal { } function _removeBlacklisted(address account) internal { } function _dontExceedAmount(address beneficiary, uint256 weiAmount) internal view { require(<FILL_ME>) } modifier onlyWhitelistingAddress() { } /* ** Checks if the contract hasn't already been initialized */ modifier isNotInitialized() { } /* ** Checks if the sender is the minter controller address */ modifier onlyDeployingAddress() { } }
_investmentAddrs[beneficiary].add(weiAmount)<=_weiMaxInvest,"HLBICO: Cannot invest more than KYC limit."
293,395
_investmentAddrs[beneficiary].add(weiAmount)<=_weiMaxInvest
"HLBICO: caller does not have the Whitelisted role"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./SafeMath.sol"; import "./CappedTimedCrowdsale.sol"; import "./RefundPostdevCrowdsale.sol"; /** ** ICO Contract for the LBC crowdsale */ contract HLBICO is CappedTimedCrowdsale, RefundablePostDeliveryCrowdsale { using SafeMath for uint256; /* ** Global State */ bool public initialized; // default : false /* ** Addresses */ address public _deployingAddress; // should remain the same as deployer's address address public _whitelistingAddress; // should be oracle address public _reserveAddress; // should be deployer then humble reserve /* ** Events */ event InitializedContract(address indexed changerAddress, address indexed whitelistingAddress); event ChangedWhitelisterAddress(address indexed whitelisterAddress, address indexed changerAddress); event ChangedReserveAddress(address indexed reserveAddress, address indexed changerAddress); event ChangedDeployerAddress(address indexed deployerAddress, address indexed changerAddress); event BlacklistedAdded(address indexed account); event BlacklistedRemoved(address indexed account); event UpdatedCaps(uint256 newGoal, uint256 newCap, uint256 newTranche, uint256 newMaxInvest, uint256 newRate, uint256 newRateCoef); /* ** Attrs */ uint256 private _currentRate; uint256 private _rateCoef; mapping(address => bool) private _blacklistedAddrs; mapping(address => uint256) private _investmentAddrs; uint256 private _weiMaxInvest; uint256 private _etherTranche; uint256 private _currentWeiTranche; // Holds the current invested value for a tranche uint256 private _deliverToReserve; uint256 private _minimumInvest; /* * initialRateReceived : Number of token units a buyer gets per wei for the first investment slice. Should be 5000 (diving by 1000 for 3 decimals). * walletReceived : Wallet that will get the invested eth at the end of the crowdsale * tokenReceived : Address of the LBC token being sold * openingTimeReceived : Starting date of the ICO * closingtimeReceived : Ending date of the ICO * capReceived : Max amount of wei to be contributed * goalReceived : Funding goal * etherMaxInvestReceived : Maximum ether that can be invested */ constructor(uint256 initialRateReceived, uint256 rateCoefficientReceived, address payable walletReceived, LBCToken tokenReceived, uint256 openingTimeReceived, uint256 closingTimeReceived, uint256 capReceived, uint256 goalReceived) CrowdsaleMint(initialRateReceived, walletReceived, tokenReceived) TimedCrowdsale(openingTimeReceived, closingTimeReceived) CappedTimedCrowdsale(capReceived) RefundableCrowdsale(goalReceived) { } /* ** Initializes the contract address and affects addresses to their roles. */ function init( address whitelistingAddress, address reserveAddress ) public isNotInitialized onlyDeployingAddress { } /** * @dev Returns the rate of tokens per wei at the present time and computes rate depending on tranche. * @param weiAmount The value in wei to be converted into tokens * @return The number of tokens a buyer gets per wei for a given tranche */ function _getCustomAmount(uint256 weiAmount) internal returns (uint256) { } /* ** Adjusts all parameters influenced by Ether value based on a percentage coefficient ** coef is based on 4 digits for decimal representation with 1 precision ** i.e : 934 -> 93.4%; 1278 -> 127.8% */ function adjustEtherValue(uint256 coef) public onlyDeployingAddress { } function rate() public view override returns (uint256) { } function getNextRate() public view returns (uint256) { } /* ** Changes the address of the token contract. Must only be callable by deployer */ function changeToken(LBCToken newToken) public onlyDeployingAddress { } /* ** Changes the address with whitelisting role and can only be called by deployer */ function changeWhitelister(address newWhitelisterAddress) public onlyDeployingAddress { } /* ** Changes the address with deployer role and can only be called by deployer */ function changeDeployer(address newDeployerAddress) public onlyDeployingAddress { } /* ** Changes the address with pause role and can only be called by deployer */ function changeReserveAddress(address newReserveAddress) public onlyDeployingAddress { } /** * @dev Escrow finalization task, called when finalize() is called. */ function _finalization() override virtual internal { } /* ** Checks if an adress has been blacklisted before letting them withdraw their funds */ function withdrawTokens(address beneficiary) override virtual public { } /** * @dev Overrides parent method taking into account variable rate. * @param weiAmount The value in wei to be converted into tokens * @return The number of tokens _weiAmount wei will buy at present time */ function _getTokenAmount(uint256 weiAmount) internal override returns (uint256) { } function _forwardFunds() internal override(CrowdsaleMint, RefundablePostDeliveryCrowdsale) { } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal override(TimedCrowdsale, CappedTimedCrowdsale) view { } function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal override { } function _processPurchase(address beneficiary, uint256 tokenAmount) internal override(CrowdsaleMint, RefundablePostDeliveryCrowdsale) { } function hasClosed() public view override(TimedCrowdsale, CappedTimedCrowdsale) returns (bool) { } function etherTranche() public view returns (uint256) { } function maxInvest() public view returns (uint256) { } function addBlacklisted(address account) public onlyWhitelistingAddress { } function removeBlacklisted(address account) public onlyWhitelistingAddress { } function isBlacklisted(address account) public view returns (bool) { } function _addBlacklisted(address account) internal { } function _removeBlacklisted(address account) internal { } function _dontExceedAmount(address beneficiary, uint256 weiAmount) internal view { } modifier onlyWhitelistingAddress() { require(<FILL_ME>) _; } /* ** Checks if the contract hasn't already been initialized */ modifier isNotInitialized() { } /* ** Checks if the sender is the minter controller address */ modifier onlyDeployingAddress() { } }
_msgSender()==_whitelistingAddress,"HLBICO: caller does not have the Whitelisted role"
293,395
_msgSender()==_whitelistingAddress
"RefundablePostDeliveryCrowdsale: goal not reached"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./RefundableCrowdsale.sol"; import "./PostDeliveryCrowdsale.sol"; /** * @title RefundablePostDeliveryCrowdsale * @dev Extension of RefundableCrowdsale contract that only delivers the tokens * once the crowdsale has closed and the goal met, preventing refunds to be issued * to token holders. */ abstract contract RefundablePostDeliveryCrowdsale is RefundableCrowdsale, PostDeliveryCrowdsale { function _forwardFunds() internal override(CrowdsaleMint,RefundableCrowdsale) virtual { } function _processPurchase(address beneficiary, uint256 tokenAmount) internal override(CrowdsaleMint, PostDeliveryCrowdsale) virtual { } function withdrawTokens(address beneficiary) override virtual public { require(finalized(), "RefundablePostDeliveryCrowdsale: not finalized"); require(<FILL_ME>) super.withdrawTokens(beneficiary); } }
goalReached(),"RefundablePostDeliveryCrowdsale: goal not reached"
293,398
goalReached()
"This address is blacklisted from transferring tokens."
// contracts/GLDToken.sol pragma solidity ^0.8.0; contract YugaInu is ERC20, Ownable { mapping(address => bool) private _blacklist; mapping(address => bool) private _isExcludedFromFee; address[] private _excluded; address devWallet = 0x57B9EAAC70d1653F8Bd3057472e679fff3ab21c7; address giveawayWallet = 0x1bEd62CCaBb030B6549D5A85f6430449783d092D; constructor(uint256 initialSupply) ERC20("YugaInu", "YUGAINU") { } // 10% transfer fees go to the giveaway wallet 0x1bEd62CCaBb030B6549D5A85f6430449783d092D // For giveaways + funding development of the project function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { } function setExcludeFromFee(address account, bool excluded) external onlyOwner { } function isExcludedFromFee(address account) public view returns (bool) { } // Prevents blacklisted addresses from transferring tokens // For those that cause any harm to our lord Yuga function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override { super._beforeTokenTransfer(from, to, amount); require(<FILL_ME>) } // Owner can blacklist any address function addAddressToBlacklist(address _user) public onlyOwner { } // Owner can remove any address from blacklist function removeAddressFromBlacklist(address _user) public onlyOwner { } }
!_blacklist[from],"This address is blacklisted from transferring tokens."
293,420
!_blacklist[from]
"This address is already blacklisted."
// contracts/GLDToken.sol pragma solidity ^0.8.0; contract YugaInu is ERC20, Ownable { mapping(address => bool) private _blacklist; mapping(address => bool) private _isExcludedFromFee; address[] private _excluded; address devWallet = 0x57B9EAAC70d1653F8Bd3057472e679fff3ab21c7; address giveawayWallet = 0x1bEd62CCaBb030B6549D5A85f6430449783d092D; constructor(uint256 initialSupply) ERC20("YugaInu", "YUGAINU") { } // 10% transfer fees go to the giveaway wallet 0x1bEd62CCaBb030B6549D5A85f6430449783d092D // For giveaways + funding development of the project function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { } function setExcludeFromFee(address account, bool excluded) external onlyOwner { } function isExcludedFromFee(address account) public view returns (bool) { } // Prevents blacklisted addresses from transferring tokens // For those that cause any harm to our lord Yuga function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override { } // Owner can blacklist any address function addAddressToBlacklist(address _user) public onlyOwner { require(<FILL_ME>) _blacklist[_user] = true; } // Owner can remove any address from blacklist function removeAddressFromBlacklist(address _user) public onlyOwner { } }
!_blacklist[_user],"This address is already blacklisted."
293,420
!_blacklist[_user]
"This address is not blacklisted."
// contracts/GLDToken.sol pragma solidity ^0.8.0; contract YugaInu is ERC20, Ownable { mapping(address => bool) private _blacklist; mapping(address => bool) private _isExcludedFromFee; address[] private _excluded; address devWallet = 0x57B9EAAC70d1653F8Bd3057472e679fff3ab21c7; address giveawayWallet = 0x1bEd62CCaBb030B6549D5A85f6430449783d092D; constructor(uint256 initialSupply) ERC20("YugaInu", "YUGAINU") { } // 10% transfer fees go to the giveaway wallet 0x1bEd62CCaBb030B6549D5A85f6430449783d092D // For giveaways + funding development of the project function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { } function setExcludeFromFee(address account, bool excluded) external onlyOwner { } function isExcludedFromFee(address account) public view returns (bool) { } // Prevents blacklisted addresses from transferring tokens // For those that cause any harm to our lord Yuga function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override { } // Owner can blacklist any address function addAddressToBlacklist(address _user) public onlyOwner { } // Owner can remove any address from blacklist function removeAddressFromBlacklist(address _user) public onlyOwner { require(<FILL_ME>) _blacklist[_user] = false; } }
_blacklist[_user],"This address is not blacklisted."
293,420
_blacklist[_user]
"Inventory: not an NFT"
@v6.0.0 pragma solidity 0.6.8; abstract contract ERC1155InventoryBase is IERC1155, IERC1155MetadataURI, IERC1155Inventory, ERC165, Context { // bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) bytes4 internal constant _ERC1155_RECEIVED = 0xf23a6e61; // bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) bytes4 internal constant _ERC1155_BATCH_RECEIVED = 0xbc197c81; // Burnt non-fungible token owner's magic value uint256 internal constant _BURNT_NFT_OWNER = 0xdead000000000000000000000000000000000000000000000000000000000000; // Non-fungible bit. If an id has this bit set, it is a non-fungible (either collection or token) uint256 internal constant _NF_BIT = 1 << 255; // Mask for non-fungible collection (including the nf bit) uint256 internal constant _NF_COLLECTION_MASK = uint256(type(uint32).max) << 224; uint256 internal constant _NF_TOKEN_MASK = ~_NF_COLLECTION_MASK; /* owner => operator => approved */ mapping(address => mapping(address => bool)) internal _operators; /* collection ID => owner => balance */ mapping(uint256 => mapping(address => uint256)) internal _balances; /* collection ID => supply */ mapping(uint256 => uint256) internal _supplies; /* NFT ID => owner */ mapping(uint256 => uint256) internal _owners; /* collection ID => creator */ mapping(uint256 => address) internal _creators; /** * @dev Constructor function */ constructor() internal { } //================================== ERC1155 =======================================/ /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address owner, uint256 id) public virtual override view returns (uint256) { } /** * @dev See {IERC1155-balanceOfBatch}. */ function balanceOfBatch(address[] memory owners, uint256[] memory ids) public virtual override view returns (uint256[] memory) { } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address tokenOwner, address operator) public virtual override view returns (bool) { } //================================== ERC1155MetadataURI =======================================/ /** * @dev See {IERC1155MetadataURI-uri}. */ function uri(uint256 id) external virtual override view returns (string memory) { } //================================== ERC1155Inventory =======================================/ /** * @dev See {IERC1155Inventory-isFungible}. */ function isFungible(uint256 id) public virtual override pure returns (bool) { } /** * @dev See {IERC1155Inventory-collectionOf}. */ function collectionOf(uint256 nftId) public virtual override pure returns (uint256) { require(<FILL_ME>) return nftId & _NF_COLLECTION_MASK; } /** * @dev See {IERC1155Inventory-ownerOf}. */ function ownerOf(uint256 nftId) public virtual override view returns (address) { } /** * @dev See {IERC1155Inventory-totalSupply}. */ function totalSupply(uint256 id) public virtual override view returns (uint256) { } //================================== ERC1155Inventory Non-standard helpers =======================================/ /** * @dev Introspects whether an identifier represents an non-fungible token. * @param id Identifier to query. * @return True if `id` represents an non-fungible token. */ function isNFT(uint256 id) public virtual pure returns (bool) { } //================================== Inventory Internal Functions =======================================/ /** * Creates a collection (optional). * @dev Reverts if `collectionId` does not represent a collection. * @dev Reverts if `collectionId` has already been created. * @dev Emits a {IERC1155Inventory-CollectionCreated} event. * @param collectionId Identifier of the collection. */ function _createCollection(uint256 collectionId) internal virtual { } /** * @dev (abstract) Returns an URI for a given identifier. * @param id Identifier to query the URI of. * @return The metadata URI for `id`. */ function _uri(uint256 id) internal virtual view returns (string memory); /** * Returns whether `sender` is authorised to make a transfer on behalf of `from`. * @param from The address to check operatibility upon. * @param sender The sender address. * @return True if sender is `from` or an operator for `from`, false otherwise. */ function _isOperatable(address from, address sender) internal virtual view returns (bool) { } //================================== Token Receiver Calls Internal =======================================/ /** * Calls {IERC1155TokenReceiver-onERC1155Received} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous token owner. * @param to New token owner. * @param id Identifier of the token transferred. * @param value Amount of token transferred. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155Received( address from, address to, uint256 id, uint256 value, bytes memory data ) internal { } /** * Calls {IERC1155TokenReceiver-onERC1155batchReceived} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous tokens owner. * @param to New tokens owner. * @param ids Identifiers of the tokens to transfer. * @param values Amounts of tokens to transfer. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155BatchReceived( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { } }
isNFT(nftId),"Inventory: not an NFT"
293,456
isNFT(nftId)
"Inventory: not a collection"
@v6.0.0 pragma solidity 0.6.8; abstract contract ERC1155InventoryBase is IERC1155, IERC1155MetadataURI, IERC1155Inventory, ERC165, Context { // bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) bytes4 internal constant _ERC1155_RECEIVED = 0xf23a6e61; // bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) bytes4 internal constant _ERC1155_BATCH_RECEIVED = 0xbc197c81; // Burnt non-fungible token owner's magic value uint256 internal constant _BURNT_NFT_OWNER = 0xdead000000000000000000000000000000000000000000000000000000000000; // Non-fungible bit. If an id has this bit set, it is a non-fungible (either collection or token) uint256 internal constant _NF_BIT = 1 << 255; // Mask for non-fungible collection (including the nf bit) uint256 internal constant _NF_COLLECTION_MASK = uint256(type(uint32).max) << 224; uint256 internal constant _NF_TOKEN_MASK = ~_NF_COLLECTION_MASK; /* owner => operator => approved */ mapping(address => mapping(address => bool)) internal _operators; /* collection ID => owner => balance */ mapping(uint256 => mapping(address => uint256)) internal _balances; /* collection ID => supply */ mapping(uint256 => uint256) internal _supplies; /* NFT ID => owner */ mapping(uint256 => uint256) internal _owners; /* collection ID => creator */ mapping(uint256 => address) internal _creators; /** * @dev Constructor function */ constructor() internal { } //================================== ERC1155 =======================================/ /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address owner, uint256 id) public virtual override view returns (uint256) { } /** * @dev See {IERC1155-balanceOfBatch}. */ function balanceOfBatch(address[] memory owners, uint256[] memory ids) public virtual override view returns (uint256[] memory) { } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address tokenOwner, address operator) public virtual override view returns (bool) { } //================================== ERC1155MetadataURI =======================================/ /** * @dev See {IERC1155MetadataURI-uri}. */ function uri(uint256 id) external virtual override view returns (string memory) { } //================================== ERC1155Inventory =======================================/ /** * @dev See {IERC1155Inventory-isFungible}. */ function isFungible(uint256 id) public virtual override pure returns (bool) { } /** * @dev See {IERC1155Inventory-collectionOf}. */ function collectionOf(uint256 nftId) public virtual override pure returns (uint256) { } /** * @dev See {IERC1155Inventory-ownerOf}. */ function ownerOf(uint256 nftId) public virtual override view returns (address) { } /** * @dev See {IERC1155Inventory-totalSupply}. */ function totalSupply(uint256 id) public virtual override view returns (uint256) { } //================================== ERC1155Inventory Non-standard helpers =======================================/ /** * @dev Introspects whether an identifier represents an non-fungible token. * @param id Identifier to query. * @return True if `id` represents an non-fungible token. */ function isNFT(uint256 id) public virtual pure returns (bool) { } //================================== Inventory Internal Functions =======================================/ /** * Creates a collection (optional). * @dev Reverts if `collectionId` does not represent a collection. * @dev Reverts if `collectionId` has already been created. * @dev Emits a {IERC1155Inventory-CollectionCreated} event. * @param collectionId Identifier of the collection. */ function _createCollection(uint256 collectionId) internal virtual { require(<FILL_ME>) require(_creators[collectionId] == address(0), "Inventory: existing collection"); _creators[collectionId] = _msgSender(); emit CollectionCreated(collectionId, isFungible(collectionId)); } /** * @dev (abstract) Returns an URI for a given identifier. * @param id Identifier to query the URI of. * @return The metadata URI for `id`. */ function _uri(uint256 id) internal virtual view returns (string memory); /** * Returns whether `sender` is authorised to make a transfer on behalf of `from`. * @param from The address to check operatibility upon. * @param sender The sender address. * @return True if sender is `from` or an operator for `from`, false otherwise. */ function _isOperatable(address from, address sender) internal virtual view returns (bool) { } //================================== Token Receiver Calls Internal =======================================/ /** * Calls {IERC1155TokenReceiver-onERC1155Received} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous token owner. * @param to New token owner. * @param id Identifier of the token transferred. * @param value Amount of token transferred. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155Received( address from, address to, uint256 id, uint256 value, bytes memory data ) internal { } /** * Calls {IERC1155TokenReceiver-onERC1155batchReceived} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous tokens owner. * @param to New tokens owner. * @param ids Identifiers of the tokens to transfer. * @param values Amounts of tokens to transfer. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155BatchReceived( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { } }
!isNFT(collectionId),"Inventory: not a collection"
293,456
!isNFT(collectionId)
"Inventory: existing collection"
@v6.0.0 pragma solidity 0.6.8; abstract contract ERC1155InventoryBase is IERC1155, IERC1155MetadataURI, IERC1155Inventory, ERC165, Context { // bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) bytes4 internal constant _ERC1155_RECEIVED = 0xf23a6e61; // bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) bytes4 internal constant _ERC1155_BATCH_RECEIVED = 0xbc197c81; // Burnt non-fungible token owner's magic value uint256 internal constant _BURNT_NFT_OWNER = 0xdead000000000000000000000000000000000000000000000000000000000000; // Non-fungible bit. If an id has this bit set, it is a non-fungible (either collection or token) uint256 internal constant _NF_BIT = 1 << 255; // Mask for non-fungible collection (including the nf bit) uint256 internal constant _NF_COLLECTION_MASK = uint256(type(uint32).max) << 224; uint256 internal constant _NF_TOKEN_MASK = ~_NF_COLLECTION_MASK; /* owner => operator => approved */ mapping(address => mapping(address => bool)) internal _operators; /* collection ID => owner => balance */ mapping(uint256 => mapping(address => uint256)) internal _balances; /* collection ID => supply */ mapping(uint256 => uint256) internal _supplies; /* NFT ID => owner */ mapping(uint256 => uint256) internal _owners; /* collection ID => creator */ mapping(uint256 => address) internal _creators; /** * @dev Constructor function */ constructor() internal { } //================================== ERC1155 =======================================/ /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address owner, uint256 id) public virtual override view returns (uint256) { } /** * @dev See {IERC1155-balanceOfBatch}. */ function balanceOfBatch(address[] memory owners, uint256[] memory ids) public virtual override view returns (uint256[] memory) { } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address tokenOwner, address operator) public virtual override view returns (bool) { } //================================== ERC1155MetadataURI =======================================/ /** * @dev See {IERC1155MetadataURI-uri}. */ function uri(uint256 id) external virtual override view returns (string memory) { } //================================== ERC1155Inventory =======================================/ /** * @dev See {IERC1155Inventory-isFungible}. */ function isFungible(uint256 id) public virtual override pure returns (bool) { } /** * @dev See {IERC1155Inventory-collectionOf}. */ function collectionOf(uint256 nftId) public virtual override pure returns (uint256) { } /** * @dev See {IERC1155Inventory-ownerOf}. */ function ownerOf(uint256 nftId) public virtual override view returns (address) { } /** * @dev See {IERC1155Inventory-totalSupply}. */ function totalSupply(uint256 id) public virtual override view returns (uint256) { } //================================== ERC1155Inventory Non-standard helpers =======================================/ /** * @dev Introspects whether an identifier represents an non-fungible token. * @param id Identifier to query. * @return True if `id` represents an non-fungible token. */ function isNFT(uint256 id) public virtual pure returns (bool) { } //================================== Inventory Internal Functions =======================================/ /** * Creates a collection (optional). * @dev Reverts if `collectionId` does not represent a collection. * @dev Reverts if `collectionId` has already been created. * @dev Emits a {IERC1155Inventory-CollectionCreated} event. * @param collectionId Identifier of the collection. */ function _createCollection(uint256 collectionId) internal virtual { require(!isNFT(collectionId), "Inventory: not a collection"); require(<FILL_ME>) _creators[collectionId] = _msgSender(); emit CollectionCreated(collectionId, isFungible(collectionId)); } /** * @dev (abstract) Returns an URI for a given identifier. * @param id Identifier to query the URI of. * @return The metadata URI for `id`. */ function _uri(uint256 id) internal virtual view returns (string memory); /** * Returns whether `sender` is authorised to make a transfer on behalf of `from`. * @param from The address to check operatibility upon. * @param sender The sender address. * @return True if sender is `from` or an operator for `from`, false otherwise. */ function _isOperatable(address from, address sender) internal virtual view returns (bool) { } //================================== Token Receiver Calls Internal =======================================/ /** * Calls {IERC1155TokenReceiver-onERC1155Received} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous token owner. * @param to New token owner. * @param id Identifier of the token transferred. * @param value Amount of token transferred. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155Received( address from, address to, uint256 id, uint256 value, bytes memory data ) internal { } /** * Calls {IERC1155TokenReceiver-onERC1155batchReceived} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous tokens owner. * @param to New tokens owner. * @param ids Identifiers of the tokens to transfer. * @param values Amounts of tokens to transfer. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155BatchReceived( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { } }
_creators[collectionId]==address(0),"Inventory: existing collection"
293,456
_creators[collectionId]==address(0)
"Inventory: transfer refused"
@v6.0.0 pragma solidity 0.6.8; abstract contract ERC1155InventoryBase is IERC1155, IERC1155MetadataURI, IERC1155Inventory, ERC165, Context { // bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) bytes4 internal constant _ERC1155_RECEIVED = 0xf23a6e61; // bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) bytes4 internal constant _ERC1155_BATCH_RECEIVED = 0xbc197c81; // Burnt non-fungible token owner's magic value uint256 internal constant _BURNT_NFT_OWNER = 0xdead000000000000000000000000000000000000000000000000000000000000; // Non-fungible bit. If an id has this bit set, it is a non-fungible (either collection or token) uint256 internal constant _NF_BIT = 1 << 255; // Mask for non-fungible collection (including the nf bit) uint256 internal constant _NF_COLLECTION_MASK = uint256(type(uint32).max) << 224; uint256 internal constant _NF_TOKEN_MASK = ~_NF_COLLECTION_MASK; /* owner => operator => approved */ mapping(address => mapping(address => bool)) internal _operators; /* collection ID => owner => balance */ mapping(uint256 => mapping(address => uint256)) internal _balances; /* collection ID => supply */ mapping(uint256 => uint256) internal _supplies; /* NFT ID => owner */ mapping(uint256 => uint256) internal _owners; /* collection ID => creator */ mapping(uint256 => address) internal _creators; /** * @dev Constructor function */ constructor() internal { } //================================== ERC1155 =======================================/ /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address owner, uint256 id) public virtual override view returns (uint256) { } /** * @dev See {IERC1155-balanceOfBatch}. */ function balanceOfBatch(address[] memory owners, uint256[] memory ids) public virtual override view returns (uint256[] memory) { } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address tokenOwner, address operator) public virtual override view returns (bool) { } //================================== ERC1155MetadataURI =======================================/ /** * @dev See {IERC1155MetadataURI-uri}. */ function uri(uint256 id) external virtual override view returns (string memory) { } //================================== ERC1155Inventory =======================================/ /** * @dev See {IERC1155Inventory-isFungible}. */ function isFungible(uint256 id) public virtual override pure returns (bool) { } /** * @dev See {IERC1155Inventory-collectionOf}. */ function collectionOf(uint256 nftId) public virtual override pure returns (uint256) { } /** * @dev See {IERC1155Inventory-ownerOf}. */ function ownerOf(uint256 nftId) public virtual override view returns (address) { } /** * @dev See {IERC1155Inventory-totalSupply}. */ function totalSupply(uint256 id) public virtual override view returns (uint256) { } //================================== ERC1155Inventory Non-standard helpers =======================================/ /** * @dev Introspects whether an identifier represents an non-fungible token. * @param id Identifier to query. * @return True if `id` represents an non-fungible token. */ function isNFT(uint256 id) public virtual pure returns (bool) { } //================================== Inventory Internal Functions =======================================/ /** * Creates a collection (optional). * @dev Reverts if `collectionId` does not represent a collection. * @dev Reverts if `collectionId` has already been created. * @dev Emits a {IERC1155Inventory-CollectionCreated} event. * @param collectionId Identifier of the collection. */ function _createCollection(uint256 collectionId) internal virtual { } /** * @dev (abstract) Returns an URI for a given identifier. * @param id Identifier to query the URI of. * @return The metadata URI for `id`. */ function _uri(uint256 id) internal virtual view returns (string memory); /** * Returns whether `sender` is authorised to make a transfer on behalf of `from`. * @param from The address to check operatibility upon. * @param sender The sender address. * @return True if sender is `from` or an operator for `from`, false otherwise. */ function _isOperatable(address from, address sender) internal virtual view returns (bool) { } //================================== Token Receiver Calls Internal =======================================/ /** * Calls {IERC1155TokenReceiver-onERC1155Received} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous token owner. * @param to New token owner. * @param id Identifier of the token transferred. * @param value Amount of token transferred. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155Received( address from, address to, uint256 id, uint256 value, bytes memory data ) internal { require(<FILL_ME>) } /** * Calls {IERC1155TokenReceiver-onERC1155batchReceived} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous tokens owner. * @param to New tokens owner. * @param ids Identifiers of the tokens to transfer. * @param values Amounts of tokens to transfer. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155BatchReceived( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { } }
IERC1155TokenReceiver(to).onERC1155Received(_msgSender(),from,id,value,data)==_ERC1155_RECEIVED,"Inventory: transfer refused"
293,456
IERC1155TokenReceiver(to).onERC1155Received(_msgSender(),from,id,value,data)==_ERC1155_RECEIVED
"Inventory: transfer refused"
@v6.0.0 pragma solidity 0.6.8; abstract contract ERC1155InventoryBase is IERC1155, IERC1155MetadataURI, IERC1155Inventory, ERC165, Context { // bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) bytes4 internal constant _ERC1155_RECEIVED = 0xf23a6e61; // bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) bytes4 internal constant _ERC1155_BATCH_RECEIVED = 0xbc197c81; // Burnt non-fungible token owner's magic value uint256 internal constant _BURNT_NFT_OWNER = 0xdead000000000000000000000000000000000000000000000000000000000000; // Non-fungible bit. If an id has this bit set, it is a non-fungible (either collection or token) uint256 internal constant _NF_BIT = 1 << 255; // Mask for non-fungible collection (including the nf bit) uint256 internal constant _NF_COLLECTION_MASK = uint256(type(uint32).max) << 224; uint256 internal constant _NF_TOKEN_MASK = ~_NF_COLLECTION_MASK; /* owner => operator => approved */ mapping(address => mapping(address => bool)) internal _operators; /* collection ID => owner => balance */ mapping(uint256 => mapping(address => uint256)) internal _balances; /* collection ID => supply */ mapping(uint256 => uint256) internal _supplies; /* NFT ID => owner */ mapping(uint256 => uint256) internal _owners; /* collection ID => creator */ mapping(uint256 => address) internal _creators; /** * @dev Constructor function */ constructor() internal { } //================================== ERC1155 =======================================/ /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address owner, uint256 id) public virtual override view returns (uint256) { } /** * @dev See {IERC1155-balanceOfBatch}. */ function balanceOfBatch(address[] memory owners, uint256[] memory ids) public virtual override view returns (uint256[] memory) { } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address tokenOwner, address operator) public virtual override view returns (bool) { } //================================== ERC1155MetadataURI =======================================/ /** * @dev See {IERC1155MetadataURI-uri}. */ function uri(uint256 id) external virtual override view returns (string memory) { } //================================== ERC1155Inventory =======================================/ /** * @dev See {IERC1155Inventory-isFungible}. */ function isFungible(uint256 id) public virtual override pure returns (bool) { } /** * @dev See {IERC1155Inventory-collectionOf}. */ function collectionOf(uint256 nftId) public virtual override pure returns (uint256) { } /** * @dev See {IERC1155Inventory-ownerOf}. */ function ownerOf(uint256 nftId) public virtual override view returns (address) { } /** * @dev See {IERC1155Inventory-totalSupply}. */ function totalSupply(uint256 id) public virtual override view returns (uint256) { } //================================== ERC1155Inventory Non-standard helpers =======================================/ /** * @dev Introspects whether an identifier represents an non-fungible token. * @param id Identifier to query. * @return True if `id` represents an non-fungible token. */ function isNFT(uint256 id) public virtual pure returns (bool) { } //================================== Inventory Internal Functions =======================================/ /** * Creates a collection (optional). * @dev Reverts if `collectionId` does not represent a collection. * @dev Reverts if `collectionId` has already been created. * @dev Emits a {IERC1155Inventory-CollectionCreated} event. * @param collectionId Identifier of the collection. */ function _createCollection(uint256 collectionId) internal virtual { } /** * @dev (abstract) Returns an URI for a given identifier. * @param id Identifier to query the URI of. * @return The metadata URI for `id`. */ function _uri(uint256 id) internal virtual view returns (string memory); /** * Returns whether `sender` is authorised to make a transfer on behalf of `from`. * @param from The address to check operatibility upon. * @param sender The sender address. * @return True if sender is `from` or an operator for `from`, false otherwise. */ function _isOperatable(address from, address sender) internal virtual view returns (bool) { } //================================== Token Receiver Calls Internal =======================================/ /** * Calls {IERC1155TokenReceiver-onERC1155Received} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous token owner. * @param to New token owner. * @param id Identifier of the token transferred. * @param value Amount of token transferred. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155Received( address from, address to, uint256 id, uint256 value, bytes memory data ) internal { } /** * Calls {IERC1155TokenReceiver-onERC1155batchReceived} on a target contract. * @dev Reverts if `to` is not a contract. * @dev Reverts if the call to the target fails or is refused. * @param from Previous tokens owner. * @param to New tokens owner. * @param ids Identifiers of the tokens to transfer. * @param values Amounts of tokens to transfer. * @param data Optional data to send along with the receiver contract call. */ function _callOnERC1155BatchReceived( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { require(<FILL_ME>) } }
IERC1155TokenReceiver(to).onERC1155BatchReceived(_msgSender(),from,ids,values,data)==_ERC1155_BATCH_RECEIVED,"Inventory: transfer refused"
293,456
IERC1155TokenReceiver(to).onERC1155BatchReceived(_msgSender(),from,ids,values,data)==_ERC1155_BATCH_RECEIVED
"MinterRole: add an account already minter"
@v3.1.1 pragma solidity 0.6.8; /** * Contract module which allows derived contracts access control over token * minting operations. * * This module is used through inheritance. It will make available the modifier * `onlyMinter`, which can be applied to the minting functions of your contract. * Those functions will only be accessible to accounts with the minter role * once the modifer is put in place. */ contract MinterRole is AccessControl { event MinterAdded(address indexed account); event MinterRemoved(address indexed account); /** * Modifier to make a function callable only by accounts with the minter role. */ modifier onlyMinter() { } /** * Constructor. */ constructor () internal { } /** * Validates whether or not the given account has been granted the minter role. * @param account The account to validate. * @return True if the account has been granted the minter role, false otherwise. */ function isMinter(address account) public view returns (bool) { } /** * Grants the minter role to a non-minter. * @param account The account to grant the minter role to. */ function addMinter(address account) public onlyMinter { require(<FILL_ME>) grantRole(DEFAULT_ADMIN_ROLE, account); emit MinterAdded(account); } /** * Renounces the granted minter role. */ function renounceMinter() public onlyMinter { } }
!isMinter(account),"MinterRole: add an account already minter"
293,461
!isMinter(account)
"max public supply reached"
// // Creators: poop.eth pragma solidity ^0.8.0; contract Poop is ERC721A, Ownable, Pausable, PreSaleAware, ReentrancyGuard { using Strings for uint256; uint256 public constant COST = 0.08 ether; // the cost per poop // the merkle root used for verifying proofs during presale bytes32 public constant PRE_SALE_MERKLE_ROOT = 0x66af55bb5080f8419cce24254502d91589985ca3b2fb85321486f557c1bf9399; // packing the next variables as uint16 (max 65535, 2 bytes each, less than 32 bytes = 1 slot) uint16 public constant MAX_SUPPLY = 8888; // the max total supply uint16 public constant MAX_PUBLIC_SUPPLY = 8388; // the max public supply uint16 public constant MAX_MINT_AMOUNT = 10; // the max amount an address can mint uint16 public constant PRE_SALE_MAX_MINT_AMOUNT = 5; // the max amount an address can mint during presale // the address of the DAO treasury that will receive percentage of all withdrawls address public constant DAO_TREASURY_ADDRESS = 0xfE379610071D92Effd15CDF689dfccf7318E6602; string public hiddenMetadataUri; string public uriPrefix = ""; bool public revealed = false; // determines whether the artwork is revealed constructor() ERC721A("PoopMasters", "PM", 500) { } /* * Base URI for computing {tokenURI}. The resulting URI for each token will be * the concatenation of the `baseURI` and the `tokenId`. */ function _baseURI() internal view override(ERC721A) returns (string memory) { } function tokenURI(uint256 _tokenId) public view override(ERC721A) returns (string memory) { } // The following functions are available only to the owner /* * @dev Pauses the contract. */ function pause() public onlyOwner { } /* * @dev Resumes the contract. */ function resume() public onlyOwner { } /* * @dev Disables presale. */ function disablePreSale() public onlyOwner { } /* * @dev Enables presale. */ function enablePreSale() public onlyOwner { } /* * @dev Withdraws the contracts balance to owner and DAO. */ function withdraw() public onlyOwner { } /* * @dev Reveals the artwork. */ function reveal() public onlyOwner { } /* * @dev Hides the artwork. */ function hide() public onlyOwner { } /* * @dev Sets uri prefix for revealed tokens */ function setUriPrefix(string memory _uriPrefix) public onlyOwner { } /* * @dev Sets uri prefix for hidden tokens */ function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner { } /* * @dev Mints a poop to an address */ function _mintpoop(address to, uint256 quantity) private { } /* * @dev Mints poops when presale is enabled. */ function presaleMintpoop(uint256 quantity, bytes32[] calldata merkleProof) external payable whenNotPaused whenPreSale nonReentrant { require(totalSupply() + quantity < MAX_SUPPLY, "max supply reached"); if (_msgSender() != owner()) { require(<FILL_ME>) require( MerkleProof.verify(merkleProof, PRE_SALE_MERKLE_ROOT, keccak256(abi.encodePacked(_msgSender()))), "Address not on the list" ); require(_numberMinted(_msgSender()) + quantity <= PRE_SALE_MAX_MINT_AMOUNT, "presale mint limit reached"); require(msg.value >= COST * quantity, "incorrect ether value"); } _mintpoop(_msgSender(), quantity); } /* * @dev Mints poops when presale is disabled. */ function mintpoop(uint256 quantity) external payable whenNotPaused whenNotPreSale nonReentrant { } /* * @dev Returns the number of tokens minted by an address */ function numberMinted(address _owner) public view returns (uint256) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721A) returns (bool) { } }
totalSupply()+quantity<MAX_PUBLIC_SUPPLY,"max public supply reached"
293,481
totalSupply()+quantity<MAX_PUBLIC_SUPPLY
"Address not on the list"
// // Creators: poop.eth pragma solidity ^0.8.0; contract Poop is ERC721A, Ownable, Pausable, PreSaleAware, ReentrancyGuard { using Strings for uint256; uint256 public constant COST = 0.08 ether; // the cost per poop // the merkle root used for verifying proofs during presale bytes32 public constant PRE_SALE_MERKLE_ROOT = 0x66af55bb5080f8419cce24254502d91589985ca3b2fb85321486f557c1bf9399; // packing the next variables as uint16 (max 65535, 2 bytes each, less than 32 bytes = 1 slot) uint16 public constant MAX_SUPPLY = 8888; // the max total supply uint16 public constant MAX_PUBLIC_SUPPLY = 8388; // the max public supply uint16 public constant MAX_MINT_AMOUNT = 10; // the max amount an address can mint uint16 public constant PRE_SALE_MAX_MINT_AMOUNT = 5; // the max amount an address can mint during presale // the address of the DAO treasury that will receive percentage of all withdrawls address public constant DAO_TREASURY_ADDRESS = 0xfE379610071D92Effd15CDF689dfccf7318E6602; string public hiddenMetadataUri; string public uriPrefix = ""; bool public revealed = false; // determines whether the artwork is revealed constructor() ERC721A("PoopMasters", "PM", 500) { } /* * Base URI for computing {tokenURI}. The resulting URI for each token will be * the concatenation of the `baseURI` and the `tokenId`. */ function _baseURI() internal view override(ERC721A) returns (string memory) { } function tokenURI(uint256 _tokenId) public view override(ERC721A) returns (string memory) { } // The following functions are available only to the owner /* * @dev Pauses the contract. */ function pause() public onlyOwner { } /* * @dev Resumes the contract. */ function resume() public onlyOwner { } /* * @dev Disables presale. */ function disablePreSale() public onlyOwner { } /* * @dev Enables presale. */ function enablePreSale() public onlyOwner { } /* * @dev Withdraws the contracts balance to owner and DAO. */ function withdraw() public onlyOwner { } /* * @dev Reveals the artwork. */ function reveal() public onlyOwner { } /* * @dev Hides the artwork. */ function hide() public onlyOwner { } /* * @dev Sets uri prefix for revealed tokens */ function setUriPrefix(string memory _uriPrefix) public onlyOwner { } /* * @dev Sets uri prefix for hidden tokens */ function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner { } /* * @dev Mints a poop to an address */ function _mintpoop(address to, uint256 quantity) private { } /* * @dev Mints poops when presale is enabled. */ function presaleMintpoop(uint256 quantity, bytes32[] calldata merkleProof) external payable whenNotPaused whenPreSale nonReentrant { require(totalSupply() + quantity < MAX_SUPPLY, "max supply reached"); if (_msgSender() != owner()) { require(totalSupply() + quantity < MAX_PUBLIC_SUPPLY, "max public supply reached"); require(<FILL_ME>) require(_numberMinted(_msgSender()) + quantity <= PRE_SALE_MAX_MINT_AMOUNT, "presale mint limit reached"); require(msg.value >= COST * quantity, "incorrect ether value"); } _mintpoop(_msgSender(), quantity); } /* * @dev Mints poops when presale is disabled. */ function mintpoop(uint256 quantity) external payable whenNotPaused whenNotPreSale nonReentrant { } /* * @dev Returns the number of tokens minted by an address */ function numberMinted(address _owner) public view returns (uint256) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721A) returns (bool) { } }
MerkleProof.verify(merkleProof,PRE_SALE_MERKLE_ROOT,keccak256(abi.encodePacked(_msgSender()))),"Address not on the list"
293,481
MerkleProof.verify(merkleProof,PRE_SALE_MERKLE_ROOT,keccak256(abi.encodePacked(_msgSender())))
"presale mint limit reached"
// // Creators: poop.eth pragma solidity ^0.8.0; contract Poop is ERC721A, Ownable, Pausable, PreSaleAware, ReentrancyGuard { using Strings for uint256; uint256 public constant COST = 0.08 ether; // the cost per poop // the merkle root used for verifying proofs during presale bytes32 public constant PRE_SALE_MERKLE_ROOT = 0x66af55bb5080f8419cce24254502d91589985ca3b2fb85321486f557c1bf9399; // packing the next variables as uint16 (max 65535, 2 bytes each, less than 32 bytes = 1 slot) uint16 public constant MAX_SUPPLY = 8888; // the max total supply uint16 public constant MAX_PUBLIC_SUPPLY = 8388; // the max public supply uint16 public constant MAX_MINT_AMOUNT = 10; // the max amount an address can mint uint16 public constant PRE_SALE_MAX_MINT_AMOUNT = 5; // the max amount an address can mint during presale // the address of the DAO treasury that will receive percentage of all withdrawls address public constant DAO_TREASURY_ADDRESS = 0xfE379610071D92Effd15CDF689dfccf7318E6602; string public hiddenMetadataUri; string public uriPrefix = ""; bool public revealed = false; // determines whether the artwork is revealed constructor() ERC721A("PoopMasters", "PM", 500) { } /* * Base URI for computing {tokenURI}. The resulting URI for each token will be * the concatenation of the `baseURI` and the `tokenId`. */ function _baseURI() internal view override(ERC721A) returns (string memory) { } function tokenURI(uint256 _tokenId) public view override(ERC721A) returns (string memory) { } // The following functions are available only to the owner /* * @dev Pauses the contract. */ function pause() public onlyOwner { } /* * @dev Resumes the contract. */ function resume() public onlyOwner { } /* * @dev Disables presale. */ function disablePreSale() public onlyOwner { } /* * @dev Enables presale. */ function enablePreSale() public onlyOwner { } /* * @dev Withdraws the contracts balance to owner and DAO. */ function withdraw() public onlyOwner { } /* * @dev Reveals the artwork. */ function reveal() public onlyOwner { } /* * @dev Hides the artwork. */ function hide() public onlyOwner { } /* * @dev Sets uri prefix for revealed tokens */ function setUriPrefix(string memory _uriPrefix) public onlyOwner { } /* * @dev Sets uri prefix for hidden tokens */ function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner { } /* * @dev Mints a poop to an address */ function _mintpoop(address to, uint256 quantity) private { } /* * @dev Mints poops when presale is enabled. */ function presaleMintpoop(uint256 quantity, bytes32[] calldata merkleProof) external payable whenNotPaused whenPreSale nonReentrant { require(totalSupply() + quantity < MAX_SUPPLY, "max supply reached"); if (_msgSender() != owner()) { require(totalSupply() + quantity < MAX_PUBLIC_SUPPLY, "max public supply reached"); require( MerkleProof.verify(merkleProof, PRE_SALE_MERKLE_ROOT, keccak256(abi.encodePacked(_msgSender()))), "Address not on the list" ); require(<FILL_ME>) require(msg.value >= COST * quantity, "incorrect ether value"); } _mintpoop(_msgSender(), quantity); } /* * @dev Mints poops when presale is disabled. */ function mintpoop(uint256 quantity) external payable whenNotPaused whenNotPreSale nonReentrant { } /* * @dev Returns the number of tokens minted by an address */ function numberMinted(address _owner) public view returns (uint256) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721A) returns (bool) { } }
_numberMinted(_msgSender())+quantity<=PRE_SALE_MAX_MINT_AMOUNT,"presale mint limit reached"
293,481
_numberMinted(_msgSender())+quantity<=PRE_SALE_MAX_MINT_AMOUNT
"mint limit reached"
// // Creators: poop.eth pragma solidity ^0.8.0; contract Poop is ERC721A, Ownable, Pausable, PreSaleAware, ReentrancyGuard { using Strings for uint256; uint256 public constant COST = 0.08 ether; // the cost per poop // the merkle root used for verifying proofs during presale bytes32 public constant PRE_SALE_MERKLE_ROOT = 0x66af55bb5080f8419cce24254502d91589985ca3b2fb85321486f557c1bf9399; // packing the next variables as uint16 (max 65535, 2 bytes each, less than 32 bytes = 1 slot) uint16 public constant MAX_SUPPLY = 8888; // the max total supply uint16 public constant MAX_PUBLIC_SUPPLY = 8388; // the max public supply uint16 public constant MAX_MINT_AMOUNT = 10; // the max amount an address can mint uint16 public constant PRE_SALE_MAX_MINT_AMOUNT = 5; // the max amount an address can mint during presale // the address of the DAO treasury that will receive percentage of all withdrawls address public constant DAO_TREASURY_ADDRESS = 0xfE379610071D92Effd15CDF689dfccf7318E6602; string public hiddenMetadataUri; string public uriPrefix = ""; bool public revealed = false; // determines whether the artwork is revealed constructor() ERC721A("PoopMasters", "PM", 500) { } /* * Base URI for computing {tokenURI}. The resulting URI for each token will be * the concatenation of the `baseURI` and the `tokenId`. */ function _baseURI() internal view override(ERC721A) returns (string memory) { } function tokenURI(uint256 _tokenId) public view override(ERC721A) returns (string memory) { } // The following functions are available only to the owner /* * @dev Pauses the contract. */ function pause() public onlyOwner { } /* * @dev Resumes the contract. */ function resume() public onlyOwner { } /* * @dev Disables presale. */ function disablePreSale() public onlyOwner { } /* * @dev Enables presale. */ function enablePreSale() public onlyOwner { } /* * @dev Withdraws the contracts balance to owner and DAO. */ function withdraw() public onlyOwner { } /* * @dev Reveals the artwork. */ function reveal() public onlyOwner { } /* * @dev Hides the artwork. */ function hide() public onlyOwner { } /* * @dev Sets uri prefix for revealed tokens */ function setUriPrefix(string memory _uriPrefix) public onlyOwner { } /* * @dev Sets uri prefix for hidden tokens */ function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner { } /* * @dev Mints a poop to an address */ function _mintpoop(address to, uint256 quantity) private { } /* * @dev Mints poops when presale is enabled. */ function presaleMintpoop(uint256 quantity, bytes32[] calldata merkleProof) external payable whenNotPaused whenPreSale nonReentrant { } /* * @dev Mints poops when presale is disabled. */ function mintpoop(uint256 quantity) external payable whenNotPaused whenNotPreSale nonReentrant { require(totalSupply() + quantity < MAX_SUPPLY, "max supply reached"); if (_msgSender() != owner()) { require(totalSupply() + quantity < MAX_PUBLIC_SUPPLY, "max public supply reached"); require(<FILL_ME>) require(msg.value >= COST * quantity, "incorrect ether value"); } _mintpoop(_msgSender(), quantity); } /* * @dev Returns the number of tokens minted by an address */ function numberMinted(address _owner) public view returns (uint256) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721A) returns (bool) { } }
_numberMinted(_msgSender())+quantity<=MAX_MINT_AMOUNT,"mint limit reached"
293,481
_numberMinted(_msgSender())+quantity<=MAX_MINT_AMOUNT
null
pragma solidity ^0.4.21; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * Math operations with safety checks */ /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ 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 TTEToken is Ownable { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint256 size) { } using SafeMath for uint256; string public constant name = "Thomas Technology Energy"; string public constant symbol = "TTE"; uint256 public constant decimals = 18; string public version = "1.0"; uint256 public totalSupply = 10 * (10**8) * 10**decimals; // 10*10^8 TTE total //address public owner; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => uint256) public freezeOf; mapping (address => mapping (address => uint256)) public allowance; /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 value); /* This notifies clients about the amount burnt */ event Burn(address indexed from, uint256 value); /* This notifies clients about the amount frozen */ event Freeze(address indexed from, uint256 value); /* This notifies clients about the amount unfrozen */ event Unfreeze(address indexed from, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract constructor() public */ function TTEToken() public { } /* Send coins */ function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) public returns (bool){ require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require(_to != address(this)); //Prevent to contract address require(0 <= _value); require(_value <= balanceOf[msg.sender]); // Check if the sender has enough require(<FILL_ME>) // Check for overflows balanceOf[msg.sender] = SafeMath.safeSub(balanceOf[msg.sender], _value); // Subtract from the sender balanceOf[_to] = SafeMath.safeAdd(balanceOf[_to], _value); // Add the same to the recipient emit Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place return true; } /* Allow another contract to spend some tokens in your behalf */ function approve(address _spender, uint256 _value) public returns (bool success) { } /* A contract attempts to get the coins */ function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) public returns (bool success) { } function burn(uint256 _value) onlyOwner public returns (bool success) { } function freeze(uint256 _value) onlyOwner public returns (bool success) { } function unfreeze(uint256 _value) onlyOwner public returns (bool success) { } // can not accept ether function() payable public { } }
balanceOf[_to]<=balanceOf[_to]+_value
293,496
balanceOf[_to]<=balanceOf[_to]+_value
"Currency too long"
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { } constructor() public { } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { require(<FILL_ME>) assembly { o := mload(add(currency, 32)) } } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } interface NanoLoanEngine { function pay(uint index, uint256 _amount, address _from, bytes oracleData) public returns (bool); function rcn() public view returns (Token); function getOracle(uint256 index) public view returns (Oracle); function getAmount(uint256 index) public view returns (uint256); function getCurrency(uint256 index) public view returns (bytes32); function convertRate(Oracle oracle, bytes32 currency, bytes data, uint256 amount) public view returns (uint256); function lend(uint index, bytes oracleData, Cosigner cosigner, bytes cosignerData) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function getPendingAmount(uint256 index) public returns (uint256); } library LrpSafeMath { function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { } function safeSubtract(uint256 x, uint256 y) internal pure returns(uint256) { } function safeMult(uint256 x, uint256 y) internal pure returns(uint256) { } function min(uint256 a, uint256 b) internal pure returns(uint256) { } function max(uint256 a, uint256 b) internal pure returns(uint256) { } } contract ConverterRamp is Ownable { using LrpSafeMath for uint256; address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; uint256 public constant AUTO_MARGIN = 1000001; // index of convert rules for pay and lend uint256 public constant I_MARGIN_SPEND = 0; // Extra sell percent of amount, 100.000 = 100% uint256 public constant I_MAX_SPEND = 1; // Max spend on perform a sell, 0 = maximum uint256 public constant I_REBUY_THRESHOLD = 2; // Threshold of rebuy change, 0 if want to rebuy always // index of loan parameters for pay and lend uint256 public constant I_ENGINE = 0; // NanoLoanEngine contract uint256 public constant I_INDEX = 1; // Loan index on Loans array of NanoLoanEngine // for pay uint256 public constant I_PAY_AMOUNT = 2; // Amount to pay of the loan uint256 public constant I_PAY_FROM = 3; // The identity of the payer of loan // for lend uint256 public constant I_LEND_COSIGNER = 2; // Cosigner contract event RequiredRebuy(address token, uint256 amount); event Return(address token, address to, uint256 amount); event OptimalSell(address token, uint256 amount); event RequiredRcn(uint256 required); event RunAutoMargin(uint256 loops, uint256 increment); function pay( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external payable returns (bool) { } function requiredLendSell( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external view returns (uint256) { } function requiredPaySell( TokenConverter converter, Token fromToken, bytes32[4] loanParams, bytes oracleData, uint256[3] convertRules ) external view returns (uint256) { } function lend( TokenConverter converter, Token fromToken, bytes32[3] loanParams, bytes oracleData, bytes cosignerData, uint256[3] convertRules ) external payable returns (bool) { } function pullAmount( Token token, uint256 amount ) private { } function transfer( Token token, address to, uint256 amount ) private { } function rebuyAndReturn( TokenConverter converter, Token fromToken, Token toToken, uint256 amount, uint256 spentAmount, uint256[3] memory convertRules ) internal returns (bool) { } function getOptimalSell( TokenConverter converter, Token fromToken, Token toToken, uint256 requiredTo, uint256 extraSell ) internal returns (uint256 sellAmount) { } function convertSafe( TokenConverter converter, Token fromToken, Token toToken, uint256 amount ) internal returns (uint256 bought) { } function executeOptimalPay( bytes32[4] memory params, bytes oracleData, uint256 rcnToPay ) internal returns (bool) { } function executeLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal returns (bool) { } function executeTransfer( bytes32[3] memory params, address to ) internal returns (bool) { } function applyRate( uint256 amount, uint256 rate ) internal pure returns (uint256) { } function getRequiredRcnLend( bytes32[3] memory params, bytes oracleData, bytes cosignerData ) internal view returns (uint256 required) { } function getRequiredRcnPay( bytes32[4] memory params, bytes oracleData ) internal view returns (uint256) { } function withdrawTokens( Token _token, address _to, uint256 _amount ) external onlyOwner returns (bool) { } function withdrawEther( address _to, uint256 _amount ) external onlyOwner { } function() external payable {} }
bytes(currency).length<=32,"Currency too long"
293,570
bytes(currency).length<=32