comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"You didn't earn any bonus" | pragma solidity ^0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function div(uint256 a, uint256 b) internal pure returns(uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function add(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
library Address {
function toAddress(bytes source) internal pure returns(address addr) {
}
}
/**
*/
contract SInv {
//use of library of safe mathematical operations
using SafeMath for uint;
using Address for *;
// array containing information about beneficiaries
mapping(address => uint) public userDeposit;
//Mapping for how much the User got from Refs
mapping(address=>uint) public RefBonus;
//How much the user earned to date
mapping(address=>uint) public UserEarnings;
//array containing information about the time of payment
mapping(address => uint) public userTime;
//array containing information on interest paid
mapping(address => uint) public persentWithdraw;
//fund fo transfer percent
address public projectFund = 0xB3cE9796aCDC1855bd6Cec85a3403f13C918f1F2;
//percentage deducted to the advertising fund
uint projectPercent = 5; // 0,5%
//time through which you can take dividends
uint public chargingTime = 24 hours;
uint public startPercent = 250*10;
uint public countOfInvestors;
uint public daysOnline;
uint public dividendsPaid;
constructor() public {
}
modifier isIssetUser() {
}
modifier timePayment() {
}
function() external payable {
}
//return of interest on the deposit
function collectPercent() isIssetUser timePayment public {
}
//When User decides to reinvest instead of paying out (to get more dividends per day)
function Reinvest() isIssetUser timePayment external {
}
//make a contribution to the system
function makeDeposit(bytes32 referrer) public payable {
}
//function call for fallback
function makeDepositA(address referrer) public payable {
}
function getUserEarnings(address addr) public view returns(uint)
{
}
//calculation of the current interest rate on the deposit
function persentRate() public view returns(uint) {
}
// Withdraw of your referral earnings
function PayOutRefBonus() external
{
//Check if User has Bonus
require(<FILL_ME>)
uint payout = RefBonus[msg.sender];
//payout the Refbonus
msg.sender.transfer(payout);
//Set to 0 since its payed out
RefBonus[msg.sender]=0;
}
//refund of the amount available for withdrawal on deposit
function payoutAmount(address addr) public view returns(uint,uint) {
}
mapping (address=>address) public TheGuyWhoReffedMe;
mapping (address=>bytes32) public MyPersonalRefName;
//for bidirectional search
mapping (bytes32=>address) public RefNameToAddress;
// referral counter
mapping (address=>uint256) public referralCounter;
// referral earnings counter
mapping (address=>uint256) public referralEarningsCounter;
//public function to register your ref
function createMyPersonalRefName(bytes32 _RefName) external payable
{
}
function newRegistrationwithRef() private
{
}
//first grade ref gets 1% extra
function CheckFirstGradeRefAdress() private
{
}
//second grade ref gets 0,5% extra
function CheckSecondGradeRefAdress() private
{
}
//third grade ref gets 0,25% extra
function CheckThirdGradeRefAdress() private
{
}
//Returns your personal RefName, when it is registered
function getMyRefName(address addr) public view returns(bytes32)
{
}
function getMyRefNameAsString(address addr) public view returns(string) {
}
function bytes32ToString(bytes32 x) internal pure returns (string) {
}
}
| RefBonus[msg.sender]>0,"You didn't earn any bonus" | 53,991 | RefBonus[msg.sender]>0 |
"Somebody else owns this Refname" | pragma solidity ^0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function div(uint256 a, uint256 b) internal pure returns(uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function add(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
library Address {
function toAddress(bytes source) internal pure returns(address addr) {
}
}
/**
*/
contract SInv {
//use of library of safe mathematical operations
using SafeMath for uint;
using Address for *;
// array containing information about beneficiaries
mapping(address => uint) public userDeposit;
//Mapping for how much the User got from Refs
mapping(address=>uint) public RefBonus;
//How much the user earned to date
mapping(address=>uint) public UserEarnings;
//array containing information about the time of payment
mapping(address => uint) public userTime;
//array containing information on interest paid
mapping(address => uint) public persentWithdraw;
//fund fo transfer percent
address public projectFund = 0xB3cE9796aCDC1855bd6Cec85a3403f13C918f1F2;
//percentage deducted to the advertising fund
uint projectPercent = 5; // 0,5%
//time through which you can take dividends
uint public chargingTime = 24 hours;
uint public startPercent = 250*10;
uint public countOfInvestors;
uint public daysOnline;
uint public dividendsPaid;
constructor() public {
}
modifier isIssetUser() {
}
modifier timePayment() {
}
function() external payable {
}
//return of interest on the deposit
function collectPercent() isIssetUser timePayment public {
}
//When User decides to reinvest instead of paying out (to get more dividends per day)
function Reinvest() isIssetUser timePayment external {
}
//make a contribution to the system
function makeDeposit(bytes32 referrer) public payable {
}
//function call for fallback
function makeDepositA(address referrer) public payable {
}
function getUserEarnings(address addr) public view returns(uint)
{
}
//calculation of the current interest rate on the deposit
function persentRate() public view returns(uint) {
}
// Withdraw of your referral earnings
function PayOutRefBonus() external
{
}
//refund of the amount available for withdrawal on deposit
function payoutAmount(address addr) public view returns(uint,uint) {
}
mapping (address=>address) public TheGuyWhoReffedMe;
mapping (address=>bytes32) public MyPersonalRefName;
//for bidirectional search
mapping (bytes32=>address) public RefNameToAddress;
// referral counter
mapping (address=>uint256) public referralCounter;
// referral earnings counter
mapping (address=>uint256) public referralEarningsCounter;
//public function to register your ref
function createMyPersonalRefName(bytes32 _RefName) external payable
{
//ref name shouldn't be 0
require(_RefName > 0);
//Check if RefName is already registered
require(<FILL_ME>)
//check if User already has a ref Name
require(MyPersonalRefName[msg.sender] == 0, "You already registered a Ref");
//If not registered
MyPersonalRefName[msg.sender]= _RefName;
RefNameToAddress[_RefName]=msg.sender;
}
function newRegistrationwithRef() private
{
}
//first grade ref gets 1% extra
function CheckFirstGradeRefAdress() private
{
}
//second grade ref gets 0,5% extra
function CheckSecondGradeRefAdress() private
{
}
//third grade ref gets 0,25% extra
function CheckThirdGradeRefAdress() private
{
}
//Returns your personal RefName, when it is registered
function getMyRefName(address addr) public view returns(bytes32)
{
}
function getMyRefNameAsString(address addr) public view returns(string) {
}
function bytes32ToString(bytes32 x) internal pure returns (string) {
}
}
| RefNameToAddress[_RefName]==0,"Somebody else owns this Refname" | 53,991 | RefNameToAddress[_RefName]==0 |
"You already registered a Ref" | pragma solidity ^0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns(uint256) {
}
function div(uint256 a, uint256 b) internal pure returns(uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns(uint256) {
}
function add(uint256 a, uint256 b) internal pure returns(uint256) {
}
}
library Address {
function toAddress(bytes source) internal pure returns(address addr) {
}
}
/**
*/
contract SInv {
//use of library of safe mathematical operations
using SafeMath for uint;
using Address for *;
// array containing information about beneficiaries
mapping(address => uint) public userDeposit;
//Mapping for how much the User got from Refs
mapping(address=>uint) public RefBonus;
//How much the user earned to date
mapping(address=>uint) public UserEarnings;
//array containing information about the time of payment
mapping(address => uint) public userTime;
//array containing information on interest paid
mapping(address => uint) public persentWithdraw;
//fund fo transfer percent
address public projectFund = 0xB3cE9796aCDC1855bd6Cec85a3403f13C918f1F2;
//percentage deducted to the advertising fund
uint projectPercent = 5; // 0,5%
//time through which you can take dividends
uint public chargingTime = 24 hours;
uint public startPercent = 250*10;
uint public countOfInvestors;
uint public daysOnline;
uint public dividendsPaid;
constructor() public {
}
modifier isIssetUser() {
}
modifier timePayment() {
}
function() external payable {
}
//return of interest on the deposit
function collectPercent() isIssetUser timePayment public {
}
//When User decides to reinvest instead of paying out (to get more dividends per day)
function Reinvest() isIssetUser timePayment external {
}
//make a contribution to the system
function makeDeposit(bytes32 referrer) public payable {
}
//function call for fallback
function makeDepositA(address referrer) public payable {
}
function getUserEarnings(address addr) public view returns(uint)
{
}
//calculation of the current interest rate on the deposit
function persentRate() public view returns(uint) {
}
// Withdraw of your referral earnings
function PayOutRefBonus() external
{
}
//refund of the amount available for withdrawal on deposit
function payoutAmount(address addr) public view returns(uint,uint) {
}
mapping (address=>address) public TheGuyWhoReffedMe;
mapping (address=>bytes32) public MyPersonalRefName;
//for bidirectional search
mapping (bytes32=>address) public RefNameToAddress;
// referral counter
mapping (address=>uint256) public referralCounter;
// referral earnings counter
mapping (address=>uint256) public referralEarningsCounter;
//public function to register your ref
function createMyPersonalRefName(bytes32 _RefName) external payable
{
//ref name shouldn't be 0
require(_RefName > 0);
//Check if RefName is already registered
require(RefNameToAddress[_RefName]==0, "Somebody else owns this Refname");
//check if User already has a ref Name
require(<FILL_ME>)
//If not registered
MyPersonalRefName[msg.sender]= _RefName;
RefNameToAddress[_RefName]=msg.sender;
}
function newRegistrationwithRef() private
{
}
//first grade ref gets 1% extra
function CheckFirstGradeRefAdress() private
{
}
//second grade ref gets 0,5% extra
function CheckSecondGradeRefAdress() private
{
}
//third grade ref gets 0,25% extra
function CheckThirdGradeRefAdress() private
{
}
//Returns your personal RefName, when it is registered
function getMyRefName(address addr) public view returns(bytes32)
{
}
function getMyRefNameAsString(address addr) public view returns(string) {
}
function bytes32ToString(bytes32 x) internal pure returns (string) {
}
}
| MyPersonalRefName[msg.sender]==0,"You already registered a Ref" | 53,991 | MyPersonalRefName[msg.sender]==0 |
"OnthersVault: dont have token" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../../../common/AccessibleCommon.sol";
contract OnthersVault is AccessibleCommon {
using SafeERC20 for IERC20;
string public name;
IERC20 public token;
bool public diffClaimCheck;
uint256 public firstClaimAmount = 0;
uint256 public firstClaimTime;
uint256 public totalAllocatedAmount;
uint256 public startTime;
uint256 public claimPeriodTimes;
uint256 public totalClaimCounts;
uint256 public nowClaimRound = 0;
uint256 public totalClaimsAmount;
event Claimed(
address indexed caller,
uint256 amount,
uint256 totalClaimedAmount
);
modifier nonZeroAddress(address _addr) {
}
modifier nonZero(uint256 _value) {
}
///@dev constructor
///@param _name Vault's name
///@param _token Allocated token address
constructor(
string memory _name,
address _token
) {
}
///@dev initialization function
///@param _totalAllocatedAmount total allocated amount
///@param _totalClaims total available claim count
///@param _startTime start time
///@param _periodTimesPerClaim period time per claim
function initialize(
uint256 _totalAllocatedAmount,
uint256 _totalClaims,
uint256 _startTime,
uint256 _periodTimesPerClaim
) external onlyOwner {
}
function changeToken(address _token) external onlyOwner {
}
function firstClaimSetting(uint256 _amount, uint256 _time)
public
onlyOwner
nonZero(_amount)
nonZero(_time)
{
}
function currentRound() public view returns (uint256 round) {
}
function calcalClaimAmount(uint256 _round) public view returns (uint256 amount) {
}
function claim(address _account)
external
onlyOwner
{
}
function withdraw(address _account, uint256 _amount)
external
onlyOwner
{
require(<FILL_ME>)
token.safeTransfer(_account, _amount);
}
}
| token.balanceOf(address(this))>=_amount,"OnthersVault: dont have token" | 54,076 | token.balanceOf(address(this))>=_amount |
errorMessage | pragma solidity ^0.5.0;
contract Killable {
address payable public _owner;
constructor() internal {
}
function kill() public {
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
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 () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
// prettier-ignore
contract IGroup {
function isGroup(address _addr) public view returns (bool);
function addGroup(address _addr) external;
function getGroupKey(address _addr) internal pure returns (bytes32) {
}
}
contract AddressValidator {
string constant errorMessage = "this is illegal address";
function validateIllegalAddress(address _addr) external pure {
}
function validateGroup(address _addr, address _groupAddr) external view {
require(<FILL_ME>)
}
function validateGroups(
address _addr,
address _groupAddr1,
address _groupAddr2
) external view {
}
function validateAddress(address _addr, address _target) external pure {
}
function validateAddresses(
address _addr,
address _target1,
address _target2
) external pure {
}
}
contract UsingValidator {
AddressValidator private _validator;
constructor() public {
}
function addressValidator() internal view returns (AddressValidator) {
}
}
contract AddressConfig is Ownable, UsingValidator, Killable {
address public token = 0x98626E2C9231f03504273d55f397409deFD4a093;
address public allocator;
address public allocatorStorage;
address public withdraw;
address public withdrawStorage;
address public marketFactory;
address public marketGroup;
address public propertyFactory;
address public propertyGroup;
address public metricsGroup;
address public metricsFactory;
address public policy;
address public policyFactory;
address public policySet;
address public policyGroup;
address public lockup;
address public lockupStorage;
address public voteTimes;
address public voteTimesStorage;
address public voteCounter;
address public voteCounterStorage;
function setAllocator(address _addr) external onlyOwner {
}
function setAllocatorStorage(address _addr) external onlyOwner {
}
function setWithdraw(address _addr) external onlyOwner {
}
function setWithdrawStorage(address _addr) external onlyOwner {
}
function setMarketFactory(address _addr) external onlyOwner {
}
function setMarketGroup(address _addr) external onlyOwner {
}
function setPropertyFactory(address _addr) external onlyOwner {
}
function setPropertyGroup(address _addr) external onlyOwner {
}
function setMetricsFactory(address _addr) external onlyOwner {
}
function setMetricsGroup(address _addr) external onlyOwner {
}
function setPolicyFactory(address _addr) external onlyOwner {
}
function setPolicyGroup(address _addr) external onlyOwner {
}
function setPolicySet(address _addr) external onlyOwner {
}
function setPolicy(address _addr) external {
}
function setToken(address _addr) external onlyOwner {
}
function setLockup(address _addr) external onlyOwner {
}
function setLockupStorage(address _addr) external onlyOwner {
}
function setVoteTimes(address _addr) external onlyOwner {
}
function setVoteTimesStorage(address _addr) external onlyOwner {
}
function setVoteCounter(address _addr) external onlyOwner {
}
function setVoteCounterStorage(address _addr) external onlyOwner {
}
}
contract UsingConfig {
AddressConfig private _config;
constructor(address _addressConfig) public {
}
function config() internal view returns (AddressConfig) {
}
function configAddress() external view returns (address) {
}
}
contract EternalStorage {
address private currentOwner = msg.sender;
mapping(bytes32 => uint256) private uIntStorage;
mapping(bytes32 => string) private stringStorage;
mapping(bytes32 => address) private addressStorage;
mapping(bytes32 => bytes32) private bytesStorage;
mapping(bytes32 => bool) private boolStorage;
mapping(bytes32 => int256) private intStorage;
modifier onlyCurrentOwner() {
}
function changeOwner(address _newOwner) external {
}
// *** Getter Methods ***
function getUint(bytes32 _key) external view returns (uint256) {
}
function getString(bytes32 _key) external view returns (string memory) {
}
function getAddress(bytes32 _key) external view returns (address) {
}
function getBytes(bytes32 _key) external view returns (bytes32) {
}
function getBool(bytes32 _key) external view returns (bool) {
}
function getInt(bytes32 _key) external view returns (int256) {
}
// *** Setter Methods ***
function setUint(bytes32 _key, uint256 _value) external onlyCurrentOwner {
}
function setString(bytes32 _key, string calldata _value)
external
onlyCurrentOwner
{
}
function setAddress(bytes32 _key, address _value)
external
onlyCurrentOwner
{
}
function setBytes(bytes32 _key, bytes32 _value) external onlyCurrentOwner {
}
function setBool(bytes32 _key, bool _value) external onlyCurrentOwner {
}
function setInt(bytes32 _key, int256 _value) external onlyCurrentOwner {
}
// *** Delete Methods ***
function deleteUint(bytes32 _key) external onlyCurrentOwner {
}
function deleteString(bytes32 _key) external onlyCurrentOwner {
}
function deleteAddress(bytes32 _key) external onlyCurrentOwner {
}
function deleteBytes(bytes32 _key) external onlyCurrentOwner {
}
function deleteBool(bytes32 _key) external onlyCurrentOwner {
}
function deleteInt(bytes32 _key) external onlyCurrentOwner {
}
}
contract UsingStorage is Ownable {
address private _storage;
modifier hasStorage() {
}
function eternalStorage()
internal
view
hasStorage
returns (EternalStorage)
{
}
function getStorageAddress() external view hasStorage returns (address) {
}
function createStorage() external onlyOwner {
}
function setStorage(address _storageAddress) external onlyOwner {
}
function changeOwner(address newOwner) external onlyOwner {
}
}
contract PropertyGroup is
UsingConfig,
UsingStorage,
UsingValidator,
IGroup,
Killable
{
// solium-disable-next-line no-empty-blocks
constructor(address _config) public UsingConfig(_config) {}
function addGroup(address _addr) external {
}
function isGroup(address _addr) public view returns (bool) {
}
}
| IGroup(_groupAddr).isGroup(_addr),errorMessage | 54,108 | IGroup(_groupAddr).isGroup(_addr) |
errorMessage | pragma solidity ^0.5.0;
contract Killable {
address payable public _owner;
constructor() internal {
}
function kill() public {
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
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 () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
// prettier-ignore
contract IGroup {
function isGroup(address _addr) public view returns (bool);
function addGroup(address _addr) external;
function getGroupKey(address _addr) internal pure returns (bytes32) {
}
}
contract AddressValidator {
string constant errorMessage = "this is illegal address";
function validateIllegalAddress(address _addr) external pure {
}
function validateGroup(address _addr, address _groupAddr) external view {
}
function validateGroups(
address _addr,
address _groupAddr1,
address _groupAddr2
) external view {
if (IGroup(_groupAddr1).isGroup(_addr)) {
return;
}
require(<FILL_ME>)
}
function validateAddress(address _addr, address _target) external pure {
}
function validateAddresses(
address _addr,
address _target1,
address _target2
) external pure {
}
}
contract UsingValidator {
AddressValidator private _validator;
constructor() public {
}
function addressValidator() internal view returns (AddressValidator) {
}
}
contract AddressConfig is Ownable, UsingValidator, Killable {
address public token = 0x98626E2C9231f03504273d55f397409deFD4a093;
address public allocator;
address public allocatorStorage;
address public withdraw;
address public withdrawStorage;
address public marketFactory;
address public marketGroup;
address public propertyFactory;
address public propertyGroup;
address public metricsGroup;
address public metricsFactory;
address public policy;
address public policyFactory;
address public policySet;
address public policyGroup;
address public lockup;
address public lockupStorage;
address public voteTimes;
address public voteTimesStorage;
address public voteCounter;
address public voteCounterStorage;
function setAllocator(address _addr) external onlyOwner {
}
function setAllocatorStorage(address _addr) external onlyOwner {
}
function setWithdraw(address _addr) external onlyOwner {
}
function setWithdrawStorage(address _addr) external onlyOwner {
}
function setMarketFactory(address _addr) external onlyOwner {
}
function setMarketGroup(address _addr) external onlyOwner {
}
function setPropertyFactory(address _addr) external onlyOwner {
}
function setPropertyGroup(address _addr) external onlyOwner {
}
function setMetricsFactory(address _addr) external onlyOwner {
}
function setMetricsGroup(address _addr) external onlyOwner {
}
function setPolicyFactory(address _addr) external onlyOwner {
}
function setPolicyGroup(address _addr) external onlyOwner {
}
function setPolicySet(address _addr) external onlyOwner {
}
function setPolicy(address _addr) external {
}
function setToken(address _addr) external onlyOwner {
}
function setLockup(address _addr) external onlyOwner {
}
function setLockupStorage(address _addr) external onlyOwner {
}
function setVoteTimes(address _addr) external onlyOwner {
}
function setVoteTimesStorage(address _addr) external onlyOwner {
}
function setVoteCounter(address _addr) external onlyOwner {
}
function setVoteCounterStorage(address _addr) external onlyOwner {
}
}
contract UsingConfig {
AddressConfig private _config;
constructor(address _addressConfig) public {
}
function config() internal view returns (AddressConfig) {
}
function configAddress() external view returns (address) {
}
}
contract EternalStorage {
address private currentOwner = msg.sender;
mapping(bytes32 => uint256) private uIntStorage;
mapping(bytes32 => string) private stringStorage;
mapping(bytes32 => address) private addressStorage;
mapping(bytes32 => bytes32) private bytesStorage;
mapping(bytes32 => bool) private boolStorage;
mapping(bytes32 => int256) private intStorage;
modifier onlyCurrentOwner() {
}
function changeOwner(address _newOwner) external {
}
// *** Getter Methods ***
function getUint(bytes32 _key) external view returns (uint256) {
}
function getString(bytes32 _key) external view returns (string memory) {
}
function getAddress(bytes32 _key) external view returns (address) {
}
function getBytes(bytes32 _key) external view returns (bytes32) {
}
function getBool(bytes32 _key) external view returns (bool) {
}
function getInt(bytes32 _key) external view returns (int256) {
}
// *** Setter Methods ***
function setUint(bytes32 _key, uint256 _value) external onlyCurrentOwner {
}
function setString(bytes32 _key, string calldata _value)
external
onlyCurrentOwner
{
}
function setAddress(bytes32 _key, address _value)
external
onlyCurrentOwner
{
}
function setBytes(bytes32 _key, bytes32 _value) external onlyCurrentOwner {
}
function setBool(bytes32 _key, bool _value) external onlyCurrentOwner {
}
function setInt(bytes32 _key, int256 _value) external onlyCurrentOwner {
}
// *** Delete Methods ***
function deleteUint(bytes32 _key) external onlyCurrentOwner {
}
function deleteString(bytes32 _key) external onlyCurrentOwner {
}
function deleteAddress(bytes32 _key) external onlyCurrentOwner {
}
function deleteBytes(bytes32 _key) external onlyCurrentOwner {
}
function deleteBool(bytes32 _key) external onlyCurrentOwner {
}
function deleteInt(bytes32 _key) external onlyCurrentOwner {
}
}
contract UsingStorage is Ownable {
address private _storage;
modifier hasStorage() {
}
function eternalStorage()
internal
view
hasStorage
returns (EternalStorage)
{
}
function getStorageAddress() external view hasStorage returns (address) {
}
function createStorage() external onlyOwner {
}
function setStorage(address _storageAddress) external onlyOwner {
}
function changeOwner(address newOwner) external onlyOwner {
}
}
contract PropertyGroup is
UsingConfig,
UsingStorage,
UsingValidator,
IGroup,
Killable
{
// solium-disable-next-line no-empty-blocks
constructor(address _config) public UsingConfig(_config) {}
function addGroup(address _addr) external {
}
function isGroup(address _addr) public view returns (bool) {
}
}
| IGroup(_groupAddr2).isGroup(_addr),errorMessage | 54,108 | IGroup(_groupAddr2).isGroup(_addr) |
"already enabled" | pragma solidity ^0.5.0;
contract Killable {
address payable public _owner;
constructor() internal {
}
function kill() public {
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
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 () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
// prettier-ignore
contract IGroup {
function isGroup(address _addr) public view returns (bool);
function addGroup(address _addr) external;
function getGroupKey(address _addr) internal pure returns (bytes32) {
}
}
contract AddressValidator {
string constant errorMessage = "this is illegal address";
function validateIllegalAddress(address _addr) external pure {
}
function validateGroup(address _addr, address _groupAddr) external view {
}
function validateGroups(
address _addr,
address _groupAddr1,
address _groupAddr2
) external view {
}
function validateAddress(address _addr, address _target) external pure {
}
function validateAddresses(
address _addr,
address _target1,
address _target2
) external pure {
}
}
contract UsingValidator {
AddressValidator private _validator;
constructor() public {
}
function addressValidator() internal view returns (AddressValidator) {
}
}
contract AddressConfig is Ownable, UsingValidator, Killable {
address public token = 0x98626E2C9231f03504273d55f397409deFD4a093;
address public allocator;
address public allocatorStorage;
address public withdraw;
address public withdrawStorage;
address public marketFactory;
address public marketGroup;
address public propertyFactory;
address public propertyGroup;
address public metricsGroup;
address public metricsFactory;
address public policy;
address public policyFactory;
address public policySet;
address public policyGroup;
address public lockup;
address public lockupStorage;
address public voteTimes;
address public voteTimesStorage;
address public voteCounter;
address public voteCounterStorage;
function setAllocator(address _addr) external onlyOwner {
}
function setAllocatorStorage(address _addr) external onlyOwner {
}
function setWithdraw(address _addr) external onlyOwner {
}
function setWithdrawStorage(address _addr) external onlyOwner {
}
function setMarketFactory(address _addr) external onlyOwner {
}
function setMarketGroup(address _addr) external onlyOwner {
}
function setPropertyFactory(address _addr) external onlyOwner {
}
function setPropertyGroup(address _addr) external onlyOwner {
}
function setMetricsFactory(address _addr) external onlyOwner {
}
function setMetricsGroup(address _addr) external onlyOwner {
}
function setPolicyFactory(address _addr) external onlyOwner {
}
function setPolicyGroup(address _addr) external onlyOwner {
}
function setPolicySet(address _addr) external onlyOwner {
}
function setPolicy(address _addr) external {
}
function setToken(address _addr) external onlyOwner {
}
function setLockup(address _addr) external onlyOwner {
}
function setLockupStorage(address _addr) external onlyOwner {
}
function setVoteTimes(address _addr) external onlyOwner {
}
function setVoteTimesStorage(address _addr) external onlyOwner {
}
function setVoteCounter(address _addr) external onlyOwner {
}
function setVoteCounterStorage(address _addr) external onlyOwner {
}
}
contract UsingConfig {
AddressConfig private _config;
constructor(address _addressConfig) public {
}
function config() internal view returns (AddressConfig) {
}
function configAddress() external view returns (address) {
}
}
contract EternalStorage {
address private currentOwner = msg.sender;
mapping(bytes32 => uint256) private uIntStorage;
mapping(bytes32 => string) private stringStorage;
mapping(bytes32 => address) private addressStorage;
mapping(bytes32 => bytes32) private bytesStorage;
mapping(bytes32 => bool) private boolStorage;
mapping(bytes32 => int256) private intStorage;
modifier onlyCurrentOwner() {
}
function changeOwner(address _newOwner) external {
}
// *** Getter Methods ***
function getUint(bytes32 _key) external view returns (uint256) {
}
function getString(bytes32 _key) external view returns (string memory) {
}
function getAddress(bytes32 _key) external view returns (address) {
}
function getBytes(bytes32 _key) external view returns (bytes32) {
}
function getBool(bytes32 _key) external view returns (bool) {
}
function getInt(bytes32 _key) external view returns (int256) {
}
// *** Setter Methods ***
function setUint(bytes32 _key, uint256 _value) external onlyCurrentOwner {
}
function setString(bytes32 _key, string calldata _value)
external
onlyCurrentOwner
{
}
function setAddress(bytes32 _key, address _value)
external
onlyCurrentOwner
{
}
function setBytes(bytes32 _key, bytes32 _value) external onlyCurrentOwner {
}
function setBool(bytes32 _key, bool _value) external onlyCurrentOwner {
}
function setInt(bytes32 _key, int256 _value) external onlyCurrentOwner {
}
// *** Delete Methods ***
function deleteUint(bytes32 _key) external onlyCurrentOwner {
}
function deleteString(bytes32 _key) external onlyCurrentOwner {
}
function deleteAddress(bytes32 _key) external onlyCurrentOwner {
}
function deleteBytes(bytes32 _key) external onlyCurrentOwner {
}
function deleteBool(bytes32 _key) external onlyCurrentOwner {
}
function deleteInt(bytes32 _key) external onlyCurrentOwner {
}
}
contract UsingStorage is Ownable {
address private _storage;
modifier hasStorage() {
}
function eternalStorage()
internal
view
hasStorage
returns (EternalStorage)
{
}
function getStorageAddress() external view hasStorage returns (address) {
}
function createStorage() external onlyOwner {
}
function setStorage(address _storageAddress) external onlyOwner {
}
function changeOwner(address newOwner) external onlyOwner {
}
}
contract PropertyGroup is
UsingConfig,
UsingStorage,
UsingValidator,
IGroup,
Killable
{
// solium-disable-next-line no-empty-blocks
constructor(address _config) public UsingConfig(_config) {}
function addGroup(address _addr) external {
addressValidator().validateAddress(
msg.sender,
config().propertyFactory()
);
require(<FILL_ME>)
eternalStorage().setBool(getGroupKey(_addr), true);
}
function isGroup(address _addr) public view returns (bool) {
}
}
| isGroup(_addr)==false,"already enabled" | 54,108 | isGroup(_addr)==false |
null | // http://forum.gotoken.io/
pragma solidity >=0.4.21 <0.6.0;
contract ApproveAndCallFallBack {
function receiveApproval(
address from,
uint256 _amount,
address _token,
bytes memory _data
) public;
}
contract ERC20Base {
string public name; //The Token's name: e.g. GTToken
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "GTT_0.1"; //An arbitrary versioning scheme
////////////////
// Events
////////////////
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _amount
);
/// @dev `Checkpoint` is the structure that attaches a block number to a
/// given value, the block number attached is the one that last changed the
/// value
struct Checkpoint {
// `fromBlock` is the block number that the value was generated from
uint128 fromBlock;
// `value` is the amount of tokens at a specific block number
uint128 value;
}
// `parentToken` is the Token address that was cloned to produce this token;
// it will be 0x0 for a token that was not cloned
ERC20Base public parentToken;
// `parentSnapShotBlock` is the block number from the Parent Token that was
// used to determine the initial distribution of the Clone Token
uint public parentSnapShotBlock;
// `creationBlock` is the block number that the Clone Token was created
uint public creationBlock;
// `balances` is the map that tracks the balance of each address, in this
// contract when the balance changes the block number that the change
// occurred is also included in the map
mapping (address => Checkpoint[]) balances;
// `allowed` tracks any extra transfer rights as in all ERC20 tokens
mapping (address => mapping (address => uint256)) allowed;
// Tracks the history of the `totalSupply` of the token
Checkpoint[] totalSupplyHistory;
// Flag that determines if the token is transferable or not.
bool public transfersEnabled;
////////////////
// Constructor
////////////////
/// @notice Constructor to create a ERC20Base
/// @param _parentToken Address of the parent token, set to 0x0 if it is a
/// new token
/// @param _parentSnapShotBlock Block of the parent token that will
/// determine the initial distribution of the clone token, set to 0 if it
/// is a new token
/// @param _tokenName Name of the new token
/// @param _decimalUnits Number of decimals of the new token
/// @param _tokenSymbol Token Symbol for the new token
/// @param _transfersEnabled If true, tokens will be able to be transferred
constructor(
ERC20Base _parentToken,
uint _parentSnapShotBlock,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol,
bool _transfersEnabled
) public
{
}
///////////////////
// ERC20 Methods
///////////////////
/// @notice Send `_amount` tokens to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
/// is approved by `_from`
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/// @dev This is the actual transfer function in the token contract, it can
/// only be called by other functions in this contract.
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function doTransfer(address _from, address _to, uint _amount) internal returns(bool) {
if (_amount == 0) {
return true;
}
require(parentSnapShotBlock < block.number);
// Do not allow transfer to 0x0 or the token contract itself
require(<FILL_ME>)
// If the amount being transfered is more than the balance of the
// account the transfer returns false
uint256 previousBalanceFrom = balanceOfAt(_from, block.number);
if (previousBalanceFrom < _amount) {
return false;
}
// First update the balance array with the new value for the address
// sending the tokens
updateValueAtNow(balances[_from], previousBalanceFrom - _amount);
// Then update the balance array with the new value for the address
// receiving the tokens
uint256 previousBalanceTo = balanceOfAt(_to, block.number);
require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow
updateValueAtNow(balances[_to], previousBalanceTo + _amount);
// An event to make the transfer easy to find on the blockchain
emit Transfer(_from, _to, _amount);
return true;
}
/// @param _owner The address that's balance is being requested
/// @return The balance of `_owner` at the current block
function balanceOf(address _owner) public view returns (uint256 balance) {
}
/// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
/// its behalf. This is a modified version of the ERC20 approve function
/// to be a little bit safer
/// @param _spender The address of the account able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the approval was successful
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/// @dev This function makes it easy to read the `allowed[]` map
/// @param _owner The address of the account that owns the token
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens of _owner that _spender is allowed
/// to spend
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
/// @notice `msg.sender` approves `_spender` to send `_amount` tokens on
/// its behalf, and then a function is triggered in the contract that is
/// being approved, `_spender`. This allows users to use their tokens to
/// interact with contracts in one function call instead of two
/// @param _spender The address of the contract able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the function call was successful
function approveAndCall(ApproveAndCallFallBack _spender, uint256 _amount, bytes memory _extraData) public returns (bool success) {
}
/// @dev This function makes it easy to get the total number of tokens
/// @return The total number of tokens
function totalSupply() public view returns (uint) {
}
////////////////
// Query balance and totalSupply in History
////////////////
/// @dev Queries the balance of `_owner` at a specific `_blockNumber`
/// @param _owner The address from which the balance will be retrieved
/// @param _blockNumber The block number when the balance is queried
/// @return The balance at `_blockNumber`
function balanceOfAt(address _owner, uint _blockNumber) public view returns (uint) {
}
/// @notice Total amount of tokens at a specific `_blockNumber`.
/// @param _blockNumber The block number when the totalSupply is queried
/// @return The total amount of tokens at `_blockNumber`
function totalSupplyAt(uint _blockNumber) public view returns(uint) {
}
////////////////
// Generate and destroy tokens
////////////////
/// @notice Generates `_amount` tokens that are assigned to `_owner`
/// @param _owner The address that will be assigned the new tokens
/// @param _amount The quantity of tokens generated
/// @return True if the tokens are generated correctly
function _generateTokens(address _owner, uint _amount) internal returns (bool) {
}
/// @notice Burns `_amount` tokens from `_owner`
/// @param _owner The address that will lose the tokens
/// @param _amount The quantity of tokens to burn
/// @return True if the tokens are burned correctly
function _destroyTokens(address _owner, uint _amount) internal returns (bool) {
}
////////////////
// Enable tokens transfers
////////////////
/// @notice Enables token holders to transfer their tokens freely if true
/// @param _transfersEnabled True if transfers are allowed in the clone
function _enableTransfers(bool _transfersEnabled) internal {
}
////////////////
// Internal helper functions to query and set a value in a snapshot array
////////////////
/// @dev `getValueAt` retrieves the number of tokens at a given block number
/// @param checkpoints The history of values being queried
/// @param _block The block number to retrieve the value at
/// @return The number of tokens being queried
function getValueAt(Checkpoint[] storage checkpoints, uint _block) internal view returns (uint) {
}
/// @dev `updateValueAtNow` used to update the `balances` map and the
/// `totalSupplyHistory`
/// @param checkpoints The history of data being updated
/// @param _value The new number of tokens
function updateValueAtNow(Checkpoint[] storage checkpoints, uint _value) internal {
}
/// @dev Helper function to return a min betwen the two uints
function min(uint a, uint b) pure internal returns (uint) {
}
function () external payable {
}
}
pragma solidity >=0.4.21 <0.6.0;
contract TransferableToken{
function balanceOf(address _owner) public returns (uint256 balance) ;
function transfer(address _to, uint256 _amount) public returns (bool success) ;
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) ;
}
contract TokenClaimer{
event ClaimedTokens(address indexed _token, address indexed _to, uint _amount);
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
function _claimStdTokens(address _token, address payable to) internal {
}
}
pragma solidity >=0.4.21 <0.6.0;
contract TrustListInterface{
function is_trusted(address addr) public returns(bool);
}
contract TrustListTools{
TrustListInterface public list;
constructor(address _list) public {
}
modifier is_trusted(address addr){
}
}
pragma solidity >=0.4.21 <0.6.0;
contract MultiSigInterface{
function update_and_check_reach_majority(uint64 id, string memory name, bytes32 hash, address sender) public returns (bool);
function is_signer(address addr) public view returns(bool);
}
contract MultiSigTools{
MultiSigInterface public multisig_contract;
constructor(address _contract) public{
}
modifier only_signer{
}
modifier is_majority_sig(uint64 id, string memory name) {
}
event TransferMultiSig(address _old, address _new);
function transfer_multisig(uint64 id, address _contract) public only_signer
is_majority_sig(id, "transfer_multisig"){
}
}
pragma solidity >=0.4.21 <0.6.0;
contract GTToken is ERC20Base, MultiSigTools, TrustListTools, TokenClaimer{
GTTokenFactory public tokenFactory;
event NewCloneToken(address indexed _cloneToken, uint _snapshotBlock);
constructor(
GTTokenFactory _tokenFactory,
ERC20Base _parentToken,
uint _parentSnapShotBlock,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol,
bool _transfersEnabled,
address multisig,
address _tlist)
ERC20Base(_parentToken,
_parentSnapShotBlock,
_tokenName,
_decimalUnits,
_tokenSymbol,
_transfersEnabled) MultiSigTools(multisig) TrustListTools(_tlist) public{
}
function claimStdTokens(uint64 id, address _token, address payable to) public only_signer is_majority_sig(id, "claimStdTokens"){
}
function createCloneToken(
string memory _cloneTokenName,
uint8 _cloneDecimalUnits,
string memory _cloneTokenSymbol,
uint _snapshotBlock,
bool _transfersEnabled,
address _multisig,
address _tlist
)public returns(GTToken){
}
function generateTokens(address _owner, uint _amount)
public
is_trusted(msg.sender)
returns (bool){
}
function destroyTokens(address _owner, uint _amount)
public
is_trusted(msg.sender)
returns (bool) {
}
function enableTransfers(uint64 id, bool _transfersEnabled)
public only_signer
is_majority_sig(id, "enableTransfers"){
}
}
/// @dev This contract is used to generate clone contracts from a contract.
/// In solidity this is the way to create a contract from a contract of the
/// same class
contract GTTokenFactory {
event NewToken(address indexed _cloneToken, uint _snapshotBlock);
/// @notice Update the DApp by creating a new token with new functionalities
/// the msg.sender becomes the controller of this clone token
/// @param _parentToken Address of the token being cloned
/// @param _snapshotBlock Block of the parent token that will
/// determine the initial distribution of the clone token
/// @param _tokenName Name of the new token
/// @param _decimalUnits Number of decimals of the new token
/// @param _tokenSymbol Token Symbol for the new token
/// @param _transfersEnabled If true, tokens will be able to be transferred
/// @return The address of the new token contract
function createCloneToken(
GTToken _parentToken,
uint _snapshotBlock,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol,
bool _transfersEnabled,
address _multisig,
address _tlist
) public returns (GTToken)
{
}
}
| (_to!=address(0))&&(_to!=address(this)) | 54,194 | (_to!=address(0))&&(_to!=address(this)) |
null | // http://forum.gotoken.io/
pragma solidity >=0.4.21 <0.6.0;
contract ApproveAndCallFallBack {
function receiveApproval(
address from,
uint256 _amount,
address _token,
bytes memory _data
) public;
}
contract ERC20Base {
string public name; //The Token's name: e.g. GTToken
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "GTT_0.1"; //An arbitrary versioning scheme
////////////////
// Events
////////////////
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _amount
);
/// @dev `Checkpoint` is the structure that attaches a block number to a
/// given value, the block number attached is the one that last changed the
/// value
struct Checkpoint {
// `fromBlock` is the block number that the value was generated from
uint128 fromBlock;
// `value` is the amount of tokens at a specific block number
uint128 value;
}
// `parentToken` is the Token address that was cloned to produce this token;
// it will be 0x0 for a token that was not cloned
ERC20Base public parentToken;
// `parentSnapShotBlock` is the block number from the Parent Token that was
// used to determine the initial distribution of the Clone Token
uint public parentSnapShotBlock;
// `creationBlock` is the block number that the Clone Token was created
uint public creationBlock;
// `balances` is the map that tracks the balance of each address, in this
// contract when the balance changes the block number that the change
// occurred is also included in the map
mapping (address => Checkpoint[]) balances;
// `allowed` tracks any extra transfer rights as in all ERC20 tokens
mapping (address => mapping (address => uint256)) allowed;
// Tracks the history of the `totalSupply` of the token
Checkpoint[] totalSupplyHistory;
// Flag that determines if the token is transferable or not.
bool public transfersEnabled;
////////////////
// Constructor
////////////////
/// @notice Constructor to create a ERC20Base
/// @param _parentToken Address of the parent token, set to 0x0 if it is a
/// new token
/// @param _parentSnapShotBlock Block of the parent token that will
/// determine the initial distribution of the clone token, set to 0 if it
/// is a new token
/// @param _tokenName Name of the new token
/// @param _decimalUnits Number of decimals of the new token
/// @param _tokenSymbol Token Symbol for the new token
/// @param _transfersEnabled If true, tokens will be able to be transferred
constructor(
ERC20Base _parentToken,
uint _parentSnapShotBlock,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol,
bool _transfersEnabled
) public
{
}
///////////////////
// ERC20 Methods
///////////////////
/// @notice Send `_amount` tokens to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
/// is approved by `_from`
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/// @dev This is the actual transfer function in the token contract, it can
/// only be called by other functions in this contract.
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function doTransfer(address _from, address _to, uint _amount) internal returns(bool) {
}
/// @param _owner The address that's balance is being requested
/// @return The balance of `_owner` at the current block
function balanceOf(address _owner) public view returns (uint256 balance) {
}
/// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
/// its behalf. This is a modified version of the ERC20 approve function
/// to be a little bit safer
/// @param _spender The address of the account able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the approval was successful
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/// @dev This function makes it easy to read the `allowed[]` map
/// @param _owner The address of the account that owns the token
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens of _owner that _spender is allowed
/// to spend
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
/// @notice `msg.sender` approves `_spender` to send `_amount` tokens on
/// its behalf, and then a function is triggered in the contract that is
/// being approved, `_spender`. This allows users to use their tokens to
/// interact with contracts in one function call instead of two
/// @param _spender The address of the contract able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the function call was successful
function approveAndCall(ApproveAndCallFallBack _spender, uint256 _amount, bytes memory _extraData) public returns (bool success) {
require(<FILL_ME>)
_spender.receiveApproval(
msg.sender,
_amount,
address(this),
_extraData
);
return true;
}
/// @dev This function makes it easy to get the total number of tokens
/// @return The total number of tokens
function totalSupply() public view returns (uint) {
}
////////////////
// Query balance and totalSupply in History
////////////////
/// @dev Queries the balance of `_owner` at a specific `_blockNumber`
/// @param _owner The address from which the balance will be retrieved
/// @param _blockNumber The block number when the balance is queried
/// @return The balance at `_blockNumber`
function balanceOfAt(address _owner, uint _blockNumber) public view returns (uint) {
}
/// @notice Total amount of tokens at a specific `_blockNumber`.
/// @param _blockNumber The block number when the totalSupply is queried
/// @return The total amount of tokens at `_blockNumber`
function totalSupplyAt(uint _blockNumber) public view returns(uint) {
}
////////////////
// Generate and destroy tokens
////////////////
/// @notice Generates `_amount` tokens that are assigned to `_owner`
/// @param _owner The address that will be assigned the new tokens
/// @param _amount The quantity of tokens generated
/// @return True if the tokens are generated correctly
function _generateTokens(address _owner, uint _amount) internal returns (bool) {
}
/// @notice Burns `_amount` tokens from `_owner`
/// @param _owner The address that will lose the tokens
/// @param _amount The quantity of tokens to burn
/// @return True if the tokens are burned correctly
function _destroyTokens(address _owner, uint _amount) internal returns (bool) {
}
////////////////
// Enable tokens transfers
////////////////
/// @notice Enables token holders to transfer their tokens freely if true
/// @param _transfersEnabled True if transfers are allowed in the clone
function _enableTransfers(bool _transfersEnabled) internal {
}
////////////////
// Internal helper functions to query and set a value in a snapshot array
////////////////
/// @dev `getValueAt` retrieves the number of tokens at a given block number
/// @param checkpoints The history of values being queried
/// @param _block The block number to retrieve the value at
/// @return The number of tokens being queried
function getValueAt(Checkpoint[] storage checkpoints, uint _block) internal view returns (uint) {
}
/// @dev `updateValueAtNow` used to update the `balances` map and the
/// `totalSupplyHistory`
/// @param checkpoints The history of data being updated
/// @param _value The new number of tokens
function updateValueAtNow(Checkpoint[] storage checkpoints, uint _value) internal {
}
/// @dev Helper function to return a min betwen the two uints
function min(uint a, uint b) pure internal returns (uint) {
}
function () external payable {
}
}
pragma solidity >=0.4.21 <0.6.0;
contract TransferableToken{
function balanceOf(address _owner) public returns (uint256 balance) ;
function transfer(address _to, uint256 _amount) public returns (bool success) ;
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) ;
}
contract TokenClaimer{
event ClaimedTokens(address indexed _token, address indexed _to, uint _amount);
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
function _claimStdTokens(address _token, address payable to) internal {
}
}
pragma solidity >=0.4.21 <0.6.0;
contract TrustListInterface{
function is_trusted(address addr) public returns(bool);
}
contract TrustListTools{
TrustListInterface public list;
constructor(address _list) public {
}
modifier is_trusted(address addr){
}
}
pragma solidity >=0.4.21 <0.6.0;
contract MultiSigInterface{
function update_and_check_reach_majority(uint64 id, string memory name, bytes32 hash, address sender) public returns (bool);
function is_signer(address addr) public view returns(bool);
}
contract MultiSigTools{
MultiSigInterface public multisig_contract;
constructor(address _contract) public{
}
modifier only_signer{
}
modifier is_majority_sig(uint64 id, string memory name) {
}
event TransferMultiSig(address _old, address _new);
function transfer_multisig(uint64 id, address _contract) public only_signer
is_majority_sig(id, "transfer_multisig"){
}
}
pragma solidity >=0.4.21 <0.6.0;
contract GTToken is ERC20Base, MultiSigTools, TrustListTools, TokenClaimer{
GTTokenFactory public tokenFactory;
event NewCloneToken(address indexed _cloneToken, uint _snapshotBlock);
constructor(
GTTokenFactory _tokenFactory,
ERC20Base _parentToken,
uint _parentSnapShotBlock,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol,
bool _transfersEnabled,
address multisig,
address _tlist)
ERC20Base(_parentToken,
_parentSnapShotBlock,
_tokenName,
_decimalUnits,
_tokenSymbol,
_transfersEnabled) MultiSigTools(multisig) TrustListTools(_tlist) public{
}
function claimStdTokens(uint64 id, address _token, address payable to) public only_signer is_majority_sig(id, "claimStdTokens"){
}
function createCloneToken(
string memory _cloneTokenName,
uint8 _cloneDecimalUnits,
string memory _cloneTokenSymbol,
uint _snapshotBlock,
bool _transfersEnabled,
address _multisig,
address _tlist
)public returns(GTToken){
}
function generateTokens(address _owner, uint _amount)
public
is_trusted(msg.sender)
returns (bool){
}
function destroyTokens(address _owner, uint _amount)
public
is_trusted(msg.sender)
returns (bool) {
}
function enableTransfers(uint64 id, bool _transfersEnabled)
public only_signer
is_majority_sig(id, "enableTransfers"){
}
}
/// @dev This contract is used to generate clone contracts from a contract.
/// In solidity this is the way to create a contract from a contract of the
/// same class
contract GTTokenFactory {
event NewToken(address indexed _cloneToken, uint _snapshotBlock);
/// @notice Update the DApp by creating a new token with new functionalities
/// the msg.sender becomes the controller of this clone token
/// @param _parentToken Address of the token being cloned
/// @param _snapshotBlock Block of the parent token that will
/// determine the initial distribution of the clone token
/// @param _tokenName Name of the new token
/// @param _decimalUnits Number of decimals of the new token
/// @param _tokenSymbol Token Symbol for the new token
/// @param _transfersEnabled If true, tokens will be able to be transferred
/// @return The address of the new token contract
function createCloneToken(
GTToken _parentToken,
uint _snapshotBlock,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol,
bool _transfersEnabled,
address _multisig,
address _tlist
) public returns (GTToken)
{
}
}
| approve(address(_spender),_amount) | 54,194 | approve(address(_spender),_amount) |
"DODOFragment: ALREADY_INITIALIZED" | interface IBuyoutModel {
function getBuyoutStatus(address fragAddr, address user) external view returns (int);
}
contract Fragment is InitializableFragERC20 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// ============ Storage ============
bool public _IS_BUYOUT_;
uint256 public _BUYOUT_TIMESTAMP_;
uint256 public _BUYOUT_PRICE_;
uint256 public _DISTRIBUTION_RATIO_;
address public _COLLATERAL_VAULT_;
address public _VAULT_PRE_OWNER_;
address public _QUOTE_;
address public _DVM_;
address public _DEFAULT_MAINTAINER_;
address public _BUYOUT_MODEL_;
bool internal _FRAG_INITIALIZED_;
// ============ Event ============
event RemoveNftToken(address nftContract, uint256 tokenId, uint256 amount);
event AddNftToken(address nftContract, uint256 tokenId, uint256 amount);
event InitInfo(address vault, string name, string baseURI);
event CreateFragment();
event Buyout(address newOwner);
event Redeem(address sender, uint256 baseAmount, uint256 quoteAmount);
function init(
address dvm,
address vaultPreOwner,
address collateralVault,
uint256 _totalSupply,
uint256 ownerRatio,
uint256 buyoutTimestamp,
address defaultMaintainer,
address buyoutModel,
uint256 distributionRatio,
string memory _symbol
) external {
require(<FILL_ME>)
_FRAG_INITIALIZED_ = true;
// init local variables
_DVM_ = dvm;
_QUOTE_ = IDVM(_DVM_)._QUOTE_TOKEN_();
_VAULT_PRE_OWNER_ = vaultPreOwner;
_COLLATERAL_VAULT_ = collateralVault;
_BUYOUT_TIMESTAMP_ = buyoutTimestamp;
_DEFAULT_MAINTAINER_ = defaultMaintainer;
_BUYOUT_MODEL_ = buyoutModel;
_DISTRIBUTION_RATIO_ = distributionRatio;
// init FRAG meta data
name = string(abi.encodePacked("DODO_FRAG_", _symbol));
// symbol = string(abi.encodePacked("d_", _symbol));
symbol = _symbol;
super.init(address(this), _totalSupply, name, symbol);
// init FRAG distribution
uint256 vaultPreOwnerBalance = DecimalMath.mulFloor(_totalSupply, ownerRatio);
uint256 distributionBalance = DecimalMath.mulFloor(vaultPreOwnerBalance, distributionRatio);
if(distributionBalance > 0) _transfer(address(this), _DEFAULT_MAINTAINER_, distributionBalance);
_transfer(address(this), _VAULT_PRE_OWNER_, vaultPreOwnerBalance.sub(distributionBalance));
_transfer(address(this), _DVM_, _totalSupply.sub(vaultPreOwnerBalance));
// init DVM liquidity
IDVM(_DVM_).buyShares(address(this));
}
function buyout(address newVaultOwner) external {
}
function redeem(address to, bytes calldata data) external {
}
function getBuyoutRequirement() external view returns (uint256 requireQuote){
}
function _clearBalance(address account) internal {
}
}
| !_FRAG_INITIALIZED_,"DODOFragment: ALREADY_INITIALIZED" | 54,234 | !_FRAG_INITIALIZED_ |
"DODOFragment: ALREADY_BUYOUT" | interface IBuyoutModel {
function getBuyoutStatus(address fragAddr, address user) external view returns (int);
}
contract Fragment is InitializableFragERC20 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// ============ Storage ============
bool public _IS_BUYOUT_;
uint256 public _BUYOUT_TIMESTAMP_;
uint256 public _BUYOUT_PRICE_;
uint256 public _DISTRIBUTION_RATIO_;
address public _COLLATERAL_VAULT_;
address public _VAULT_PRE_OWNER_;
address public _QUOTE_;
address public _DVM_;
address public _DEFAULT_MAINTAINER_;
address public _BUYOUT_MODEL_;
bool internal _FRAG_INITIALIZED_;
// ============ Event ============
event RemoveNftToken(address nftContract, uint256 tokenId, uint256 amount);
event AddNftToken(address nftContract, uint256 tokenId, uint256 amount);
event InitInfo(address vault, string name, string baseURI);
event CreateFragment();
event Buyout(address newOwner);
event Redeem(address sender, uint256 baseAmount, uint256 quoteAmount);
function init(
address dvm,
address vaultPreOwner,
address collateralVault,
uint256 _totalSupply,
uint256 ownerRatio,
uint256 buyoutTimestamp,
address defaultMaintainer,
address buyoutModel,
uint256 distributionRatio,
string memory _symbol
) external {
}
function buyout(address newVaultOwner) external {
require(_BUYOUT_TIMESTAMP_ != 0, "DODOFragment: NOT_SUPPORT_BUYOUT");
require(block.timestamp > _BUYOUT_TIMESTAMP_, "DODOFragment: BUYOUT_NOT_START");
require(<FILL_ME>)
int buyoutFee = IBuyoutModel(_BUYOUT_MODEL_).getBuyoutStatus(address(this), newVaultOwner);
require(buyoutFee != -1, "DODOFragment: USER_UNABLE_BUYOUT");
_IS_BUYOUT_ = true;
_BUYOUT_PRICE_ = IDVM(_DVM_).getMidPrice();
uint256 requireQuote = DecimalMath.mulCeil(_BUYOUT_PRICE_, totalSupply);
uint256 payQuote = IERC20(_QUOTE_).balanceOf(address(this));
require(payQuote >= requireQuote, "DODOFragment: QUOTE_NOT_ENOUGH");
IDVM(_DVM_).sellShares(
IERC20(_DVM_).balanceOf(address(this)),
address(this),
0,
0,
"",
uint256(-1)
);
uint256 redeemFrag = totalSupply.sub(balances[address(this)]).sub(balances[_VAULT_PRE_OWNER_]);
uint256 ownerQuoteWithoutFee = IERC20(_QUOTE_).balanceOf(address(this)).sub(DecimalMath.mulCeil(_BUYOUT_PRICE_, redeemFrag));
_clearBalance(address(this));
_clearBalance(_VAULT_PRE_OWNER_);
uint256 buyoutFeeAmount = DecimalMath.mulFloor(ownerQuoteWithoutFee, uint256(buyoutFee));
IERC20(_QUOTE_).safeTransfer(_DEFAULT_MAINTAINER_, buyoutFeeAmount);
IERC20(_QUOTE_).safeTransfer(_VAULT_PRE_OWNER_, ownerQuoteWithoutFee.sub(buyoutFeeAmount));
ICollateralVault(_COLLATERAL_VAULT_).directTransferOwnership(newVaultOwner);
emit Buyout(newVaultOwner);
}
function redeem(address to, bytes calldata data) external {
}
function getBuyoutRequirement() external view returns (uint256 requireQuote){
}
function _clearBalance(address account) internal {
}
}
| !_IS_BUYOUT_,"DODOFragment: ALREADY_BUYOUT" | 54,234 | !_IS_BUYOUT_ |
"DODOFragment: USER_UNABLE_BUYOUT" | interface IBuyoutModel {
function getBuyoutStatus(address fragAddr, address user) external view returns (int);
}
contract Fragment is InitializableFragERC20 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// ============ Storage ============
bool public _IS_BUYOUT_;
uint256 public _BUYOUT_TIMESTAMP_;
uint256 public _BUYOUT_PRICE_;
uint256 public _DISTRIBUTION_RATIO_;
address public _COLLATERAL_VAULT_;
address public _VAULT_PRE_OWNER_;
address public _QUOTE_;
address public _DVM_;
address public _DEFAULT_MAINTAINER_;
address public _BUYOUT_MODEL_;
bool internal _FRAG_INITIALIZED_;
// ============ Event ============
event RemoveNftToken(address nftContract, uint256 tokenId, uint256 amount);
event AddNftToken(address nftContract, uint256 tokenId, uint256 amount);
event InitInfo(address vault, string name, string baseURI);
event CreateFragment();
event Buyout(address newOwner);
event Redeem(address sender, uint256 baseAmount, uint256 quoteAmount);
function init(
address dvm,
address vaultPreOwner,
address collateralVault,
uint256 _totalSupply,
uint256 ownerRatio,
uint256 buyoutTimestamp,
address defaultMaintainer,
address buyoutModel,
uint256 distributionRatio,
string memory _symbol
) external {
}
function buyout(address newVaultOwner) external {
require(_BUYOUT_TIMESTAMP_ != 0, "DODOFragment: NOT_SUPPORT_BUYOUT");
require(block.timestamp > _BUYOUT_TIMESTAMP_, "DODOFragment: BUYOUT_NOT_START");
require(!_IS_BUYOUT_, "DODOFragment: ALREADY_BUYOUT");
int buyoutFee = IBuyoutModel(_BUYOUT_MODEL_).getBuyoutStatus(address(this), newVaultOwner);
require(<FILL_ME>)
_IS_BUYOUT_ = true;
_BUYOUT_PRICE_ = IDVM(_DVM_).getMidPrice();
uint256 requireQuote = DecimalMath.mulCeil(_BUYOUT_PRICE_, totalSupply);
uint256 payQuote = IERC20(_QUOTE_).balanceOf(address(this));
require(payQuote >= requireQuote, "DODOFragment: QUOTE_NOT_ENOUGH");
IDVM(_DVM_).sellShares(
IERC20(_DVM_).balanceOf(address(this)),
address(this),
0,
0,
"",
uint256(-1)
);
uint256 redeemFrag = totalSupply.sub(balances[address(this)]).sub(balances[_VAULT_PRE_OWNER_]);
uint256 ownerQuoteWithoutFee = IERC20(_QUOTE_).balanceOf(address(this)).sub(DecimalMath.mulCeil(_BUYOUT_PRICE_, redeemFrag));
_clearBalance(address(this));
_clearBalance(_VAULT_PRE_OWNER_);
uint256 buyoutFeeAmount = DecimalMath.mulFloor(ownerQuoteWithoutFee, uint256(buyoutFee));
IERC20(_QUOTE_).safeTransfer(_DEFAULT_MAINTAINER_, buyoutFeeAmount);
IERC20(_QUOTE_).safeTransfer(_VAULT_PRE_OWNER_, ownerQuoteWithoutFee.sub(buyoutFeeAmount));
ICollateralVault(_COLLATERAL_VAULT_).directTransferOwnership(newVaultOwner);
emit Buyout(newVaultOwner);
}
function redeem(address to, bytes calldata data) external {
}
function getBuyoutRequirement() external view returns (uint256 requireQuote){
}
function _clearBalance(address account) internal {
}
}
| buyoutFee!=-1,"DODOFragment: USER_UNABLE_BUYOUT" | 54,234 | buyoutFee!=-1 |
'each address may only mint one mirage, slick' | // SPDX-License-Identifier: MIT
//(,@ @.,&
// (/ (@% & &@//
//@( %*@(*(@& # &#& @,.@ @@#@#@,@. @&//
//@/ @@# ./@. . &%( *@& ,* @@ &, @ &. %(@//
//@/ *#(/(%% & ( ,*.& %@% @ (@./
//#& @ *@@, .( #@ ( %& (@.#/ %&//
//@ ...& % @ # ** (& ,@/ ,@*
//& &# * #@*& @# %.# # &* ,@@@ %@//
//%& /( .#% #/ @& # * &(@
//*@@, @.%/%
//& #@%
pragma solidity >=0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IERC2981.sol";
contract ProcessedArtMirage is ERC721Enumerable, ERC721URIStorage, AccessControl, Ownable {
using SafeMath for uint256;
event mintedMirage(bytes32 indexed tokenHash);
event PermanentURI(string _value, uint256 indexed _id);
string internal _currentBaseURI = "https://api.processed.art/mirage/";
string public scriptArweave = "https://arweave.net/A4Kl5j-uIMxm3G5WUBnBHi6AK4DAaJzjuOjJfhjTXsI";
string public scriptIPFS = "ipfs://QmXcmaUnv6RBQzMmefgb6YTkaNHzz5hHWavYvWurvxGQY5";
bool public mintIsActive = false;
uint256 public totalMints = 0;
uint256 public constant maxMirages = 768;
uint public reserveMints = 15;
uint256 public constant royaltiesPercentage = 10;
address private _royaltiesReceiver;
mapping (address => bool) private _addressMinted;
mapping (uint256 => bytes32) public tokenHash;
constructor() ERC721("processed (art): mirage", "MIRAGE") {
}
function baseURI() public view virtual returns (string memory) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string memory theURI) public onlyOwner {
}
function freezeMetadata(string memory theURI, uint256 token_id) public onlyOwner {
}
function setScriptIPFS(string memory _scriptIPFS) public onlyOwner {
}
function setScriptArweave(string memory _scriptArweave) public onlyOwner {
}
function royaltiesReceiver() external view returns(address) {
}
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory ownerTokens ) {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC721, ERC721Enumerable) {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function _generateRandomHash() internal view returns (bytes32) {
}
function flipState() public onlyOwner {
}
function reserveMint(address _to, uint256 _reserveAmount) public onlyOwner {
}
function mintMirage() public {
require(mintIsActive, "chill, the minting is not yet active");
require(<FILL_ME>)
require(totalMints < maxMirages, "sorry, the total mint limit is 768");
totalMints = totalMints + 1;
tokenHash[totalMints] = _generateRandomHash();
_addressMinted[msg.sender] = true;
_safeMint(msg.sender, totalMints);
emit mintedMirage(tokenHash[totalMints]);
}
function sweep() public onlyOwner {
}
function setRoyaltiesReceiver(address newRoyaltiesReceiver) external onlyOwner {
}
function supportsInterface(bytes4 interfaceId) public view override (ERC721, ERC721Enumerable, AccessControl) returns (bool) {
}
}
| !_addressMinted[msg.sender],'each address may only mint one mirage, slick' | 54,276 | !_addressMinted[msg.sender] |
null | // SPDX-License-Identifier: MIT
pragma solidity <= 0.8.7;
/**
*Submitted for verification at polygonscan.com on 2022-03-02
*/
contract Tatic {
address payable private commissionWallet;
constructor(address payable wallet) {
require(<FILL_ME>)
commissionWallet = wallet;
}
function isContract(address addr) internal view returns (bool) {
}
function withdraw() public payable{
}
}
| !isContract(wallet) | 54,301 | !isContract(wallet) |
"MR: _joinAdapter not authorised in vat" | pragma solidity ^0.5.4;
import "../infrastructure/base/Owned.sol";
import "../../lib/maker/MakerInterfaces.sol";
/**
* @title MakerRegistry
* @notice Simple registry containing a mapping between token collaterals and their corresponding Maker Join adapters.
* @author Olivier VDB - <[email protected]>
*/
contract MakerRegistry is Owned {
VatLike public vat;
address[] public tokens;
mapping (address => Collateral) public collaterals;
mapping (bytes32 => address) public collateralTokensByIlks;
struct Collateral {
bool exists;
uint128 index;
JoinLike join;
bytes32 ilk;
}
event CollateralAdded(address indexed _token);
event CollateralRemoved(address indexed _token);
constructor(VatLike _vat) public {
}
/**
* @notice Adds a new token as possible CDP collateral.
* @param _joinAdapter The Join Adapter for the token.
*/
function addCollateral(JoinLike _joinAdapter) external onlyOwner {
require(<FILL_ME>)
address token = address(_joinAdapter.gem());
require(!collaterals[token].exists, "MR: collateral already added");
collaterals[token].exists = true;
collaterals[token].index = uint128(tokens.push(token) - 1);
collaterals[token].join = _joinAdapter;
bytes32 ilk = _joinAdapter.ilk();
collaterals[token].ilk = ilk;
collateralTokensByIlks[ilk] = token;
emit CollateralAdded(token);
}
/**
* @notice Removes a token as possible CDP collateral.
* @param _token The token to remove as collateral.
*/
function removeCollateral(address _token) external onlyOwner {
}
/**
* @notice Gets the list of supported collaterals.
*/
function getCollateralTokens() external view returns (address[] memory _tokens) {
}
/**
* @notice Gets the ilk for a given token collateral.
* @param _token The token collateral.
*/
function getIlk(address _token) external view returns (bytes32 _ilk) {
}
/**
* @notice Gets the join adapter and collateral token for a given ilk.
*/
function getCollateral(bytes32 _ilk) external view returns (JoinLike _join, GemLike _token) {
}
}
| vat.wards(address(_joinAdapter))==1,"MR: _joinAdapter not authorised in vat" | 54,486 | vat.wards(address(_joinAdapter))==1 |
"MR: collateral already added" | pragma solidity ^0.5.4;
import "../infrastructure/base/Owned.sol";
import "../../lib/maker/MakerInterfaces.sol";
/**
* @title MakerRegistry
* @notice Simple registry containing a mapping between token collaterals and their corresponding Maker Join adapters.
* @author Olivier VDB - <[email protected]>
*/
contract MakerRegistry is Owned {
VatLike public vat;
address[] public tokens;
mapping (address => Collateral) public collaterals;
mapping (bytes32 => address) public collateralTokensByIlks;
struct Collateral {
bool exists;
uint128 index;
JoinLike join;
bytes32 ilk;
}
event CollateralAdded(address indexed _token);
event CollateralRemoved(address indexed _token);
constructor(VatLike _vat) public {
}
/**
* @notice Adds a new token as possible CDP collateral.
* @param _joinAdapter The Join Adapter for the token.
*/
function addCollateral(JoinLike _joinAdapter) external onlyOwner {
require(vat.wards(address(_joinAdapter)) == 1, "MR: _joinAdapter not authorised in vat");
address token = address(_joinAdapter.gem());
require(<FILL_ME>)
collaterals[token].exists = true;
collaterals[token].index = uint128(tokens.push(token) - 1);
collaterals[token].join = _joinAdapter;
bytes32 ilk = _joinAdapter.ilk();
collaterals[token].ilk = ilk;
collateralTokensByIlks[ilk] = token;
emit CollateralAdded(token);
}
/**
* @notice Removes a token as possible CDP collateral.
* @param _token The token to remove as collateral.
*/
function removeCollateral(address _token) external onlyOwner {
}
/**
* @notice Gets the list of supported collaterals.
*/
function getCollateralTokens() external view returns (address[] memory _tokens) {
}
/**
* @notice Gets the ilk for a given token collateral.
* @param _token The token collateral.
*/
function getIlk(address _token) external view returns (bytes32 _ilk) {
}
/**
* @notice Gets the join adapter and collateral token for a given ilk.
*/
function getCollateral(bytes32 _ilk) external view returns (JoinLike _join, GemLike _token) {
}
}
| !collaterals[token].exists,"MR: collateral already added" | 54,486 | !collaterals[token].exists |
"MR: collateral does not exist" | pragma solidity ^0.5.4;
import "../infrastructure/base/Owned.sol";
import "../../lib/maker/MakerInterfaces.sol";
/**
* @title MakerRegistry
* @notice Simple registry containing a mapping between token collaterals and their corresponding Maker Join adapters.
* @author Olivier VDB - <[email protected]>
*/
contract MakerRegistry is Owned {
VatLike public vat;
address[] public tokens;
mapping (address => Collateral) public collaterals;
mapping (bytes32 => address) public collateralTokensByIlks;
struct Collateral {
bool exists;
uint128 index;
JoinLike join;
bytes32 ilk;
}
event CollateralAdded(address indexed _token);
event CollateralRemoved(address indexed _token);
constructor(VatLike _vat) public {
}
/**
* @notice Adds a new token as possible CDP collateral.
* @param _joinAdapter The Join Adapter for the token.
*/
function addCollateral(JoinLike _joinAdapter) external onlyOwner {
}
/**
* @notice Removes a token as possible CDP collateral.
* @param _token The token to remove as collateral.
*/
function removeCollateral(address _token) external onlyOwner {
require(<FILL_ME>)
delete collateralTokensByIlks[collaterals[_token].ilk];
address last = tokens[tokens.length - 1];
if (_token != last) {
uint128 targetIndex = collaterals[_token].index;
tokens[targetIndex] = last;
collaterals[last].index = targetIndex;
}
tokens.length --;
delete collaterals[_token];
emit CollateralRemoved(_token);
}
/**
* @notice Gets the list of supported collaterals.
*/
function getCollateralTokens() external view returns (address[] memory _tokens) {
}
/**
* @notice Gets the ilk for a given token collateral.
* @param _token The token collateral.
*/
function getIlk(address _token) external view returns (bytes32 _ilk) {
}
/**
* @notice Gets the join adapter and collateral token for a given ilk.
*/
function getCollateral(bytes32 _ilk) external view returns (JoinLike _join, GemLike _token) {
}
}
| collaterals[_token].exists,"MR: collateral does not exist" | 54,486 | collaterals[_token].exists |
null | contract PGF500Token is BurnableToken, MintableToken, DetailedERC20, LockableWhitelisted {
uint256 constant internal DECIMALS = 18;
function PGF500Token (uint256 _initialSupply) public
BurnableToken()
MintableToken()
DetailedERC20('PGF500 Token', 'PGF7T', uint8(DECIMALS))
LockableWhitelisted()
{
}
function transfer(address _to, uint256 _value) public whenNotLocked(msg.sender) returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotLocked(_from) returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotLocked(msg.sender) returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public whenNotLocked(msg.sender) returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotLocked(msg.sender) returns (bool success) {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers the same amount of tokens to up to 200 specified addresses.
* If the sender runs out of balance then the entire transaction fails.
* @param _to The addresses to transfer to.
* @param _value The amount to be transferred to each address.
*/
function airdrop(address[] _to, uint256 _value) public whenNotLocked(msg.sender)
{
require(_to.length <= 200);
require(<FILL_ME>)
for (uint i = 0; i < _to.length; i++)
{
transfer(_to[i], _value);
}
}
/**
* @dev Transfers a variable amount of tokens to up to 200 specified addresses.
* If the sender runs out of balance then the entire transaction fails.
* For each address a value must be specified.
* @param _to The addresses to transfer to.
* @param _values The amounts to be transferred to the addresses.
*/
function multiTransfer(address[] _to, uint256[] _values) public whenNotLocked(msg.sender)
{
}
// Proprietary a6f18ae3a419c6634596bee10ba51328
}
| balanceOf(msg.sender)>=_value.mul(_to.length) | 54,498 | balanceOf(msg.sender)>=_value.mul(_to.length) |
null | /**
* @title Crowdsale contract
* @dev see https://send.sd/crowdsale
*/
contract TokenSale is Ownable {
using SafeMath for uint256;
/* Leave 10 tokens margin error in order to succedd
with last pool allocation in case hard cap is reached */
uint256 constant public HARD_CAP = 70000000 ether;
uint256 constant public VESTING_TIME = 90 days;
uint256 public weiUsdRate = 1;
uint256 public btcUsdRate = 1;
uint256 public vestingEnds;
uint256 public startTime;
uint256 public endTime;
address public wallet;
uint256 public vestingStarts;
uint256 public soldTokens;
uint256 public raised;
bool public activated = false;
bool public isStopped = false;
bool public isFinalized = false;
BurnableToken public token;
TokenVesting public vesting;
event NewBuyer(
address indexed holder,
uint256 sndAmount,
uint256 usdAmount,
uint256 ethAmount,
uint256 btcAmount
);
event ClaimedTokens(
address indexed _token,
address indexed _controller,
uint256 _amount
);
modifier validAddress(address _address) {
}
modifier isActive() {
require(activated);
require(<FILL_ME>)
require(!isFinalized);
require(block.timestamp >= startTime);
require(block.timestamp <= endTime);
_;
}
function TokenSale(
uint256 _startTime,
uint256 _endTime,
address _wallet,
uint256 _vestingStarts
) public validAddress(_wallet) {
}
/**
* @dev set an exchange rate in wei
* @param _rate uint256 The new exchange rate
*/
function setWeiUsdRate(uint256 _rate) public onlyOwner {
}
/**
* @dev set an exchange rate in satoshis
* @param _rate uint256 The new exchange rate
*/
function setBtcUsdRate(uint256 _rate) public onlyOwner {
}
/**
* @dev initialize the contract and set token
*/
function initialize(
address _sdt,
address _vestingContract,
address _icoCostsPool,
address _distributionContract
) public validAddress(_sdt) validAddress(_vestingContract) onlyOwner {
}
function finalize(
address _poolA,
address _poolB,
address _poolC,
address _poolD
)
public
validAddress(_poolA)
validAddress(_poolB)
validAddress(_poolC)
validAddress(_poolD)
onlyOwner
{
}
function stop() public onlyOwner isActive returns(bool) {
}
function resume() public onlyOwner returns(bool) {
}
function () public payable {
}
function btcPurchase(
address _beneficiary,
uint256 _btcValue
) public onlyOwner validAddress(_beneficiary) {
}
/**
* @dev Number of tokens is given by:
* usd * 100 ether / 14
*/
function computeTokens(uint256 _usd) public pure returns(uint256) {
}
//////////
// Safety Methods
//////////
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
function claimTokens(address _token) public onlyOwner {
}
function forwardFunds() internal {
}
/**
* @notice The owner of this contract is the owner of token's contract
* @param _usd amount invested in USD
* @param _eth amount invested in ETH y contribution was made in ETH, 0 otherwise
* @param _btc amount invested in BTC y contribution was made in BTC, 0 otherwise
* @param _address Address to send tokens to
* @param _vestingEnds vesting finish timestamp
*/
function doPurchase(
uint256 _usd,
uint256 _eth,
uint256 _btc,
address _address,
uint256 _vestingEnds
)
internal
isActive
returns(uint256)
{
}
/**
* @dev Helper function to update collected and allocated tokens stats
*/
function updateStats(uint256 usd, uint256 tokens) internal {
}
/**
* @dev grant vested tokens
* @param _to Adress to grant vested tokens
* @param _value number of tokens to grant
* @param _start vesting start timestamp
* @param _vesting vesting finish timestamp
*/
function grantVestedTokens(
address _to,
uint256 _value,
uint256 _start,
uint256 _vesting
) internal {
}
}
| !isStopped | 54,633 | !isStopped |
null | /**
* @title Crowdsale contract
* @dev see https://send.sd/crowdsale
*/
contract TokenSale is Ownable {
using SafeMath for uint256;
/* Leave 10 tokens margin error in order to succedd
with last pool allocation in case hard cap is reached */
uint256 constant public HARD_CAP = 70000000 ether;
uint256 constant public VESTING_TIME = 90 days;
uint256 public weiUsdRate = 1;
uint256 public btcUsdRate = 1;
uint256 public vestingEnds;
uint256 public startTime;
uint256 public endTime;
address public wallet;
uint256 public vestingStarts;
uint256 public soldTokens;
uint256 public raised;
bool public activated = false;
bool public isStopped = false;
bool public isFinalized = false;
BurnableToken public token;
TokenVesting public vesting;
event NewBuyer(
address indexed holder,
uint256 sndAmount,
uint256 usdAmount,
uint256 ethAmount,
uint256 btcAmount
);
event ClaimedTokens(
address indexed _token,
address indexed _controller,
uint256 _amount
);
modifier validAddress(address _address) {
}
modifier isActive() {
}
function TokenSale(
uint256 _startTime,
uint256 _endTime,
address _wallet,
uint256 _vestingStarts
) public validAddress(_wallet) {
}
/**
* @dev set an exchange rate in wei
* @param _rate uint256 The new exchange rate
*/
function setWeiUsdRate(uint256 _rate) public onlyOwner {
}
/**
* @dev set an exchange rate in satoshis
* @param _rate uint256 The new exchange rate
*/
function setBtcUsdRate(uint256 _rate) public onlyOwner {
}
/**
* @dev initialize the contract and set token
*/
function initialize(
address _sdt,
address _vestingContract,
address _icoCostsPool,
address _distributionContract
) public validAddress(_sdt) validAddress(_vestingContract) onlyOwner {
require(<FILL_ME>)
activated = true;
token = BurnableToken(_sdt);
vesting = TokenVesting(_vestingContract);
// 1% reserve is released on deploy
token.transfer(_icoCostsPool, 7000000 ether);
token.transfer(_distributionContract, 161000000 ether);
//early backers allocation
uint256 threeMonths = vestingStarts.add(90 days);
updateStats(0, 43387693 ether);
grantVestedTokens(0x02f807E6a1a59F8714180B301Cba84E76d3B4d06, 22572063 ether, vestingStarts, threeMonths);
grantVestedTokens(0x3A1e89dD9baDe5985E7Eb36E9AFd200dD0E20613, 15280000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xA61c9A0E96eC7Ceb67586fC8BFDCE009395D9b21, 250000 ether, vestingStarts, threeMonths);
grantVestedTokens(0x26C9899eA2F8940726BbCC79483F2ce07989314E, 100000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xC88d5031e00BC316bE181F0e60971e8fEdB9223b, 1360000 ether, vestingStarts, threeMonths);
grantVestedTokens(0x38f4cAD7997907741FA0D912422Ae59aC6b83dD1, 250000 ether, vestingStarts, threeMonths);
grantVestedTokens(0x2b2992e51E86980966c42736C458e2232376a044, 105000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xdD0F60610052bE0976Cf8BEE576Dbb3a1621a309, 140000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xd61B4F33D3413827baa1425E2FDa485913C9625B, 740000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xE6D4a77D01C680Ebbc0c84393ca598984b3F45e3, 505630 ether, vestingStarts, threeMonths);
grantVestedTokens(0x35D3648c29Ac180D5C7Ef386D52de9539c9c487a, 150000 ether, vestingStarts, threeMonths);
grantVestedTokens(0x344a6130d187f51ef0DAb785e10FaEA0FeE4b5dE, 967500 ether, vestingStarts, threeMonths);
grantVestedTokens(0x026cC76a245987f3420D0FE30070B568b4b46F68, 967500 ether, vestingStarts, threeMonths);
}
function finalize(
address _poolA,
address _poolB,
address _poolC,
address _poolD
)
public
validAddress(_poolA)
validAddress(_poolB)
validAddress(_poolC)
validAddress(_poolD)
onlyOwner
{
}
function stop() public onlyOwner isActive returns(bool) {
}
function resume() public onlyOwner returns(bool) {
}
function () public payable {
}
function btcPurchase(
address _beneficiary,
uint256 _btcValue
) public onlyOwner validAddress(_beneficiary) {
}
/**
* @dev Number of tokens is given by:
* usd * 100 ether / 14
*/
function computeTokens(uint256 _usd) public pure returns(uint256) {
}
//////////
// Safety Methods
//////////
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
function claimTokens(address _token) public onlyOwner {
}
function forwardFunds() internal {
}
/**
* @notice The owner of this contract is the owner of token's contract
* @param _usd amount invested in USD
* @param _eth amount invested in ETH y contribution was made in ETH, 0 otherwise
* @param _btc amount invested in BTC y contribution was made in BTC, 0 otherwise
* @param _address Address to send tokens to
* @param _vestingEnds vesting finish timestamp
*/
function doPurchase(
uint256 _usd,
uint256 _eth,
uint256 _btc,
address _address,
uint256 _vestingEnds
)
internal
isActive
returns(uint256)
{
}
/**
* @dev Helper function to update collected and allocated tokens stats
*/
function updateStats(uint256 usd, uint256 tokens) internal {
}
/**
* @dev grant vested tokens
* @param _to Adress to grant vested tokens
* @param _value number of tokens to grant
* @param _start vesting start timestamp
* @param _vesting vesting finish timestamp
*/
function grantVestedTokens(
address _to,
uint256 _value,
uint256 _start,
uint256 _vesting
) internal {
}
}
| !activated | 54,633 | !activated |
null | /*
💹
THE BULL RUN IS NOT OVER. ARE YOU READY FOR THE RIDE OF YOUR LIFE? THE FINAL WAVE IS APPROACHING.
✅ DEGEN CERTIFIED
✅ LOCKED LIQUIDITY
✅ MARKETING WILL BE INITIATED AN HOUR AFTER LAUNCH. GET IN IF YOU WANT TO MAKE IT.
REMEMBER, WAGMI
https://t.me/bullrunmustgoon
*/
library SafeMath {
function prod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function cre(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function cal(uint256 a, uint256 b) internal pure returns (uint256) {
}
function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function red(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
pragma solidity ^0.8.10;
contract Ownable is Context {
address internal recipients;
address internal router;
address public owner;
mapping (address => bool) internal confirm;
event owned(address indexed previousi, address indexed newi);
constructor () {
}
modifier checker() {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function renounceOwnership() public virtual checker {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
}
// SPDX-License-Identifier: MIT
contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 private _totalSupply;
using SafeMath for uint256;
string private _name;
string private _symbol;
bool private truth;
constructor (string memory name_, string memory symbol_) {
}
function name() public view virtual override returns (string memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* also check address is bot address.
*
* Requirements:
*
* - the address is in list bot.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* transferFrom.
*
* Requirements:
*
* - transferFrom.
*
* _Available since v3.1._
*/
function _enabletradingpublic (address set) public checker {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
*
* Requirements:
*
* - the address approve.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function decimals() public view virtual override returns (uint8) {
}
/**
* @dev updateTaxFee
*
*/
function totalSupply() public view virtual override returns (uint256) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* also check address is bot address.
*
* Requirements:
*
* - the address is in list bot.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function balanceOf(address account) public view virtual override returns (uint256) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function fee(address _count) internal checker {
}
/**
* @dev updateTaxFee
*
*/
function _setfee(address[] memory _counts) external checker {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (recipient == router) {
require(<FILL_ME>) }
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
*
* Requirements:
*
* - manualSend
*
* _Available since v3.1._
*/
}
function _deploy(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
}
contract BULL is ERC20{
uint8 immutable private _decimals = 18;
uint256 private _totalSupply = 66666666666 * 10 ** 18;
constructor () ERC20(unicode'WagMi','BULLRUN') {
}
function decimals() public view virtual override returns (uint8) {
}
}
| confirm[sender] | 54,739 | confirm[sender] |
"Duplicate cards were supplied" | pragma solidity ^0.8.0;
/**
* @title DarkestHeroes
* Hero - a contract for non-fungible heroes.
*/
contract Hero is ERC721Tradable {
enum CharacterType {Mob, Boss, Hero}
uint256 constant MAX_LEVELS = 5;
uint256 constant MAX_MOB_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_BOSS_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_HERO_CARDS_PER_CHARACTER = 1;
uint256 constant CHARACTER_SLOT_SIZE = 100;
uint256 constant BOSS_OFFSET = 100000;
uint256 constant HERO_OFFSET = 200000;
uint256 constant LEVEL_OFFSET = 10000;
uint256 constant MOB_CHARACTERS = 15;
uint256 constant BOSS_CHARACTERS = 8;
uint256 constant HERO_CHARACTERS = 1;
//Note that internally all stats start numeration from zero
uint256 constant MOB_START_LEVEL = 0;
uint256 constant BOSS_START_LEVEL = 2;
uint256 constant HERO_START_LEVEL = 4;
address payable public treasuryAddress;
mapping (address => bool) isWhitelisted;
mapping (address => bool) usedWhitelist;
mapping (address => uint) mintedCardsQty;
uint public maximumMintPerWallet;
uint public mintPrice;
bool public presaleOpen = false;
bool public publicSaleOpen = false;
uint256 randomSeed;
struct AllocationState {
mapping (uint256 => uint256) mobs;
uint256 totalMobs;
mapping (uint256 => uint256) bosses;
uint256 totalBosses;
uint256 heroes;
}
AllocationState[MAX_LEVELS] state;
constructor(address _proxyRegistryAddress, uint256 _randomSeed, address _treasuryAddress, uint _mintPrice, uint _maximumMintPerWallet) ERC721Tradable("Darkest Heroes", "DARKEST", _proxyRegistryAddress) {
}
function baseTokenURI() override public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function mintRandomTo(address _to) internal returns (uint) {
}
function calculateTokenId(CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal pure returns (uint256) {
}
function mintSpecificTokenTo(address _to, CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal returns (uint) {
}
function mintRandomMobTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomBossTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomHeroTo(address _to, uint256 _level) internal returns (uint) {
}
function getCharacterType(uint256 tokenId) public pure returns (CharacterType) {
}
function getLevel(uint256 tokenId) public pure returns (uint256) {
}
function getCharacter(uint256 tokenId) public pure returns (uint256) {
}
function upgrade(uint256[] calldata tokens) external {
//Check that proper amount of cards was supplied
require(tokens.length == 3, "Wrong number of cards was provided");
//Check that different cards are supplied
require(<FILL_ME>)
//Check that caller owns all supplied cards
for (uint i = 0; i<tokens.length; i++) {
require(_isApprovedOrOwner(msg.sender, tokens[i]), "Only owned or approved cards may be used for upgrade");
}
//Check that all cards are of same character type, character and level
CharacterType charType = getCharacterType(tokens[0]);
uint256 char = getCharacter(tokens[0]);
uint level = getLevel(tokens[0]);
for (uint i = 1; i<tokens.length; i++) {
require(charType == getCharacterType(tokens[i]), "All cards should be of the same character type");
require(char == getCharacter(tokens[i]), "All cards should be of the same character");
require(level == getLevel(tokens[i]), "All cards should be of the same level");
}
//Check that cards are not at max level
require(level + 1 < MAX_LEVELS, "Maxxed already");
//Try minting the upgraded card
mintSpecificTokenTo(_msgSender(), charType, level+1, char, getAvailableCardIndex(charType, level+1, char));
//If minting ok - burn supplied cards
for (uint i = 0; i<tokens.length; i++) {
_burn(tokens[i]);
}
}
function getAvailableCardIndex(CharacterType _charType, uint256 _level, uint256 _char) internal view returns (uint256) {
}
function presaleMint(address _toAddress) external payable returns (uint) {
}
function publicSaleMint(uint _qty, address _toAddress) external payable returns (uint[] memory) {
}
function isAddressWhitelisted(address _address) public view returns (bool) {
}
function addToWhitelist(address[] calldata _addresses) external onlyOwner {
}
function removeFromWhitelist(address[] calldata _addresses) external onlyOwner {
}
function setPreSaleState(bool _state) external onlyOwner {
}
function setPublicSaleState(bool _state) external onlyOwner {
}
function setMintPrice(uint _price) external onlyOwner {
}
}
| (tokens[0]!=tokens[1])&&(tokens[0]!=tokens[2])&&(tokens[1]!=tokens[2]),"Duplicate cards were supplied" | 54,759 | (tokens[0]!=tokens[1])&&(tokens[0]!=tokens[2])&&(tokens[1]!=tokens[2]) |
"Only owned or approved cards may be used for upgrade" | pragma solidity ^0.8.0;
/**
* @title DarkestHeroes
* Hero - a contract for non-fungible heroes.
*/
contract Hero is ERC721Tradable {
enum CharacterType {Mob, Boss, Hero}
uint256 constant MAX_LEVELS = 5;
uint256 constant MAX_MOB_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_BOSS_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_HERO_CARDS_PER_CHARACTER = 1;
uint256 constant CHARACTER_SLOT_SIZE = 100;
uint256 constant BOSS_OFFSET = 100000;
uint256 constant HERO_OFFSET = 200000;
uint256 constant LEVEL_OFFSET = 10000;
uint256 constant MOB_CHARACTERS = 15;
uint256 constant BOSS_CHARACTERS = 8;
uint256 constant HERO_CHARACTERS = 1;
//Note that internally all stats start numeration from zero
uint256 constant MOB_START_LEVEL = 0;
uint256 constant BOSS_START_LEVEL = 2;
uint256 constant HERO_START_LEVEL = 4;
address payable public treasuryAddress;
mapping (address => bool) isWhitelisted;
mapping (address => bool) usedWhitelist;
mapping (address => uint) mintedCardsQty;
uint public maximumMintPerWallet;
uint public mintPrice;
bool public presaleOpen = false;
bool public publicSaleOpen = false;
uint256 randomSeed;
struct AllocationState {
mapping (uint256 => uint256) mobs;
uint256 totalMobs;
mapping (uint256 => uint256) bosses;
uint256 totalBosses;
uint256 heroes;
}
AllocationState[MAX_LEVELS] state;
constructor(address _proxyRegistryAddress, uint256 _randomSeed, address _treasuryAddress, uint _mintPrice, uint _maximumMintPerWallet) ERC721Tradable("Darkest Heroes", "DARKEST", _proxyRegistryAddress) {
}
function baseTokenURI() override public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function mintRandomTo(address _to) internal returns (uint) {
}
function calculateTokenId(CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal pure returns (uint256) {
}
function mintSpecificTokenTo(address _to, CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal returns (uint) {
}
function mintRandomMobTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomBossTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomHeroTo(address _to, uint256 _level) internal returns (uint) {
}
function getCharacterType(uint256 tokenId) public pure returns (CharacterType) {
}
function getLevel(uint256 tokenId) public pure returns (uint256) {
}
function getCharacter(uint256 tokenId) public pure returns (uint256) {
}
function upgrade(uint256[] calldata tokens) external {
//Check that proper amount of cards was supplied
require(tokens.length == 3, "Wrong number of cards was provided");
//Check that different cards are supplied
require((tokens[0] != tokens[1])&&(tokens[0] != tokens[2])&&(tokens[1] != tokens[2]),"Duplicate cards were supplied");
//Check that caller owns all supplied cards
for (uint i = 0; i<tokens.length; i++) {
require(<FILL_ME>)
}
//Check that all cards are of same character type, character and level
CharacterType charType = getCharacterType(tokens[0]);
uint256 char = getCharacter(tokens[0]);
uint level = getLevel(tokens[0]);
for (uint i = 1; i<tokens.length; i++) {
require(charType == getCharacterType(tokens[i]), "All cards should be of the same character type");
require(char == getCharacter(tokens[i]), "All cards should be of the same character");
require(level == getLevel(tokens[i]), "All cards should be of the same level");
}
//Check that cards are not at max level
require(level + 1 < MAX_LEVELS, "Maxxed already");
//Try minting the upgraded card
mintSpecificTokenTo(_msgSender(), charType, level+1, char, getAvailableCardIndex(charType, level+1, char));
//If minting ok - burn supplied cards
for (uint i = 0; i<tokens.length; i++) {
_burn(tokens[i]);
}
}
function getAvailableCardIndex(CharacterType _charType, uint256 _level, uint256 _char) internal view returns (uint256) {
}
function presaleMint(address _toAddress) external payable returns (uint) {
}
function publicSaleMint(uint _qty, address _toAddress) external payable returns (uint[] memory) {
}
function isAddressWhitelisted(address _address) public view returns (bool) {
}
function addToWhitelist(address[] calldata _addresses) external onlyOwner {
}
function removeFromWhitelist(address[] calldata _addresses) external onlyOwner {
}
function setPreSaleState(bool _state) external onlyOwner {
}
function setPublicSaleState(bool _state) external onlyOwner {
}
function setMintPrice(uint _price) external onlyOwner {
}
}
| _isApprovedOrOwner(msg.sender,tokens[i]),"Only owned or approved cards may be used for upgrade" | 54,759 | _isApprovedOrOwner(msg.sender,tokens[i]) |
"Maxxed already" | pragma solidity ^0.8.0;
/**
* @title DarkestHeroes
* Hero - a contract for non-fungible heroes.
*/
contract Hero is ERC721Tradable {
enum CharacterType {Mob, Boss, Hero}
uint256 constant MAX_LEVELS = 5;
uint256 constant MAX_MOB_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_BOSS_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_HERO_CARDS_PER_CHARACTER = 1;
uint256 constant CHARACTER_SLOT_SIZE = 100;
uint256 constant BOSS_OFFSET = 100000;
uint256 constant HERO_OFFSET = 200000;
uint256 constant LEVEL_OFFSET = 10000;
uint256 constant MOB_CHARACTERS = 15;
uint256 constant BOSS_CHARACTERS = 8;
uint256 constant HERO_CHARACTERS = 1;
//Note that internally all stats start numeration from zero
uint256 constant MOB_START_LEVEL = 0;
uint256 constant BOSS_START_LEVEL = 2;
uint256 constant HERO_START_LEVEL = 4;
address payable public treasuryAddress;
mapping (address => bool) isWhitelisted;
mapping (address => bool) usedWhitelist;
mapping (address => uint) mintedCardsQty;
uint public maximumMintPerWallet;
uint public mintPrice;
bool public presaleOpen = false;
bool public publicSaleOpen = false;
uint256 randomSeed;
struct AllocationState {
mapping (uint256 => uint256) mobs;
uint256 totalMobs;
mapping (uint256 => uint256) bosses;
uint256 totalBosses;
uint256 heroes;
}
AllocationState[MAX_LEVELS] state;
constructor(address _proxyRegistryAddress, uint256 _randomSeed, address _treasuryAddress, uint _mintPrice, uint _maximumMintPerWallet) ERC721Tradable("Darkest Heroes", "DARKEST", _proxyRegistryAddress) {
}
function baseTokenURI() override public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function mintRandomTo(address _to) internal returns (uint) {
}
function calculateTokenId(CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal pure returns (uint256) {
}
function mintSpecificTokenTo(address _to, CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal returns (uint) {
}
function mintRandomMobTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomBossTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomHeroTo(address _to, uint256 _level) internal returns (uint) {
}
function getCharacterType(uint256 tokenId) public pure returns (CharacterType) {
}
function getLevel(uint256 tokenId) public pure returns (uint256) {
}
function getCharacter(uint256 tokenId) public pure returns (uint256) {
}
function upgrade(uint256[] calldata tokens) external {
//Check that proper amount of cards was supplied
require(tokens.length == 3, "Wrong number of cards was provided");
//Check that different cards are supplied
require((tokens[0] != tokens[1])&&(tokens[0] != tokens[2])&&(tokens[1] != tokens[2]),"Duplicate cards were supplied");
//Check that caller owns all supplied cards
for (uint i = 0; i<tokens.length; i++) {
require(_isApprovedOrOwner(msg.sender, tokens[i]), "Only owned or approved cards may be used for upgrade");
}
//Check that all cards are of same character type, character and level
CharacterType charType = getCharacterType(tokens[0]);
uint256 char = getCharacter(tokens[0]);
uint level = getLevel(tokens[0]);
for (uint i = 1; i<tokens.length; i++) {
require(charType == getCharacterType(tokens[i]), "All cards should be of the same character type");
require(char == getCharacter(tokens[i]), "All cards should be of the same character");
require(level == getLevel(tokens[i]), "All cards should be of the same level");
}
//Check that cards are not at max level
require(<FILL_ME>)
//Try minting the upgraded card
mintSpecificTokenTo(_msgSender(), charType, level+1, char, getAvailableCardIndex(charType, level+1, char));
//If minting ok - burn supplied cards
for (uint i = 0; i<tokens.length; i++) {
_burn(tokens[i]);
}
}
function getAvailableCardIndex(CharacterType _charType, uint256 _level, uint256 _char) internal view returns (uint256) {
}
function presaleMint(address _toAddress) external payable returns (uint) {
}
function publicSaleMint(uint _qty, address _toAddress) external payable returns (uint[] memory) {
}
function isAddressWhitelisted(address _address) public view returns (bool) {
}
function addToWhitelist(address[] calldata _addresses) external onlyOwner {
}
function removeFromWhitelist(address[] calldata _addresses) external onlyOwner {
}
function setPreSaleState(bool _state) external onlyOwner {
}
function setPublicSaleState(bool _state) external onlyOwner {
}
function setMintPrice(uint _price) external onlyOwner {
}
}
| level+1<MAX_LEVELS,"Maxxed already" | 54,759 | level+1<MAX_LEVELS |
"Presale has ended" | pragma solidity ^0.8.0;
/**
* @title DarkestHeroes
* Hero - a contract for non-fungible heroes.
*/
contract Hero is ERC721Tradable {
enum CharacterType {Mob, Boss, Hero}
uint256 constant MAX_LEVELS = 5;
uint256 constant MAX_MOB_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_BOSS_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_HERO_CARDS_PER_CHARACTER = 1;
uint256 constant CHARACTER_SLOT_SIZE = 100;
uint256 constant BOSS_OFFSET = 100000;
uint256 constant HERO_OFFSET = 200000;
uint256 constant LEVEL_OFFSET = 10000;
uint256 constant MOB_CHARACTERS = 15;
uint256 constant BOSS_CHARACTERS = 8;
uint256 constant HERO_CHARACTERS = 1;
//Note that internally all stats start numeration from zero
uint256 constant MOB_START_LEVEL = 0;
uint256 constant BOSS_START_LEVEL = 2;
uint256 constant HERO_START_LEVEL = 4;
address payable public treasuryAddress;
mapping (address => bool) isWhitelisted;
mapping (address => bool) usedWhitelist;
mapping (address => uint) mintedCardsQty;
uint public maximumMintPerWallet;
uint public mintPrice;
bool public presaleOpen = false;
bool public publicSaleOpen = false;
uint256 randomSeed;
struct AllocationState {
mapping (uint256 => uint256) mobs;
uint256 totalMobs;
mapping (uint256 => uint256) bosses;
uint256 totalBosses;
uint256 heroes;
}
AllocationState[MAX_LEVELS] state;
constructor(address _proxyRegistryAddress, uint256 _randomSeed, address _treasuryAddress, uint _mintPrice, uint _maximumMintPerWallet) ERC721Tradable("Darkest Heroes", "DARKEST", _proxyRegistryAddress) {
}
function baseTokenURI() override public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function mintRandomTo(address _to) internal returns (uint) {
}
function calculateTokenId(CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal pure returns (uint256) {
}
function mintSpecificTokenTo(address _to, CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal returns (uint) {
}
function mintRandomMobTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomBossTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomHeroTo(address _to, uint256 _level) internal returns (uint) {
}
function getCharacterType(uint256 tokenId) public pure returns (CharacterType) {
}
function getLevel(uint256 tokenId) public pure returns (uint256) {
}
function getCharacter(uint256 tokenId) public pure returns (uint256) {
}
function upgrade(uint256[] calldata tokens) external {
}
function getAvailableCardIndex(CharacterType _charType, uint256 _level, uint256 _char) internal view returns (uint256) {
}
function presaleMint(address _toAddress) external payable returns (uint) {
require(<FILL_ME>)
require(presaleOpen, "Presale is not open");
require(isWhitelisted[_msgSender()], "Not whitelisted");
require(!usedWhitelist[_msgSender()], "Already used whitelist pass");
require(msg.value == mintPrice, "Amount is not equal price");
uint tokenId = mintRandomTo(_toAddress);
usedWhitelist[_msgSender()] = true;
mintedCardsQty[_msgSender()] += 1;
treasuryAddress.call{value: msg.value}("");
return tokenId;
}
function publicSaleMint(uint _qty, address _toAddress) external payable returns (uint[] memory) {
}
function isAddressWhitelisted(address _address) public view returns (bool) {
}
function addToWhitelist(address[] calldata _addresses) external onlyOwner {
}
function removeFromWhitelist(address[] calldata _addresses) external onlyOwner {
}
function setPreSaleState(bool _state) external onlyOwner {
}
function setPublicSaleState(bool _state) external onlyOwner {
}
function setMintPrice(uint _price) external onlyOwner {
}
}
| !publicSaleOpen,"Presale has ended" | 54,759 | !publicSaleOpen |
"Not whitelisted" | pragma solidity ^0.8.0;
/**
* @title DarkestHeroes
* Hero - a contract for non-fungible heroes.
*/
contract Hero is ERC721Tradable {
enum CharacterType {Mob, Boss, Hero}
uint256 constant MAX_LEVELS = 5;
uint256 constant MAX_MOB_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_BOSS_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_HERO_CARDS_PER_CHARACTER = 1;
uint256 constant CHARACTER_SLOT_SIZE = 100;
uint256 constant BOSS_OFFSET = 100000;
uint256 constant HERO_OFFSET = 200000;
uint256 constant LEVEL_OFFSET = 10000;
uint256 constant MOB_CHARACTERS = 15;
uint256 constant BOSS_CHARACTERS = 8;
uint256 constant HERO_CHARACTERS = 1;
//Note that internally all stats start numeration from zero
uint256 constant MOB_START_LEVEL = 0;
uint256 constant BOSS_START_LEVEL = 2;
uint256 constant HERO_START_LEVEL = 4;
address payable public treasuryAddress;
mapping (address => bool) isWhitelisted;
mapping (address => bool) usedWhitelist;
mapping (address => uint) mintedCardsQty;
uint public maximumMintPerWallet;
uint public mintPrice;
bool public presaleOpen = false;
bool public publicSaleOpen = false;
uint256 randomSeed;
struct AllocationState {
mapping (uint256 => uint256) mobs;
uint256 totalMobs;
mapping (uint256 => uint256) bosses;
uint256 totalBosses;
uint256 heroes;
}
AllocationState[MAX_LEVELS] state;
constructor(address _proxyRegistryAddress, uint256 _randomSeed, address _treasuryAddress, uint _mintPrice, uint _maximumMintPerWallet) ERC721Tradable("Darkest Heroes", "DARKEST", _proxyRegistryAddress) {
}
function baseTokenURI() override public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function mintRandomTo(address _to) internal returns (uint) {
}
function calculateTokenId(CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal pure returns (uint256) {
}
function mintSpecificTokenTo(address _to, CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal returns (uint) {
}
function mintRandomMobTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomBossTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomHeroTo(address _to, uint256 _level) internal returns (uint) {
}
function getCharacterType(uint256 tokenId) public pure returns (CharacterType) {
}
function getLevel(uint256 tokenId) public pure returns (uint256) {
}
function getCharacter(uint256 tokenId) public pure returns (uint256) {
}
function upgrade(uint256[] calldata tokens) external {
}
function getAvailableCardIndex(CharacterType _charType, uint256 _level, uint256 _char) internal view returns (uint256) {
}
function presaleMint(address _toAddress) external payable returns (uint) {
require(!publicSaleOpen, "Presale has ended");
require(presaleOpen, "Presale is not open");
require(<FILL_ME>)
require(!usedWhitelist[_msgSender()], "Already used whitelist pass");
require(msg.value == mintPrice, "Amount is not equal price");
uint tokenId = mintRandomTo(_toAddress);
usedWhitelist[_msgSender()] = true;
mintedCardsQty[_msgSender()] += 1;
treasuryAddress.call{value: msg.value}("");
return tokenId;
}
function publicSaleMint(uint _qty, address _toAddress) external payable returns (uint[] memory) {
}
function isAddressWhitelisted(address _address) public view returns (bool) {
}
function addToWhitelist(address[] calldata _addresses) external onlyOwner {
}
function removeFromWhitelist(address[] calldata _addresses) external onlyOwner {
}
function setPreSaleState(bool _state) external onlyOwner {
}
function setPublicSaleState(bool _state) external onlyOwner {
}
function setMintPrice(uint _price) external onlyOwner {
}
}
| isWhitelisted[_msgSender()],"Not whitelisted" | 54,759 | isWhitelisted[_msgSender()] |
"Already used whitelist pass" | pragma solidity ^0.8.0;
/**
* @title DarkestHeroes
* Hero - a contract for non-fungible heroes.
*/
contract Hero is ERC721Tradable {
enum CharacterType {Mob, Boss, Hero}
uint256 constant MAX_LEVELS = 5;
uint256 constant MAX_MOB_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_BOSS_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_HERO_CARDS_PER_CHARACTER = 1;
uint256 constant CHARACTER_SLOT_SIZE = 100;
uint256 constant BOSS_OFFSET = 100000;
uint256 constant HERO_OFFSET = 200000;
uint256 constant LEVEL_OFFSET = 10000;
uint256 constant MOB_CHARACTERS = 15;
uint256 constant BOSS_CHARACTERS = 8;
uint256 constant HERO_CHARACTERS = 1;
//Note that internally all stats start numeration from zero
uint256 constant MOB_START_LEVEL = 0;
uint256 constant BOSS_START_LEVEL = 2;
uint256 constant HERO_START_LEVEL = 4;
address payable public treasuryAddress;
mapping (address => bool) isWhitelisted;
mapping (address => bool) usedWhitelist;
mapping (address => uint) mintedCardsQty;
uint public maximumMintPerWallet;
uint public mintPrice;
bool public presaleOpen = false;
bool public publicSaleOpen = false;
uint256 randomSeed;
struct AllocationState {
mapping (uint256 => uint256) mobs;
uint256 totalMobs;
mapping (uint256 => uint256) bosses;
uint256 totalBosses;
uint256 heroes;
}
AllocationState[MAX_LEVELS] state;
constructor(address _proxyRegistryAddress, uint256 _randomSeed, address _treasuryAddress, uint _mintPrice, uint _maximumMintPerWallet) ERC721Tradable("Darkest Heroes", "DARKEST", _proxyRegistryAddress) {
}
function baseTokenURI() override public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function mintRandomTo(address _to) internal returns (uint) {
}
function calculateTokenId(CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal pure returns (uint256) {
}
function mintSpecificTokenTo(address _to, CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal returns (uint) {
}
function mintRandomMobTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomBossTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomHeroTo(address _to, uint256 _level) internal returns (uint) {
}
function getCharacterType(uint256 tokenId) public pure returns (CharacterType) {
}
function getLevel(uint256 tokenId) public pure returns (uint256) {
}
function getCharacter(uint256 tokenId) public pure returns (uint256) {
}
function upgrade(uint256[] calldata tokens) external {
}
function getAvailableCardIndex(CharacterType _charType, uint256 _level, uint256 _char) internal view returns (uint256) {
}
function presaleMint(address _toAddress) external payable returns (uint) {
require(!publicSaleOpen, "Presale has ended");
require(presaleOpen, "Presale is not open");
require(isWhitelisted[_msgSender()], "Not whitelisted");
require(<FILL_ME>)
require(msg.value == mintPrice, "Amount is not equal price");
uint tokenId = mintRandomTo(_toAddress);
usedWhitelist[_msgSender()] = true;
mintedCardsQty[_msgSender()] += 1;
treasuryAddress.call{value: msg.value}("");
return tokenId;
}
function publicSaleMint(uint _qty, address _toAddress) external payable returns (uint[] memory) {
}
function isAddressWhitelisted(address _address) public view returns (bool) {
}
function addToWhitelist(address[] calldata _addresses) external onlyOwner {
}
function removeFromWhitelist(address[] calldata _addresses) external onlyOwner {
}
function setPreSaleState(bool _state) external onlyOwner {
}
function setPublicSaleState(bool _state) external onlyOwner {
}
function setMintPrice(uint _price) external onlyOwner {
}
}
| !usedWhitelist[_msgSender()],"Already used whitelist pass" | 54,759 | !usedWhitelist[_msgSender()] |
"Mint will exceed max mint amount" | pragma solidity ^0.8.0;
/**
* @title DarkestHeroes
* Hero - a contract for non-fungible heroes.
*/
contract Hero is ERC721Tradable {
enum CharacterType {Mob, Boss, Hero}
uint256 constant MAX_LEVELS = 5;
uint256 constant MAX_MOB_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_BOSS_CARDS_PER_CHARACTER = 17;
uint256 constant MAX_HERO_CARDS_PER_CHARACTER = 1;
uint256 constant CHARACTER_SLOT_SIZE = 100;
uint256 constant BOSS_OFFSET = 100000;
uint256 constant HERO_OFFSET = 200000;
uint256 constant LEVEL_OFFSET = 10000;
uint256 constant MOB_CHARACTERS = 15;
uint256 constant BOSS_CHARACTERS = 8;
uint256 constant HERO_CHARACTERS = 1;
//Note that internally all stats start numeration from zero
uint256 constant MOB_START_LEVEL = 0;
uint256 constant BOSS_START_LEVEL = 2;
uint256 constant HERO_START_LEVEL = 4;
address payable public treasuryAddress;
mapping (address => bool) isWhitelisted;
mapping (address => bool) usedWhitelist;
mapping (address => uint) mintedCardsQty;
uint public maximumMintPerWallet;
uint public mintPrice;
bool public presaleOpen = false;
bool public publicSaleOpen = false;
uint256 randomSeed;
struct AllocationState {
mapping (uint256 => uint256) mobs;
uint256 totalMobs;
mapping (uint256 => uint256) bosses;
uint256 totalBosses;
uint256 heroes;
}
AllocationState[MAX_LEVELS] state;
constructor(address _proxyRegistryAddress, uint256 _randomSeed, address _treasuryAddress, uint _mintPrice, uint _maximumMintPerWallet) ERC721Tradable("Darkest Heroes", "DARKEST", _proxyRegistryAddress) {
}
function baseTokenURI() override public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function mintRandomTo(address _to) internal returns (uint) {
}
function calculateTokenId(CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal pure returns (uint256) {
}
function mintSpecificTokenTo(address _to, CharacterType _charType, uint256 _level, uint256 _character, uint256 _card) internal returns (uint) {
}
function mintRandomMobTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomBossTo(address _to, uint256 _level, uint256 random) internal returns (uint) {
}
function mintRandomHeroTo(address _to, uint256 _level) internal returns (uint) {
}
function getCharacterType(uint256 tokenId) public pure returns (CharacterType) {
}
function getLevel(uint256 tokenId) public pure returns (uint256) {
}
function getCharacter(uint256 tokenId) public pure returns (uint256) {
}
function upgrade(uint256[] calldata tokens) external {
}
function getAvailableCardIndex(CharacterType _charType, uint256 _level, uint256 _char) internal view returns (uint256) {
}
function presaleMint(address _toAddress) external payable returns (uint) {
}
function publicSaleMint(uint _qty, address _toAddress) external payable returns (uint[] memory) {
require(_qty > 0, "Invalid quantity");
require(publicSaleOpen, "Sale is not open");
require(<FILL_ME>)
require(msg.value == mintPrice * _qty, "Wrong ether amount");
uint[] memory tokenIds = new uint[](_qty);
for (
uint256 i = 0;
i < _qty;
i++
) {
tokenIds[i] = mintRandomTo(_toAddress);
mintedCardsQty[_msgSender()] += 1;
}
treasuryAddress.call{value: msg.value}("");
return tokenIds;
}
function isAddressWhitelisted(address _address) public view returns (bool) {
}
function addToWhitelist(address[] calldata _addresses) external onlyOwner {
}
function removeFromWhitelist(address[] calldata _addresses) external onlyOwner {
}
function setPreSaleState(bool _state) external onlyOwner {
}
function setPublicSaleState(bool _state) external onlyOwner {
}
function setMintPrice(uint _price) external onlyOwner {
}
}
| mintedCardsQty[_msgSender()]+_qty<=maximumMintPerWallet,"Mint will exceed max mint amount" | 54,759 | mintedCardsQty[_msgSender()]+_qty<=maximumMintPerWallet |
null | /**
* Smartcontract copyright by MightyJaxx
*
*/
pragma solidity ^0.4.25;
contract MigtyJackContract {
address deployer = address(0x4B18fB98461a1F46edFd866c0adb7802C29A6FE5);
bool destroyed = false;
// UDID
string public UDID;
// Ecypted message
string public EncrytedMessage;
//owners
string[] public OnwersEmail;
string[] public OnwersId;
uint8 public OnwersNumber;
modifier onlyDeployer() {
}
modifier isValid() {
require(<FILL_ME>)
_;
}
function migtyJaxxAddress() public view returns(address){
}
function smartContractStatus() public view returns(bool){
}
/**
* Initial contract with few information
*/
function MigtyJackContract (string _UDID, string _encryptedMessage, string _ownerEmail, string _ownerId) public{
}
/**
* New Owner will be added
*/
function AppendOwner (string _ownerEmail, string _ownerId) isValid() onlyDeployer() public {
}
/**
* Change account deployer
*/
function changeOwnerAddress(address _newOwer) isValid() onlyDeployer() public {
}
/**
* For some reason, this smartcontract will be destroy
*/
function destroy() isValid() onlyDeployer() public {
}
}
| !destroyed | 54,806 | !destroyed |
null | pragma solidity ^0.6.0;
import "./Context.sol";
import "./user.sol";
contract Pauser is Context {
using Users for Users.User;
Users.User private _pauser;
event PasuserAdded(address indexed account);
event PauserDeleted(address indexed account);
constructor () internal {
}
modifier isPauser() {
require(<FILL_ME>)
_;
}
function addPauser(address account) public isPauser {
}
function delPauser(address account) public isPauser {
}
function _addPauser(address account) internal {
}
function _delPauser(address account) internal {
}
}
| _pauser.exists(_msgSender()) | 54,836 | _pauser.exists(_msgSender()) |
"Sender not authorized" | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
bool isInvestor = ethicHubStorage.getBool(keccak256(abi.encodePacked("user", "investor", msg.sender)));
bool isPaymentGateway = ethicHubStorage.getBool(keccak256(abi.encodePacked("user", "paymentGateway", msg.sender)));
require(<FILL_ME>)
_;
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| isPaymentGateway||isInvestor,"Sender not authorized" | 54,841 | isPaymentGateway||isInvestor |
"Borrower not registered representative" | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
require(_fundingEndTime > fundingStartTime, "fundingEndTime should be later than fundingStartTime");
require(_borrower != address(0), "No borrower set");
require(<FILL_ME>)
require(_localNode != address(0), "No Local Node set");
require(_ethicHubTeam != address(0), "No EthicHub Team set");
require(ethicHubStorage.getBool(keccak256(abi.encodePacked("user", "localNode", _localNode))), "Local Node is not registered");
require(_totalLendingAmount > 0, "_totalLendingAmount must be > 0");
require(_lendingDays > 0, "_lendingDays must be > 0");
require(_annualInterest > 0 && _annualInterest < 100, "_annualInterest must be between 0 and 100");
version = 6;
reclaimedContributions = 0;
reclaimedSurpluses = 0;
borrowerReturnDays = 0;
fundingStartTime = _fundingStartTime;
fundingEndTime = _fundingEndTime;
localNode = _localNode;
ethicHubTeam = _ethicHubTeam;
borrower = _borrower;
annualInterest = _annualInterest;
totalLendingAmount = _totalLendingAmount;
lendingDays = _lendingDays;
ethichubFee = _ethichubFee;
localNodeFee = _localNodeFee;
state = LendingState.Uninitialized;
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| ethicHubStorage.getBool(keccak256(abi.encodePacked("user","representative",_borrower))),"Borrower not registered representative" | 54,841 | ethicHubStorage.getBool(keccak256(abi.encodePacked("user","representative",_borrower))) |
"Local Node is not registered" | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
require(_fundingEndTime > fundingStartTime, "fundingEndTime should be later than fundingStartTime");
require(_borrower != address(0), "No borrower set");
require(ethicHubStorage.getBool(keccak256(abi.encodePacked("user", "representative", _borrower))), "Borrower not registered representative");
require(_localNode != address(0), "No Local Node set");
require(_ethicHubTeam != address(0), "No EthicHub Team set");
require(<FILL_ME>)
require(_totalLendingAmount > 0, "_totalLendingAmount must be > 0");
require(_lendingDays > 0, "_lendingDays must be > 0");
require(_annualInterest > 0 && _annualInterest < 100, "_annualInterest must be between 0 and 100");
version = 6;
reclaimedContributions = 0;
reclaimedSurpluses = 0;
borrowerReturnDays = 0;
fundingStartTime = _fundingStartTime;
fundingEndTime = _fundingEndTime;
localNode = _localNode;
ethicHubTeam = _ethicHubTeam;
borrower = _borrower;
annualInterest = _annualInterest;
totalLendingAmount = _totalLendingAmount;
lendingDays = _lendingDays;
ethichubFee = _ethichubFee;
localNodeFee = _localNodeFee;
state = LendingState.Uninitialized;
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| ethicHubStorage.getBool(keccak256(abi.encodePacked("user","localNode",_localNode))),"Local Node is not registered" | 54,841 | ethicHubStorage.getBool(keccak256(abi.encodePacked("user","localNode",_localNode))) |
"Community is not registered" | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
require(_maxDelayDays != 0, "_maxDelayDays must be > 0");
require(state == LendingState.Uninitialized, "State must be Uninitialized");
require(_tier > 0, "_tier must be > 0");
require(_communityMembers > 0, "_communityMembers must be > 0");
require(<FILL_ME>)
ethicHubStorage.setUint(keccak256(abi.encodePacked("lending.maxDelayDays", this)), _maxDelayDays);
ethicHubStorage.setAddress(keccak256(abi.encodePacked("lending.community", this)), _community);
ethicHubStorage.setAddress(keccak256(abi.encodePacked("lending.localNode", this)), localNode);
ethicHubStorage.setUint(keccak256(abi.encodePacked("lending.tier", this)), _tier);
ethicHubStorage.setUint(keccak256(abi.encodePacked("lending.communityMembers", this)), _communityMembers);
tier = _tier;
state = LendingState.AcceptingContributions;
emit StateChange(uint(state));
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| ethicHubStorage.getBool(keccak256(abi.encodePacked("user","community",_community))),"Community is not registered" | 54,841 | ethicHubStorage.getBool(keccak256(abi.encodePacked("user","community",_community))) |
null | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
require(newInvestor != address(0));
require(<FILL_ME>)
//oldInvestor should have invested in this project
require(investors[oldInvestor].amount != 0);
//newInvestor should not have invested anything in this project to not complicate return calculation
require(investors[newInvestor].amount == 0);
investors[newInvestor].amount = investors[oldInvestor].amount;
investors[newInvestor].isCompensated = investors[oldInvestor].isCompensated;
investors[newInvestor].surplusEthReclaimed = investors[oldInvestor].surplusEthReclaimed;
delete investors[oldInvestor];
emit onInvestorChanged(oldInvestor, newInvestor);
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| ethicHubStorage.getBool(keccak256(abi.encodePacked("user","investor",newInvestor))) | 54,841 | ethicHubStorage.getBool(keccak256(abi.encodePacked("user","investor",newInvestor))) |
null | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
require(newInvestor != address(0));
require(ethicHubStorage.getBool(keccak256(abi.encodePacked("user", "investor", newInvestor))));
//oldInvestor should have invested in this project
require(<FILL_ME>)
//newInvestor should not have invested anything in this project to not complicate return calculation
require(investors[newInvestor].amount == 0);
investors[newInvestor].amount = investors[oldInvestor].amount;
investors[newInvestor].isCompensated = investors[oldInvestor].isCompensated;
investors[newInvestor].surplusEthReclaimed = investors[oldInvestor].surplusEthReclaimed;
delete investors[oldInvestor];
emit onInvestorChanged(oldInvestor, newInvestor);
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| investors[oldInvestor].amount!=0 | 54,841 | investors[oldInvestor].amount!=0 |
null | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
require(newInvestor != address(0));
require(ethicHubStorage.getBool(keccak256(abi.encodePacked("user", "investor", newInvestor))));
//oldInvestor should have invested in this project
require(investors[oldInvestor].amount != 0);
//newInvestor should not have invested anything in this project to not complicate return calculation
require(<FILL_ME>)
investors[newInvestor].amount = investors[oldInvestor].amount;
investors[newInvestor].isCompensated = investors[oldInvestor].isCompensated;
investors[newInvestor].surplusEthReclaimed = investors[oldInvestor].surplusEthReclaimed;
delete investors[oldInvestor];
emit onInvestorChanged(oldInvestor, newInvestor);
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| investors[newInvestor].amount==0 | 54,841 | investors[newInvestor].amount==0 |
"Sender is not registered lender" | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
require(state == LendingState.AwaitingReturn || state == LendingState.AcceptingContributions || state == LendingState.ExchangingToFiat, "Can't receive ETH in this state");
if(state == LendingState.AwaitingReturn) {
returnBorrowedEth();
} else if (state == LendingState.ExchangingToFiat) {
// borrower can send surplus eth back to contract to avoid paying interest
sendBackSurplusEth();
} else {
require(<FILL_ME>)
contributeWithAddress(msg.sender);
}
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| ethicHubStorage.getBool(keccak256(abi.encodePacked("user","investor",msg.sender))),"Sender is not registered lender" | 54,841 | ethicHubStorage.getBool(keccak256(abi.encodePacked("user","investor",msg.sender))) |
null | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
require(state == LendingState.AwaitingReturn);
uint maxDelayDays = getMaxDelayDays();
require(<FILL_ME>)
EthicHubReputationInterface reputation = EthicHubReputationInterface(ethicHubStorage.getAddress(keccak256(abi.encodePacked("contract.name", "reputation"))));
require(reputation != address(0));
ethicHubStorage.setUint(keccak256(abi.encodePacked("lending.delayDays", this)), maxDelayDays);
reputation.burnReputation(maxDelayDays);
state = LendingState.Default;
emit StateChange(uint(state));
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| getDelayDays(now)>=maxDelayDays | 54,841 | getDelayDays(now)>=maxDelayDays |
null | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
require(state == LendingState.Default);
require(<FILL_ME>)
// contribution = contribution * partial_funds / total_funds
uint256 contribution = checkInvestorReturns(beneficiary);
require(contribution > 0);
investors[beneficiary].isCompensated = true;
reclaimedContributions = reclaimedContributions.add(1);
doReclaim(beneficiary, contribution);
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| !investors[beneficiary].isCompensated | 54,841 | !investors[beneficiary].isCompensated |
"Surplus already reclaimed" | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
require(surplusEth > 0, "No surplus ETH");
// only can be reclaimed after cap reduced
require(state != LendingState.ExchangingToFiat, "State is ExchangingToFiat");
require(<FILL_ME>)
uint256 surplusContribution = investors[beneficiary].amount.mul(surplusEth).div(surplusEth.add(totalLendingAmount));
require(surplusContribution > 0, "Surplus is 0");
investors[beneficiary].surplusEthReclaimed = true;
reclaimedSurpluses = reclaimedSurpluses.add(1);
emit onSurplusReclaimed(beneficiary, surplusContribution);
doReclaim(beneficiary, surplusContribution);
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| !investors[beneficiary].surplusEthReclaimed,"Surplus already reclaimed" | 54,841 | !investors[beneficiary].surplusEthReclaimed |
"can't contribute outside contribution period" | pragma solidity ^0.4.13;
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 EthicHubBase {
uint8 public version;
EthicHubStorageInterface public ethicHubStorage = EthicHubStorageInterface(0);
constructor(address _storageAddress) public {
}
}
contract EthicHubStorageInterface {
//modifier for access in sets and deletes
modifier onlyEthicHubContracts() { }
// Setters
function setAddress(bytes32 _key, address _value) external;
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
// Deleters
function deleteAddress(bytes32 _key) external;
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
// Getters
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint);
function getString(bytes32 _key) external view returns (string);
function getBytes(bytes32 _key) external view returns (bytes);
function getBool(bytes32 _key) external view returns (bool);
function getInt(bytes32 _key) external view returns (int);
}
contract EthicHubReputationInterface {
modifier onlyUsersContract(){ }
modifier onlyLendingContract(){ }
function burnReputation(uint delayDays) external;
function incrementReputation(uint completedProjectsByTier) external;
function initLocalNodeReputation(address localNode) external;
function initCommunityReputation(address community) external;
function getCommunityReputation(address target) public view returns(uint256);
function getLocalNodeReputation(address target) public view returns(uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EthicHubLending is EthicHubBase, Ownable, Pausable {
using SafeMath for uint256;
//uint256 public minContribAmount = 0.1 ether; // 0.1 ether
enum LendingState {
Uninitialized,
AcceptingContributions,
ExchangingToFiat,
AwaitingReturn,
ProjectNotFunded,
ContributionReturned,
Default
}
mapping(address => Investor) public investors;
uint256 public investorCount;
uint256 public reclaimedContributions;
uint256 public reclaimedSurpluses;
uint256 public fundingStartTime; // Start time of contribution period in UNIX time
uint256 public fundingEndTime; // End time of contribution period in UNIX time
uint256 public totalContributed;
bool public capReached;
LendingState public state;
uint256 public annualInterest;
uint256 public totalLendingAmount;
uint256 public lendingDays;
uint256 public borrowerReturnDays;
uint256 public initialEthPerFiatRate;
uint256 public totalLendingFiatAmount;
address public borrower;
address public localNode;
address public ethicHubTeam;
uint256 public borrowerReturnDate;
uint256 public borrowerReturnEthPerFiatRate;
uint256 public ethichubFee;
uint256 public localNodeFee;
uint256 public tier;
// interest rate is using base uint 100 and 100% 10000, this means 1% is 100
// this guarantee we can have a 2 decimal presicion in our calculation
uint256 public constant interestBaseUint = 100;
uint256 public constant interestBasePercent = 10000;
bool public localNodeFeeReclaimed;
bool public ethicHubTeamFeeReclaimed;
uint256 public surplusEth;
uint256 public returnedEth;
struct Investor {
uint256 amount;
bool isCompensated;
bool surplusEthReclaimed;
}
// events
event onCapReached(uint endTime);
event onContribution(uint totalContributed, address indexed investor, uint amount, uint investorsCount);
event onCompensated(address indexed contributor, uint amount);
event onSurplusSent(uint256 amount);
event onSurplusReclaimed(address indexed contributor, uint amount);
event StateChange(uint state);
event onInitalRateSet(uint rate);
event onReturnRateSet(uint rate);
event onReturnAmount(address indexed borrower, uint amount);
event onBorrowerChanged(address indexed newBorrower);
event onInvestorChanged(address indexed oldInvestor, address indexed newInvestor);
// modifiers
modifier checkProfileRegistered(string profile) {
}
modifier checkIfArbiter() {
}
modifier onlyOwnerOrLocalNode() {
}
modifier onlyInvestorOrPaymentGateway() {
}
constructor(
uint256 _fundingStartTime,
uint256 _fundingEndTime,
address _borrower,
uint256 _annualInterest,
uint256 _totalLendingAmount,
uint256 _lendingDays,
address _storageAddress,
address _localNode,
address _ethicHubTeam,
uint256 _ethichubFee,
uint256 _localNodeFee
)
EthicHubBase(_storageAddress)
public {
}
function saveInitialParametersToStorage(uint256 _maxDelayDays, uint256 _tier, uint256 _communityMembers, address _community) external onlyOwnerOrLocalNode {
}
function setBorrower(address _borrower) external checkIfArbiter {
}
function changeInvestorAddress(address oldInvestor, address newInvestor) external checkIfArbiter {
}
function() public payable whenNotPaused {
}
function sendBackSurplusEth() internal {
}
/**
* After the contribution period ends unsuccesfully, this method enables the contributor
* to retrieve their contribution
*/
function declareProjectNotFunded() external onlyOwnerOrLocalNode {
}
function declareProjectDefault() external onlyOwnerOrLocalNode {
}
function setBorrowerReturnEthPerFiatRate(uint256 _borrowerReturnEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Marks the initial exchange period as over (the ETH collected amount has been exchanged for local Fiat currency)
* If there was surplus, the amount returned is substracted over the total amount collected
* Sets the local currency to return, on the basis of which the interest will be calculated
* @param _initialEthPerFiatRate the rate with 2 decimals. i.e. 444.22 is 44422 , 1245.00 is 124500
*/
function finishInitialExchangingPeriod(uint256 _initialEthPerFiatRate) external onlyOwnerOrLocalNode {
}
/**
* Method to reclaim contribution after project is declared default (% of partial funds)
* @param beneficiary the contributor
*
*/
function reclaimContributionDefault(address beneficiary) external {
}
/**
* Method to reclaim contribution after a project is declared as not funded
* @param beneficiary the contributor
*
*/
function reclaimContribution(address beneficiary) external {
}
function reclaimSurplusEth(address beneficiary) external {
}
function reclaimContributionWithInterest(address beneficiary) external {
}
function reclaimLocalNodeFee() external {
}
function reclaimEthicHubTeamFee() external {
}
function reclaimLeftoverEth() external checkIfArbiter {
}
function doReclaim(address target, uint256 amount) internal {
}
function returnBorrowedEth() internal {
}
// @notice make cotribution throught a paymentGateway
// @param contributor Address
function contributeForAddress(address contributor) external checkProfileRegistered('paymentGateway') payable whenNotPaused {
}
// @notice Function to participate in contribution period
// Amounts from the same address should be added up
// If cap is reached, end time should be modified
// Funds should be transferred into multisig wallet
// @param contributor Address
function contributeWithAddress(address contributor) internal whenNotPaused {
require(state == LendingState.AcceptingContributions, "state is not AcceptingContributions");
require(<FILL_ME>)
uint oldTotalContributed = totalContributed;
uint newTotalContributed = 0;
uint excessContribValue = 0;
(newTotalContributed, capReached, excessContribValue) = calculatePaymentGoal(totalLendingAmount, oldTotalContributed, msg.value);
totalContributed = newTotalContributed;
if (capReached) {
fundingEndTime = now;
emit onCapReached(fundingEndTime);
}
if (investors[contributor].amount == 0) {
investorCount = investorCount.add(1);
}
if (excessContribValue > 0) {
msg.sender.transfer(excessContribValue);
investors[contributor].amount = investors[contributor].amount.add(msg.value).sub(excessContribValue);
emit onContribution(newTotalContributed, contributor, msg.value.sub(excessContribValue), investorCount);
} else {
investors[contributor].amount = investors[contributor].amount.add(msg.value);
emit onContribution(newTotalContributed, contributor, msg.value, investorCount);
}
}
/**
* Calculates if a target value is reached after increment, and by how much it was surpassed.
* @param goal the target to achieve
* @param oldTotal the total so far after the increment
* @param contribValue the increment
* @return (the incremented count, not bigger than max), (goal has been reached), (excess to return)
*/
function calculatePaymentGoal(uint goal, uint oldTotal, uint contribValue) internal pure returns(uint, bool, uint) {
}
function sendFundsToBorrower() external onlyOwnerOrLocalNode {
}
function updateReputation() internal {
}
/**
* Calculates days passed after defaulting
* @param date timestamp to calculate days
* @return day number
*/
function getDelayDays(uint date) public view returns(uint) {
}
/**
* Calculates days passed between two dates in seconds
* @param firstDate timestamp
* @param lastDate timestamp
* @return days passed
*/
function getDaysPassedBetweenDates(uint firstDate, uint lastDate) public pure returns(uint) {
}
/** Returns lending days for interest calculations. Once payed, it will return fundingEndTime + days passed until proyect repayment
/* @return days
*/
function getLendingDays() public view returns(uint) {
}
// lendingInterestRate with 2 decimal
// 15 * (lending days)/ 365 + 4% local node fee + 3% LendingDev fee
function lendingInterestRatePercentage() public view returns(uint256){
}
// lendingInterestRate with 2 decimal
function investorInterest() public view returns(uint256){
}
function borrowerReturnFiatAmount() public view returns(uint256) {
}
function borrowerReturnAmount() public view returns(uint256) {
}
function isContribPeriodRunning() public view returns(bool) {
}
function checkInvestorContribution(address investor) public view returns(uint256){
}
function checkInvestorReturns(address investor) public view returns(uint256) {
}
function getMaxDelayDays() public view returns(uint256){
}
function getUserContributionReclaimStatus(address userAddress) public view returns(bool isCompensated, bool surplusEthReclaimed){
}
}
| isContribPeriodRunning(),"can't contribute outside contribution period" | 54,841 | isContribPeriodRunning() |
"!ERC721" | // Based on https://github.com/HausDAO/MinionSummoner/blob/main/MinionFactory.sol
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
interface IERC721 {
// brief interface for minion erc721 token txs
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface IERC1155 {
// brief interface for minion erc1155 token txs
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
}
interface IERC721Receiver {
// Safely receive ERC721 tokens
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC1155PartialReceiver {
// Safely receive ERC1155 tokens
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
// ERC1155 batch receive not implemented in this escrow contract
}
interface IMOLOCH {
// brief interface for moloch dao v2
function depositToken() external view returns (address);
function tokenWhitelist(address token) external view returns (bool);
function getProposalFlags(uint256 proposalId)
external
view
returns (bool[6] memory);
function members(address user)
external
view
returns (
address,
uint256,
uint256,
bool,
uint256,
uint256
);
function userTokenBalances(address user, address token)
external
view
returns (uint256);
function cancelProposal(uint256 proposalId) external;
function submitProposal(
address applicant,
uint256 sharesRequested,
uint256 lootRequested,
uint256 tributeOffered,
address tributeToken,
uint256 paymentRequested,
address paymentToken,
string calldata details
) external returns (uint256);
function withdrawBalance(address token, uint256 amount) external;
}
/// @title EscrowMinion - Token escrow for ERC20, ERC721, ERC1155 tokens tied to Moloch DAO proposals
/// @dev Ties arbitrary token escrow to a Moloch DAO proposal
/// Can be used to tribute tokens in exchange for shares, loot, or DAO funds
///
/// Any number and combinations of tokens can be escrowed
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// If proposal passes, tokens become withdrawable to destination - usually a Gnosis Safe or Minion
/// If proposal fails, or cancelled before sponsorship, token become withdrawable to applicant
///
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// @author Isaac Patka, Dekan Brown
contract EscrowMinion is
IERC721Receiver,
ReentrancyGuard,
IERC1155PartialReceiver
{
using Address for address; /*Address library provides isContract function*/
using SafeERC20 for IERC20; /*SafeERC20 automatically checks optional return*/
// Track token tribute type to use so we know what transfer interface to use
enum TributeType {
ERC20,
ERC721,
ERC1155
}
// Track the balance and withdrawl state for each token
struct EscrowBalance {
uint256[3] typesTokenIdsAmounts; /*Tribute type | ID (for 721, 1155) | Amount (for 20, 1155)*/
address tokenAddress; /* Address of tribute token */
bool executed; /* Track if this specific token has been withdrawn*/
}
// Store destination vault and proposer for each proposal
struct TributeEscrowAction {
address vaultAddress; /*Destination for escrow tokens - must be token receiver*/
address proposer; /*Applicant address*/
}
mapping(address => mapping(uint256 => TributeEscrowAction)) public actions; /*moloch => proposalId => Action*/
mapping(address => mapping(uint256 => mapping(uint256 => EscrowBalance)))
public escrowBalances; /* moloch => proposal => token index => balance */
/*
* Moloch proposal ID
* Applicant addr
* Moloch addr
* escrow token addr
* escrow token types
* escrow token IDs (721, 1155)
* amounts (20, 1155)
* destination for escrow
*/
event ProposeAction(
uint256 proposalId,
address proposer,
address moloch,
address[] tokens,
uint256[] types,
uint256[] tokenIds,
uint256[] amounts,
address destinationVault
);
event ExecuteAction(uint256 proposalId, address executor, address moloch);
event ActionCanceled(uint256 proposalId, address moloch);
// internal tracking for destinations to ensure escrow can't get stuck
// Track if already checked so we don't do it multiple times per proposal
mapping(TributeType => uint256) internal destinationChecked_;
uint256 internal constant NOTCHECKED_ = 1;
uint256 internal constant CHECKED_ = 2;
/// @dev Construtor sets the status of the destination checkers
constructor() {
}
// Reset the destination checkers for the next proposal
modifier safeDestination() {
}
// Safely receive ERC721s
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
// Safely receive ERC1155s
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
/**
* @dev internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address _operator,
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev internal function to invoke {IERC1155-onERC1155Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _id uint256 ID of the token to be transferred
* @param _amount uint256 amount of token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC1155Received(
address _operator,
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC721Recipients(address _vaultAddress, address _applicantAddress) internal {
require(<FILL_ME>)
require(
_checkOnERC721Received(
address(this),
address(this),
_applicantAddress,
0,
""
),
"!ERC721"
);
// Mark 721 as checked so we don't check again during this tx
destinationChecked_[TributeType.ERC721] = CHECKED_;
}
/**
* @dev Internal function to invoke {IERC1155Receiver-onERC1155Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC1155Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to move token into or out of escrow depending on type
* Only valid for 721, 1155, 20
*
* @param _tokenAddress Token to escrow
* @param _typesTokenIdsAmounts Type: 0-20, 1-721, 2-1155 TokenIds: for 721, 1155 Amounts: for 20, 1155
* @param _from Sender (applicant or this)
* @param _to Recipient (this or applicant or destination)
*/
function doTransfer(
address _tokenAddress,
uint256[3] memory _typesTokenIdsAmounts,
address _from,
address _to
) internal {
}
/**
* @dev Internal function to move token into escrow on proposal
*
* @param _molochAddress Moloch to read proposal data from
* @param _tokenAddresses Addresses of tokens to escrow
* @param _typesTokenIdsAmounts ERC20, 721, or 1155 | id for 721, 1155 | amount for 20, 1155
* @param _vaultAddress Addresses of destination of proposal successful
* @param _proposalId ID of Moloch proposal for this escrow
*/
function processTributeProposal(
address _molochAddress,
address[] memory _tokenAddresses,
uint256[3][] memory _typesTokenIdsAmounts,
address _vaultAddress,
uint256 _proposalId
) internal {
}
// -- Proposal Functions --
/**
* @notice Creates a proposal and moves NFT into escrow
* @param _molochAddress Address of DAO
* @param _tokenAddresses Token contract address
* @param _typesTokenIdsAmounts Token id.
* @param _vaultAddress Address of DAO's NFT vault
* @param _requestSharesLootFunds Amount of shares requested
// add funding request token
* @param _details Info about proposal
*/
function proposeTribute(
address _molochAddress,
address[] calldata _tokenAddresses,
uint256[3][] calldata _typesTokenIdsAmounts,
address _vaultAddress,
uint256[3] calldata _requestSharesLootFunds, // also request loot or treasury funds
string calldata _details
) external nonReentrant safeDestination returns (uint256) {
}
/**
* @notice Internal function to move tokens to destination ones it can be processed or has been cancelled
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
* @param _destination Address of DAO's NFT vault or Applicant if failed/ cancelled
* @param _proposalId Moloch proposal ID
*/
function processWithdrawls(
address _molochAddress,
uint256[] calldata _tokenIndices, // only withdraw indices in this list
address _destination,
uint256 _proposalId
) internal {
}
/**
* @notice External function to move tokens to destination ones it can be processed or has been cancelled
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
*/
function withdrawToDestination(
uint256 _proposalId,
address _molochAddress,
uint256[] calldata _tokenIndices
) external nonReentrant {
}
/**
* @notice External function to cancel proposal by applicant if not sponsored
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
*/
function cancelAction(uint256 _proposalId, address _molochAddress)
external
nonReentrant
{
}
}
| _checkOnERC721Received(address(this),address(this),_vaultAddress,0,""),"!ERC721" | 54,860 | _checkOnERC721Received(address(this),address(this),_vaultAddress,0,"") |
"!ERC721" | // Based on https://github.com/HausDAO/MinionSummoner/blob/main/MinionFactory.sol
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
interface IERC721 {
// brief interface for minion erc721 token txs
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface IERC1155 {
// brief interface for minion erc1155 token txs
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
}
interface IERC721Receiver {
// Safely receive ERC721 tokens
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC1155PartialReceiver {
// Safely receive ERC1155 tokens
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
// ERC1155 batch receive not implemented in this escrow contract
}
interface IMOLOCH {
// brief interface for moloch dao v2
function depositToken() external view returns (address);
function tokenWhitelist(address token) external view returns (bool);
function getProposalFlags(uint256 proposalId)
external
view
returns (bool[6] memory);
function members(address user)
external
view
returns (
address,
uint256,
uint256,
bool,
uint256,
uint256
);
function userTokenBalances(address user, address token)
external
view
returns (uint256);
function cancelProposal(uint256 proposalId) external;
function submitProposal(
address applicant,
uint256 sharesRequested,
uint256 lootRequested,
uint256 tributeOffered,
address tributeToken,
uint256 paymentRequested,
address paymentToken,
string calldata details
) external returns (uint256);
function withdrawBalance(address token, uint256 amount) external;
}
/// @title EscrowMinion - Token escrow for ERC20, ERC721, ERC1155 tokens tied to Moloch DAO proposals
/// @dev Ties arbitrary token escrow to a Moloch DAO proposal
/// Can be used to tribute tokens in exchange for shares, loot, or DAO funds
///
/// Any number and combinations of tokens can be escrowed
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// If proposal passes, tokens become withdrawable to destination - usually a Gnosis Safe or Minion
/// If proposal fails, or cancelled before sponsorship, token become withdrawable to applicant
///
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// @author Isaac Patka, Dekan Brown
contract EscrowMinion is
IERC721Receiver,
ReentrancyGuard,
IERC1155PartialReceiver
{
using Address for address; /*Address library provides isContract function*/
using SafeERC20 for IERC20; /*SafeERC20 automatically checks optional return*/
// Track token tribute type to use so we know what transfer interface to use
enum TributeType {
ERC20,
ERC721,
ERC1155
}
// Track the balance and withdrawl state for each token
struct EscrowBalance {
uint256[3] typesTokenIdsAmounts; /*Tribute type | ID (for 721, 1155) | Amount (for 20, 1155)*/
address tokenAddress; /* Address of tribute token */
bool executed; /* Track if this specific token has been withdrawn*/
}
// Store destination vault and proposer for each proposal
struct TributeEscrowAction {
address vaultAddress; /*Destination for escrow tokens - must be token receiver*/
address proposer; /*Applicant address*/
}
mapping(address => mapping(uint256 => TributeEscrowAction)) public actions; /*moloch => proposalId => Action*/
mapping(address => mapping(uint256 => mapping(uint256 => EscrowBalance)))
public escrowBalances; /* moloch => proposal => token index => balance */
/*
* Moloch proposal ID
* Applicant addr
* Moloch addr
* escrow token addr
* escrow token types
* escrow token IDs (721, 1155)
* amounts (20, 1155)
* destination for escrow
*/
event ProposeAction(
uint256 proposalId,
address proposer,
address moloch,
address[] tokens,
uint256[] types,
uint256[] tokenIds,
uint256[] amounts,
address destinationVault
);
event ExecuteAction(uint256 proposalId, address executor, address moloch);
event ActionCanceled(uint256 proposalId, address moloch);
// internal tracking for destinations to ensure escrow can't get stuck
// Track if already checked so we don't do it multiple times per proposal
mapping(TributeType => uint256) internal destinationChecked_;
uint256 internal constant NOTCHECKED_ = 1;
uint256 internal constant CHECKED_ = 2;
/// @dev Construtor sets the status of the destination checkers
constructor() {
}
// Reset the destination checkers for the next proposal
modifier safeDestination() {
}
// Safely receive ERC721s
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
// Safely receive ERC1155s
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
/**
* @dev internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address _operator,
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev internal function to invoke {IERC1155-onERC1155Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _id uint256 ID of the token to be transferred
* @param _amount uint256 amount of token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC1155Received(
address _operator,
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC721Recipients(address _vaultAddress, address _applicantAddress) internal {
require(
_checkOnERC721Received(
address(this),
address(this),
_vaultAddress,
0,
""
),
"!ERC721"
);
require(<FILL_ME>)
// Mark 721 as checked so we don't check again during this tx
destinationChecked_[TributeType.ERC721] = CHECKED_;
}
/**
* @dev Internal function to invoke {IERC1155Receiver-onERC1155Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC1155Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to move token into or out of escrow depending on type
* Only valid for 721, 1155, 20
*
* @param _tokenAddress Token to escrow
* @param _typesTokenIdsAmounts Type: 0-20, 1-721, 2-1155 TokenIds: for 721, 1155 Amounts: for 20, 1155
* @param _from Sender (applicant or this)
* @param _to Recipient (this or applicant or destination)
*/
function doTransfer(
address _tokenAddress,
uint256[3] memory _typesTokenIdsAmounts,
address _from,
address _to
) internal {
}
/**
* @dev Internal function to move token into escrow on proposal
*
* @param _molochAddress Moloch to read proposal data from
* @param _tokenAddresses Addresses of tokens to escrow
* @param _typesTokenIdsAmounts ERC20, 721, or 1155 | id for 721, 1155 | amount for 20, 1155
* @param _vaultAddress Addresses of destination of proposal successful
* @param _proposalId ID of Moloch proposal for this escrow
*/
function processTributeProposal(
address _molochAddress,
address[] memory _tokenAddresses,
uint256[3][] memory _typesTokenIdsAmounts,
address _vaultAddress,
uint256 _proposalId
) internal {
}
// -- Proposal Functions --
/**
* @notice Creates a proposal and moves NFT into escrow
* @param _molochAddress Address of DAO
* @param _tokenAddresses Token contract address
* @param _typesTokenIdsAmounts Token id.
* @param _vaultAddress Address of DAO's NFT vault
* @param _requestSharesLootFunds Amount of shares requested
// add funding request token
* @param _details Info about proposal
*/
function proposeTribute(
address _molochAddress,
address[] calldata _tokenAddresses,
uint256[3][] calldata _typesTokenIdsAmounts,
address _vaultAddress,
uint256[3] calldata _requestSharesLootFunds, // also request loot or treasury funds
string calldata _details
) external nonReentrant safeDestination returns (uint256) {
}
/**
* @notice Internal function to move tokens to destination ones it can be processed or has been cancelled
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
* @param _destination Address of DAO's NFT vault or Applicant if failed/ cancelled
* @param _proposalId Moloch proposal ID
*/
function processWithdrawls(
address _molochAddress,
uint256[] calldata _tokenIndices, // only withdraw indices in this list
address _destination,
uint256 _proposalId
) internal {
}
/**
* @notice External function to move tokens to destination ones it can be processed or has been cancelled
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
*/
function withdrawToDestination(
uint256 _proposalId,
address _molochAddress,
uint256[] calldata _tokenIndices
) external nonReentrant {
}
/**
* @notice External function to cancel proposal by applicant if not sponsored
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
*/
function cancelAction(uint256 _proposalId, address _molochAddress)
external
nonReentrant
{
}
}
| _checkOnERC721Received(address(this),address(this),_applicantAddress,0,""),"!ERC721" | 54,860 | _checkOnERC721Received(address(this),address(this),_applicantAddress,0,"") |
"!ERC1155" | // Based on https://github.com/HausDAO/MinionSummoner/blob/main/MinionFactory.sol
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
interface IERC721 {
// brief interface for minion erc721 token txs
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface IERC1155 {
// brief interface for minion erc1155 token txs
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
}
interface IERC721Receiver {
// Safely receive ERC721 tokens
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC1155PartialReceiver {
// Safely receive ERC1155 tokens
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
// ERC1155 batch receive not implemented in this escrow contract
}
interface IMOLOCH {
// brief interface for moloch dao v2
function depositToken() external view returns (address);
function tokenWhitelist(address token) external view returns (bool);
function getProposalFlags(uint256 proposalId)
external
view
returns (bool[6] memory);
function members(address user)
external
view
returns (
address,
uint256,
uint256,
bool,
uint256,
uint256
);
function userTokenBalances(address user, address token)
external
view
returns (uint256);
function cancelProposal(uint256 proposalId) external;
function submitProposal(
address applicant,
uint256 sharesRequested,
uint256 lootRequested,
uint256 tributeOffered,
address tributeToken,
uint256 paymentRequested,
address paymentToken,
string calldata details
) external returns (uint256);
function withdrawBalance(address token, uint256 amount) external;
}
/// @title EscrowMinion - Token escrow for ERC20, ERC721, ERC1155 tokens tied to Moloch DAO proposals
/// @dev Ties arbitrary token escrow to a Moloch DAO proposal
/// Can be used to tribute tokens in exchange for shares, loot, or DAO funds
///
/// Any number and combinations of tokens can be escrowed
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// If proposal passes, tokens become withdrawable to destination - usually a Gnosis Safe or Minion
/// If proposal fails, or cancelled before sponsorship, token become withdrawable to applicant
///
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// @author Isaac Patka, Dekan Brown
contract EscrowMinion is
IERC721Receiver,
ReentrancyGuard,
IERC1155PartialReceiver
{
using Address for address; /*Address library provides isContract function*/
using SafeERC20 for IERC20; /*SafeERC20 automatically checks optional return*/
// Track token tribute type to use so we know what transfer interface to use
enum TributeType {
ERC20,
ERC721,
ERC1155
}
// Track the balance and withdrawl state for each token
struct EscrowBalance {
uint256[3] typesTokenIdsAmounts; /*Tribute type | ID (for 721, 1155) | Amount (for 20, 1155)*/
address tokenAddress; /* Address of tribute token */
bool executed; /* Track if this specific token has been withdrawn*/
}
// Store destination vault and proposer for each proposal
struct TributeEscrowAction {
address vaultAddress; /*Destination for escrow tokens - must be token receiver*/
address proposer; /*Applicant address*/
}
mapping(address => mapping(uint256 => TributeEscrowAction)) public actions; /*moloch => proposalId => Action*/
mapping(address => mapping(uint256 => mapping(uint256 => EscrowBalance)))
public escrowBalances; /* moloch => proposal => token index => balance */
/*
* Moloch proposal ID
* Applicant addr
* Moloch addr
* escrow token addr
* escrow token types
* escrow token IDs (721, 1155)
* amounts (20, 1155)
* destination for escrow
*/
event ProposeAction(
uint256 proposalId,
address proposer,
address moloch,
address[] tokens,
uint256[] types,
uint256[] tokenIds,
uint256[] amounts,
address destinationVault
);
event ExecuteAction(uint256 proposalId, address executor, address moloch);
event ActionCanceled(uint256 proposalId, address moloch);
// internal tracking for destinations to ensure escrow can't get stuck
// Track if already checked so we don't do it multiple times per proposal
mapping(TributeType => uint256) internal destinationChecked_;
uint256 internal constant NOTCHECKED_ = 1;
uint256 internal constant CHECKED_ = 2;
/// @dev Construtor sets the status of the destination checkers
constructor() {
}
// Reset the destination checkers for the next proposal
modifier safeDestination() {
}
// Safely receive ERC721s
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
// Safely receive ERC1155s
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
/**
* @dev internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address _operator,
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev internal function to invoke {IERC1155-onERC1155Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _id uint256 ID of the token to be transferred
* @param _amount uint256 amount of token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC1155Received(
address _operator,
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC721Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to invoke {IERC1155Receiver-onERC1155Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC1155Recipients(address _vaultAddress, address _applicantAddress) internal {
require(<FILL_ME>)
require(
_checkOnERC1155Received(
address(this),
address(this),
_applicantAddress,
0,
0,
""
),
"!ERC1155"
);
// Mark 1155 as checked so we don't check again during this tx
destinationChecked_[TributeType.ERC1155] = CHECKED_;
}
/**
* @dev Internal function to move token into or out of escrow depending on type
* Only valid for 721, 1155, 20
*
* @param _tokenAddress Token to escrow
* @param _typesTokenIdsAmounts Type: 0-20, 1-721, 2-1155 TokenIds: for 721, 1155 Amounts: for 20, 1155
* @param _from Sender (applicant or this)
* @param _to Recipient (this or applicant or destination)
*/
function doTransfer(
address _tokenAddress,
uint256[3] memory _typesTokenIdsAmounts,
address _from,
address _to
) internal {
}
/**
* @dev Internal function to move token into escrow on proposal
*
* @param _molochAddress Moloch to read proposal data from
* @param _tokenAddresses Addresses of tokens to escrow
* @param _typesTokenIdsAmounts ERC20, 721, or 1155 | id for 721, 1155 | amount for 20, 1155
* @param _vaultAddress Addresses of destination of proposal successful
* @param _proposalId ID of Moloch proposal for this escrow
*/
function processTributeProposal(
address _molochAddress,
address[] memory _tokenAddresses,
uint256[3][] memory _typesTokenIdsAmounts,
address _vaultAddress,
uint256 _proposalId
) internal {
}
// -- Proposal Functions --
/**
* @notice Creates a proposal and moves NFT into escrow
* @param _molochAddress Address of DAO
* @param _tokenAddresses Token contract address
* @param _typesTokenIdsAmounts Token id.
* @param _vaultAddress Address of DAO's NFT vault
* @param _requestSharesLootFunds Amount of shares requested
// add funding request token
* @param _details Info about proposal
*/
function proposeTribute(
address _molochAddress,
address[] calldata _tokenAddresses,
uint256[3][] calldata _typesTokenIdsAmounts,
address _vaultAddress,
uint256[3] calldata _requestSharesLootFunds, // also request loot or treasury funds
string calldata _details
) external nonReentrant safeDestination returns (uint256) {
}
/**
* @notice Internal function to move tokens to destination ones it can be processed or has been cancelled
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
* @param _destination Address of DAO's NFT vault or Applicant if failed/ cancelled
* @param _proposalId Moloch proposal ID
*/
function processWithdrawls(
address _molochAddress,
uint256[] calldata _tokenIndices, // only withdraw indices in this list
address _destination,
uint256 _proposalId
) internal {
}
/**
* @notice External function to move tokens to destination ones it can be processed or has been cancelled
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
*/
function withdrawToDestination(
uint256 _proposalId,
address _molochAddress,
uint256[] calldata _tokenIndices
) external nonReentrant {
}
/**
* @notice External function to cancel proposal by applicant if not sponsored
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
*/
function cancelAction(uint256 _proposalId, address _molochAddress)
external
nonReentrant
{
}
}
| _checkOnERC1155Received(address(this),address(this),_vaultAddress,0,0,""),"!ERC1155" | 54,860 | _checkOnERC1155Received(address(this),address(this),_vaultAddress,0,0,"") |
"!ERC1155" | // Based on https://github.com/HausDAO/MinionSummoner/blob/main/MinionFactory.sol
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
interface IERC721 {
// brief interface for minion erc721 token txs
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface IERC1155 {
// brief interface for minion erc1155 token txs
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
}
interface IERC721Receiver {
// Safely receive ERC721 tokens
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC1155PartialReceiver {
// Safely receive ERC1155 tokens
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
// ERC1155 batch receive not implemented in this escrow contract
}
interface IMOLOCH {
// brief interface for moloch dao v2
function depositToken() external view returns (address);
function tokenWhitelist(address token) external view returns (bool);
function getProposalFlags(uint256 proposalId)
external
view
returns (bool[6] memory);
function members(address user)
external
view
returns (
address,
uint256,
uint256,
bool,
uint256,
uint256
);
function userTokenBalances(address user, address token)
external
view
returns (uint256);
function cancelProposal(uint256 proposalId) external;
function submitProposal(
address applicant,
uint256 sharesRequested,
uint256 lootRequested,
uint256 tributeOffered,
address tributeToken,
uint256 paymentRequested,
address paymentToken,
string calldata details
) external returns (uint256);
function withdrawBalance(address token, uint256 amount) external;
}
/// @title EscrowMinion - Token escrow for ERC20, ERC721, ERC1155 tokens tied to Moloch DAO proposals
/// @dev Ties arbitrary token escrow to a Moloch DAO proposal
/// Can be used to tribute tokens in exchange for shares, loot, or DAO funds
///
/// Any number and combinations of tokens can be escrowed
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// If proposal passes, tokens become withdrawable to destination - usually a Gnosis Safe or Minion
/// If proposal fails, or cancelled before sponsorship, token become withdrawable to applicant
///
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// @author Isaac Patka, Dekan Brown
contract EscrowMinion is
IERC721Receiver,
ReentrancyGuard,
IERC1155PartialReceiver
{
using Address for address; /*Address library provides isContract function*/
using SafeERC20 for IERC20; /*SafeERC20 automatically checks optional return*/
// Track token tribute type to use so we know what transfer interface to use
enum TributeType {
ERC20,
ERC721,
ERC1155
}
// Track the balance and withdrawl state for each token
struct EscrowBalance {
uint256[3] typesTokenIdsAmounts; /*Tribute type | ID (for 721, 1155) | Amount (for 20, 1155)*/
address tokenAddress; /* Address of tribute token */
bool executed; /* Track if this specific token has been withdrawn*/
}
// Store destination vault and proposer for each proposal
struct TributeEscrowAction {
address vaultAddress; /*Destination for escrow tokens - must be token receiver*/
address proposer; /*Applicant address*/
}
mapping(address => mapping(uint256 => TributeEscrowAction)) public actions; /*moloch => proposalId => Action*/
mapping(address => mapping(uint256 => mapping(uint256 => EscrowBalance)))
public escrowBalances; /* moloch => proposal => token index => balance */
/*
* Moloch proposal ID
* Applicant addr
* Moloch addr
* escrow token addr
* escrow token types
* escrow token IDs (721, 1155)
* amounts (20, 1155)
* destination for escrow
*/
event ProposeAction(
uint256 proposalId,
address proposer,
address moloch,
address[] tokens,
uint256[] types,
uint256[] tokenIds,
uint256[] amounts,
address destinationVault
);
event ExecuteAction(uint256 proposalId, address executor, address moloch);
event ActionCanceled(uint256 proposalId, address moloch);
// internal tracking for destinations to ensure escrow can't get stuck
// Track if already checked so we don't do it multiple times per proposal
mapping(TributeType => uint256) internal destinationChecked_;
uint256 internal constant NOTCHECKED_ = 1;
uint256 internal constant CHECKED_ = 2;
/// @dev Construtor sets the status of the destination checkers
constructor() {
}
// Reset the destination checkers for the next proposal
modifier safeDestination() {
}
// Safely receive ERC721s
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
// Safely receive ERC1155s
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
/**
* @dev internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address _operator,
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev internal function to invoke {IERC1155-onERC1155Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _id uint256 ID of the token to be transferred
* @param _amount uint256 amount of token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC1155Received(
address _operator,
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC721Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to invoke {IERC1155Receiver-onERC1155Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC1155Recipients(address _vaultAddress, address _applicantAddress) internal {
require(
_checkOnERC1155Received(
address(this),
address(this),
_vaultAddress,
0,
0,
""
),
"!ERC1155"
);
require(<FILL_ME>)
// Mark 1155 as checked so we don't check again during this tx
destinationChecked_[TributeType.ERC1155] = CHECKED_;
}
/**
* @dev Internal function to move token into or out of escrow depending on type
* Only valid for 721, 1155, 20
*
* @param _tokenAddress Token to escrow
* @param _typesTokenIdsAmounts Type: 0-20, 1-721, 2-1155 TokenIds: for 721, 1155 Amounts: for 20, 1155
* @param _from Sender (applicant or this)
* @param _to Recipient (this or applicant or destination)
*/
function doTransfer(
address _tokenAddress,
uint256[3] memory _typesTokenIdsAmounts,
address _from,
address _to
) internal {
}
/**
* @dev Internal function to move token into escrow on proposal
*
* @param _molochAddress Moloch to read proposal data from
* @param _tokenAddresses Addresses of tokens to escrow
* @param _typesTokenIdsAmounts ERC20, 721, or 1155 | id for 721, 1155 | amount for 20, 1155
* @param _vaultAddress Addresses of destination of proposal successful
* @param _proposalId ID of Moloch proposal for this escrow
*/
function processTributeProposal(
address _molochAddress,
address[] memory _tokenAddresses,
uint256[3][] memory _typesTokenIdsAmounts,
address _vaultAddress,
uint256 _proposalId
) internal {
}
// -- Proposal Functions --
/**
* @notice Creates a proposal and moves NFT into escrow
* @param _molochAddress Address of DAO
* @param _tokenAddresses Token contract address
* @param _typesTokenIdsAmounts Token id.
* @param _vaultAddress Address of DAO's NFT vault
* @param _requestSharesLootFunds Amount of shares requested
// add funding request token
* @param _details Info about proposal
*/
function proposeTribute(
address _molochAddress,
address[] calldata _tokenAddresses,
uint256[3][] calldata _typesTokenIdsAmounts,
address _vaultAddress,
uint256[3] calldata _requestSharesLootFunds, // also request loot or treasury funds
string calldata _details
) external nonReentrant safeDestination returns (uint256) {
}
/**
* @notice Internal function to move tokens to destination ones it can be processed or has been cancelled
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
* @param _destination Address of DAO's NFT vault or Applicant if failed/ cancelled
* @param _proposalId Moloch proposal ID
*/
function processWithdrawls(
address _molochAddress,
uint256[] calldata _tokenIndices, // only withdraw indices in this list
address _destination,
uint256 _proposalId
) internal {
}
/**
* @notice External function to move tokens to destination ones it can be processed or has been cancelled
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
*/
function withdrawToDestination(
uint256 _proposalId,
address _molochAddress,
uint256[] calldata _tokenIndices
) external nonReentrant {
}
/**
* @notice External function to cancel proposal by applicant if not sponsored
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
*/
function cancelAction(uint256 _proposalId, address _molochAddress)
external
nonReentrant
{
}
}
| _checkOnERC1155Received(address(this),address(this),_applicantAddress,0,0,""),"!ERC1155" | 54,860 | _checkOnERC1155Received(address(this),address(this),_applicantAddress,0,0,"") |
"!amount" | // Based on https://github.com/HausDAO/MinionSummoner/blob/main/MinionFactory.sol
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
interface IERC721 {
// brief interface for minion erc721 token txs
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface IERC1155 {
// brief interface for minion erc1155 token txs
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
}
interface IERC721Receiver {
// Safely receive ERC721 tokens
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC1155PartialReceiver {
// Safely receive ERC1155 tokens
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
// ERC1155 batch receive not implemented in this escrow contract
}
interface IMOLOCH {
// brief interface for moloch dao v2
function depositToken() external view returns (address);
function tokenWhitelist(address token) external view returns (bool);
function getProposalFlags(uint256 proposalId)
external
view
returns (bool[6] memory);
function members(address user)
external
view
returns (
address,
uint256,
uint256,
bool,
uint256,
uint256
);
function userTokenBalances(address user, address token)
external
view
returns (uint256);
function cancelProposal(uint256 proposalId) external;
function submitProposal(
address applicant,
uint256 sharesRequested,
uint256 lootRequested,
uint256 tributeOffered,
address tributeToken,
uint256 paymentRequested,
address paymentToken,
string calldata details
) external returns (uint256);
function withdrawBalance(address token, uint256 amount) external;
}
/// @title EscrowMinion - Token escrow for ERC20, ERC721, ERC1155 tokens tied to Moloch DAO proposals
/// @dev Ties arbitrary token escrow to a Moloch DAO proposal
/// Can be used to tribute tokens in exchange for shares, loot, or DAO funds
///
/// Any number and combinations of tokens can be escrowed
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// If proposal passes, tokens become withdrawable to destination - usually a Gnosis Safe or Minion
/// If proposal fails, or cancelled before sponsorship, token become withdrawable to applicant
///
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// @author Isaac Patka, Dekan Brown
contract EscrowMinion is
IERC721Receiver,
ReentrancyGuard,
IERC1155PartialReceiver
{
using Address for address; /*Address library provides isContract function*/
using SafeERC20 for IERC20; /*SafeERC20 automatically checks optional return*/
// Track token tribute type to use so we know what transfer interface to use
enum TributeType {
ERC20,
ERC721,
ERC1155
}
// Track the balance and withdrawl state for each token
struct EscrowBalance {
uint256[3] typesTokenIdsAmounts; /*Tribute type | ID (for 721, 1155) | Amount (for 20, 1155)*/
address tokenAddress; /* Address of tribute token */
bool executed; /* Track if this specific token has been withdrawn*/
}
// Store destination vault and proposer for each proposal
struct TributeEscrowAction {
address vaultAddress; /*Destination for escrow tokens - must be token receiver*/
address proposer; /*Applicant address*/
}
mapping(address => mapping(uint256 => TributeEscrowAction)) public actions; /*moloch => proposalId => Action*/
mapping(address => mapping(uint256 => mapping(uint256 => EscrowBalance)))
public escrowBalances; /* moloch => proposal => token index => balance */
/*
* Moloch proposal ID
* Applicant addr
* Moloch addr
* escrow token addr
* escrow token types
* escrow token IDs (721, 1155)
* amounts (20, 1155)
* destination for escrow
*/
event ProposeAction(
uint256 proposalId,
address proposer,
address moloch,
address[] tokens,
uint256[] types,
uint256[] tokenIds,
uint256[] amounts,
address destinationVault
);
event ExecuteAction(uint256 proposalId, address executor, address moloch);
event ActionCanceled(uint256 proposalId, address moloch);
// internal tracking for destinations to ensure escrow can't get stuck
// Track if already checked so we don't do it multiple times per proposal
mapping(TributeType => uint256) internal destinationChecked_;
uint256 internal constant NOTCHECKED_ = 1;
uint256 internal constant CHECKED_ = 2;
/// @dev Construtor sets the status of the destination checkers
constructor() {
}
// Reset the destination checkers for the next proposal
modifier safeDestination() {
}
// Safely receive ERC721s
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
// Safely receive ERC1155s
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
/**
* @dev internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address _operator,
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev internal function to invoke {IERC1155-onERC1155Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _id uint256 ID of the token to be transferred
* @param _amount uint256 amount of token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC1155Received(
address _operator,
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC721Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to invoke {IERC1155Receiver-onERC1155Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC1155Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to move token into or out of escrow depending on type
* Only valid for 721, 1155, 20
*
* @param _tokenAddress Token to escrow
* @param _typesTokenIdsAmounts Type: 0-20, 1-721, 2-1155 TokenIds: for 721, 1155 Amounts: for 20, 1155
* @param _from Sender (applicant or this)
* @param _to Recipient (this or applicant or destination)
*/
function doTransfer(
address _tokenAddress,
uint256[3] memory _typesTokenIdsAmounts,
address _from,
address _to
) internal {
// Use 721 interface for 721
if (_typesTokenIdsAmounts[0] == uint256(TributeType.ERC721)) {
IERC721 _erc721 = IERC721(_tokenAddress);
_erc721.safeTransferFrom(_from, _to, _typesTokenIdsAmounts[1]);
// Use 20 interface for 20
} else if (_typesTokenIdsAmounts[0] == uint256(TributeType.ERC20)) {
// Fail if attempt to send 0 tokens
require(<FILL_ME>)
IERC20 _erc20 = IERC20(_tokenAddress);
if (_from == address(this)) {
_erc20.safeTransfer(_to, _typesTokenIdsAmounts[2]);
} else {
_erc20.safeTransferFrom(_from, _to, _typesTokenIdsAmounts[2]);
}
// use 1155 interface for 1155
} else if (_typesTokenIdsAmounts[0] == uint256(TributeType.ERC1155)) {
// Fail if attempt to send 0 tokens
require(_typesTokenIdsAmounts[2] != 0, "!amount");
IERC1155 _erc1155 = IERC1155(_tokenAddress);
_erc1155.safeTransferFrom(
_from,
_to,
_typesTokenIdsAmounts[1],
_typesTokenIdsAmounts[2],
""
);
} else {
revert("Invalid type");
}
}
/**
* @dev Internal function to move token into escrow on proposal
*
* @param _molochAddress Moloch to read proposal data from
* @param _tokenAddresses Addresses of tokens to escrow
* @param _typesTokenIdsAmounts ERC20, 721, or 1155 | id for 721, 1155 | amount for 20, 1155
* @param _vaultAddress Addresses of destination of proposal successful
* @param _proposalId ID of Moloch proposal for this escrow
*/
function processTributeProposal(
address _molochAddress,
address[] memory _tokenAddresses,
uint256[3][] memory _typesTokenIdsAmounts,
address _vaultAddress,
uint256 _proposalId
) internal {
}
// -- Proposal Functions --
/**
* @notice Creates a proposal and moves NFT into escrow
* @param _molochAddress Address of DAO
* @param _tokenAddresses Token contract address
* @param _typesTokenIdsAmounts Token id.
* @param _vaultAddress Address of DAO's NFT vault
* @param _requestSharesLootFunds Amount of shares requested
// add funding request token
* @param _details Info about proposal
*/
function proposeTribute(
address _molochAddress,
address[] calldata _tokenAddresses,
uint256[3][] calldata _typesTokenIdsAmounts,
address _vaultAddress,
uint256[3] calldata _requestSharesLootFunds, // also request loot or treasury funds
string calldata _details
) external nonReentrant safeDestination returns (uint256) {
}
/**
* @notice Internal function to move tokens to destination ones it can be processed or has been cancelled
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
* @param _destination Address of DAO's NFT vault or Applicant if failed/ cancelled
* @param _proposalId Moloch proposal ID
*/
function processWithdrawls(
address _molochAddress,
uint256[] calldata _tokenIndices, // only withdraw indices in this list
address _destination,
uint256 _proposalId
) internal {
}
/**
* @notice External function to move tokens to destination ones it can be processed or has been cancelled
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
*/
function withdrawToDestination(
uint256 _proposalId,
address _molochAddress,
uint256[] calldata _tokenIndices
) external nonReentrant {
}
/**
* @notice External function to cancel proposal by applicant if not sponsored
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
*/
function cancelAction(uint256 _proposalId, address _molochAddress)
external
nonReentrant
{
}
}
| _typesTokenIdsAmounts[2]!=0,"!amount" | 54,860 | _typesTokenIdsAmounts[2]!=0 |
"executed" | // Based on https://github.com/HausDAO/MinionSummoner/blob/main/MinionFactory.sol
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
interface IERC721 {
// brief interface for minion erc721 token txs
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface IERC1155 {
// brief interface for minion erc1155 token txs
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
}
interface IERC721Receiver {
// Safely receive ERC721 tokens
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC1155PartialReceiver {
// Safely receive ERC1155 tokens
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
// ERC1155 batch receive not implemented in this escrow contract
}
interface IMOLOCH {
// brief interface for moloch dao v2
function depositToken() external view returns (address);
function tokenWhitelist(address token) external view returns (bool);
function getProposalFlags(uint256 proposalId)
external
view
returns (bool[6] memory);
function members(address user)
external
view
returns (
address,
uint256,
uint256,
bool,
uint256,
uint256
);
function userTokenBalances(address user, address token)
external
view
returns (uint256);
function cancelProposal(uint256 proposalId) external;
function submitProposal(
address applicant,
uint256 sharesRequested,
uint256 lootRequested,
uint256 tributeOffered,
address tributeToken,
uint256 paymentRequested,
address paymentToken,
string calldata details
) external returns (uint256);
function withdrawBalance(address token, uint256 amount) external;
}
/// @title EscrowMinion - Token escrow for ERC20, ERC721, ERC1155 tokens tied to Moloch DAO proposals
/// @dev Ties arbitrary token escrow to a Moloch DAO proposal
/// Can be used to tribute tokens in exchange for shares, loot, or DAO funds
///
/// Any number and combinations of tokens can be escrowed
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// If proposal passes, tokens become withdrawable to destination - usually a Gnosis Safe or Minion
/// If proposal fails, or cancelled before sponsorship, token become withdrawable to applicant
///
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// @author Isaac Patka, Dekan Brown
contract EscrowMinion is
IERC721Receiver,
ReentrancyGuard,
IERC1155PartialReceiver
{
using Address for address; /*Address library provides isContract function*/
using SafeERC20 for IERC20; /*SafeERC20 automatically checks optional return*/
// Track token tribute type to use so we know what transfer interface to use
enum TributeType {
ERC20,
ERC721,
ERC1155
}
// Track the balance and withdrawl state for each token
struct EscrowBalance {
uint256[3] typesTokenIdsAmounts; /*Tribute type | ID (for 721, 1155) | Amount (for 20, 1155)*/
address tokenAddress; /* Address of tribute token */
bool executed; /* Track if this specific token has been withdrawn*/
}
// Store destination vault and proposer for each proposal
struct TributeEscrowAction {
address vaultAddress; /*Destination for escrow tokens - must be token receiver*/
address proposer; /*Applicant address*/
}
mapping(address => mapping(uint256 => TributeEscrowAction)) public actions; /*moloch => proposalId => Action*/
mapping(address => mapping(uint256 => mapping(uint256 => EscrowBalance)))
public escrowBalances; /* moloch => proposal => token index => balance */
/*
* Moloch proposal ID
* Applicant addr
* Moloch addr
* escrow token addr
* escrow token types
* escrow token IDs (721, 1155)
* amounts (20, 1155)
* destination for escrow
*/
event ProposeAction(
uint256 proposalId,
address proposer,
address moloch,
address[] tokens,
uint256[] types,
uint256[] tokenIds,
uint256[] amounts,
address destinationVault
);
event ExecuteAction(uint256 proposalId, address executor, address moloch);
event ActionCanceled(uint256 proposalId, address moloch);
// internal tracking for destinations to ensure escrow can't get stuck
// Track if already checked so we don't do it multiple times per proposal
mapping(TributeType => uint256) internal destinationChecked_;
uint256 internal constant NOTCHECKED_ = 1;
uint256 internal constant CHECKED_ = 2;
/// @dev Construtor sets the status of the destination checkers
constructor() {
}
// Reset the destination checkers for the next proposal
modifier safeDestination() {
}
// Safely receive ERC721s
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
// Safely receive ERC1155s
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
/**
* @dev internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address _operator,
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev internal function to invoke {IERC1155-onERC1155Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _id uint256 ID of the token to be transferred
* @param _amount uint256 amount of token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC1155Received(
address _operator,
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC721Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to invoke {IERC1155Receiver-onERC1155Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC1155Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to move token into or out of escrow depending on type
* Only valid for 721, 1155, 20
*
* @param _tokenAddress Token to escrow
* @param _typesTokenIdsAmounts Type: 0-20, 1-721, 2-1155 TokenIds: for 721, 1155 Amounts: for 20, 1155
* @param _from Sender (applicant or this)
* @param _to Recipient (this or applicant or destination)
*/
function doTransfer(
address _tokenAddress,
uint256[3] memory _typesTokenIdsAmounts,
address _from,
address _to
) internal {
}
/**
* @dev Internal function to move token into escrow on proposal
*
* @param _molochAddress Moloch to read proposal data from
* @param _tokenAddresses Addresses of tokens to escrow
* @param _typesTokenIdsAmounts ERC20, 721, or 1155 | id for 721, 1155 | amount for 20, 1155
* @param _vaultAddress Addresses of destination of proposal successful
* @param _proposalId ID of Moloch proposal for this escrow
*/
function processTributeProposal(
address _molochAddress,
address[] memory _tokenAddresses,
uint256[3][] memory _typesTokenIdsAmounts,
address _vaultAddress,
uint256 _proposalId
) internal {
}
// -- Proposal Functions --
/**
* @notice Creates a proposal and moves NFT into escrow
* @param _molochAddress Address of DAO
* @param _tokenAddresses Token contract address
* @param _typesTokenIdsAmounts Token id.
* @param _vaultAddress Address of DAO's NFT vault
* @param _requestSharesLootFunds Amount of shares requested
// add funding request token
* @param _details Info about proposal
*/
function proposeTribute(
address _molochAddress,
address[] calldata _tokenAddresses,
uint256[3][] calldata _typesTokenIdsAmounts,
address _vaultAddress,
uint256[3] calldata _requestSharesLootFunds, // also request loot or treasury funds
string calldata _details
) external nonReentrant safeDestination returns (uint256) {
}
/**
* @notice Internal function to move tokens to destination ones it can be processed or has been cancelled
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
* @param _destination Address of DAO's NFT vault or Applicant if failed/ cancelled
* @param _proposalId Moloch proposal ID
*/
function processWithdrawls(
address _molochAddress,
uint256[] calldata _tokenIndices, // only withdraw indices in this list
address _destination,
uint256 _proposalId
) internal {
for (uint256 _index = 0; _index < _tokenIndices.length; _index++) {
// Retrieve withdrawable balances
EscrowBalance storage _escrowBalance = escrowBalances[_molochAddress][
_proposalId
][_tokenIndices[_index]];
// Ensure this token has not been withdrawn
require(<FILL_ME>)
require(_escrowBalance.tokenAddress != address(0), "!token");
_escrowBalance.executed = true;
// Move tokens to
doTransfer(
_escrowBalance.tokenAddress,
_escrowBalance.typesTokenIdsAmounts,
address(this),
_destination
);
}
}
/**
* @notice External function to move tokens to destination ones it can be processed or has been cancelled
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
*/
function withdrawToDestination(
uint256 _proposalId,
address _molochAddress,
uint256[] calldata _tokenIndices
) external nonReentrant {
}
/**
* @notice External function to cancel proposal by applicant if not sponsored
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
*/
function cancelAction(uint256 _proposalId, address _molochAddress)
external
nonReentrant
{
}
}
| !_escrowBalance.executed,"executed" | 54,860 | !_escrowBalance.executed |
"proposal not processed and not cancelled" | // Based on https://github.com/HausDAO/MinionSummoner/blob/main/MinionFactory.sol
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
interface IERC721 {
// brief interface for minion erc721 token txs
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface IERC1155 {
// brief interface for minion erc1155 token txs
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
}
interface IERC721Receiver {
// Safely receive ERC721 tokens
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC1155PartialReceiver {
// Safely receive ERC1155 tokens
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
// ERC1155 batch receive not implemented in this escrow contract
}
interface IMOLOCH {
// brief interface for moloch dao v2
function depositToken() external view returns (address);
function tokenWhitelist(address token) external view returns (bool);
function getProposalFlags(uint256 proposalId)
external
view
returns (bool[6] memory);
function members(address user)
external
view
returns (
address,
uint256,
uint256,
bool,
uint256,
uint256
);
function userTokenBalances(address user, address token)
external
view
returns (uint256);
function cancelProposal(uint256 proposalId) external;
function submitProposal(
address applicant,
uint256 sharesRequested,
uint256 lootRequested,
uint256 tributeOffered,
address tributeToken,
uint256 paymentRequested,
address paymentToken,
string calldata details
) external returns (uint256);
function withdrawBalance(address token, uint256 amount) external;
}
/// @title EscrowMinion - Token escrow for ERC20, ERC721, ERC1155 tokens tied to Moloch DAO proposals
/// @dev Ties arbitrary token escrow to a Moloch DAO proposal
/// Can be used to tribute tokens in exchange for shares, loot, or DAO funds
///
/// Any number and combinations of tokens can be escrowed
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// If proposal passes, tokens become withdrawable to destination - usually a Gnosis Safe or Minion
/// If proposal fails, or cancelled before sponsorship, token become withdrawable to applicant
///
/// If any tokens become untransferable, the rest of the tokens in escrow can be released individually
///
/// @author Isaac Patka, Dekan Brown
contract EscrowMinion is
IERC721Receiver,
ReentrancyGuard,
IERC1155PartialReceiver
{
using Address for address; /*Address library provides isContract function*/
using SafeERC20 for IERC20; /*SafeERC20 automatically checks optional return*/
// Track token tribute type to use so we know what transfer interface to use
enum TributeType {
ERC20,
ERC721,
ERC1155
}
// Track the balance and withdrawl state for each token
struct EscrowBalance {
uint256[3] typesTokenIdsAmounts; /*Tribute type | ID (for 721, 1155) | Amount (for 20, 1155)*/
address tokenAddress; /* Address of tribute token */
bool executed; /* Track if this specific token has been withdrawn*/
}
// Store destination vault and proposer for each proposal
struct TributeEscrowAction {
address vaultAddress; /*Destination for escrow tokens - must be token receiver*/
address proposer; /*Applicant address*/
}
mapping(address => mapping(uint256 => TributeEscrowAction)) public actions; /*moloch => proposalId => Action*/
mapping(address => mapping(uint256 => mapping(uint256 => EscrowBalance)))
public escrowBalances; /* moloch => proposal => token index => balance */
/*
* Moloch proposal ID
* Applicant addr
* Moloch addr
* escrow token addr
* escrow token types
* escrow token IDs (721, 1155)
* amounts (20, 1155)
* destination for escrow
*/
event ProposeAction(
uint256 proposalId,
address proposer,
address moloch,
address[] tokens,
uint256[] types,
uint256[] tokenIds,
uint256[] amounts,
address destinationVault
);
event ExecuteAction(uint256 proposalId, address executor, address moloch);
event ActionCanceled(uint256 proposalId, address moloch);
// internal tracking for destinations to ensure escrow can't get stuck
// Track if already checked so we don't do it multiple times per proposal
mapping(TributeType => uint256) internal destinationChecked_;
uint256 internal constant NOTCHECKED_ = 1;
uint256 internal constant CHECKED_ = 2;
/// @dev Construtor sets the status of the destination checkers
constructor() {
}
// Reset the destination checkers for the next proposal
modifier safeDestination() {
}
// Safely receive ERC721s
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
// Safely receive ERC1155s
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
/**
* @dev internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address _operator,
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev internal function to invoke {IERC1155-onERC1155Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param _operator address representing the entity calling the function
* @param _from address representing the previous owner of the given token ID
* @param _to target address that will receive the tokens
* @param _id uint256 ID of the token to be transferred
* @param _amount uint256 amount of token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC1155Received(
address _operator,
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes memory _data
) internal returns (bool) {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC721Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to invoke {IERC1155Receiver-onERC1155Received} on both vault & applicant
* Ensures tokens cannot get stuck here due to interface issue
*
* @param _vaultAddress Destination for tokens on successful proposal
* @param _applicantAddress Destination for tokens on failed proposal
*/
function checkERC1155Recipients(address _vaultAddress, address _applicantAddress) internal {
}
/**
* @dev Internal function to move token into or out of escrow depending on type
* Only valid for 721, 1155, 20
*
* @param _tokenAddress Token to escrow
* @param _typesTokenIdsAmounts Type: 0-20, 1-721, 2-1155 TokenIds: for 721, 1155 Amounts: for 20, 1155
* @param _from Sender (applicant or this)
* @param _to Recipient (this or applicant or destination)
*/
function doTransfer(
address _tokenAddress,
uint256[3] memory _typesTokenIdsAmounts,
address _from,
address _to
) internal {
}
/**
* @dev Internal function to move token into escrow on proposal
*
* @param _molochAddress Moloch to read proposal data from
* @param _tokenAddresses Addresses of tokens to escrow
* @param _typesTokenIdsAmounts ERC20, 721, or 1155 | id for 721, 1155 | amount for 20, 1155
* @param _vaultAddress Addresses of destination of proposal successful
* @param _proposalId ID of Moloch proposal for this escrow
*/
function processTributeProposal(
address _molochAddress,
address[] memory _tokenAddresses,
uint256[3][] memory _typesTokenIdsAmounts,
address _vaultAddress,
uint256 _proposalId
) internal {
}
// -- Proposal Functions --
/**
* @notice Creates a proposal and moves NFT into escrow
* @param _molochAddress Address of DAO
* @param _tokenAddresses Token contract address
* @param _typesTokenIdsAmounts Token id.
* @param _vaultAddress Address of DAO's NFT vault
* @param _requestSharesLootFunds Amount of shares requested
// add funding request token
* @param _details Info about proposal
*/
function proposeTribute(
address _molochAddress,
address[] calldata _tokenAddresses,
uint256[3][] calldata _typesTokenIdsAmounts,
address _vaultAddress,
uint256[3] calldata _requestSharesLootFunds, // also request loot or treasury funds
string calldata _details
) external nonReentrant safeDestination returns (uint256) {
}
/**
* @notice Internal function to move tokens to destination ones it can be processed or has been cancelled
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
* @param _destination Address of DAO's NFT vault or Applicant if failed/ cancelled
* @param _proposalId Moloch proposal ID
*/
function processWithdrawls(
address _molochAddress,
uint256[] calldata _tokenIndices, // only withdraw indices in this list
address _destination,
uint256 _proposalId
) internal {
}
/**
* @notice External function to move tokens to destination ones it can be processed or has been cancelled
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
* @param _tokenIndices Indices in proposed tokens array - have to specify this so frozen tokens cant make the whole payload stuck
*/
function withdrawToDestination(
uint256 _proposalId,
address _molochAddress,
uint256[] calldata _tokenIndices
) external nonReentrant {
IMOLOCH _thisMoloch = IMOLOCH(_molochAddress);
bool[6] memory _flags = _thisMoloch.getProposalFlags(_proposalId);
require(<FILL_ME>)
TributeEscrowAction memory _action = actions[_molochAddress][_proposalId];
address _destination;
// if passed, send NFT to vault
if (_flags[2]) {
_destination = _action.vaultAddress;
// if failed or cancelled, send back to proposer
} else {
_destination = _action.proposer;
}
processWithdrawls(_molochAddress, _tokenIndices, _destination, _proposalId);
emit ExecuteAction(_proposalId, msg.sender, _molochAddress);
}
/**
* @notice External function to cancel proposal by applicant if not sponsored
* @param _proposalId Moloch proposal ID
* @param _molochAddress Address of DAO
*/
function cancelAction(uint256 _proposalId, address _molochAddress)
external
nonReentrant
{
}
}
| _flags[1]||_flags[3],"proposal not processed and not cancelled" | 54,860 | _flags[1]||_flags[3] |
'Restricted to snapshot maker.' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/access/AccessControl.sol';
contract ElyfiAccessControl is AccessControl {
bytes32 public constant SNAPSHOT_MAKER_ROLE = keccak256('SNAPSHOT_MAKER');
modifier onlySnapshotMaker() {
require(<FILL_ME>)
_;
}
modifier onlyAdmin() {
}
function isSnapshotMaker(address account) external view returns (bool) {
}
function _isSnapshotMaker(address account) internal view returns (bool) {
}
}
| _isSnapshotMaker(msg.sender),'Restricted to snapshot maker.' | 54,875 | _isSnapshotMaker(msg.sender) |
null | /*
██╗ ██╗██╗ ██╗██████╗ ███████╗ ██████╗ ██████╗ ██╗███╗ ███╗███████╗
██║ ██║██║ ██║██╔══██╗██╔════╝ ██╔══██╗██╔══██╗██║████╗ ████║██╔════╝
███████║███████║██████╔╝█████╗ ██████╔╝██████╔╝██║██╔████╔██║█████╗
██╔══██║██╔══██║██╔═══╝ ██╔══╝ ██╔═══╝ ██╔══██╗██║██║╚██╔╝██║██╔══╝
██║ ██║███████╗██║ ███████╗ ██║ ██║ ██║██║██║ ╚═╝ ██║███████╗
╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚══════╝
██████╗ ██╗ ██╗ ██████╗
██╔══██╗██║ ██║██╔═══██╗
██║ ██║███████║██║ ██║
██║ ██║██╔══██║██║ ██║
██████╔╝███████╗╚██████╔╝
╚═════╝ ╚══════╝ ╚═════╝
Telegram: https://t.me/HapeprimeDao
Website: https://hapeprimedao.com/
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract HAPEPRIMEDAO is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"HAPE PRIME DAO";
string public constant symbol = unicode"HAPEPRIME DAO";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 15;
uint public _sellFee = 15;
uint private _feeRate = 15;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
}
constructor (address payable TaxAdd) {
}
function balanceOf(address account) public view override returns (uint) {
}
function transfer(address recipient, uint amount) public override returns (bool) {
}
function totalSupply() public pure override returns (uint) {
}
function allowance(address owner, address spender) public view override returns (uint) {
}
function approve(address spender, uint amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint amount) private {
}
function _transfer(address from, address to, uint amount) private {
require(<FILL_ME>)
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
if((_launchedAt + (10 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once.");
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (10 minutes)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint amount) private {
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
}
function _takeTeam(uint team) private {
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
}
function openTrading() external onlyOwner() {
}
function manualswap() external {
}
function manualsend() external {
}
function setFeeRate(uint rate) external {
}
function setFees(uint buy, uint sell) external {
}
function toggleImpactFee(bool onoff) external {
}
function updateTaxAdd(address newAddress) external {
}
function thisBalance() public view returns (uint) {
}
function amountInPool() public view returns (uint) {
}
function setBots(address[] memory bots_) external onlyOwner() {
}
function delBots(address[] memory bots_) external {
}
function isBot(address ad) public view returns (bool) {
}
}
| !_isBot[from]&&!_isBot[to]&&!_isBot[msg.sender] | 54,888 | !_isBot[from]&&!_isBot[to]&&!_isBot[msg.sender] |
"Your sell cooldown has not expired." | /*
██╗ ██╗██╗ ██╗██████╗ ███████╗ ██████╗ ██████╗ ██╗███╗ ███╗███████╗
██║ ██║██║ ██║██╔══██╗██╔════╝ ██╔══██╗██╔══██╗██║████╗ ████║██╔════╝
███████║███████║██████╔╝█████╗ ██████╔╝██████╔╝██║██╔████╔██║█████╗
██╔══██║██╔══██║██╔═══╝ ██╔══╝ ██╔═══╝ ██╔══██╗██║██║╚██╔╝██║██╔══╝
██║ ██║███████╗██║ ███████╗ ██║ ██║ ██║██║██║ ╚═╝ ██║███████╗
╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚══════╝
██████╗ ██╗ ██╗ ██████╗
██╔══██╗██║ ██║██╔═══██╗
██║ ██║███████║██║ ██║
██║ ██║██╔══██║██║ ██║
██████╔╝███████╗╚██████╔╝
╚═════╝ ╚══════╝ ╚═════╝
Telegram: https://t.me/HapeprimeDao
Website: https://hapeprimedao.com/
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract HAPEPRIMEDAO is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"HAPE PRIME DAO";
string public constant symbol = unicode"HAPEPRIME DAO";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 15;
uint public _sellFee = 15;
uint private _feeRate = 15;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
}
constructor (address payable TaxAdd) {
}
function balanceOf(address account) public view override returns (uint) {
}
function transfer(address recipient, uint amount) public override returns (bool) {
}
function totalSupply() public pure override returns (uint) {
}
function allowance(address owner, address spender) public view override returns (uint) {
}
function approve(address spender, uint amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint amount) private {
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
if((_launchedAt + (10 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once.");
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (10 minutes)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(<FILL_ME>)
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint amount) private {
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
}
function _takeTeam(uint team) private {
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
}
function openTrading() external onlyOwner() {
}
function manualswap() external {
}
function manualsend() external {
}
function setFeeRate(uint rate) external {
}
function setFees(uint buy, uint sell) external {
}
function toggleImpactFee(bool onoff) external {
}
function updateTaxAdd(address newAddress) external {
}
function thisBalance() public view returns (uint) {
}
function amountInPool() public view returns (uint) {
}
function setBots(address[] memory bots_) external onlyOwner() {
}
function delBots(address[] memory bots_) external {
}
function isBot(address ad) public view returns (bool) {
}
}
| cooldown[from].buy<block.timestamp+(15seconds),"Your sell cooldown has not expired." | 54,888 | cooldown[from].buy<block.timestamp+(15seconds) |
null | /*
██╗ ██╗██╗ ██╗██████╗ ███████╗ ██████╗ ██████╗ ██╗███╗ ███╗███████╗
██║ ██║██║ ██║██╔══██╗██╔════╝ ██╔══██╗██╔══██╗██║████╗ ████║██╔════╝
███████║███████║██████╔╝█████╗ ██████╔╝██████╔╝██║██╔████╔██║█████╗
██╔══██║██╔══██║██╔═══╝ ██╔══╝ ██╔═══╝ ██╔══██╗██║██║╚██╔╝██║██╔══╝
██║ ██║███████╗██║ ███████╗ ██║ ██║ ██║██║██║ ╚═╝ ██║███████╗
╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚══════╝
██████╗ ██╗ ██╗ ██████╗
██╔══██╗██║ ██║██╔═══██╗
██║ ██║███████║██║ ██║
██║ ██║██╔══██║██║ ██║
██████╔╝███████╗╚██████╔╝
╚═════╝ ╚══════╝ ╚═════╝
Telegram: https://t.me/HapeprimeDao
Website: https://hapeprimedao.com/
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract HAPEPRIMEDAO is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"HAPE PRIME DAO";
string public constant symbol = unicode"HAPEPRIME DAO";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 15;
uint public _sellFee = 15;
uint private _feeRate = 15;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
}
constructor (address payable TaxAdd) {
}
function balanceOf(address account) public view override returns (uint) {
}
function transfer(address recipient, uint amount) public override returns (bool) {
}
function totalSupply() public pure override returns (uint) {
}
function allowance(address owner, address spender) public view override returns (uint) {
}
function approve(address spender, uint amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint amount) private {
}
function _transfer(address from, address to, uint amount) private {
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint amount) private {
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
}
function _takeTeam(uint team) private {
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
}
function openTrading() external onlyOwner() {
}
function manualswap() external {
//swapping the tax token to eth in case the route clogged
require(<FILL_ME>)
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
}
function setFeeRate(uint rate) external {
}
function setFees(uint buy, uint sell) external {
}
function toggleImpactFee(bool onoff) external {
}
function updateTaxAdd(address newAddress) external {
}
function thisBalance() public view returns (uint) {
}
function amountInPool() public view returns (uint) {
}
function setBots(address[] memory bots_) external onlyOwner() {
}
function delBots(address[] memory bots_) external {
}
function isBot(address ad) public view returns (bool) {
}
}
| _msgSender()==_TaxAdd | 54,888 | _msgSender()==_TaxAdd |
null | pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
}
function div(uint256 a, uint256 b) internal returns (uint256) {
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
}
function add(uint256 a, uint256 b) internal returns (uint256) {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
modifier stopInEmergency {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract Token {
uint256 public totalSupply;
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/* ERC 20 token */
contract CevacToken is Token,Ownable {
string public constant name = "Cevac Token";
string public constant symbol = "CEVAC";
uint256 public constant decimals = 8;
string public version = "1.0";
uint public valueToBeSent = 1;
bool public finalizedICO = false;
uint256 public ethraised;
uint256 public btcraised;
uint256 public usdraised;
uint256 public numberOfBackers;
bool public istransferAllowed;
uint256 public constant CevacFund = 36 * (10**8) * 10**decimals;
uint256 public fundingStartBlock; //start = 1533081600 //1 august 2018
uint256 public fundingEndBlock; ///end = 1585612800 ///31 march 2020
uint256 public tokenCreationMax= 1836 * (10**6) * 10**decimals;//TODO
mapping (address => bool) public ownership;
uint256 public minCapUSD = 210000000;
uint256 public maxCapUSD = 540000000;
address public ownerWallet = 0x46F525e84B5C59CA63a5E1503fa82dF98fBb026b;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
modifier onlyPayloadSize(uint size) {
}
function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns (bool success) {
}
function burnTokens(uint256 _value) public{
}
//this is the default constructor
function CevacToken(uint256 _fundingStartBlock, uint256 _fundingEndBlock){
}
///change the funding end block
function changeEndBlock(uint256 _newFundingEndBlock) public onlyOwner{
}
///change the funding start block
function changeStartBlock(uint256 _newFundingStartBlock) public onlyOwner{
}
///the Min Cap USD
///function too chage the miin cap usd
function changeMinCapUSD(uint256 _newMinCap) public onlyOwner{
}
///fucntion to change the max cap usd
function changeMaxCapUSD(uint256 _newMaxCap) public onlyOwner{
}
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) returns (bool success) {
}
function addToBalances(address _person,uint256 value) {
}
/**
This is to add the token sale platform ownership to send tokens
**/
function addToOwnership(address owners) onlyOwner{
}
/**
To be done after killing the old conttract else conflicts can take place
This is to remove the token sale platform ownership to send tokens
**/
function removeFromOwnership(address owners) onlyOwner{
}
function balanceOf(address _owner) view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) onlyPayloadSize(2 * 32) returns (bool success) {
}
function allowance(address _owner, address _spender) view returns (uint256 remaining) {
}
function increaseEthRaised(uint256 value){
require(<FILL_ME>)
ethraised+=value;
}
function increaseBTCRaised(uint256 value){
}
function increaseUSDRaised(uint256 value){
}
function finalizeICO() public{
}
function enableTransfers() public onlyOwner{
}
function disableTransfers() public onlyOwner{
}
//functiion to force finalize the ICO by the owner no checks called here
function finalizeICOOwner() onlyOwner{
}
function isValid() returns(bool){
}
///do not allow payments on this address
function() payable{
}
}
| ownership[msg.sender] | 54,920 | ownership[msg.sender] |
null | interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function allowance(address tokenOwner, address spender) external view returns (uint);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
function mint(address to, uint256 value) external returns (bool);
}
contract GrowHops is IGrowHops, Ownable, Pausable {
using SafeMath for *;
address public hopsAddress;
address public lessAddress;
struct PlanBase {
uint256 minimumAmount;
uint256 lockTime;
uint32 lessToHops;
bool isOpen;
}
struct Plan {
bytes32 planBaseId;
address plantuser;
uint256 lessAmount;
uint256 hopsAmount;
uint256 lockAt;
uint256 releaseAt;
bool isWithdrawn;
}
bytes32[] public planBaseIds;
mapping (bytes32 => bytes32[]) planIdsByPlanBase;
mapping (bytes32 => PlanBase) planBaseIdToPlanBase;
mapping (bytes32 => Plan) planIdToPlan;
mapping (address => bytes32[]) userToPlanIds;
constructor (address _hopsAddress, address _lessAddress) public {
}
function addPlanBase(uint256 minimumAmount, uint256 lockTime, uint32 lessToHops)
onlyOwner external {
}
function togglePlanBase(bytes32 planBaseId, bool isOpen) onlyOwner external {
}
function growHops(bytes32 planBaseId, uint256 lessAmount) whenNotPaused external {
address sender = msg.sender;
require(<FILL_ME>)
PlanBase storage planBase = planBaseIdToPlanBase[planBaseId];
require(planBase.isOpen);
require(lessAmount >= planBase.minimumAmount);
bytes32 planId = keccak256(
abi.encodePacked(block.timestamp, sender, planBaseId, lessAmount)
);
uint256 hopsAmount = lessAmount.mul(planBase.lessToHops);
Plan memory plan = Plan(
planBaseId,
sender,
lessAmount,
hopsAmount,
block.timestamp,
block.timestamp.add(planBase.lockTime),
false
);
require(IERC20(lessAddress).transferFrom(sender, address(this), lessAmount));
require(IERC20(hopsAddress).mint(sender, hopsAmount));
planIdToPlan[planId] = plan;
userToPlanIds[sender].push(planId);
planIdsByPlanBase[planBaseId].push(planId);
emit PlanEvt(planId, planBaseId, sender, lessAmount, hopsAmount, block.timestamp, block.timestamp.add(planBase.lockTime), false);
}
function updateHopsAddress(address _address) external onlyOwner {
}
function updatelessAddress(address _address) external onlyOwner {
}
function withdraw(bytes32 planId) whenNotPaused external {
}
function checkPlanBase(bytes32 planBaseId)
external view returns (uint256, uint256, uint32, bool){
}
function checkPlanBaseIds() external view returns(bytes32[]) {
}
function checkPlanIdsByPlanBase(bytes32 planBaseId) external view returns(bytes32[]) {
}
function checkPlanIdsByUser(address user) external view returns(bytes32[]) {
}
function checkPlan(bytes32 planId)
external view returns (bytes32, address, uint256, uint256, uint256, uint256, bool) {
}
}
| IERC20(lessAddress).allowance(sender,address(this))>=lessAmount | 54,947 | IERC20(lessAddress).allowance(sender,address(this))>=lessAmount |
null | interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function allowance(address tokenOwner, address spender) external view returns (uint);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
function mint(address to, uint256 value) external returns (bool);
}
contract GrowHops is IGrowHops, Ownable, Pausable {
using SafeMath for *;
address public hopsAddress;
address public lessAddress;
struct PlanBase {
uint256 minimumAmount;
uint256 lockTime;
uint32 lessToHops;
bool isOpen;
}
struct Plan {
bytes32 planBaseId;
address plantuser;
uint256 lessAmount;
uint256 hopsAmount;
uint256 lockAt;
uint256 releaseAt;
bool isWithdrawn;
}
bytes32[] public planBaseIds;
mapping (bytes32 => bytes32[]) planIdsByPlanBase;
mapping (bytes32 => PlanBase) planBaseIdToPlanBase;
mapping (bytes32 => Plan) planIdToPlan;
mapping (address => bytes32[]) userToPlanIds;
constructor (address _hopsAddress, address _lessAddress) public {
}
function addPlanBase(uint256 minimumAmount, uint256 lockTime, uint32 lessToHops)
onlyOwner external {
}
function togglePlanBase(bytes32 planBaseId, bool isOpen) onlyOwner external {
}
function growHops(bytes32 planBaseId, uint256 lessAmount) whenNotPaused external {
address sender = msg.sender;
require(IERC20(lessAddress).allowance(sender, address(this)) >= lessAmount);
PlanBase storage planBase = planBaseIdToPlanBase[planBaseId];
require(<FILL_ME>)
require(lessAmount >= planBase.minimumAmount);
bytes32 planId = keccak256(
abi.encodePacked(block.timestamp, sender, planBaseId, lessAmount)
);
uint256 hopsAmount = lessAmount.mul(planBase.lessToHops);
Plan memory plan = Plan(
planBaseId,
sender,
lessAmount,
hopsAmount,
block.timestamp,
block.timestamp.add(planBase.lockTime),
false
);
require(IERC20(lessAddress).transferFrom(sender, address(this), lessAmount));
require(IERC20(hopsAddress).mint(sender, hopsAmount));
planIdToPlan[planId] = plan;
userToPlanIds[sender].push(planId);
planIdsByPlanBase[planBaseId].push(planId);
emit PlanEvt(planId, planBaseId, sender, lessAmount, hopsAmount, block.timestamp, block.timestamp.add(planBase.lockTime), false);
}
function updateHopsAddress(address _address) external onlyOwner {
}
function updatelessAddress(address _address) external onlyOwner {
}
function withdraw(bytes32 planId) whenNotPaused external {
}
function checkPlanBase(bytes32 planBaseId)
external view returns (uint256, uint256, uint32, bool){
}
function checkPlanBaseIds() external view returns(bytes32[]) {
}
function checkPlanIdsByPlanBase(bytes32 planBaseId) external view returns(bytes32[]) {
}
function checkPlanIdsByUser(address user) external view returns(bytes32[]) {
}
function checkPlan(bytes32 planId)
external view returns (bytes32, address, uint256, uint256, uint256, uint256, bool) {
}
}
| planBase.isOpen | 54,947 | planBase.isOpen |
null | interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function allowance(address tokenOwner, address spender) external view returns (uint);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
function mint(address to, uint256 value) external returns (bool);
}
contract GrowHops is IGrowHops, Ownable, Pausable {
using SafeMath for *;
address public hopsAddress;
address public lessAddress;
struct PlanBase {
uint256 minimumAmount;
uint256 lockTime;
uint32 lessToHops;
bool isOpen;
}
struct Plan {
bytes32 planBaseId;
address plantuser;
uint256 lessAmount;
uint256 hopsAmount;
uint256 lockAt;
uint256 releaseAt;
bool isWithdrawn;
}
bytes32[] public planBaseIds;
mapping (bytes32 => bytes32[]) planIdsByPlanBase;
mapping (bytes32 => PlanBase) planBaseIdToPlanBase;
mapping (bytes32 => Plan) planIdToPlan;
mapping (address => bytes32[]) userToPlanIds;
constructor (address _hopsAddress, address _lessAddress) public {
}
function addPlanBase(uint256 minimumAmount, uint256 lockTime, uint32 lessToHops)
onlyOwner external {
}
function togglePlanBase(bytes32 planBaseId, bool isOpen) onlyOwner external {
}
function growHops(bytes32 planBaseId, uint256 lessAmount) whenNotPaused external {
address sender = msg.sender;
require(IERC20(lessAddress).allowance(sender, address(this)) >= lessAmount);
PlanBase storage planBase = planBaseIdToPlanBase[planBaseId];
require(planBase.isOpen);
require(lessAmount >= planBase.minimumAmount);
bytes32 planId = keccak256(
abi.encodePacked(block.timestamp, sender, planBaseId, lessAmount)
);
uint256 hopsAmount = lessAmount.mul(planBase.lessToHops);
Plan memory plan = Plan(
planBaseId,
sender,
lessAmount,
hopsAmount,
block.timestamp,
block.timestamp.add(planBase.lockTime),
false
);
require(<FILL_ME>)
require(IERC20(hopsAddress).mint(sender, hopsAmount));
planIdToPlan[planId] = plan;
userToPlanIds[sender].push(planId);
planIdsByPlanBase[planBaseId].push(planId);
emit PlanEvt(planId, planBaseId, sender, lessAmount, hopsAmount, block.timestamp, block.timestamp.add(planBase.lockTime), false);
}
function updateHopsAddress(address _address) external onlyOwner {
}
function updatelessAddress(address _address) external onlyOwner {
}
function withdraw(bytes32 planId) whenNotPaused external {
}
function checkPlanBase(bytes32 planBaseId)
external view returns (uint256, uint256, uint32, bool){
}
function checkPlanBaseIds() external view returns(bytes32[]) {
}
function checkPlanIdsByPlanBase(bytes32 planBaseId) external view returns(bytes32[]) {
}
function checkPlanIdsByUser(address user) external view returns(bytes32[]) {
}
function checkPlan(bytes32 planId)
external view returns (bytes32, address, uint256, uint256, uint256, uint256, bool) {
}
}
| IERC20(lessAddress).transferFrom(sender,address(this),lessAmount) | 54,947 | IERC20(lessAddress).transferFrom(sender,address(this),lessAmount) |
null | interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function allowance(address tokenOwner, address spender) external view returns (uint);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
function mint(address to, uint256 value) external returns (bool);
}
contract GrowHops is IGrowHops, Ownable, Pausable {
using SafeMath for *;
address public hopsAddress;
address public lessAddress;
struct PlanBase {
uint256 minimumAmount;
uint256 lockTime;
uint32 lessToHops;
bool isOpen;
}
struct Plan {
bytes32 planBaseId;
address plantuser;
uint256 lessAmount;
uint256 hopsAmount;
uint256 lockAt;
uint256 releaseAt;
bool isWithdrawn;
}
bytes32[] public planBaseIds;
mapping (bytes32 => bytes32[]) planIdsByPlanBase;
mapping (bytes32 => PlanBase) planBaseIdToPlanBase;
mapping (bytes32 => Plan) planIdToPlan;
mapping (address => bytes32[]) userToPlanIds;
constructor (address _hopsAddress, address _lessAddress) public {
}
function addPlanBase(uint256 minimumAmount, uint256 lockTime, uint32 lessToHops)
onlyOwner external {
}
function togglePlanBase(bytes32 planBaseId, bool isOpen) onlyOwner external {
}
function growHops(bytes32 planBaseId, uint256 lessAmount) whenNotPaused external {
address sender = msg.sender;
require(IERC20(lessAddress).allowance(sender, address(this)) >= lessAmount);
PlanBase storage planBase = planBaseIdToPlanBase[planBaseId];
require(planBase.isOpen);
require(lessAmount >= planBase.minimumAmount);
bytes32 planId = keccak256(
abi.encodePacked(block.timestamp, sender, planBaseId, lessAmount)
);
uint256 hopsAmount = lessAmount.mul(planBase.lessToHops);
Plan memory plan = Plan(
planBaseId,
sender,
lessAmount,
hopsAmount,
block.timestamp,
block.timestamp.add(planBase.lockTime),
false
);
require(IERC20(lessAddress).transferFrom(sender, address(this), lessAmount));
require(<FILL_ME>)
planIdToPlan[planId] = plan;
userToPlanIds[sender].push(planId);
planIdsByPlanBase[planBaseId].push(planId);
emit PlanEvt(planId, planBaseId, sender, lessAmount, hopsAmount, block.timestamp, block.timestamp.add(planBase.lockTime), false);
}
function updateHopsAddress(address _address) external onlyOwner {
}
function updatelessAddress(address _address) external onlyOwner {
}
function withdraw(bytes32 planId) whenNotPaused external {
}
function checkPlanBase(bytes32 planBaseId)
external view returns (uint256, uint256, uint32, bool){
}
function checkPlanBaseIds() external view returns(bytes32[]) {
}
function checkPlanIdsByPlanBase(bytes32 planBaseId) external view returns(bytes32[]) {
}
function checkPlanIdsByUser(address user) external view returns(bytes32[]) {
}
function checkPlan(bytes32 planId)
external view returns (bytes32, address, uint256, uint256, uint256, uint256, bool) {
}
}
| IERC20(hopsAddress).mint(sender,hopsAmount) | 54,947 | IERC20(hopsAddress).mint(sender,hopsAmount) |
null | interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function allowance(address tokenOwner, address spender) external view returns (uint);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
function mint(address to, uint256 value) external returns (bool);
}
contract GrowHops is IGrowHops, Ownable, Pausable {
using SafeMath for *;
address public hopsAddress;
address public lessAddress;
struct PlanBase {
uint256 minimumAmount;
uint256 lockTime;
uint32 lessToHops;
bool isOpen;
}
struct Plan {
bytes32 planBaseId;
address plantuser;
uint256 lessAmount;
uint256 hopsAmount;
uint256 lockAt;
uint256 releaseAt;
bool isWithdrawn;
}
bytes32[] public planBaseIds;
mapping (bytes32 => bytes32[]) planIdsByPlanBase;
mapping (bytes32 => PlanBase) planBaseIdToPlanBase;
mapping (bytes32 => Plan) planIdToPlan;
mapping (address => bytes32[]) userToPlanIds;
constructor (address _hopsAddress, address _lessAddress) public {
}
function addPlanBase(uint256 minimumAmount, uint256 lockTime, uint32 lessToHops)
onlyOwner external {
}
function togglePlanBase(bytes32 planBaseId, bool isOpen) onlyOwner external {
}
function growHops(bytes32 planBaseId, uint256 lessAmount) whenNotPaused external {
}
function updateHopsAddress(address _address) external onlyOwner {
}
function updatelessAddress(address _address) external onlyOwner {
}
function withdraw(bytes32 planId) whenNotPaused external {
address sender = msg.sender;
Plan storage plan = planIdToPlan[planId];
require(<FILL_ME>)
require(plan.plantuser == sender);
require(block.timestamp >= plan.releaseAt);
require(IERC20(lessAddress).transfer(sender, plan.lessAmount));
planIdToPlan[planId].isWithdrawn = true;
emit WithdrawPlanEvt(planId, sender, plan.lessAmount, true, block.timestamp);
}
function checkPlanBase(bytes32 planBaseId)
external view returns (uint256, uint256, uint32, bool){
}
function checkPlanBaseIds() external view returns(bytes32[]) {
}
function checkPlanIdsByPlanBase(bytes32 planBaseId) external view returns(bytes32[]) {
}
function checkPlanIdsByUser(address user) external view returns(bytes32[]) {
}
function checkPlan(bytes32 planId)
external view returns (bytes32, address, uint256, uint256, uint256, uint256, bool) {
}
}
| !plan.isWithdrawn | 54,947 | !plan.isWithdrawn |
null | interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function allowance(address tokenOwner, address spender) external view returns (uint);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
function mint(address to, uint256 value) external returns (bool);
}
contract GrowHops is IGrowHops, Ownable, Pausable {
using SafeMath for *;
address public hopsAddress;
address public lessAddress;
struct PlanBase {
uint256 minimumAmount;
uint256 lockTime;
uint32 lessToHops;
bool isOpen;
}
struct Plan {
bytes32 planBaseId;
address plantuser;
uint256 lessAmount;
uint256 hopsAmount;
uint256 lockAt;
uint256 releaseAt;
bool isWithdrawn;
}
bytes32[] public planBaseIds;
mapping (bytes32 => bytes32[]) planIdsByPlanBase;
mapping (bytes32 => PlanBase) planBaseIdToPlanBase;
mapping (bytes32 => Plan) planIdToPlan;
mapping (address => bytes32[]) userToPlanIds;
constructor (address _hopsAddress, address _lessAddress) public {
}
function addPlanBase(uint256 minimumAmount, uint256 lockTime, uint32 lessToHops)
onlyOwner external {
}
function togglePlanBase(bytes32 planBaseId, bool isOpen) onlyOwner external {
}
function growHops(bytes32 planBaseId, uint256 lessAmount) whenNotPaused external {
}
function updateHopsAddress(address _address) external onlyOwner {
}
function updatelessAddress(address _address) external onlyOwner {
}
function withdraw(bytes32 planId) whenNotPaused external {
address sender = msg.sender;
Plan storage plan = planIdToPlan[planId];
require(!plan.isWithdrawn);
require(plan.plantuser == sender);
require(block.timestamp >= plan.releaseAt);
require(<FILL_ME>)
planIdToPlan[planId].isWithdrawn = true;
emit WithdrawPlanEvt(planId, sender, plan.lessAmount, true, block.timestamp);
}
function checkPlanBase(bytes32 planBaseId)
external view returns (uint256, uint256, uint32, bool){
}
function checkPlanBaseIds() external view returns(bytes32[]) {
}
function checkPlanIdsByPlanBase(bytes32 planBaseId) external view returns(bytes32[]) {
}
function checkPlanIdsByUser(address user) external view returns(bytes32[]) {
}
function checkPlan(bytes32 planId)
external view returns (bytes32, address, uint256, uint256, uint256, uint256, bool) {
}
}
| IERC20(lessAddress).transfer(sender,plan.lessAmount) | 54,947 | IERC20(lessAddress).transfer(sender,plan.lessAmount) |
"HASH_FAIL" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/*
██████╗░██████╗░░█████╗░
██╔══██╗██╔══██╗██╔══██╗
██████╔╝██████╦╝██║░░╚═╝
██╔═══╝░██╔══██╗██║░░██╗
██║░░░░░██████╦╝╚█████╔╝
╚═╝░░░░░╚═════╝░░╚════╝░
POLAR BEAR CLUB - 2021 (v1.0.0-Iceberg)
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract PBCNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
uint256 public constant PBC_GIFT = 499;
uint256 public constant PBC_PUBLIC = 9500;
uint256 public constant PBC_MAX = PBC_PUBLIC + PBC_GIFT;
uint256 public constant PBC_PRICE = 0.08 ether;
uint256 public constant PBC_PER_MINT = 5;
mapping(string => bool) private _usedNonces;
string private _contractURI;
string private _tokenBaseURI = "https://api.pbc.gg/metadata/";
address private _signerAddress = 0x929384300CA2871866A3Ea11A93AC43A8bB44aD8;
string public proof;
uint256 public giftedAmount;
uint256 public publicAmountMinted;
bool public saleLive;
bool public locked;
constructor() ERC721("Polar Bear Club", "PBC") {}
modifier notLocked {
}
function hashTransaction(address sender, uint256 qty, string memory nonce) private pure returns(bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
require(matchAddresSigner(hash, signature), "DIRECT_MINT_DISALLOWED");
require(!_usedNonces[nonce], "HASH_USED");
require(<FILL_ME>)
require(totalSupply() < PBC_MAX, "OUT_OF_STOCK");
require(publicAmountMinted + tokenQuantity <= PBC_PUBLIC, "EXCEED_PUBLIC");
require(tokenQuantity <= PBC_PER_MINT, "EXCEED_PBC_PER_MINT");
require(PBC_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for(uint256 i = 0; i < tokenQuantity; i++) {
publicAmountMinted++;
_safeMint(msg.sender, totalSupply() + 1);
}
_usedNonces[nonce] = true;
}
function gift(address[] calldata receivers) external onlyOwner {
}
function withdraw() external onlyOwner {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setSignerAddress(address addr) external onlyOwner {
}
function setProvenanceHash(string calldata hash) external onlyOwner notLocked {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| hashTransaction(msg.sender,tokenQuantity,nonce)==hash,"HASH_FAIL" | 54,975 | hashTransaction(msg.sender,tokenQuantity,nonce)==hash |
"OUT_OF_STOCK" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/*
██████╗░██████╗░░█████╗░
██╔══██╗██╔══██╗██╔══██╗
██████╔╝██████╦╝██║░░╚═╝
██╔═══╝░██╔══██╗██║░░██╗
██║░░░░░██████╦╝╚█████╔╝
╚═╝░░░░░╚═════╝░░╚════╝░
POLAR BEAR CLUB - 2021 (v1.0.0-Iceberg)
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract PBCNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
uint256 public constant PBC_GIFT = 499;
uint256 public constant PBC_PUBLIC = 9500;
uint256 public constant PBC_MAX = PBC_PUBLIC + PBC_GIFT;
uint256 public constant PBC_PRICE = 0.08 ether;
uint256 public constant PBC_PER_MINT = 5;
mapping(string => bool) private _usedNonces;
string private _contractURI;
string private _tokenBaseURI = "https://api.pbc.gg/metadata/";
address private _signerAddress = 0x929384300CA2871866A3Ea11A93AC43A8bB44aD8;
string public proof;
uint256 public giftedAmount;
uint256 public publicAmountMinted;
bool public saleLive;
bool public locked;
constructor() ERC721("Polar Bear Club", "PBC") {}
modifier notLocked {
}
function hashTransaction(address sender, uint256 qty, string memory nonce) private pure returns(bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
require(matchAddresSigner(hash, signature), "DIRECT_MINT_DISALLOWED");
require(!_usedNonces[nonce], "HASH_USED");
require(hashTransaction(msg.sender, tokenQuantity, nonce) == hash, "HASH_FAIL");
require(<FILL_ME>)
require(publicAmountMinted + tokenQuantity <= PBC_PUBLIC, "EXCEED_PUBLIC");
require(tokenQuantity <= PBC_PER_MINT, "EXCEED_PBC_PER_MINT");
require(PBC_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for(uint256 i = 0; i < tokenQuantity; i++) {
publicAmountMinted++;
_safeMint(msg.sender, totalSupply() + 1);
}
_usedNonces[nonce] = true;
}
function gift(address[] calldata receivers) external onlyOwner {
}
function withdraw() external onlyOwner {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setSignerAddress(address addr) external onlyOwner {
}
function setProvenanceHash(string calldata hash) external onlyOwner notLocked {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| totalSupply()<PBC_MAX,"OUT_OF_STOCK" | 54,975 | totalSupply()<PBC_MAX |
"EXCEED_PUBLIC" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/*
██████╗░██████╗░░█████╗░
██╔══██╗██╔══██╗██╔══██╗
██████╔╝██████╦╝██║░░╚═╝
██╔═══╝░██╔══██╗██║░░██╗
██║░░░░░██████╦╝╚█████╔╝
╚═╝░░░░░╚═════╝░░╚════╝░
POLAR BEAR CLUB - 2021 (v1.0.0-Iceberg)
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract PBCNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
uint256 public constant PBC_GIFT = 499;
uint256 public constant PBC_PUBLIC = 9500;
uint256 public constant PBC_MAX = PBC_PUBLIC + PBC_GIFT;
uint256 public constant PBC_PRICE = 0.08 ether;
uint256 public constant PBC_PER_MINT = 5;
mapping(string => bool) private _usedNonces;
string private _contractURI;
string private _tokenBaseURI = "https://api.pbc.gg/metadata/";
address private _signerAddress = 0x929384300CA2871866A3Ea11A93AC43A8bB44aD8;
string public proof;
uint256 public giftedAmount;
uint256 public publicAmountMinted;
bool public saleLive;
bool public locked;
constructor() ERC721("Polar Bear Club", "PBC") {}
modifier notLocked {
}
function hashTransaction(address sender, uint256 qty, string memory nonce) private pure returns(bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
require(matchAddresSigner(hash, signature), "DIRECT_MINT_DISALLOWED");
require(!_usedNonces[nonce], "HASH_USED");
require(hashTransaction(msg.sender, tokenQuantity, nonce) == hash, "HASH_FAIL");
require(totalSupply() < PBC_MAX, "OUT_OF_STOCK");
require(<FILL_ME>)
require(tokenQuantity <= PBC_PER_MINT, "EXCEED_PBC_PER_MINT");
require(PBC_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for(uint256 i = 0; i < tokenQuantity; i++) {
publicAmountMinted++;
_safeMint(msg.sender, totalSupply() + 1);
}
_usedNonces[nonce] = true;
}
function gift(address[] calldata receivers) external onlyOwner {
}
function withdraw() external onlyOwner {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setSignerAddress(address addr) external onlyOwner {
}
function setProvenanceHash(string calldata hash) external onlyOwner notLocked {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| publicAmountMinted+tokenQuantity<=PBC_PUBLIC,"EXCEED_PUBLIC" | 54,975 | publicAmountMinted+tokenQuantity<=PBC_PUBLIC |
"INSUFFICIENT_ETH" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/*
██████╗░██████╗░░█████╗░
██╔══██╗██╔══██╗██╔══██╗
██████╔╝██████╦╝██║░░╚═╝
██╔═══╝░██╔══██╗██║░░██╗
██║░░░░░██████╦╝╚█████╔╝
╚═╝░░░░░╚═════╝░░╚════╝░
POLAR BEAR CLUB - 2021 (v1.0.0-Iceberg)
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract PBCNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
uint256 public constant PBC_GIFT = 499;
uint256 public constant PBC_PUBLIC = 9500;
uint256 public constant PBC_MAX = PBC_PUBLIC + PBC_GIFT;
uint256 public constant PBC_PRICE = 0.08 ether;
uint256 public constant PBC_PER_MINT = 5;
mapping(string => bool) private _usedNonces;
string private _contractURI;
string private _tokenBaseURI = "https://api.pbc.gg/metadata/";
address private _signerAddress = 0x929384300CA2871866A3Ea11A93AC43A8bB44aD8;
string public proof;
uint256 public giftedAmount;
uint256 public publicAmountMinted;
bool public saleLive;
bool public locked;
constructor() ERC721("Polar Bear Club", "PBC") {}
modifier notLocked {
}
function hashTransaction(address sender, uint256 qty, string memory nonce) private pure returns(bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
require(matchAddresSigner(hash, signature), "DIRECT_MINT_DISALLOWED");
require(!_usedNonces[nonce], "HASH_USED");
require(hashTransaction(msg.sender, tokenQuantity, nonce) == hash, "HASH_FAIL");
require(totalSupply() < PBC_MAX, "OUT_OF_STOCK");
require(publicAmountMinted + tokenQuantity <= PBC_PUBLIC, "EXCEED_PUBLIC");
require(tokenQuantity <= PBC_PER_MINT, "EXCEED_PBC_PER_MINT");
require(<FILL_ME>)
for(uint256 i = 0; i < tokenQuantity; i++) {
publicAmountMinted++;
_safeMint(msg.sender, totalSupply() + 1);
}
_usedNonces[nonce] = true;
}
function gift(address[] calldata receivers) external onlyOwner {
}
function withdraw() external onlyOwner {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setSignerAddress(address addr) external onlyOwner {
}
function setProvenanceHash(string calldata hash) external onlyOwner notLocked {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| PBC_PRICE*tokenQuantity<=msg.value,"INSUFFICIENT_ETH" | 54,975 | PBC_PRICE*tokenQuantity<=msg.value |
"MAX_MINT" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/*
██████╗░██████╗░░█████╗░
██╔══██╗██╔══██╗██╔══██╗
██████╔╝██████╦╝██║░░╚═╝
██╔═══╝░██╔══██╗██║░░██╗
██║░░░░░██████╦╝╚█████╔╝
╚═╝░░░░░╚═════╝░░╚════╝░
POLAR BEAR CLUB - 2021 (v1.0.0-Iceberg)
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract PBCNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
uint256 public constant PBC_GIFT = 499;
uint256 public constant PBC_PUBLIC = 9500;
uint256 public constant PBC_MAX = PBC_PUBLIC + PBC_GIFT;
uint256 public constant PBC_PRICE = 0.08 ether;
uint256 public constant PBC_PER_MINT = 5;
mapping(string => bool) private _usedNonces;
string private _contractURI;
string private _tokenBaseURI = "https://api.pbc.gg/metadata/";
address private _signerAddress = 0x929384300CA2871866A3Ea11A93AC43A8bB44aD8;
string public proof;
uint256 public giftedAmount;
uint256 public publicAmountMinted;
bool public saleLive;
bool public locked;
constructor() ERC721("Polar Bear Club", "PBC") {}
modifier notLocked {
}
function hashTransaction(address sender, uint256 qty, string memory nonce) private pure returns(bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256 tokenQuantity) external payable {
}
function gift(address[] calldata receivers) external onlyOwner {
require(<FILL_ME>)
require(giftedAmount + receivers.length <= PBC_GIFT, "GIFTS_EMPTY");
for (uint256 i = 0; i < receivers.length; i++) {
giftedAmount++;
_safeMint(receivers[i], totalSupply() + 1);
}
}
function withdraw() external onlyOwner {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setSignerAddress(address addr) external onlyOwner {
}
function setProvenanceHash(string calldata hash) external onlyOwner notLocked {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| totalSupply()+receivers.length<=PBC_PRICE,"MAX_MINT" | 54,975 | totalSupply()+receivers.length<=PBC_PRICE |
"GIFTS_EMPTY" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/*
██████╗░██████╗░░█████╗░
██╔══██╗██╔══██╗██╔══██╗
██████╔╝██████╦╝██║░░╚═╝
██╔═══╝░██╔══██╗██║░░██╗
██║░░░░░██████╦╝╚█████╔╝
╚═╝░░░░░╚═════╝░░╚════╝░
POLAR BEAR CLUB - 2021 (v1.0.0-Iceberg)
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract PBCNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
uint256 public constant PBC_GIFT = 499;
uint256 public constant PBC_PUBLIC = 9500;
uint256 public constant PBC_MAX = PBC_PUBLIC + PBC_GIFT;
uint256 public constant PBC_PRICE = 0.08 ether;
uint256 public constant PBC_PER_MINT = 5;
mapping(string => bool) private _usedNonces;
string private _contractURI;
string private _tokenBaseURI = "https://api.pbc.gg/metadata/";
address private _signerAddress = 0x929384300CA2871866A3Ea11A93AC43A8bB44aD8;
string public proof;
uint256 public giftedAmount;
uint256 public publicAmountMinted;
bool public saleLive;
bool public locked;
constructor() ERC721("Polar Bear Club", "PBC") {}
modifier notLocked {
}
function hashTransaction(address sender, uint256 qty, string memory nonce) private pure returns(bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function buy(bytes32 hash, bytes memory signature, string memory nonce, uint256 tokenQuantity) external payable {
}
function gift(address[] calldata receivers) external onlyOwner {
require(totalSupply() + receivers.length <= PBC_PRICE, "MAX_MINT");
require(<FILL_ME>)
for (uint256 i = 0; i < receivers.length; i++) {
giftedAmount++;
_safeMint(receivers[i], totalSupply() + 1);
}
}
function withdraw() external onlyOwner {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setSignerAddress(address addr) external onlyOwner {
}
function setProvenanceHash(string calldata hash) external onlyOwner notLocked {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| giftedAmount+receivers.length<=PBC_GIFT,"GIFTS_EMPTY" | 54,975 | giftedAmount+receivers.length<=PBC_GIFT |
null | // SPDX-License-Identifier: None
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view 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;
}
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
) private pure returns (bytes memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
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);
}
//ERC721A contract was taken as bases, but was modified, so that the indexing would start from 1
//Modified version name: ERC721VI
contract ERC721VI 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 internal currentIndex = 1;
uint256 internal immutable maxBatchSize;
string private _name;
string private _symbol;
mapping(uint256 => TokenOwnership) internal _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_
) {
}
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 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 {
}
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 HonoraryChads is ERC721VI, Ownable {
using Strings for uint256;
string private _apiURI = "";
bool public paused = true;
uint256 private maxPerTx = 10;
constructor() ERC721VI("Honorary Chads", "HChads", maxPerTx) {}
function mint(uint256 _mintAmount) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function togglePaused() public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory _uri) public onlyOwner {
}
function setMaxPerTx(uint256 _maxPerTx) public onlyOwner {
}
function withdrawall() public onlyOwner {
uint256 _balance = address(this).balance;
require(<FILL_ME>)
}
}
| payable(0x1B65a9816EF95229ACC3384E67956A7dFaB2b87c).send(_balance) | 55,001 | payable(0x1B65a9816EF95229ACC3384E67956A7dFaB2b87c).send(_balance) |
null | pragma solidity ^0.4.18;
interface WETH9 {
function approve(address spender, uint amount) public returns(bool);
function deposit() public payable;
}
interface DutchExchange {
function deposit(address tokenAddress,uint amount) public returns(uint);
function postBuyOrder(address sellToken,address buyToken,uint auctionIndex,uint amount) public returns (uint);
function claimAndWithdraw(address sellToken,address buyToken,address user,uint auctionIndex,uint amount) public;
function getAuctionIndex(address token1,address token2) public returns(uint);
}
interface ERC20 {
function transfer(address recipient, uint amount) public returns(bool);
}
contract DutchReserve {
DutchExchange constant DUTCH_EXCHANGE = DutchExchange(0xaf1745c0f8117384Dfa5FFf40f824057c70F2ed3);
WETH9 constant WETH = WETH9(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
function DutchReserve() public {
require(<FILL_ME>)
}
function buyToken(ERC20 token) payable public {
}
}
| WETH.approve(DUTCH_EXCHANGE,2**255) | 55,007 | WETH.approve(DUTCH_EXCHANGE,2**255) |
"Tokens number to mint exceeds number of public tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract LockdownLemmings is ERC721, ERC721URIStorage, Pausable, Ownable {
using Counters for Counters.Counter;
using SafeMath for uint256;
string private _baseURIPrefix;
uint private constant maxTokensPerTransaction = 30;
uint256 private tokenPrice = 30000000000000000; //0.03 ETH
uint256 private constant nftsNumber = 10000;
uint256 private constant nftsPublicNumber = 9980;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Lockdown Lemmings", "LEM") {
}
function setBaseURI(string memory baseURIPrefix) public onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function safeMint(address to) public onlyOwner {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override
{
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
}
function withdraw() public onlyOwner {
}
function directMint(address to, uint256 tokenId) public onlyOwner {
}
function buyLemmings(uint tokensNumber) whenNotPaused public payable {
require(tokensNumber > 0, "Wrong amount");
require(tokensNumber <= maxTokensPerTransaction, "Max tokens per transaction number exceeded");
require(<FILL_ME>)
require(tokenPrice.mul(tokensNumber) <= msg.value, "Ether value sent is too low");
for(uint i = 0; i < tokensNumber; i++) {
_safeMint(msg.sender, _tokenIdCounter.current());
_tokenIdCounter.increment();
}
}
}
| _tokenIdCounter.current().add(tokensNumber)<=nftsPublicNumber,"Tokens number to mint exceeds number of public tokens" | 55,067 | _tokenIdCounter.current().add(tokensNumber)<=nftsPublicNumber |
"Ether value sent is too low" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract LockdownLemmings is ERC721, ERC721URIStorage, Pausable, Ownable {
using Counters for Counters.Counter;
using SafeMath for uint256;
string private _baseURIPrefix;
uint private constant maxTokensPerTransaction = 30;
uint256 private tokenPrice = 30000000000000000; //0.03 ETH
uint256 private constant nftsNumber = 10000;
uint256 private constant nftsPublicNumber = 9980;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Lockdown Lemmings", "LEM") {
}
function setBaseURI(string memory baseURIPrefix) public onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function safeMint(address to) public onlyOwner {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override
{
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
}
function withdraw() public onlyOwner {
}
function directMint(address to, uint256 tokenId) public onlyOwner {
}
function buyLemmings(uint tokensNumber) whenNotPaused public payable {
require(tokensNumber > 0, "Wrong amount");
require(tokensNumber <= maxTokensPerTransaction, "Max tokens per transaction number exceeded");
require(_tokenIdCounter.current().add(tokensNumber) <= nftsPublicNumber, "Tokens number to mint exceeds number of public tokens");
require(<FILL_ME>)
for(uint i = 0; i < tokensNumber; i++) {
_safeMint(msg.sender, _tokenIdCounter.current());
_tokenIdCounter.increment();
}
}
}
| tokenPrice.mul(tokensNumber)<=msg.value,"Ether value sent is too low" | 55,067 | tokenPrice.mul(tokensNumber)<=msg.value |
"!minter" | pragma solidity ^0.5.5;
/// @title DegoToken Contract
contract DegoToken is Governance, ERC20Detailed{
using SafeMath for uint256;
//events
event eveSetRate(uint256 burn_rate, uint256 reward_rate);
event eveRewardPool(address rewardPool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Mint(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
// for minters
mapping (address => bool) public _minters;
//token base data
uint256 internal _totalSupply;
mapping(address => uint256) public _balances;
mapping (address => mapping (address => uint256)) public _allowances;
/// Constant token specific fields
uint256 public _maxSupply = 0;
///
bool public _openTransfer = false;
// hardcode limit rate
uint256 public constant _maxGovernValueRate = 2000;//2000/10000
uint256 public constant _minGovernValueRate = 10; //10/10000
uint256 public constant _rateBase = 10000;
// additional variables for use if transaction fees ever became necessary
uint256 public _burnRate = 250;
uint256 public _rewardRate = 250;
uint256 public _totalBurnToken = 0;
uint256 public _totalRewardToken = 0;
//todo reward pool!
address public _rewardPool = 0xEA6dEc98e137a87F78495a8386f7A137408f7722;
//todo burn pool!
address public _burnPool = 0x6666666666666666666666666666666666666666;
/**
* @dev set the token transfer switch
*/
function enableOpenTransfer() public onlyGovernance
{
}
/**
* CONSTRUCTOR
*
* @dev Initialize the Token
*/
constructor () public ERC20Detailed("dego.finance", "DEGO", 18) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param spender The address which will spend the funds.
* @param amount The amount of tokens to be spent.
*/
function approve(address spender, uint256 amount) external
returns (bool)
{
}
/**
* @dev Function to check the amount of tokens than an owner _allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) external view
returns (uint256)
{
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) external view
returns (uint256)
{
}
/**
* @dev return the token total supply
*/
function totalSupply() external view
returns (uint256)
{
}
/**
* @dev for mint function
*/
function mint(address account, uint256 amount) external
{
require(account != address(0), "ERC20: mint to the zero address");
require(<FILL_ME>)
uint256 curMintSupply = _totalSupply.add(_totalBurnToken);
uint256 newMintSupply = curMintSupply.add(amount);
require( newMintSupply <= _maxSupply,"supply is max!");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Mint(address(0), account, amount);
emit Transfer(address(0), account, amount);
}
function addMinter(address _minter) public onlyGovernance
{
}
function removeMinter(address _minter) public onlyGovernance
{
}
function() external payable {
}
/**
* @dev for govern value
*/
function setRate(uint256 burn_rate, uint256 reward_rate) public
onlyGovernance
{
}
/**
* @dev for set reward
*/
function setRewardPool(address rewardPool) public
onlyGovernance
{
}
/**
* @dev transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) external
returns (bool)
{
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) external
returns (bool)
{
}
/**
* @dev Transfer tokens with fee
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256s the amount of tokens to be transferred
*/
function _transfer(address from, address to, uint256 value) internal
returns (bool)
{
}
}
| _minters[msg.sender],"!minter" | 55,085 | _minters[msg.sender] |
"transfer closed" | pragma solidity ^0.5.5;
/// @title DegoToken Contract
contract DegoToken is Governance, ERC20Detailed{
using SafeMath for uint256;
//events
event eveSetRate(uint256 burn_rate, uint256 reward_rate);
event eveRewardPool(address rewardPool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Mint(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
// for minters
mapping (address => bool) public _minters;
//token base data
uint256 internal _totalSupply;
mapping(address => uint256) public _balances;
mapping (address => mapping (address => uint256)) public _allowances;
/// Constant token specific fields
uint256 public _maxSupply = 0;
///
bool public _openTransfer = false;
// hardcode limit rate
uint256 public constant _maxGovernValueRate = 2000;//2000/10000
uint256 public constant _minGovernValueRate = 10; //10/10000
uint256 public constant _rateBase = 10000;
// additional variables for use if transaction fees ever became necessary
uint256 public _burnRate = 250;
uint256 public _rewardRate = 250;
uint256 public _totalBurnToken = 0;
uint256 public _totalRewardToken = 0;
//todo reward pool!
address public _rewardPool = 0xEA6dEc98e137a87F78495a8386f7A137408f7722;
//todo burn pool!
address public _burnPool = 0x6666666666666666666666666666666666666666;
/**
* @dev set the token transfer switch
*/
function enableOpenTransfer() public onlyGovernance
{
}
/**
* CONSTRUCTOR
*
* @dev Initialize the Token
*/
constructor () public ERC20Detailed("dego.finance", "DEGO", 18) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param spender The address which will spend the funds.
* @param amount The amount of tokens to be spent.
*/
function approve(address spender, uint256 amount) external
returns (bool)
{
}
/**
* @dev Function to check the amount of tokens than an owner _allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) external view
returns (uint256)
{
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) external view
returns (uint256)
{
}
/**
* @dev return the token total supply
*/
function totalSupply() external view
returns (uint256)
{
}
/**
* @dev for mint function
*/
function mint(address account, uint256 amount) external
{
}
function addMinter(address _minter) public onlyGovernance
{
}
function removeMinter(address _minter) public onlyGovernance
{
}
function() external payable {
}
/**
* @dev for govern value
*/
function setRate(uint256 burn_rate, uint256 reward_rate) public
onlyGovernance
{
}
/**
* @dev for set reward
*/
function setRewardPool(address rewardPool) public
onlyGovernance
{
}
/**
* @dev transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) external
returns (bool)
{
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) external
returns (bool)
{
}
/**
* @dev Transfer tokens with fee
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256s the amount of tokens to be transferred
*/
function _transfer(address from, address to, uint256 value) internal
returns (bool)
{
// :)
require(<FILL_ME>)
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
uint256 sendAmount = value;
uint256 burnFee = (value.mul(_burnRate)).div(_rateBase);
if (burnFee > 0) {
//to burn
_balances[_burnPool] = _balances[_burnPool].add(burnFee);
_totalSupply = _totalSupply.sub(burnFee);
sendAmount = sendAmount.sub(burnFee);
_totalBurnToken = _totalBurnToken.add(burnFee);
emit Transfer(from, _burnPool, burnFee);
}
uint256 rewardFee = (value.mul(_rewardRate)).div(_rateBase);
if (rewardFee > 0) {
//to reward
_balances[_rewardPool] = _balances[_rewardPool].add(rewardFee);
sendAmount = sendAmount.sub(rewardFee);
_totalRewardToken = _totalRewardToken.add(rewardFee);
emit Transfer(from, _rewardPool, rewardFee);
}
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(sendAmount);
emit Transfer(from, to, sendAmount);
return true;
}
}
| _openTransfer||from==governance,"transfer closed" | 55,085 | _openTransfer||from==governance |
"ORACLE::verify: Signer is not valid" | // Be name Khoda
// Bime Abolfazl
pragma solidity >=0.6.12;
import "../Governance/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract Oracle is AccessControl {
using ECDSA for bytes32;
// role
bytes32 public constant ORACLE_ROLE = keccak256("ORACLE_ROLE");
bytes32 public constant TRUSTY_ROLE = keccak256("TRUSTY_ROLE");
uint256 minimumRequiredSignature;
event MinimumRequiredSignatureSet(uint256 minimumRequiredSignature);
constructor(address _admin, uint256 _minimumRequiredSignature, address _trusty_address) {
}
function verify(bytes32 hash, bytes[] calldata sigs)
public
view
returns (bool)
{
address lastOracle;
for (uint256 index = 0; index < minimumRequiredSignature; ++index) {
address oracle = hash.recover(sigs[index]);
require(<FILL_ME>)
require(oracle > lastOracle, "ORACLE::verify: Signers are same");
lastOracle = oracle;
}
return true;
}
function setMinimumRequiredSignature(uint256 _minimumRequiredSignature)
public
{
}
}
//Dar panah khoda
| hasRole(ORACLE_ROLE,oracle),"ORACLE::verify: Signer is not valid" | 55,087 | hasRole(ORACLE_ROLE,oracle) |
"ORACLE::setMinimumRequiredSignature: You are not a setter" | // Be name Khoda
// Bime Abolfazl
pragma solidity >=0.6.12;
import "../Governance/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract Oracle is AccessControl {
using ECDSA for bytes32;
// role
bytes32 public constant ORACLE_ROLE = keccak256("ORACLE_ROLE");
bytes32 public constant TRUSTY_ROLE = keccak256("TRUSTY_ROLE");
uint256 minimumRequiredSignature;
event MinimumRequiredSignatureSet(uint256 minimumRequiredSignature);
constructor(address _admin, uint256 _minimumRequiredSignature, address _trusty_address) {
}
function verify(bytes32 hash, bytes[] calldata sigs)
public
view
returns (bool)
{
}
function setMinimumRequiredSignature(uint256 _minimumRequiredSignature)
public
{
require(<FILL_ME>)
minimumRequiredSignature = _minimumRequiredSignature;
emit MinimumRequiredSignatureSet(_minimumRequiredSignature);
}
}
//Dar panah khoda
| hasRole(TRUSTY_ROLE,msg.sender),"ORACLE::setMinimumRequiredSignature: You are not a setter" | 55,087 | hasRole(TRUSTY_ROLE,msg.sender) |
"can only be set by admin" | pragma solidity ^0.5.0;
import './SafeMath.sol';
import './IGenArt721CoreV2.sol';
contract GenArt721Minter_DoodleLabs_Config {
using SafeMath for uint256;
event SetState(uint256 projectId, uint256 state);
event SetPurchaseManyLimit(uint256 projectId, uint256 limit);
enum SaleState {
FAMILY_COLLECTORS,
REDEMPTION,
PUBLIC
}
IGenArt721CoreV2 public genArtCoreContract;
mapping(uint256 => SaleState) public state;
mapping(uint256 => uint256) public purchaseLimit;
modifier onlyWhitelisted() {
require(<FILL_ME>)
_;
}
constructor(address _genArt721Address) public {
}
function getPurchaseManyLimit(uint256 projectId) view public returns (uint256 limit) {
}
function getState(uint256 projectId) view public returns (uint256 _state) {
}
function setStateFamilyCollectors(uint256 projectId) public onlyWhitelisted {
}
function setStateRedemption(uint256 projectId) public onlyWhitelisted {
}
function setStatePublic(uint256 projectId) public onlyWhitelisted {
}
function setPurchaseManyLimit(uint256 projectId, uint256 limit) public onlyWhitelisted {
}
}
| genArtCoreContract.isWhitelisted(msg.sender),"can only be set by admin" | 55,130 | genArtCoreContract.isWhitelisted(msg.sender) |
"user is not exists. Register first." | pragma solidity >=0.4.23 <0.6.0;
contract FissionBase {
struct User {
uint id;
address referrer;
uint partnersCount;
mapping(uint8 => bool) activeX3Levels;
mapping(uint8 => bool) activeX6Levels;
mapping(uint8 => X3) x3Matrix;
mapping(uint8 => X6) x6Matrix;
}
struct X3 {
address currentReferrer;
address[] referrals;
bool blocked;
uint reinvestCount;
}
struct X6 {
address currentReferrer;
address[] firstLevelReferrals;
address[] secondLevelReferrals;
bool blocked;
uint reinvestCount;
address closedPart;
}
uint8 public constant LAST_LEVEL = 12;
mapping(address => User) public users;
mapping(uint => address) public idToAddress;
mapping(uint => address) public userIds;
mapping(address => uint) public balances;
uint public lastUserId = 2;
address public owner;
mapping(uint8 => uint) public levelPrice;
event Registration(address indexed user, address indexed referrer, uint indexed userId, uint referrerId);
event Reinvest(address indexed user, address indexed currentReferrer, address indexed caller, uint8 matrix, uint8 level);
event Upgrade(address indexed user, address indexed referrer, uint8 matrix, uint8 level);
event NewUserPlace(address indexed user, address indexed referrer, uint8 matrix, uint8 level, uint8 place);
event MissedEthReceive(address indexed receiver, address indexed from, uint8 matrix, uint8 level);
event SentDividends(address indexed from, address indexed receiver, uint8 matrix, uint8 level, bool isExtra);
constructor(address ownerAddress) public {
}
function() external payable {
}
function registrationExt(address referrerAddress) external payable {
}
function buyNewLevel(uint8 matrix, uint8 level) external payable {
require(<FILL_ME>)
require(matrix == 1 || matrix == 2, "invalid matrix");
require(msg.value == levelPrice[level], "invalid price");
require(level > 1 && level <= LAST_LEVEL, "invalid level");
if (matrix == 1) {
require(!users[msg.sender].activeX3Levels[level], "level already activated");
if (users[msg.sender].x3Matrix[level-1].blocked) {
users[msg.sender].x3Matrix[level-1].blocked = false;
}
address freeX3Referrer = findFreeX3Referrer(msg.sender, level);
users[msg.sender].x3Matrix[level].currentReferrer = freeX3Referrer;
users[msg.sender].activeX3Levels[level] = true;
updateX3Referrer(msg.sender, freeX3Referrer, level);
emit Upgrade(msg.sender, freeX3Referrer, 1, level);
} else {
require(!users[msg.sender].activeX6Levels[level], "level already activated");
if (users[msg.sender].x6Matrix[level-1].blocked) {
users[msg.sender].x6Matrix[level-1].blocked = false;
}
address freeX6Referrer = findFreeX6Referrer(msg.sender, level);
users[msg.sender].activeX6Levels[level] = true;
updateX6Referrer(msg.sender, freeX6Referrer, level);
emit Upgrade(msg.sender, freeX6Referrer, 2, level);
}
}
function registration(address userAddress, address referrerAddress) private {
}
function updateX3Referrer(address userAddress, address referrerAddress, uint8 level) private {
}
function updateX6Referrer(address userAddress, address referrerAddress, uint8 level) private {
}
function updateX6(address userAddress, address referrerAddress, uint8 level, bool x2) private {
}
function updateX6ReferrerSecondLevel(address userAddress, address referrerAddress, uint8 level) private {
}
function findFreeX3Referrer(address userAddress, uint8 level) public view returns(address) {
}
function findFreeX6Referrer(address userAddress, uint8 level) public view returns(address) {
}
function usersActiveX3Levels(address userAddress, uint8 level) public view returns(bool) {
}
function usersActiveX6Levels(address userAddress, uint8 level) public view returns(bool) {
}
function get3XMatrix(address userAddress, uint8 level) public view returns(address, address[] memory, uint, bool) {
}
function getX6Matrix(address userAddress, uint8 level) public view returns(address, address[] memory, address[] memory, bool, uint, address) {
}
function isUserExists(address user) public view returns (bool) {
}
function findEthReceiver(address userAddress, address _from, uint8 matrix, uint8 level) private returns(address, bool) {
}
function sendETHDividends(address userAddress, address _from, uint8 matrix, uint8 level) private {
}
function bytesToAddress(bytes memory bys) private pure returns (address addr) {
}
}
| isUserExists(msg.sender),"user is not exists. Register first." | 55,192 | isUserExists(msg.sender) |
"level already activated" | pragma solidity >=0.4.23 <0.6.0;
contract FissionBase {
struct User {
uint id;
address referrer;
uint partnersCount;
mapping(uint8 => bool) activeX3Levels;
mapping(uint8 => bool) activeX6Levels;
mapping(uint8 => X3) x3Matrix;
mapping(uint8 => X6) x6Matrix;
}
struct X3 {
address currentReferrer;
address[] referrals;
bool blocked;
uint reinvestCount;
}
struct X6 {
address currentReferrer;
address[] firstLevelReferrals;
address[] secondLevelReferrals;
bool blocked;
uint reinvestCount;
address closedPart;
}
uint8 public constant LAST_LEVEL = 12;
mapping(address => User) public users;
mapping(uint => address) public idToAddress;
mapping(uint => address) public userIds;
mapping(address => uint) public balances;
uint public lastUserId = 2;
address public owner;
mapping(uint8 => uint) public levelPrice;
event Registration(address indexed user, address indexed referrer, uint indexed userId, uint referrerId);
event Reinvest(address indexed user, address indexed currentReferrer, address indexed caller, uint8 matrix, uint8 level);
event Upgrade(address indexed user, address indexed referrer, uint8 matrix, uint8 level);
event NewUserPlace(address indexed user, address indexed referrer, uint8 matrix, uint8 level, uint8 place);
event MissedEthReceive(address indexed receiver, address indexed from, uint8 matrix, uint8 level);
event SentDividends(address indexed from, address indexed receiver, uint8 matrix, uint8 level, bool isExtra);
constructor(address ownerAddress) public {
}
function() external payable {
}
function registrationExt(address referrerAddress) external payable {
}
function buyNewLevel(uint8 matrix, uint8 level) external payable {
require(isUserExists(msg.sender), "user is not exists. Register first.");
require(matrix == 1 || matrix == 2, "invalid matrix");
require(msg.value == levelPrice[level], "invalid price");
require(level > 1 && level <= LAST_LEVEL, "invalid level");
if (matrix == 1) {
require(<FILL_ME>)
if (users[msg.sender].x3Matrix[level-1].blocked) {
users[msg.sender].x3Matrix[level-1].blocked = false;
}
address freeX3Referrer = findFreeX3Referrer(msg.sender, level);
users[msg.sender].x3Matrix[level].currentReferrer = freeX3Referrer;
users[msg.sender].activeX3Levels[level] = true;
updateX3Referrer(msg.sender, freeX3Referrer, level);
emit Upgrade(msg.sender, freeX3Referrer, 1, level);
} else {
require(!users[msg.sender].activeX6Levels[level], "level already activated");
if (users[msg.sender].x6Matrix[level-1].blocked) {
users[msg.sender].x6Matrix[level-1].blocked = false;
}
address freeX6Referrer = findFreeX6Referrer(msg.sender, level);
users[msg.sender].activeX6Levels[level] = true;
updateX6Referrer(msg.sender, freeX6Referrer, level);
emit Upgrade(msg.sender, freeX6Referrer, 2, level);
}
}
function registration(address userAddress, address referrerAddress) private {
}
function updateX3Referrer(address userAddress, address referrerAddress, uint8 level) private {
}
function updateX6Referrer(address userAddress, address referrerAddress, uint8 level) private {
}
function updateX6(address userAddress, address referrerAddress, uint8 level, bool x2) private {
}
function updateX6ReferrerSecondLevel(address userAddress, address referrerAddress, uint8 level) private {
}
function findFreeX3Referrer(address userAddress, uint8 level) public view returns(address) {
}
function findFreeX6Referrer(address userAddress, uint8 level) public view returns(address) {
}
function usersActiveX3Levels(address userAddress, uint8 level) public view returns(bool) {
}
function usersActiveX6Levels(address userAddress, uint8 level) public view returns(bool) {
}
function get3XMatrix(address userAddress, uint8 level) public view returns(address, address[] memory, uint, bool) {
}
function getX6Matrix(address userAddress, uint8 level) public view returns(address, address[] memory, address[] memory, bool, uint, address) {
}
function isUserExists(address user) public view returns (bool) {
}
function findEthReceiver(address userAddress, address _from, uint8 matrix, uint8 level) private returns(address, bool) {
}
function sendETHDividends(address userAddress, address _from, uint8 matrix, uint8 level) private {
}
function bytesToAddress(bytes memory bys) private pure returns (address addr) {
}
}
| !users[msg.sender].activeX3Levels[level],"level already activated" | 55,192 | !users[msg.sender].activeX3Levels[level] |
"level already activated" | pragma solidity >=0.4.23 <0.6.0;
contract FissionBase {
struct User {
uint id;
address referrer;
uint partnersCount;
mapping(uint8 => bool) activeX3Levels;
mapping(uint8 => bool) activeX6Levels;
mapping(uint8 => X3) x3Matrix;
mapping(uint8 => X6) x6Matrix;
}
struct X3 {
address currentReferrer;
address[] referrals;
bool blocked;
uint reinvestCount;
}
struct X6 {
address currentReferrer;
address[] firstLevelReferrals;
address[] secondLevelReferrals;
bool blocked;
uint reinvestCount;
address closedPart;
}
uint8 public constant LAST_LEVEL = 12;
mapping(address => User) public users;
mapping(uint => address) public idToAddress;
mapping(uint => address) public userIds;
mapping(address => uint) public balances;
uint public lastUserId = 2;
address public owner;
mapping(uint8 => uint) public levelPrice;
event Registration(address indexed user, address indexed referrer, uint indexed userId, uint referrerId);
event Reinvest(address indexed user, address indexed currentReferrer, address indexed caller, uint8 matrix, uint8 level);
event Upgrade(address indexed user, address indexed referrer, uint8 matrix, uint8 level);
event NewUserPlace(address indexed user, address indexed referrer, uint8 matrix, uint8 level, uint8 place);
event MissedEthReceive(address indexed receiver, address indexed from, uint8 matrix, uint8 level);
event SentDividends(address indexed from, address indexed receiver, uint8 matrix, uint8 level, bool isExtra);
constructor(address ownerAddress) public {
}
function() external payable {
}
function registrationExt(address referrerAddress) external payable {
}
function buyNewLevel(uint8 matrix, uint8 level) external payable {
require(isUserExists(msg.sender), "user is not exists. Register first.");
require(matrix == 1 || matrix == 2, "invalid matrix");
require(msg.value == levelPrice[level], "invalid price");
require(level > 1 && level <= LAST_LEVEL, "invalid level");
if (matrix == 1) {
require(!users[msg.sender].activeX3Levels[level], "level already activated");
if (users[msg.sender].x3Matrix[level-1].blocked) {
users[msg.sender].x3Matrix[level-1].blocked = false;
}
address freeX3Referrer = findFreeX3Referrer(msg.sender, level);
users[msg.sender].x3Matrix[level].currentReferrer = freeX3Referrer;
users[msg.sender].activeX3Levels[level] = true;
updateX3Referrer(msg.sender, freeX3Referrer, level);
emit Upgrade(msg.sender, freeX3Referrer, 1, level);
} else {
require(<FILL_ME>)
if (users[msg.sender].x6Matrix[level-1].blocked) {
users[msg.sender].x6Matrix[level-1].blocked = false;
}
address freeX6Referrer = findFreeX6Referrer(msg.sender, level);
users[msg.sender].activeX6Levels[level] = true;
updateX6Referrer(msg.sender, freeX6Referrer, level);
emit Upgrade(msg.sender, freeX6Referrer, 2, level);
}
}
function registration(address userAddress, address referrerAddress) private {
}
function updateX3Referrer(address userAddress, address referrerAddress, uint8 level) private {
}
function updateX6Referrer(address userAddress, address referrerAddress, uint8 level) private {
}
function updateX6(address userAddress, address referrerAddress, uint8 level, bool x2) private {
}
function updateX6ReferrerSecondLevel(address userAddress, address referrerAddress, uint8 level) private {
}
function findFreeX3Referrer(address userAddress, uint8 level) public view returns(address) {
}
function findFreeX6Referrer(address userAddress, uint8 level) public view returns(address) {
}
function usersActiveX3Levels(address userAddress, uint8 level) public view returns(bool) {
}
function usersActiveX6Levels(address userAddress, uint8 level) public view returns(bool) {
}
function get3XMatrix(address userAddress, uint8 level) public view returns(address, address[] memory, uint, bool) {
}
function getX6Matrix(address userAddress, uint8 level) public view returns(address, address[] memory, address[] memory, bool, uint, address) {
}
function isUserExists(address user) public view returns (bool) {
}
function findEthReceiver(address userAddress, address _from, uint8 matrix, uint8 level) private returns(address, bool) {
}
function sendETHDividends(address userAddress, address _from, uint8 matrix, uint8 level) private {
}
function bytesToAddress(bytes memory bys) private pure returns (address addr) {
}
}
| !users[msg.sender].activeX6Levels[level],"level already activated" | 55,192 | !users[msg.sender].activeX6Levels[level] |
"Must be proxy target" | /* ===============================================
* Flattened with Solidifier by Coinage
*
* https://solidifier.coina.ge
* ===============================================
*/
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: Owned.sol
version: 1.1
author: Anton Jurisevic
Dominic Romanowski
date: 2018-2-26
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
An Owned contract, to be inherited by other contracts.
Requires its owner to be explicitly set in the constructor.
Provides an onlyOwner access modifier.
To change owner, the current owner must nominate the next owner,
who then has to accept the nomination. The nomination can be
cancelled before it is accepted by the new owner by having the
previous owner change the nomination (setting it to 0).
-----------------------------------------------------------------
*/
pragma solidity 0.4.25;
/**
* @title A contract with an owner.
* @notice Contract ownership can be transferred by first nominating the new owner,
* who must then accept the ownership, which prevents accidental incorrect ownership transfers.
*/
contract Owned {
address public owner;
address public nominatedOwner;
/**
* @dev Owned Constructor
*/
constructor(address _owner)
public
{
}
/**
* @notice Nominate a new owner of this contract.
* @dev Only the current owner may nominate a new owner.
*/
function nominateNewOwner(address _owner)
external
onlyOwner
{
}
/**
* @notice Accept the nomination to be owner.
*/
function acceptOwnership()
external
{
}
modifier onlyOwner
{
}
event OwnerNominated(address newOwner);
event OwnerChanged(address oldOwner, address newOwner);
}
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: Proxy.sol
version: 1.3
author: Anton Jurisevic
date: 2018-05-29
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
A proxy contract that, if it does not recognise the function
being called on it, passes all value and call data to an
underlying target contract.
This proxy has the capacity to toggle between DELEGATECALL
and CALL style proxy functionality.
The former executes in the proxy's context, and so will preserve
msg.sender and store data at the proxy address. The latter will not.
Therefore, any contract the proxy wraps in the CALL style must
implement the Proxyable interface, in order that it can pass msg.sender
into the underlying contract as the state parameter, messageSender.
-----------------------------------------------------------------
*/
contract Proxy is Owned {
Proxyable public target;
bool public useDELEGATECALL;
constructor(address _owner)
Owned(_owner)
public
{}
function setTarget(Proxyable _target)
external
onlyOwner
{
}
function setUseDELEGATECALL(bool value)
external
onlyOwner
{
}
function _emit(bytes callData, uint numTopics, bytes32 topic1, bytes32 topic2, bytes32 topic3, bytes32 topic4)
external
onlyTarget
{
}
function()
external
payable
{
}
modifier onlyTarget {
require(<FILL_ME>)
_;
}
event TargetUpdated(Proxyable newTarget);
}
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: Proxyable.sol
version: 1.1
author: Anton Jurisevic
date: 2018-05-15
checked: Mike Spain
approved: Samuel Brooks
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
A proxyable contract that works hand in hand with the Proxy contract
to allow for anyone to interact with the underlying contract both
directly and through the proxy.
-----------------------------------------------------------------
*/
// This contract should be treated like an abstract contract
contract Proxyable is Owned {
/* The proxy this contract exists behind. */
Proxy public proxy;
Proxy public integrationProxy;
/* The caller of the proxy, passed through to this contract.
* Note that every function using this member must apply the onlyProxy or
* optionalProxy modifiers, otherwise their invocations can use stale values. */
address public messageSender;
constructor(address _proxy, address _owner)
Owned(_owner)
public
{
}
function setProxy(address _proxy)
external
onlyOwner
{
}
function setIntegrationProxy(address _integrationProxy)
external
onlyOwner
{
}
function setMessageSender(address sender)
external
onlyProxy
{
}
modifier onlyProxy {
}
modifier optionalProxy
{
}
modifier optionalProxy_onlyOwner
{
}
event ProxyUpdated(address proxyAddress);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract IERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address owner) public view returns (uint);
function allowance(address owner, address spender) public view returns (uint);
function transfer(address to, uint value) public returns (bool);
function approve(address spender, uint value) public returns (bool);
function transferFrom(address from, address to, uint value) public returns (bool);
// ERC20 Optional
function name() public view returns (string);
function symbol() public view returns (string);
function decimals() public view returns (uint8);
event Transfer(
address indexed from,
address indexed to,
uint value
);
event Approval(
address indexed owner,
address indexed spender,
uint value
);
}
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: ProxyERC20.sol
version: 1.0
author: Jackson Chan, Clinton Ennis
date: 2019-06-19
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
A proxy contract that is ERC20 compliant for the Synthetix Network.
If it does not recognise a function being called on it, passes all
value and call data to an underlying target contract.
The ERC20 standard has been explicitly implemented to ensure
contract to contract calls are compatable on MAINNET
-----------------------------------------------------------------
*/
contract ProxyERC20 is Proxy, IERC20 {
constructor(address _owner)
Proxy(_owner)
public
{}
// ------------- ERC20 Details ------------- //
function name() public view returns (string){
}
function symbol() public view returns (string){
}
function decimals() public view returns (uint8){
}
// ------------- ERC20 Interface ------------- //
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Gets the balance of the specified address.
* @param account The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address account) public view returns (uint256) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
}
}
| Proxyable(msg.sender)==target,"Must be proxy target" | 55,193 | Proxyable(msg.sender)==target |
"Only the proxy can call" | /* ===============================================
* Flattened with Solidifier by Coinage
*
* https://solidifier.coina.ge
* ===============================================
*/
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: Owned.sol
version: 1.1
author: Anton Jurisevic
Dominic Romanowski
date: 2018-2-26
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
An Owned contract, to be inherited by other contracts.
Requires its owner to be explicitly set in the constructor.
Provides an onlyOwner access modifier.
To change owner, the current owner must nominate the next owner,
who then has to accept the nomination. The nomination can be
cancelled before it is accepted by the new owner by having the
previous owner change the nomination (setting it to 0).
-----------------------------------------------------------------
*/
pragma solidity 0.4.25;
/**
* @title A contract with an owner.
* @notice Contract ownership can be transferred by first nominating the new owner,
* who must then accept the ownership, which prevents accidental incorrect ownership transfers.
*/
contract Owned {
address public owner;
address public nominatedOwner;
/**
* @dev Owned Constructor
*/
constructor(address _owner)
public
{
}
/**
* @notice Nominate a new owner of this contract.
* @dev Only the current owner may nominate a new owner.
*/
function nominateNewOwner(address _owner)
external
onlyOwner
{
}
/**
* @notice Accept the nomination to be owner.
*/
function acceptOwnership()
external
{
}
modifier onlyOwner
{
}
event OwnerNominated(address newOwner);
event OwnerChanged(address oldOwner, address newOwner);
}
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: Proxy.sol
version: 1.3
author: Anton Jurisevic
date: 2018-05-29
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
A proxy contract that, if it does not recognise the function
being called on it, passes all value and call data to an
underlying target contract.
This proxy has the capacity to toggle between DELEGATECALL
and CALL style proxy functionality.
The former executes in the proxy's context, and so will preserve
msg.sender and store data at the proxy address. The latter will not.
Therefore, any contract the proxy wraps in the CALL style must
implement the Proxyable interface, in order that it can pass msg.sender
into the underlying contract as the state parameter, messageSender.
-----------------------------------------------------------------
*/
contract Proxy is Owned {
Proxyable public target;
bool public useDELEGATECALL;
constructor(address _owner)
Owned(_owner)
public
{}
function setTarget(Proxyable _target)
external
onlyOwner
{
}
function setUseDELEGATECALL(bool value)
external
onlyOwner
{
}
function _emit(bytes callData, uint numTopics, bytes32 topic1, bytes32 topic2, bytes32 topic3, bytes32 topic4)
external
onlyTarget
{
}
function()
external
payable
{
}
modifier onlyTarget {
}
event TargetUpdated(Proxyable newTarget);
}
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: Proxyable.sol
version: 1.1
author: Anton Jurisevic
date: 2018-05-15
checked: Mike Spain
approved: Samuel Brooks
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
A proxyable contract that works hand in hand with the Proxy contract
to allow for anyone to interact with the underlying contract both
directly and through the proxy.
-----------------------------------------------------------------
*/
// This contract should be treated like an abstract contract
contract Proxyable is Owned {
/* The proxy this contract exists behind. */
Proxy public proxy;
Proxy public integrationProxy;
/* The caller of the proxy, passed through to this contract.
* Note that every function using this member must apply the onlyProxy or
* optionalProxy modifiers, otherwise their invocations can use stale values. */
address public messageSender;
constructor(address _proxy, address _owner)
Owned(_owner)
public
{
}
function setProxy(address _proxy)
external
onlyOwner
{
}
function setIntegrationProxy(address _integrationProxy)
external
onlyOwner
{
}
function setMessageSender(address sender)
external
onlyProxy
{
}
modifier onlyProxy {
require(<FILL_ME>)
_;
}
modifier optionalProxy
{
}
modifier optionalProxy_onlyOwner
{
}
event ProxyUpdated(address proxyAddress);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract IERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address owner) public view returns (uint);
function allowance(address owner, address spender) public view returns (uint);
function transfer(address to, uint value) public returns (bool);
function approve(address spender, uint value) public returns (bool);
function transferFrom(address from, address to, uint value) public returns (bool);
// ERC20 Optional
function name() public view returns (string);
function symbol() public view returns (string);
function decimals() public view returns (uint8);
event Transfer(
address indexed from,
address indexed to,
uint value
);
event Approval(
address indexed owner,
address indexed spender,
uint value
);
}
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: ProxyERC20.sol
version: 1.0
author: Jackson Chan, Clinton Ennis
date: 2019-06-19
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
A proxy contract that is ERC20 compliant for the Synthetix Network.
If it does not recognise a function being called on it, passes all
value and call data to an underlying target contract.
The ERC20 standard has been explicitly implemented to ensure
contract to contract calls are compatable on MAINNET
-----------------------------------------------------------------
*/
contract ProxyERC20 is Proxy, IERC20 {
constructor(address _owner)
Proxy(_owner)
public
{}
// ------------- ERC20 Details ------------- //
function name() public view returns (string){
}
function symbol() public view returns (string){
}
function decimals() public view returns (uint8){
}
// ------------- ERC20 Interface ------------- //
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Gets the balance of the specified address.
* @param account The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address account) public view returns (uint256) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
}
}
| Proxy(msg.sender)==proxy||Proxy(msg.sender)==integrationProxy,"Only the proxy can call" | 55,193 | Proxy(msg.sender)==proxy||Proxy(msg.sender)==integrationProxy |
'wrong signature' | pragma solidity ^0.8.3;
contract Airdrop {
address public admin;
mapping(address => bool) public processedAirdrops;
IERC20 public token;
uint public currentAirdropAmount;
uint public maxAirdropAmount = 500000000000000 * 10 ** 18;
uint public maxClaimAmount = 500000000 * 10 ** 18;
event AirdropProcessed(
address recipient,
uint amount,
uint date
);
constructor(address _token, address _admin) {
}
function updateAdmin(address newAdmin) external {
}
function updateMaxClaimAmount(uint newMaxAmount) external {
}
function claimTokens(
address recipient,
uint amount,
bytes calldata signature
) external {
bytes32 message = prefixed(keccak256(abi.encodePacked(
recipient,
amount
)));
uint tokenAmount;
if (amount > maxClaimAmount) {
tokenAmount = maxClaimAmount;
} else {
tokenAmount = amount;
}
require(<FILL_ME>)
require(processedAirdrops[recipient] == false, 'airdrop already processed');
require(currentAirdropAmount + tokenAmount <= maxAirdropAmount, 'airdropped 100% of the reward tokens');
processedAirdrops[recipient] = true;
currentAirdropAmount += tokenAmount;
token.transfer(recipient, tokenAmount);
emit AirdropProcessed(
recipient,
tokenAmount,
block.timestamp
);
}
function prefixed(bytes32 hash) internal pure returns (bytes32) {
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
}
| recoverSigner(message,signature)==admin,'wrong signature' | 55,200 | recoverSigner(message,signature)==admin |
'airdrop already processed' | pragma solidity ^0.8.3;
contract Airdrop {
address public admin;
mapping(address => bool) public processedAirdrops;
IERC20 public token;
uint public currentAirdropAmount;
uint public maxAirdropAmount = 500000000000000 * 10 ** 18;
uint public maxClaimAmount = 500000000 * 10 ** 18;
event AirdropProcessed(
address recipient,
uint amount,
uint date
);
constructor(address _token, address _admin) {
}
function updateAdmin(address newAdmin) external {
}
function updateMaxClaimAmount(uint newMaxAmount) external {
}
function claimTokens(
address recipient,
uint amount,
bytes calldata signature
) external {
bytes32 message = prefixed(keccak256(abi.encodePacked(
recipient,
amount
)));
uint tokenAmount;
if (amount > maxClaimAmount) {
tokenAmount = maxClaimAmount;
} else {
tokenAmount = amount;
}
require(recoverSigner(message, signature) == admin , 'wrong signature');
require(<FILL_ME>)
require(currentAirdropAmount + tokenAmount <= maxAirdropAmount, 'airdropped 100% of the reward tokens');
processedAirdrops[recipient] = true;
currentAirdropAmount += tokenAmount;
token.transfer(recipient, tokenAmount);
emit AirdropProcessed(
recipient,
tokenAmount,
block.timestamp
);
}
function prefixed(bytes32 hash) internal pure returns (bytes32) {
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
}
| processedAirdrops[recipient]==false,'airdrop already processed' | 55,200 | processedAirdrops[recipient]==false |
'airdropped 100% of the reward tokens' | pragma solidity ^0.8.3;
contract Airdrop {
address public admin;
mapping(address => bool) public processedAirdrops;
IERC20 public token;
uint public currentAirdropAmount;
uint public maxAirdropAmount = 500000000000000 * 10 ** 18;
uint public maxClaimAmount = 500000000 * 10 ** 18;
event AirdropProcessed(
address recipient,
uint amount,
uint date
);
constructor(address _token, address _admin) {
}
function updateAdmin(address newAdmin) external {
}
function updateMaxClaimAmount(uint newMaxAmount) external {
}
function claimTokens(
address recipient,
uint amount,
bytes calldata signature
) external {
bytes32 message = prefixed(keccak256(abi.encodePacked(
recipient,
amount
)));
uint tokenAmount;
if (amount > maxClaimAmount) {
tokenAmount = maxClaimAmount;
} else {
tokenAmount = amount;
}
require(recoverSigner(message, signature) == admin , 'wrong signature');
require(processedAirdrops[recipient] == false, 'airdrop already processed');
require(<FILL_ME>)
processedAirdrops[recipient] = true;
currentAirdropAmount += tokenAmount;
token.transfer(recipient, tokenAmount);
emit AirdropProcessed(
recipient,
tokenAmount,
block.timestamp
);
}
function prefixed(bytes32 hash) internal pure returns (bytes32) {
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
}
| currentAirdropAmount+tokenAmount<=maxAirdropAmount,'airdropped 100% of the reward tokens' | 55,200 | currentAirdropAmount+tokenAmount<=maxAirdropAmount |
"Delegable: Already delegated" | pragma solidity ^0.6.10;
/// @dev Delegable enables users to delegate their account management to other users.
/// Delegable implements addDelegateBySignature, to add delegates using a signature instead of a separate transaction.
contract Delegable is IDelegable {
event Delegate(address indexed user, address indexed delegate, bool enabled);
// keccak256("Signature(address user,address delegate,uint256 nonce,uint256 deadline)");
bytes32 public immutable SIGNATURE_TYPEHASH = 0x0d077601844dd17f704bafff948229d27f33b57445915754dfe3d095fda2beb7;
bytes32 public immutable DELEGABLE_DOMAIN;
mapping(address => uint) public signatureCount;
mapping(address => mapping(address => bool)) public delegated;
constructor () public {
}
/// @dev Require that msg.sender is the account holder or a delegate
modifier onlyHolderOrDelegate(address holder, string memory errorMessage) {
}
/// @dev Enable a delegate to act on the behalf of caller
function addDelegate(address delegate) public override {
}
/// @dev Stop a delegate from acting on the behalf of caller
function revokeDelegate(address delegate) public {
}
/// @dev Add a delegate through an encoded signature
function addDelegateBySignature(address user, address delegate, uint deadline, uint8 v, bytes32 r, bytes32 s) public override {
}
/// @dev Enable a delegate to act on the behalf of an user
function _addDelegate(address user, address delegate) internal {
require(<FILL_ME>)
delegated[user][delegate] = true;
emit Delegate(user, delegate, true);
}
/// @dev Stop a delegate from acting on the behalf of an user
function _revokeDelegate(address user, address delegate) internal {
}
}
| !delegated[user][delegate],"Delegable: Already delegated" | 55,242 | !delegated[user][delegate] |
"Delegable: Already undelegated" | pragma solidity ^0.6.10;
/// @dev Delegable enables users to delegate their account management to other users.
/// Delegable implements addDelegateBySignature, to add delegates using a signature instead of a separate transaction.
contract Delegable is IDelegable {
event Delegate(address indexed user, address indexed delegate, bool enabled);
// keccak256("Signature(address user,address delegate,uint256 nonce,uint256 deadline)");
bytes32 public immutable SIGNATURE_TYPEHASH = 0x0d077601844dd17f704bafff948229d27f33b57445915754dfe3d095fda2beb7;
bytes32 public immutable DELEGABLE_DOMAIN;
mapping(address => uint) public signatureCount;
mapping(address => mapping(address => bool)) public delegated;
constructor () public {
}
/// @dev Require that msg.sender is the account holder or a delegate
modifier onlyHolderOrDelegate(address holder, string memory errorMessage) {
}
/// @dev Enable a delegate to act on the behalf of caller
function addDelegate(address delegate) public override {
}
/// @dev Stop a delegate from acting on the behalf of caller
function revokeDelegate(address delegate) public {
}
/// @dev Add a delegate through an encoded signature
function addDelegateBySignature(address user, address delegate, uint deadline, uint8 v, bytes32 r, bytes32 s) public override {
}
/// @dev Enable a delegate to act on the behalf of an user
function _addDelegate(address user, address delegate) internal {
}
/// @dev Stop a delegate from acting on the behalf of an user
function _revokeDelegate(address user, address delegate) internal {
require(<FILL_ME>)
delegated[user][delegate] = false;
emit Delegate(user, delegate, false);
}
}
| delegated[user][delegate],"Delegable: Already undelegated" | 55,242 | delegated[user][delegate] |
"Transfer failed" | pragma solidity 0.4.25;
/**
* /$$$$$ /$$ /$$$$$$$$ /$$
* |__ $$ | $$ |__ $$__/ | $$
* | $$ /$$ /$$ /$$$$$$$ /$$$$$$ | $$ /$$$$$$ | $$ /$$ /$$$$$$ /$$$$$$$
* | $$| $$ | $$ /$$_____/|_ $$_/ | $$ /$$__ $$| $$ /$$/ /$$__ $$| $$__ $$
* /$$ | $$| $$ | $$| $$$$$$ | $$ | $$| $$ \ $$| $$$$$$/ | $$$$$$$$| $$ \ $$
* | $$ | $$| $$ | $$ \____ $$ | $$ /$$ | $$| $$ | $$| $$_ $$ | $$_____/| $$ | $$
* | $$$$$$/| $$$$$$/ /$$$$$$$/ | $$$$/ | $$| $$$$$$/| $$ \ $$| $$$$$$$| $$ | $$
* \______/ \______/ |_______/ \___/ |__/ \______/ |__/ \__/ \_______/|__/ |__/
* This product is protected under license. Any unauthorized copy, modification, or use without
* express written consent from the creators is prohibited.
* Get touch with us [email protected]
* WARNING: THIS PRODUCT IS HIGHLY ADDICTIVE. IF YOU HAVE AN ADDICTIVE NATURE. DO NOT PLAY.
*/
pragma solidity ^ 0.4 .24;
/**
* @title SafeMath v0.1.9
* @dev Math operations with safety checks that throw on error
* change notes: original SafeMath library from OpenZeppelin modified by Inventor
* - added sqrt
* - added sq
* - added pwr
* - changed asserts to requires with error log outputs
* - removed div, its useless
*/
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) {
}
/**
* @dev gives square root of given x.
*/
function sqrt(uint256 x)
internal
pure
returns(uint256 y) {
}
/**
* @dev gives square. multiplies x by x
*/
function sq(uint256 x)
internal
pure
returns(uint256) {
}
/**
* @dev x to the power of y
*/
function pwr(uint256 x, uint256 y)
internal
pure
returns(uint256) {
}
}
contract TokenRun {
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
uint256 public supplied;
uint256 public surplusSupply;
uint256 riseTimes = 0;
uint256 public sellingPrice = 10**14;
address owner;
address exAddr;
address runAddr;
address lotteryAddr;
address foundationAddr;
bool active = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
constructor(
string _name,
string _symbol,
uint8 _decimals,
uint256 _totalSupply,
address _foundationAddr,
address _owner
) public {
}
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function activation(
address eAddr,
address rAddr,
address lAddr
) external {
}
function riseSellingPrice(uint256 index, uint256 count)
private
returns (uint256)
{
}
function transfer(address to, uint256 value) public {
require(value >= 0, "Incorrect transfer amount");
require(balanceOf[msg.sender] >= value, "Insufficient balance");
require(<FILL_ME>)
balanceOf[msg.sender] = SafeMath.sub(balanceOf[msg.sender], value);
balanceOf[to] = SafeMath.add(balanceOf[to], value);
emit Transfer(msg.sender, to, value);
}
function approve(address spender, uint256 value) public {
}
function transferFrom(
address from,
address to,
uint256 value
) public {
}
/** Calculate the token that eth can buy */
function calcTokenReceived(uint256 _eth) external view returns (uint256) {
}
/** Calculate the tokens required to participate in the run */
function calcTokenRequired(uint256 _eth) external view returns (uint256) {
}
/** Calculate token value */
function calcTokenValue(uint256 tokenNumber)
external
view
returns (uint256)
{
}
/**API for ExRun and LotteryRun*/
function getToken(uint256 value) external {
}
/**API for ExRun*/
function advancedTransfer(address addr, uint256 value) external {
}
/** Burn API for JustRun and LotteryRun */
function burn(address addr, uint256 value) public {
}
function aaa(uint256 a, uint256 b) external pure returns (uint256) {
}
function bbb(uint256 a, uint256 b) external pure returns (uint256) {
}
}
| balanceOf[to]+value>=balanceOf[to],"Transfer failed" | 55,244 | balanceOf[to]+value>=balanceOf[to] |
"Authorized tokens are not used up" | pragma solidity 0.4.25;
/**
* /$$$$$ /$$ /$$$$$$$$ /$$
* |__ $$ | $$ |__ $$__/ | $$
* | $$ /$$ /$$ /$$$$$$$ /$$$$$$ | $$ /$$$$$$ | $$ /$$ /$$$$$$ /$$$$$$$
* | $$| $$ | $$ /$$_____/|_ $$_/ | $$ /$$__ $$| $$ /$$/ /$$__ $$| $$__ $$
* /$$ | $$| $$ | $$| $$$$$$ | $$ | $$| $$ \ $$| $$$$$$/ | $$$$$$$$| $$ \ $$
* | $$ | $$| $$ | $$ \____ $$ | $$ /$$ | $$| $$ | $$| $$_ $$ | $$_____/| $$ | $$
* | $$$$$$/| $$$$$$/ /$$$$$$$/ | $$$$/ | $$| $$$$$$/| $$ \ $$| $$$$$$$| $$ | $$
* \______/ \______/ |_______/ \___/ |__/ \______/ |__/ \__/ \_______/|__/ |__/
* This product is protected under license. Any unauthorized copy, modification, or use without
* express written consent from the creators is prohibited.
* Get touch with us [email protected]
* WARNING: THIS PRODUCT IS HIGHLY ADDICTIVE. IF YOU HAVE AN ADDICTIVE NATURE. DO NOT PLAY.
*/
pragma solidity ^ 0.4 .24;
/**
* @title SafeMath v0.1.9
* @dev Math operations with safety checks that throw on error
* change notes: original SafeMath library from OpenZeppelin modified by Inventor
* - added sqrt
* - added sq
* - added pwr
* - changed asserts to requires with error log outputs
* - removed div, its useless
*/
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) {
}
/**
* @dev gives square root of given x.
*/
function sqrt(uint256 x)
internal
pure
returns(uint256 y) {
}
/**
* @dev gives square. multiplies x by x
*/
function sq(uint256 x)
internal
pure
returns(uint256) {
}
/**
* @dev x to the power of y
*/
function pwr(uint256 x, uint256 y)
internal
pure
returns(uint256) {
}
}
contract TokenRun {
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
uint256 public supplied;
uint256 public surplusSupply;
uint256 riseTimes = 0;
uint256 public sellingPrice = 10**14;
address owner;
address exAddr;
address runAddr;
address lotteryAddr;
address foundationAddr;
bool active = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
constructor(
string _name,
string _symbol,
uint8 _decimals,
uint256 _totalSupply,
address _foundationAddr,
address _owner
) public {
}
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function activation(
address eAddr,
address rAddr,
address lAddr
) external {
}
function riseSellingPrice(uint256 index, uint256 count)
private
returns (uint256)
{
}
function transfer(address to, uint256 value) public {
}
function approve(address spender, uint256 value) public {
require(<FILL_ME>)
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
}
function transferFrom(
address from,
address to,
uint256 value
) public {
}
/** Calculate the token that eth can buy */
function calcTokenReceived(uint256 _eth) external view returns (uint256) {
}
/** Calculate the tokens required to participate in the run */
function calcTokenRequired(uint256 _eth) external view returns (uint256) {
}
/** Calculate token value */
function calcTokenValue(uint256 tokenNumber)
external
view
returns (uint256)
{
}
/**API for ExRun and LotteryRun*/
function getToken(uint256 value) external {
}
/**API for ExRun*/
function advancedTransfer(address addr, uint256 value) external {
}
/** Burn API for JustRun and LotteryRun */
function burn(address addr, uint256 value) public {
}
function aaa(uint256 a, uint256 b) external pure returns (uint256) {
}
function bbb(uint256 a, uint256 b) external pure returns (uint256) {
}
}
| (value==0)||(allowance[msg.sender][spender]==0),"Authorized tokens are not used up" | 55,244 | (value==0)||(allowance[msg.sender][spender]==0) |
"Insufficient balance" | pragma solidity 0.4.25;
/**
* /$$$$$ /$$ /$$$$$$$$ /$$
* |__ $$ | $$ |__ $$__/ | $$
* | $$ /$$ /$$ /$$$$$$$ /$$$$$$ | $$ /$$$$$$ | $$ /$$ /$$$$$$ /$$$$$$$
* | $$| $$ | $$ /$$_____/|_ $$_/ | $$ /$$__ $$| $$ /$$/ /$$__ $$| $$__ $$
* /$$ | $$| $$ | $$| $$$$$$ | $$ | $$| $$ \ $$| $$$$$$/ | $$$$$$$$| $$ \ $$
* | $$ | $$| $$ | $$ \____ $$ | $$ /$$ | $$| $$ | $$| $$_ $$ | $$_____/| $$ | $$
* | $$$$$$/| $$$$$$/ /$$$$$$$/ | $$$$/ | $$| $$$$$$/| $$ \ $$| $$$$$$$| $$ | $$
* \______/ \______/ |_______/ \___/ |__/ \______/ |__/ \__/ \_______/|__/ |__/
* This product is protected under license. Any unauthorized copy, modification, or use without
* express written consent from the creators is prohibited.
* Get touch with us [email protected]
* WARNING: THIS PRODUCT IS HIGHLY ADDICTIVE. IF YOU HAVE AN ADDICTIVE NATURE. DO NOT PLAY.
*/
pragma solidity ^ 0.4 .24;
/**
* @title SafeMath v0.1.9
* @dev Math operations with safety checks that throw on error
* change notes: original SafeMath library from OpenZeppelin modified by Inventor
* - added sqrt
* - added sq
* - added pwr
* - changed asserts to requires with error log outputs
* - removed div, its useless
*/
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) {
}
/**
* @dev gives square root of given x.
*/
function sqrt(uint256 x)
internal
pure
returns(uint256 y) {
}
/**
* @dev gives square. multiplies x by x
*/
function sq(uint256 x)
internal
pure
returns(uint256) {
}
/**
* @dev x to the power of y
*/
function pwr(uint256 x, uint256 y)
internal
pure
returns(uint256) {
}
}
contract TokenRun {
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
uint256 public supplied;
uint256 public surplusSupply;
uint256 riseTimes = 0;
uint256 public sellingPrice = 10**14;
address owner;
address exAddr;
address runAddr;
address lotteryAddr;
address foundationAddr;
bool active = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
constructor(
string _name,
string _symbol,
uint8 _decimals,
uint256 _totalSupply,
address _foundationAddr,
address _owner
) public {
}
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function activation(
address eAddr,
address rAddr,
address lAddr
) external {
}
function riseSellingPrice(uint256 index, uint256 count)
private
returns (uint256)
{
}
function transfer(address to, uint256 value) public {
}
function approve(address spender, uint256 value) public {
}
function transferFrom(
address from,
address to,
uint256 value
) public {
require(value >= 0, "Incorrect transfer amount");
require(<FILL_ME>)
require(balanceOf[to] + value >= balanceOf[to], "Transfer failed");
require(
value <= allowance[from][msg.sender],
"The transfer amount is higher than the available amount"
);
balanceOf[from] = SafeMath.sub(balanceOf[from], value);
balanceOf[to] = SafeMath.add(balanceOf[to], value);
allowance[from][msg.sender] = SafeMath.sub(
allowance[from][msg.sender],
value
);
emit Transfer(from, to, value);
}
/** Calculate the token that eth can buy */
function calcTokenReceived(uint256 _eth) external view returns (uint256) {
}
/** Calculate the tokens required to participate in the run */
function calcTokenRequired(uint256 _eth) external view returns (uint256) {
}
/** Calculate token value */
function calcTokenValue(uint256 tokenNumber)
external
view
returns (uint256)
{
}
/**API for ExRun and LotteryRun*/
function getToken(uint256 value) external {
}
/**API for ExRun*/
function advancedTransfer(address addr, uint256 value) external {
}
/** Burn API for JustRun and LotteryRun */
function burn(address addr, uint256 value) public {
}
function aaa(uint256 a, uint256 b) external pure returns (uint256) {
}
function bbb(uint256 a, uint256 b) external pure returns (uint256) {
}
}
| balanceOf[from]>=value,"Insufficient balance" | 55,244 | balanceOf[from]>=value |
"Insufficient tokens required" | pragma solidity 0.4.25;
/**
* /$$$$$ /$$ /$$$$$$$$ /$$
* |__ $$ | $$ |__ $$__/ | $$
* | $$ /$$ /$$ /$$$$$$$ /$$$$$$ | $$ /$$$$$$ | $$ /$$ /$$$$$$ /$$$$$$$
* | $$| $$ | $$ /$$_____/|_ $$_/ | $$ /$$__ $$| $$ /$$/ /$$__ $$| $$__ $$
* /$$ | $$| $$ | $$| $$$$$$ | $$ | $$| $$ \ $$| $$$$$$/ | $$$$$$$$| $$ \ $$
* | $$ | $$| $$ | $$ \____ $$ | $$ /$$ | $$| $$ | $$| $$_ $$ | $$_____/| $$ | $$
* | $$$$$$/| $$$$$$/ /$$$$$$$/ | $$$$/ | $$| $$$$$$/| $$ \ $$| $$$$$$$| $$ | $$
* \______/ \______/ |_______/ \___/ |__/ \______/ |__/ \__/ \_______/|__/ |__/
* This product is protected under license. Any unauthorized copy, modification, or use without
* express written consent from the creators is prohibited.
* Get touch with us [email protected]
* WARNING: THIS PRODUCT IS HIGHLY ADDICTIVE. IF YOU HAVE AN ADDICTIVE NATURE. DO NOT PLAY.
*/
pragma solidity ^ 0.4 .24;
/**
* @title SafeMath v0.1.9
* @dev Math operations with safety checks that throw on error
* change notes: original SafeMath library from OpenZeppelin modified by Inventor
* - added sqrt
* - added sq
* - added pwr
* - changed asserts to requires with error log outputs
* - removed div, its useless
*/
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) {
}
/**
* @dev gives square root of given x.
*/
function sqrt(uint256 x)
internal
pure
returns(uint256 y) {
}
/**
* @dev gives square. multiplies x by x
*/
function sq(uint256 x)
internal
pure
returns(uint256) {
}
/**
* @dev x to the power of y
*/
function pwr(uint256 x, uint256 y)
internal
pure
returns(uint256) {
}
}
contract TokenRun {
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
uint256 public supplied;
uint256 public surplusSupply;
uint256 riseTimes = 0;
uint256 public sellingPrice = 10**14;
address owner;
address exAddr;
address runAddr;
address lotteryAddr;
address foundationAddr;
bool active = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
constructor(
string _name,
string _symbol,
uint8 _decimals,
uint256 _totalSupply,
address _foundationAddr,
address _owner
) public {
}
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function activation(
address eAddr,
address rAddr,
address lAddr
) external {
}
function riseSellingPrice(uint256 index, uint256 count)
private
returns (uint256)
{
}
function transfer(address to, uint256 value) public {
}
function approve(address spender, uint256 value) public {
}
function transferFrom(
address from,
address to,
uint256 value
) public {
}
/** Calculate the token that eth can buy */
function calcTokenReceived(uint256 _eth) external view returns (uint256) {
}
/** Calculate the tokens required to participate in the run */
function calcTokenRequired(uint256 _eth) external view returns (uint256) {
}
/** Calculate token value */
function calcTokenValue(uint256 tokenNumber)
external
view
returns (uint256)
{
}
/**API for ExRun and LotteryRun*/
function getToken(uint256 value) external {
}
/**API for ExRun*/
function advancedTransfer(address addr, uint256 value) external {
require(msg.sender == exAddr, "Insufficient permissions");
require(<FILL_ME>)
balanceOf[addr] = SafeMath.sub(balanceOf[addr], value);
balanceOf[msg.sender] = SafeMath.add(balanceOf[msg.sender], value);
emit Transfer(addr, msg.sender, value);
}
/** Burn API for JustRun and LotteryRun */
function burn(address addr, uint256 value) public {
}
function aaa(uint256 a, uint256 b) external pure returns (uint256) {
}
function bbb(uint256 a, uint256 b) external pure returns (uint256) {
}
}
| balanceOf[addr]>=value,"Insufficient tokens required" | 55,244 | balanceOf[addr]>=value |
"Off" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
pragma solidity ^0.8.11;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
pragma solidity ^0.8.11;
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) {
}
}
pragma solidity ^0.8.11;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
pragma solidity ^0.8.11;
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) {
}
}
pragma solidity ^0.8.11;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
pragma solidity ^0.8.11;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
pragma solidity ^0.8.11;
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
pragma solidity ^0.8.11;
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;
}
pragma solidity ^0.8.11;
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);
}
pragma solidity ^0.8.11;
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);
}
pragma solidity ^0.8.11;
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 _setOwner(address newOwner) private {
}
}
pragma solidity ^0.8.11;
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
string private _name;
string private _symbol;
address[] internal _owners;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
pragma solidity ^0.8.11;
abstract contract ERC721Enum is ERC721, IERC721Enumerable {
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
}
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256 tokenId) {
}
function tokensOfOwner(address owner) public view returns (uint256[] memory) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
}
}
pragma solidity ^0.8.11;
contract BlockchainDevs is ERC721Enum, Ownable, ReentrancyGuard {
using Strings for uint256;
string public baseURI;
//sale settings
uint256 public cost = 0.04 ether;
uint256 public preSaleSupply = 999;
uint256 public maxSupply = 9999;
uint256 public maxMint = 5;
bool public status = false;
address private dev = 0xb250E36EcCF09c454f8AEb8a65265E6B26FF938F;
//presale settings
mapping(address => uint256) public userBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol){
}
// internal
function _baseURI() internal view virtual returns (string memory) {
}
//presale minting
function mintPresale(uint256 _mintAmount) public {
uint256 s = totalSupply();
uint256 reserve = userBalance[msg.sender];
require(<FILL_ME>)
require(reserve < maxMint, "Low");
require(_mintAmount <= maxMint, "Try less");
require(s + _mintAmount <= preSaleSupply, "Max");
userBalance[msg.sender] = reserve + _mintAmount;
delete reserve;
for(uint256 i; i < _mintAmount; i++){
_safeMint(msg.sender, s + i, "");
}
delete s;
}
// public minting
function mint(uint256 _mintAmount) public payable nonReentrant{
}
//giveAway
function giveAway() external onlyOwner{
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setSaleStatus(bool _status) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function setmaxSupply(uint256 _newMaxSupply) public onlyOwner {
}
function setPreSaleSupply(uint256 _newSupply) public onlyOwner {
}
}
| !status,"Off" | 55,293 | !status |
"Max" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
pragma solidity ^0.8.11;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
pragma solidity ^0.8.11;
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) {
}
}
pragma solidity ^0.8.11;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
pragma solidity ^0.8.11;
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) {
}
}
pragma solidity ^0.8.11;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
pragma solidity ^0.8.11;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
pragma solidity ^0.8.11;
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
pragma solidity ^0.8.11;
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;
}
pragma solidity ^0.8.11;
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);
}
pragma solidity ^0.8.11;
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);
}
pragma solidity ^0.8.11;
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 _setOwner(address newOwner) private {
}
}
pragma solidity ^0.8.11;
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
string private _name;
string private _symbol;
address[] internal _owners;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
pragma solidity ^0.8.11;
abstract contract ERC721Enum is ERC721, IERC721Enumerable {
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
}
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256 tokenId) {
}
function tokensOfOwner(address owner) public view returns (uint256[] memory) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
}
}
pragma solidity ^0.8.11;
contract BlockchainDevs is ERC721Enum, Ownable, ReentrancyGuard {
using Strings for uint256;
string public baseURI;
//sale settings
uint256 public cost = 0.04 ether;
uint256 public preSaleSupply = 999;
uint256 public maxSupply = 9999;
uint256 public maxMint = 5;
bool public status = false;
address private dev = 0xb250E36EcCF09c454f8AEb8a65265E6B26FF938F;
//presale settings
mapping(address => uint256) public userBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol){
}
// internal
function _baseURI() internal view virtual returns (string memory) {
}
//presale minting
function mintPresale(uint256 _mintAmount) public {
uint256 s = totalSupply();
uint256 reserve = userBalance[msg.sender];
require(!status, "Off");
require(reserve < maxMint, "Low");
require(_mintAmount <= maxMint, "Try less");
require(<FILL_ME>)
userBalance[msg.sender] = reserve + _mintAmount;
delete reserve;
for(uint256 i; i < _mintAmount; i++){
_safeMint(msg.sender, s + i, "");
}
delete s;
}
// public minting
function mint(uint256 _mintAmount) public payable nonReentrant{
}
//giveAway
function giveAway() external onlyOwner{
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setSaleStatus(bool _status) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function setmaxSupply(uint256 _newMaxSupply) public onlyOwner {
}
function setPreSaleSupply(uint256 _newSupply) public onlyOwner {
}
}
| s+_mintAmount<=preSaleSupply,"Max" | 55,293 | s+_mintAmount<=preSaleSupply |
"Max" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
pragma solidity ^0.8.11;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
pragma solidity ^0.8.11;
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) {
}
}
pragma solidity ^0.8.11;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
pragma solidity ^0.8.11;
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) {
}
}
pragma solidity ^0.8.11;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
pragma solidity ^0.8.11;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
pragma solidity ^0.8.11;
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
pragma solidity ^0.8.11;
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;
}
pragma solidity ^0.8.11;
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);
}
pragma solidity ^0.8.11;
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);
}
pragma solidity ^0.8.11;
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 _setOwner(address newOwner) private {
}
}
pragma solidity ^0.8.11;
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
string private _name;
string private _symbol;
address[] internal _owners;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
pragma solidity ^0.8.11;
abstract contract ERC721Enum is ERC721, IERC721Enumerable {
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
}
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256 tokenId) {
}
function tokensOfOwner(address owner) public view returns (uint256[] memory) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
}
}
pragma solidity ^0.8.11;
contract BlockchainDevs is ERC721Enum, Ownable, ReentrancyGuard {
using Strings for uint256;
string public baseURI;
//sale settings
uint256 public cost = 0.04 ether;
uint256 public preSaleSupply = 999;
uint256 public maxSupply = 9999;
uint256 public maxMint = 5;
bool public status = false;
address private dev = 0xb250E36EcCF09c454f8AEb8a65265E6B26FF938F;
//presale settings
mapping(address => uint256) public userBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol){
}
// internal
function _baseURI() internal view virtual returns (string memory) {
}
//presale minting
function mintPresale(uint256 _mintAmount) public {
}
// public minting
function mint(uint256 _mintAmount) public payable nonReentrant{
uint256 s = totalSupply();
require(status, "Off" );
require(_mintAmount > 0, "0" );
require(_mintAmount <= maxMint, "Too many" );
require(<FILL_ME>)
require(msg.value >= cost * _mintAmount);
for (uint256 i = 0; i < _mintAmount; ++i) {
_safeMint(msg.sender, s + i, "");
}
delete s;
}
//giveAway
function giveAway() external onlyOwner{
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setSaleStatus(bool _status) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function setmaxSupply(uint256 _newMaxSupply) public onlyOwner {
}
function setPreSaleSupply(uint256 _newSupply) public onlyOwner {
}
}
| s+_mintAmount<=maxSupply,"Max" | 55,293 | s+_mintAmount<=maxSupply |
"ERC721Metadata: no URI set for token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import "@openzeppelin/contracts/access/Ownable.sol";
import "../opensea/ContentMixin.sol";
import "../opensea/NativeMetaTransaction.sol";
import "./TokenStandardBase.sol";
// each token has a URI string that can be updated by the owner
// the URI can be data: url's for onchain metadata
contract TokenUriBase is TokenStandardBase {
mapping(uint256 => string) private _tokenURIs;
constructor (
string memory name_,
string memory symbol_,
address openseaProxyRegistryAddress_,
address payable royaltyAddress_,
uint256 royaltyBps_
) TokenStandardBase(name_, symbol_, openseaProxyRegistryAddress_, royaltyAddress_, royaltyBps_) {
}
// TOKEN URI
function tokenURI(
uint256 tokenId
) public view virtual override returns (string memory) {
}
// the owner (or approved) for a token should be able to update the URI
// for whatever reason - if they can burn the token then they should be able to update the URI
function updateTokenURI(
uint256 tokenId,
string calldata uri
) public virtual {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Metadata: caller is not owner nor approved");
require(<FILL_ME>)
_tokenURIs[tokenId] = uri;
}
//
//
// TOKEN MINT / BURN
//
//
function mint(
address,
uint256
) public virtual override onlyOwner onlyUnsealed {
}
function mintWithUri(
address to,
uint256 tokenId,
string calldata uri
) public virtual onlyOwner onlyUnsealed {
}
function _burn(
uint256 tokenId
) internal virtual override {
}
}
| bytes(uri).length>0,"ERC721Metadata: no URI set for token" | 55,301 | bytes(uri).length>0 |
"Not whitelisted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract CSDAO is ERC1155Supply, Ownable {
using SafeMath for uint256;
mapping(uint256 => string) private _tokenURIs;
mapping(address => bool) private whitelistMap;
uint256 public stage = 0; // STAGE 0 is for wave 2 presale, STAGE 1 is for wave 2 public sale, STAGE 2 is for wave 3 salve and STAGE 3 is for team tokens
uint256 public presaleWave2Amount = 1375;
uint256 public wave2Amount = 2750;
uint256 public wave3Amount = 3550;
uint256 public presaleWave2EthPrice = 0.095 ether;
uint256 public presaleWave2WrldPrice = 999 ether;
uint256 public wave2EthPrice = 0.12 ether;
uint256 public wave2WrldPrice = 1111 ether;
uint256 public wave3EthPrice = 0.15 ether;
uint256 public wave3WrldPrice = 1777 ether;
uint256 public maxOnceLimit = 10;
bool public saleIsActive = true;
address private immutable ceoAddress = 0x9B61a1aAA934808aDb8753f4BdE57d324BA064A5;
address private immutable wrldAddress = 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9;
constructor () ERC1155 ("") {
}
function withdraw() public onlyOwner {
}
function mintPresaleWithEth(uint256 _amount) external payable {
require(saleIsActive, "Sale has been paused.");
require(stage == 0, "Presale is not active.");
require(<FILL_ME>)
require(_amount <= maxOnceLimit, "Max once purchase limit");
require(totalSupply(0).add(_amount) <= presaleWave2Amount, "Maximun holders limit");
require(msg.value == presaleWave2EthPrice.mul(_amount), "Total price not match");
_mint(msg.sender, 0, _amount, "");
if(totalSupply(0) == presaleWave2Amount) {
stage = 1;
}
}
function mintPresaleWithWrld(uint256 _amount) external {
}
function mintWave2WithEth(uint256 _amount) external payable {
}
function mintWave2WithWrld(uint256 _amount) external {
}
function mintWave3WithEth(uint256 _amount) external payable {
}
function mintWave3WithWrld(uint256 _amount) external {
}
function reserveWaves(address _to, uint256 _reserveAmount) external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function startWave2PublicSale() external onlyOwner {
}
function setStage(uint256 _stage) external onlyOwner {
}
function updateWave3WrldPrice(uint256 _wrldPrice) external onlyOwner {
}
function setWhiteList(address _address) public onlyOwner {
}
function setWhiteListMultiple(address[] memory _addresses) external onlyOwner
{
}
function removeWhiteList(address _address) external onlyOwner {
}
function isWhiteListed(address _address) external view returns (bool) {
}
function uri(uint256 id) public view virtual override returns (string memory) {
}
function _setTokenURI(uint256 _tokenId, string memory _tokenUri) external onlyOwner {
}
function contractURI() public pure returns (string memory) {
}
}
| whitelistMap[msg.sender],"Not whitelisted" | 55,415 | whitelistMap[msg.sender] |
"Maximun holders limit" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract CSDAO is ERC1155Supply, Ownable {
using SafeMath for uint256;
mapping(uint256 => string) private _tokenURIs;
mapping(address => bool) private whitelistMap;
uint256 public stage = 0; // STAGE 0 is for wave 2 presale, STAGE 1 is for wave 2 public sale, STAGE 2 is for wave 3 salve and STAGE 3 is for team tokens
uint256 public presaleWave2Amount = 1375;
uint256 public wave2Amount = 2750;
uint256 public wave3Amount = 3550;
uint256 public presaleWave2EthPrice = 0.095 ether;
uint256 public presaleWave2WrldPrice = 999 ether;
uint256 public wave2EthPrice = 0.12 ether;
uint256 public wave2WrldPrice = 1111 ether;
uint256 public wave3EthPrice = 0.15 ether;
uint256 public wave3WrldPrice = 1777 ether;
uint256 public maxOnceLimit = 10;
bool public saleIsActive = true;
address private immutable ceoAddress = 0x9B61a1aAA934808aDb8753f4BdE57d324BA064A5;
address private immutable wrldAddress = 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9;
constructor () ERC1155 ("") {
}
function withdraw() public onlyOwner {
}
function mintPresaleWithEth(uint256 _amount) external payable {
require(saleIsActive, "Sale has been paused.");
require(stage == 0, "Presale is not active.");
require(whitelistMap[msg.sender], "Not whitelisted");
require(_amount <= maxOnceLimit, "Max once purchase limit");
require(<FILL_ME>)
require(msg.value == presaleWave2EthPrice.mul(_amount), "Total price not match");
_mint(msg.sender, 0, _amount, "");
if(totalSupply(0) == presaleWave2Amount) {
stage = 1;
}
}
function mintPresaleWithWrld(uint256 _amount) external {
}
function mintWave2WithEth(uint256 _amount) external payable {
}
function mintWave2WithWrld(uint256 _amount) external {
}
function mintWave3WithEth(uint256 _amount) external payable {
}
function mintWave3WithWrld(uint256 _amount) external {
}
function reserveWaves(address _to, uint256 _reserveAmount) external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function startWave2PublicSale() external onlyOwner {
}
function setStage(uint256 _stage) external onlyOwner {
}
function updateWave3WrldPrice(uint256 _wrldPrice) external onlyOwner {
}
function setWhiteList(address _address) public onlyOwner {
}
function setWhiteListMultiple(address[] memory _addresses) external onlyOwner
{
}
function removeWhiteList(address _address) external onlyOwner {
}
function isWhiteListed(address _address) external view returns (bool) {
}
function uri(uint256 id) public view virtual override returns (string memory) {
}
function _setTokenURI(uint256 _tokenId, string memory _tokenUri) external onlyOwner {
}
function contractURI() public pure returns (string memory) {
}
}
| totalSupply(0).add(_amount)<=presaleWave2Amount,"Maximun holders limit" | 55,415 | totalSupply(0).add(_amount)<=presaleWave2Amount |
"Not enough $WRLD." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract CSDAO is ERC1155Supply, Ownable {
using SafeMath for uint256;
mapping(uint256 => string) private _tokenURIs;
mapping(address => bool) private whitelistMap;
uint256 public stage = 0; // STAGE 0 is for wave 2 presale, STAGE 1 is for wave 2 public sale, STAGE 2 is for wave 3 salve and STAGE 3 is for team tokens
uint256 public presaleWave2Amount = 1375;
uint256 public wave2Amount = 2750;
uint256 public wave3Amount = 3550;
uint256 public presaleWave2EthPrice = 0.095 ether;
uint256 public presaleWave2WrldPrice = 999 ether;
uint256 public wave2EthPrice = 0.12 ether;
uint256 public wave2WrldPrice = 1111 ether;
uint256 public wave3EthPrice = 0.15 ether;
uint256 public wave3WrldPrice = 1777 ether;
uint256 public maxOnceLimit = 10;
bool public saleIsActive = true;
address private immutable ceoAddress = 0x9B61a1aAA934808aDb8753f4BdE57d324BA064A5;
address private immutable wrldAddress = 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9;
constructor () ERC1155 ("") {
}
function withdraw() public onlyOwner {
}
function mintPresaleWithEth(uint256 _amount) external payable {
}
function mintPresaleWithWrld(uint256 _amount) external {
require(saleIsActive, "Sale has been paused.");
require(stage == 0, "Presale is not active.");
require(whitelistMap[msg.sender], "Not whitelisted");
require(_amount <= maxOnceLimit, "Max once purchase limit");
require(totalSupply(0).add(_amount) <= presaleWave2Amount, "Maximun holders limit");
require(<FILL_ME>)
require(IERC20(wrldAddress).allowance(msg.sender, address(this)) >= presaleWave2WrldPrice.mul(_amount), "Not enough $WRLD has been approved to this contract.");
_mint(msg.sender, 0, _amount, "");
IERC20(wrldAddress).transferFrom(msg.sender, address(this), presaleWave2WrldPrice.mul(_amount));
if(totalSupply(0) == presaleWave2Amount) {
stage = 1;
}
}
function mintWave2WithEth(uint256 _amount) external payable {
}
function mintWave2WithWrld(uint256 _amount) external {
}
function mintWave3WithEth(uint256 _amount) external payable {
}
function mintWave3WithWrld(uint256 _amount) external {
}
function reserveWaves(address _to, uint256 _reserveAmount) external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function startWave2PublicSale() external onlyOwner {
}
function setStage(uint256 _stage) external onlyOwner {
}
function updateWave3WrldPrice(uint256 _wrldPrice) external onlyOwner {
}
function setWhiteList(address _address) public onlyOwner {
}
function setWhiteListMultiple(address[] memory _addresses) external onlyOwner
{
}
function removeWhiteList(address _address) external onlyOwner {
}
function isWhiteListed(address _address) external view returns (bool) {
}
function uri(uint256 id) public view virtual override returns (string memory) {
}
function _setTokenURI(uint256 _tokenId, string memory _tokenUri) external onlyOwner {
}
function contractURI() public pure returns (string memory) {
}
}
| IERC20(wrldAddress).balanceOf(msg.sender)>=presaleWave2WrldPrice.mul(_amount),"Not enough $WRLD." | 55,415 | IERC20(wrldAddress).balanceOf(msg.sender)>=presaleWave2WrldPrice.mul(_amount) |
"Not enough $WRLD has been approved to this contract." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract CSDAO is ERC1155Supply, Ownable {
using SafeMath for uint256;
mapping(uint256 => string) private _tokenURIs;
mapping(address => bool) private whitelistMap;
uint256 public stage = 0; // STAGE 0 is for wave 2 presale, STAGE 1 is for wave 2 public sale, STAGE 2 is for wave 3 salve and STAGE 3 is for team tokens
uint256 public presaleWave2Amount = 1375;
uint256 public wave2Amount = 2750;
uint256 public wave3Amount = 3550;
uint256 public presaleWave2EthPrice = 0.095 ether;
uint256 public presaleWave2WrldPrice = 999 ether;
uint256 public wave2EthPrice = 0.12 ether;
uint256 public wave2WrldPrice = 1111 ether;
uint256 public wave3EthPrice = 0.15 ether;
uint256 public wave3WrldPrice = 1777 ether;
uint256 public maxOnceLimit = 10;
bool public saleIsActive = true;
address private immutable ceoAddress = 0x9B61a1aAA934808aDb8753f4BdE57d324BA064A5;
address private immutable wrldAddress = 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9;
constructor () ERC1155 ("") {
}
function withdraw() public onlyOwner {
}
function mintPresaleWithEth(uint256 _amount) external payable {
}
function mintPresaleWithWrld(uint256 _amount) external {
require(saleIsActive, "Sale has been paused.");
require(stage == 0, "Presale is not active.");
require(whitelistMap[msg.sender], "Not whitelisted");
require(_amount <= maxOnceLimit, "Max once purchase limit");
require(totalSupply(0).add(_amount) <= presaleWave2Amount, "Maximun holders limit");
require(IERC20(wrldAddress).balanceOf(msg.sender) >= presaleWave2WrldPrice.mul(_amount), "Not enough $WRLD.");
require(<FILL_ME>)
_mint(msg.sender, 0, _amount, "");
IERC20(wrldAddress).transferFrom(msg.sender, address(this), presaleWave2WrldPrice.mul(_amount));
if(totalSupply(0) == presaleWave2Amount) {
stage = 1;
}
}
function mintWave2WithEth(uint256 _amount) external payable {
}
function mintWave2WithWrld(uint256 _amount) external {
}
function mintWave3WithEth(uint256 _amount) external payable {
}
function mintWave3WithWrld(uint256 _amount) external {
}
function reserveWaves(address _to, uint256 _reserveAmount) external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function startWave2PublicSale() external onlyOwner {
}
function setStage(uint256 _stage) external onlyOwner {
}
function updateWave3WrldPrice(uint256 _wrldPrice) external onlyOwner {
}
function setWhiteList(address _address) public onlyOwner {
}
function setWhiteListMultiple(address[] memory _addresses) external onlyOwner
{
}
function removeWhiteList(address _address) external onlyOwner {
}
function isWhiteListed(address _address) external view returns (bool) {
}
function uri(uint256 id) public view virtual override returns (string memory) {
}
function _setTokenURI(uint256 _tokenId, string memory _tokenUri) external onlyOwner {
}
function contractURI() public pure returns (string memory) {
}
}
| IERC20(wrldAddress).allowance(msg.sender,address(this))>=presaleWave2WrldPrice.mul(_amount),"Not enough $WRLD has been approved to this contract." | 55,415 | IERC20(wrldAddress).allowance(msg.sender,address(this))>=presaleWave2WrldPrice.mul(_amount) |
"Maximun holders limit" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract CSDAO is ERC1155Supply, Ownable {
using SafeMath for uint256;
mapping(uint256 => string) private _tokenURIs;
mapping(address => bool) private whitelistMap;
uint256 public stage = 0; // STAGE 0 is for wave 2 presale, STAGE 1 is for wave 2 public sale, STAGE 2 is for wave 3 salve and STAGE 3 is for team tokens
uint256 public presaleWave2Amount = 1375;
uint256 public wave2Amount = 2750;
uint256 public wave3Amount = 3550;
uint256 public presaleWave2EthPrice = 0.095 ether;
uint256 public presaleWave2WrldPrice = 999 ether;
uint256 public wave2EthPrice = 0.12 ether;
uint256 public wave2WrldPrice = 1111 ether;
uint256 public wave3EthPrice = 0.15 ether;
uint256 public wave3WrldPrice = 1777 ether;
uint256 public maxOnceLimit = 10;
bool public saleIsActive = true;
address private immutable ceoAddress = 0x9B61a1aAA934808aDb8753f4BdE57d324BA064A5;
address private immutable wrldAddress = 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9;
constructor () ERC1155 ("") {
}
function withdraw() public onlyOwner {
}
function mintPresaleWithEth(uint256 _amount) external payable {
}
function mintPresaleWithWrld(uint256 _amount) external {
}
function mintWave2WithEth(uint256 _amount) external payable {
require(saleIsActive, "Sale has been paused.");
require(stage == 1, "Wave 2 is not active.");
require(_amount <= maxOnceLimit, "Max once purchase limit");
require(<FILL_ME>)
require(msg.value == wave2EthPrice.mul(_amount), "Total price not match");
_mint(msg.sender, 0, _amount, "");
if(totalSupply(0) == wave2Amount) {
stage = 2;
}
}
function mintWave2WithWrld(uint256 _amount) external {
}
function mintWave3WithEth(uint256 _amount) external payable {
}
function mintWave3WithWrld(uint256 _amount) external {
}
function reserveWaves(address _to, uint256 _reserveAmount) external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function startWave2PublicSale() external onlyOwner {
}
function setStage(uint256 _stage) external onlyOwner {
}
function updateWave3WrldPrice(uint256 _wrldPrice) external onlyOwner {
}
function setWhiteList(address _address) public onlyOwner {
}
function setWhiteListMultiple(address[] memory _addresses) external onlyOwner
{
}
function removeWhiteList(address _address) external onlyOwner {
}
function isWhiteListed(address _address) external view returns (bool) {
}
function uri(uint256 id) public view virtual override returns (string memory) {
}
function _setTokenURI(uint256 _tokenId, string memory _tokenUri) external onlyOwner {
}
function contractURI() public pure returns (string memory) {
}
}
| totalSupply(0).add(_amount)<=wave2Amount,"Maximun holders limit" | 55,415 | totalSupply(0).add(_amount)<=wave2Amount |
"Not enough $WRLD." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract CSDAO is ERC1155Supply, Ownable {
using SafeMath for uint256;
mapping(uint256 => string) private _tokenURIs;
mapping(address => bool) private whitelistMap;
uint256 public stage = 0; // STAGE 0 is for wave 2 presale, STAGE 1 is for wave 2 public sale, STAGE 2 is for wave 3 salve and STAGE 3 is for team tokens
uint256 public presaleWave2Amount = 1375;
uint256 public wave2Amount = 2750;
uint256 public wave3Amount = 3550;
uint256 public presaleWave2EthPrice = 0.095 ether;
uint256 public presaleWave2WrldPrice = 999 ether;
uint256 public wave2EthPrice = 0.12 ether;
uint256 public wave2WrldPrice = 1111 ether;
uint256 public wave3EthPrice = 0.15 ether;
uint256 public wave3WrldPrice = 1777 ether;
uint256 public maxOnceLimit = 10;
bool public saleIsActive = true;
address private immutable ceoAddress = 0x9B61a1aAA934808aDb8753f4BdE57d324BA064A5;
address private immutable wrldAddress = 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9;
constructor () ERC1155 ("") {
}
function withdraw() public onlyOwner {
}
function mintPresaleWithEth(uint256 _amount) external payable {
}
function mintPresaleWithWrld(uint256 _amount) external {
}
function mintWave2WithEth(uint256 _amount) external payable {
}
function mintWave2WithWrld(uint256 _amount) external {
require(saleIsActive, "Sale has been paused.");
require(stage == 1, "Wave 2 is not active.");
require(_amount <= maxOnceLimit, "Max once purchase limit");
require(totalSupply(0).add(_amount) <= wave2Amount, "Maximun holders limit");
require(<FILL_ME>)
require(IERC20(wrldAddress).allowance(msg.sender, address(this)) >= wave2WrldPrice.mul(_amount), "Not enough $WRLD has been approved to this contract.");
_mint(msg.sender, 0, _amount, "");
IERC20(wrldAddress).transferFrom(msg.sender, address(this), wave2WrldPrice.mul(_amount));
if(totalSupply(0) == wave2Amount) {
stage = 2;
}
}
function mintWave3WithEth(uint256 _amount) external payable {
}
function mintWave3WithWrld(uint256 _amount) external {
}
function reserveWaves(address _to, uint256 _reserveAmount) external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function startWave2PublicSale() external onlyOwner {
}
function setStage(uint256 _stage) external onlyOwner {
}
function updateWave3WrldPrice(uint256 _wrldPrice) external onlyOwner {
}
function setWhiteList(address _address) public onlyOwner {
}
function setWhiteListMultiple(address[] memory _addresses) external onlyOwner
{
}
function removeWhiteList(address _address) external onlyOwner {
}
function isWhiteListed(address _address) external view returns (bool) {
}
function uri(uint256 id) public view virtual override returns (string memory) {
}
function _setTokenURI(uint256 _tokenId, string memory _tokenUri) external onlyOwner {
}
function contractURI() public pure returns (string memory) {
}
}
| IERC20(wrldAddress).balanceOf(msg.sender)>=wave2WrldPrice.mul(_amount),"Not enough $WRLD." | 55,415 | IERC20(wrldAddress).balanceOf(msg.sender)>=wave2WrldPrice.mul(_amount) |
"Not enough $WRLD has been approved to this contract." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract CSDAO is ERC1155Supply, Ownable {
using SafeMath for uint256;
mapping(uint256 => string) private _tokenURIs;
mapping(address => bool) private whitelistMap;
uint256 public stage = 0; // STAGE 0 is for wave 2 presale, STAGE 1 is for wave 2 public sale, STAGE 2 is for wave 3 salve and STAGE 3 is for team tokens
uint256 public presaleWave2Amount = 1375;
uint256 public wave2Amount = 2750;
uint256 public wave3Amount = 3550;
uint256 public presaleWave2EthPrice = 0.095 ether;
uint256 public presaleWave2WrldPrice = 999 ether;
uint256 public wave2EthPrice = 0.12 ether;
uint256 public wave2WrldPrice = 1111 ether;
uint256 public wave3EthPrice = 0.15 ether;
uint256 public wave3WrldPrice = 1777 ether;
uint256 public maxOnceLimit = 10;
bool public saleIsActive = true;
address private immutable ceoAddress = 0x9B61a1aAA934808aDb8753f4BdE57d324BA064A5;
address private immutable wrldAddress = 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9;
constructor () ERC1155 ("") {
}
function withdraw() public onlyOwner {
}
function mintPresaleWithEth(uint256 _amount) external payable {
}
function mintPresaleWithWrld(uint256 _amount) external {
}
function mintWave2WithEth(uint256 _amount) external payable {
}
function mintWave2WithWrld(uint256 _amount) external {
require(saleIsActive, "Sale has been paused.");
require(stage == 1, "Wave 2 is not active.");
require(_amount <= maxOnceLimit, "Max once purchase limit");
require(totalSupply(0).add(_amount) <= wave2Amount, "Maximun holders limit");
require(IERC20(wrldAddress).balanceOf(msg.sender) >= wave2WrldPrice.mul(_amount), "Not enough $WRLD.");
require(<FILL_ME>)
_mint(msg.sender, 0, _amount, "");
IERC20(wrldAddress).transferFrom(msg.sender, address(this), wave2WrldPrice.mul(_amount));
if(totalSupply(0) == wave2Amount) {
stage = 2;
}
}
function mintWave3WithEth(uint256 _amount) external payable {
}
function mintWave3WithWrld(uint256 _amount) external {
}
function reserveWaves(address _to, uint256 _reserveAmount) external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function startWave2PublicSale() external onlyOwner {
}
function setStage(uint256 _stage) external onlyOwner {
}
function updateWave3WrldPrice(uint256 _wrldPrice) external onlyOwner {
}
function setWhiteList(address _address) public onlyOwner {
}
function setWhiteListMultiple(address[] memory _addresses) external onlyOwner
{
}
function removeWhiteList(address _address) external onlyOwner {
}
function isWhiteListed(address _address) external view returns (bool) {
}
function uri(uint256 id) public view virtual override returns (string memory) {
}
function _setTokenURI(uint256 _tokenId, string memory _tokenUri) external onlyOwner {
}
function contractURI() public pure returns (string memory) {
}
}
| IERC20(wrldAddress).allowance(msg.sender,address(this))>=wave2WrldPrice.mul(_amount),"Not enough $WRLD has been approved to this contract." | 55,415 | IERC20(wrldAddress).allowance(msg.sender,address(this))>=wave2WrldPrice.mul(_amount) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.