comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | pragma solidity ^0.5.0;
contract OldBaseRegistrarImplementation is BaseRegistrar, ERC721 {
// Expiration timestamp for migrated domains.
uint public transferPeriodEnds;
// The interim registrar
Registrar public previousRegistrar;
// A map of expiry times
mapping(uint256=>uint) expiries;
uint constant public MIGRATION_LOCK_PERIOD = 28 days;
bytes4 constant private INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)"));
bytes4 constant private ERC721_ID = bytes4(
keccak256("balanceOf(uint256)") ^
keccak256("ownerOf(uint256)") ^
keccak256("approve(address,uint256)") ^
keccak256("getApproved(uint256)") ^
keccak256("setApprovalForAll(address,bool)") ^
keccak256("isApprovedForAll(address,address)") ^
keccak256("transferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256,bytes)")
);
bytes4 constant private RECLAIM_ID = bytes4(keccak256("reclaim(uint256,address)"));
constructor(ENS _ens, HashRegistrar _previousRegistrar, bytes32 _baseNode, uint _transferPeriodEnds) public {
}
modifier live {
}
modifier onlyController {
}
/**
* @dev Gets the owner of the specified token ID. Names become unowned
* when their registration expires.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId) public view returns (address) {
require(<FILL_ME>)
return super.ownerOf(tokenId);
}
// Authorises a controller, who can register and renew domains.
function addController(address controller) external onlyOwner {
}
// Revoke controller permission for an address.
function removeController(address controller) external onlyOwner {
}
// Set the resolver for the TLD this registrar manages.
function setResolver(address resolver) external onlyOwner {
}
// Returns the expiration timestamp of the specified id.
function nameExpires(uint256 id) external view returns(uint) {
}
// Returns true iff the specified name is available for registration.
function available(uint256 id) public view returns(bool) {
}
/**
* @dev Register a name.
*/
function register(uint256 id, address owner, uint duration) external returns(uint) {
}
/**
* @dev Register a name.
*/
function registerOnly(uint256 id, address owner, uint duration) external returns(uint) {
}
/**
* @dev Register a name.
*/
function _register(uint256 id, address owner, uint duration, bool updateRegistry) internal live onlyController returns(uint) {
}
function renew(uint256 id, uint duration) external live onlyController returns(uint) {
}
/**
* @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
*/
function reclaim(uint256 id, address owner) external live {
}
/**
* @dev Transfers a registration from the initial registrar.
* This function is called by the initial registrar when a user calls `transferRegistrars`.
*/
function acceptRegistrarTransfer(bytes32 label, Deed deed, uint) external live {
}
function supportsInterface(bytes4 interfaceID) external view returns (bool) {
}
}
| expiries[tokenId]>now | 364,001 | expiries[tokenId]>now |
null | pragma solidity ^0.5.0;
contract OldBaseRegistrarImplementation is BaseRegistrar, ERC721 {
// Expiration timestamp for migrated domains.
uint public transferPeriodEnds;
// The interim registrar
Registrar public previousRegistrar;
// A map of expiry times
mapping(uint256=>uint) expiries;
uint constant public MIGRATION_LOCK_PERIOD = 28 days;
bytes4 constant private INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)"));
bytes4 constant private ERC721_ID = bytes4(
keccak256("balanceOf(uint256)") ^
keccak256("ownerOf(uint256)") ^
keccak256("approve(address,uint256)") ^
keccak256("getApproved(uint256)") ^
keccak256("setApprovalForAll(address,bool)") ^
keccak256("isApprovedForAll(address,address)") ^
keccak256("transferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256,bytes)")
);
bytes4 constant private RECLAIM_ID = bytes4(keccak256("reclaim(uint256,address)"));
constructor(ENS _ens, HashRegistrar _previousRegistrar, bytes32 _baseNode, uint _transferPeriodEnds) public {
}
modifier live {
}
modifier onlyController {
}
/**
* @dev Gets the owner of the specified token ID. Names become unowned
* when their registration expires.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId) public view returns (address) {
}
// Authorises a controller, who can register and renew domains.
function addController(address controller) external onlyOwner {
}
// Revoke controller permission for an address.
function removeController(address controller) external onlyOwner {
}
// Set the resolver for the TLD this registrar manages.
function setResolver(address resolver) external onlyOwner {
}
// Returns the expiration timestamp of the specified id.
function nameExpires(uint256 id) external view returns(uint) {
}
// Returns true iff the specified name is available for registration.
function available(uint256 id) public view returns(bool) {
}
/**
* @dev Register a name.
*/
function register(uint256 id, address owner, uint duration) external returns(uint) {
}
/**
* @dev Register a name.
*/
function registerOnly(uint256 id, address owner, uint duration) external returns(uint) {
}
/**
* @dev Register a name.
*/
function _register(uint256 id, address owner, uint duration, bool updateRegistry) internal live onlyController returns(uint) {
require(available(id));
require(<FILL_ME>) // Prevent future overflow
expiries[id] = now + duration;
if(_exists(id)) {
// Name was previously owned, and expired
_burn(id);
}
_mint(owner, id);
if(updateRegistry) {
ens.setSubnodeOwner(baseNode, bytes32(id), owner);
}
emit NameRegistered(id, owner, now + duration);
return now + duration;
}
function renew(uint256 id, uint duration) external live onlyController returns(uint) {
}
/**
* @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
*/
function reclaim(uint256 id, address owner) external live {
}
/**
* @dev Transfers a registration from the initial registrar.
* This function is called by the initial registrar when a user calls `transferRegistrars`.
*/
function acceptRegistrarTransfer(bytes32 label, Deed deed, uint) external live {
}
function supportsInterface(bytes4 interfaceID) external view returns (bool) {
}
}
| now+duration+GRACE_PERIOD>now+GRACE_PERIOD | 364,001 | now+duration+GRACE_PERIOD>now+GRACE_PERIOD |
null | pragma solidity ^0.5.0;
contract OldBaseRegistrarImplementation is BaseRegistrar, ERC721 {
// Expiration timestamp for migrated domains.
uint public transferPeriodEnds;
// The interim registrar
Registrar public previousRegistrar;
// A map of expiry times
mapping(uint256=>uint) expiries;
uint constant public MIGRATION_LOCK_PERIOD = 28 days;
bytes4 constant private INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)"));
bytes4 constant private ERC721_ID = bytes4(
keccak256("balanceOf(uint256)") ^
keccak256("ownerOf(uint256)") ^
keccak256("approve(address,uint256)") ^
keccak256("getApproved(uint256)") ^
keccak256("setApprovalForAll(address,bool)") ^
keccak256("isApprovedForAll(address,address)") ^
keccak256("transferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256,bytes)")
);
bytes4 constant private RECLAIM_ID = bytes4(keccak256("reclaim(uint256,address)"));
constructor(ENS _ens, HashRegistrar _previousRegistrar, bytes32 _baseNode, uint _transferPeriodEnds) public {
}
modifier live {
}
modifier onlyController {
}
/**
* @dev Gets the owner of the specified token ID. Names become unowned
* when their registration expires.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId) public view returns (address) {
}
// Authorises a controller, who can register and renew domains.
function addController(address controller) external onlyOwner {
}
// Revoke controller permission for an address.
function removeController(address controller) external onlyOwner {
}
// Set the resolver for the TLD this registrar manages.
function setResolver(address resolver) external onlyOwner {
}
// Returns the expiration timestamp of the specified id.
function nameExpires(uint256 id) external view returns(uint) {
}
// Returns true iff the specified name is available for registration.
function available(uint256 id) public view returns(bool) {
}
/**
* @dev Register a name.
*/
function register(uint256 id, address owner, uint duration) external returns(uint) {
}
/**
* @dev Register a name.
*/
function registerOnly(uint256 id, address owner, uint duration) external returns(uint) {
}
/**
* @dev Register a name.
*/
function _register(uint256 id, address owner, uint duration, bool updateRegistry) internal live onlyController returns(uint) {
}
function renew(uint256 id, uint duration) external live onlyController returns(uint) {
require(<FILL_ME>) // Name must be registered here or in grace period
require(expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD); // Prevent future overflow
expiries[id] += duration;
emit NameRenewed(id, expiries[id]);
return expiries[id];
}
/**
* @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
*/
function reclaim(uint256 id, address owner) external live {
}
/**
* @dev Transfers a registration from the initial registrar.
* This function is called by the initial registrar when a user calls `transferRegistrars`.
*/
function acceptRegistrarTransfer(bytes32 label, Deed deed, uint) external live {
}
function supportsInterface(bytes4 interfaceID) external view returns (bool) {
}
}
| expiries[id]+GRACE_PERIOD>=now | 364,001 | expiries[id]+GRACE_PERIOD>=now |
null | pragma solidity ^0.5.0;
contract OldBaseRegistrarImplementation is BaseRegistrar, ERC721 {
// Expiration timestamp for migrated domains.
uint public transferPeriodEnds;
// The interim registrar
Registrar public previousRegistrar;
// A map of expiry times
mapping(uint256=>uint) expiries;
uint constant public MIGRATION_LOCK_PERIOD = 28 days;
bytes4 constant private INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)"));
bytes4 constant private ERC721_ID = bytes4(
keccak256("balanceOf(uint256)") ^
keccak256("ownerOf(uint256)") ^
keccak256("approve(address,uint256)") ^
keccak256("getApproved(uint256)") ^
keccak256("setApprovalForAll(address,bool)") ^
keccak256("isApprovedForAll(address,address)") ^
keccak256("transferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256,bytes)")
);
bytes4 constant private RECLAIM_ID = bytes4(keccak256("reclaim(uint256,address)"));
constructor(ENS _ens, HashRegistrar _previousRegistrar, bytes32 _baseNode, uint _transferPeriodEnds) public {
}
modifier live {
}
modifier onlyController {
}
/**
* @dev Gets the owner of the specified token ID. Names become unowned
* when their registration expires.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId) public view returns (address) {
}
// Authorises a controller, who can register and renew domains.
function addController(address controller) external onlyOwner {
}
// Revoke controller permission for an address.
function removeController(address controller) external onlyOwner {
}
// Set the resolver for the TLD this registrar manages.
function setResolver(address resolver) external onlyOwner {
}
// Returns the expiration timestamp of the specified id.
function nameExpires(uint256 id) external view returns(uint) {
}
// Returns true iff the specified name is available for registration.
function available(uint256 id) public view returns(bool) {
}
/**
* @dev Register a name.
*/
function register(uint256 id, address owner, uint duration) external returns(uint) {
}
/**
* @dev Register a name.
*/
function registerOnly(uint256 id, address owner, uint duration) external returns(uint) {
}
/**
* @dev Register a name.
*/
function _register(uint256 id, address owner, uint duration, bool updateRegistry) internal live onlyController returns(uint) {
}
function renew(uint256 id, uint duration) external live onlyController returns(uint) {
}
/**
* @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
*/
function reclaim(uint256 id, address owner) external live {
}
/**
* @dev Transfers a registration from the initial registrar.
* This function is called by the initial registrar when a user calls `transferRegistrars`.
*/
function acceptRegistrarTransfer(bytes32 label, Deed deed, uint) external live {
uint256 id = uint256(label);
require(msg.sender == address(previousRegistrar));
require(<FILL_ME>)
require(transferPeriodEnds > now);
uint registrationDate;
(,,registrationDate,,) = previousRegistrar.entries(label);
require(registrationDate < now - MIGRATION_LOCK_PERIOD);
address owner = deed.owner();
// Destroy the deed and transfer the funds back to the registrant.
deed.closeDeed(1000);
// Register the name
expiries[id] = transferPeriodEnds;
_mint(owner, id);
ens.setSubnodeOwner(baseNode, label, owner);
emit NameMigrated(id, owner, transferPeriodEnds);
emit NameRegistered(id, owner, transferPeriodEnds);
}
function supportsInterface(bytes4 interfaceID) external view returns (bool) {
}
}
| expiries[id]==0 | 364,001 | expiries[id]==0 |
"Claim send failed" | contract EscrowLibrary {
enum SettlementType {
Claim,
Refund
}
struct EscrowParams {
bytes32 puzzleA;
bytes32 puzzleB;
address tokenAddress;
uint escrowAmount;
uint timeLockA;
uint timeLockB;
address payable claimAddress;
address payable refundAddress;
}
struct PuzzleData {
uint timeSolved;
}
event SolutionPosted(bytes32 indexed puzzle, bytes solution);
event EscrowSettled(address indexed escrowAddress, SettlementType settlementType);
mapping(bytes32 => PuzzleData) public puzzles;
function postSolution(bytes32 puzzle, bytes calldata solution) external {
}
function claimEscrow(
bytes32 puzzleA,
bytes32 puzzleB,
address tokenAddress,
uint escrowAmount,
uint timeLockA,
uint timeLockB,
address payable claimAddress,
address payable refundAddress
)
external
{
(bytes32 escrowParamsHash, bytes memory bytecode) = computeCreate2Params(
EscrowParams(puzzleA, puzzleB, tokenAddress, escrowAmount, timeLockA, timeLockB, claimAddress, refundAddress)
);
// Create the escrow with create2 with escrowParamsHash as salt
address escrowAddress = Create2.deploy(escrowParamsHash, bytecode);
IEscrow escrow = IEscrow(escrowAddress);
// Check the escrow is funded
uint balance = escrow.balance();
require(balance >= escrowAmount, "Escrow not funded");
PuzzleData memory puzzleAData = puzzles[puzzleA];
PuzzleData memory puzzleBData = puzzles[puzzleB];
// Check both solutions posted
require(puzzleAData.timeSolved != 0, "Solution A not posted");
require(puzzleBData.timeSolved != 0, "Solution B not posted");
// Check before final timelock
// Use timeLockA unless solution B was posted first then use timeLockB
uint finalTimelock = (puzzleBData.timeSolved < puzzleAData.timeSolved) ? timeLockB : timeLockA;
require(now < finalTimelock, "After claim timelock");
// Send escrow amount to the claim address
require(<FILL_ME>)
emit EscrowSettled(escrowAddress, SettlementType.Claim);
}
function refundEscrow(
bytes32 puzzleA,
bytes32 puzzleB,
address tokenAddress,
uint escrowAmount,
uint timeLockA,
uint timeLockB,
address payable claimAddress,
address payable refundAddress
)
external
{
}
function computeCreate2Params(EscrowParams memory escrowParams) internal view
returns (bytes32 salt, bytes memory bytecode)
{
}
function isContract(address addr) internal view returns (bool) {
}
}
| escrow.send(claimAddress,escrowAmount),"Claim send failed" | 364,057 | escrow.send(claimAddress,escrowAmount) |
"Refund send failed" | contract EscrowLibrary {
enum SettlementType {
Claim,
Refund
}
struct EscrowParams {
bytes32 puzzleA;
bytes32 puzzleB;
address tokenAddress;
uint escrowAmount;
uint timeLockA;
uint timeLockB;
address payable claimAddress;
address payable refundAddress;
}
struct PuzzleData {
uint timeSolved;
}
event SolutionPosted(bytes32 indexed puzzle, bytes solution);
event EscrowSettled(address indexed escrowAddress, SettlementType settlementType);
mapping(bytes32 => PuzzleData) public puzzles;
function postSolution(bytes32 puzzle, bytes calldata solution) external {
}
function claimEscrow(
bytes32 puzzleA,
bytes32 puzzleB,
address tokenAddress,
uint escrowAmount,
uint timeLockA,
uint timeLockB,
address payable claimAddress,
address payable refundAddress
)
external
{
}
function refundEscrow(
bytes32 puzzleA,
bytes32 puzzleB,
address tokenAddress,
uint escrowAmount,
uint timeLockA,
uint timeLockB,
address payable claimAddress,
address payable refundAddress
)
external
{
(bytes32 escrowParamsHash, bytes memory bytecode) = computeCreate2Params(
EscrowParams(puzzleA, puzzleB, tokenAddress, escrowAmount, timeLockA, timeLockB, claimAddress, refundAddress)
);
// Compute the create2 address
address escrowAddress = Create2.computeAddress(escrowParamsHash, bytecode);
// Deploy the contract if it doesnt exist
if(! isContract(escrowAddress)) {
Create2.deploy(escrowParamsHash, bytecode);
}
IEscrow escrow = IEscrow(escrowAddress);
// Check after timelock
uint timeSolvedB = puzzles[puzzleB].timeSolved;
uint timeSolvedA = puzzles[puzzleA].timeSolved;
// Use timeLockA unless solution B was posted first then use timeLockB
uint finalTimelock = (timeSolvedB != 0 && (timeSolvedA == 0 || timeSolvedB < timeSolvedA)) ? timeLockB : timeLockA;
require(now >= finalTimelock, "Before refund timelock");
// Send entire escrow balance to the refund address
uint balance = escrow.balance();
require(balance > 0, "Refund balance must be > 0");
require(<FILL_ME>)
emit EscrowSettled(escrowAddress, SettlementType.Refund);
}
function computeCreate2Params(EscrowParams memory escrowParams) internal view
returns (bytes32 salt, bytes memory bytecode)
{
}
function isContract(address addr) internal view returns (bool) {
}
}
| escrow.send(refundAddress,balance),"Refund send failed" | 364,057 | escrow.send(refundAddress,balance) |
"Tokens cannot be transferred from user account" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;
// ----------------------------------------------------------------------------
// 'HAPPYHOUR' Staking smart contract
//
// Enter our universe : cocktailbar.finance
//
// Come join the disscussion: https://t.me/cocktailbar_discussion
//
// Sincerely, Mr. Martini
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
contract ReentrancyGuard {
bool private _notEntered;
constructor () {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
modifier onlyOwner() virtual{
}
address payable owner;
address payable newOwner;
function changeOwner(address payable _newOwner) external onlyOwner {
}
function acceptOwnership() external {
}
}
interface ERC20 {
function balanceOf(address _owner) view external returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) view external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
contract Token is Owned, ERC20 {
using SafeMath for uint256;
uint256 public totalSupply;
string public symbol;
string public name;
uint8 public decimals;
mapping (address=>uint256) balances;
mapping (address=>mapping (address=>uint256)) allowed;
uint256 public rewardfee;
event TransferFee(address indexed _from, address indexed _to, uint256 _value);
function balanceOf(address _owner) view public override returns (uint256 balance) { }
function transfer(address _to, uint256 _amount) public override returns (bool success) {
}
function transferFrom(address _from,address _to,uint256 _amount) public override returns (bool success) {
}
function approve(address _spender, uint256 _amount) public override returns (bool success) {
}
function allowance(address _owner, address _spender) view public override returns (uint256 remaining) {
}
function onehalfPercent(uint256 _tokens) private pure returns (uint256){
}
}
contract Mojito is Token{
using SafeMath for uint256;
constructor() {
}
receive () payable external {
}
}
interface REWARDTOKEN {
function balanceOf(address _owner) view external returns (uint256 balance);
function allowance(address _owner, address _spender) view external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function transfer(address _to, uint256 _amount) external returns (bool success);
function transferFrom(address _from,address _to,uint256 _amount) external returns (bool success);
function approve(address _to, uint256 _amount) external returns (bool success);
function _mint(address account, uint256 amount) external ;
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract Stake is Mojito, ReentrancyGuard {
using SafeMath for uint256;
address public rewtkn= 0x39FB7AF42ef12D92A0d577ca44cd54a0f24c4915;
uint256 public totalStakes = 0;
uint256 stakingFee = 10; // 1%
uint256 unstakingFee = 30; // 3%
uint256 public prevreward = 0;
REWARD public reward;
struct REWARD
{
uint256 rewardstart;
uint256 rewardend;
uint256 totalreward;
}
struct USER{
uint256 stakedTokens;
uint256 remainder;
uint256 creationTime;
uint256 lastClaim;
uint256 totalEarned;
}
mapping(address => USER) public stakers;
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event CLAIMEDREWARD(address staker, uint256 reward);
constructor() {
}
modifier onlyOwner() override{
}
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external nonReentrant {
require(<FILL_ME>)
uint256 _stakingFee = (onePercent(tokens).mul(stakingFee)).div(10);
reward.totalreward = (reward.totalreward).add(stakingFee);
stakers[msg.sender].stakedTokens = (tokens.sub(_stakingFee)).add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].creationTime = block.timestamp;
totalStakes = totalStakes.add(tokens.sub(_stakingFee));
emit STAKED(msg.sender, tokens.sub(_stakingFee), _stakingFee);
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Stakers can unstake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external nonReentrant {
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) private pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedREWARDTOKEN(address staker) external view returns(uint256 stakedTOKEN){
}
// ------------------------------------------------------------------------
// Get the TOKEN balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourREWARDTOKENBalance(address user) external view returns(uint256 TOKENBalance){
}
function CurrEsstematedRew(address user) external view returns (uint256 MojitoReward)
{
}
function CLAIMREWARD() external {
}
function WatchClaimTime() public view returns (uint ClaimTimeHours)
{
}
function WatchClaimTimeMins() public view returns (uint ClaimTimeHours)
{
}
}
| REWARDTOKEN(rewtkn).transferFrom(msg.sender,address(this),tokens),"Tokens cannot be transferred from user account" | 364,220 | REWARDTOKEN(rewtkn).transferFrom(msg.sender,address(this),tokens) |
"Error in un-staking tokens" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;
// ----------------------------------------------------------------------------
// 'HAPPYHOUR' Staking smart contract
//
// Enter our universe : cocktailbar.finance
//
// Come join the disscussion: https://t.me/cocktailbar_discussion
//
// Sincerely, Mr. Martini
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
contract ReentrancyGuard {
bool private _notEntered;
constructor () {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
modifier onlyOwner() virtual{
}
address payable owner;
address payable newOwner;
function changeOwner(address payable _newOwner) external onlyOwner {
}
function acceptOwnership() external {
}
}
interface ERC20 {
function balanceOf(address _owner) view external returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) view external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
contract Token is Owned, ERC20 {
using SafeMath for uint256;
uint256 public totalSupply;
string public symbol;
string public name;
uint8 public decimals;
mapping (address=>uint256) balances;
mapping (address=>mapping (address=>uint256)) allowed;
uint256 public rewardfee;
event TransferFee(address indexed _from, address indexed _to, uint256 _value);
function balanceOf(address _owner) view public override returns (uint256 balance) { }
function transfer(address _to, uint256 _amount) public override returns (bool success) {
}
function transferFrom(address _from,address _to,uint256 _amount) public override returns (bool success) {
}
function approve(address _spender, uint256 _amount) public override returns (bool success) {
}
function allowance(address _owner, address _spender) view public override returns (uint256 remaining) {
}
function onehalfPercent(uint256 _tokens) private pure returns (uint256){
}
}
contract Mojito is Token{
using SafeMath for uint256;
constructor() {
}
receive () payable external {
}
}
interface REWARDTOKEN {
function balanceOf(address _owner) view external returns (uint256 balance);
function allowance(address _owner, address _spender) view external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function transfer(address _to, uint256 _amount) external returns (bool success);
function transferFrom(address _from,address _to,uint256 _amount) external returns (bool success);
function approve(address _to, uint256 _amount) external returns (bool success);
function _mint(address account, uint256 amount) external ;
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract Stake is Mojito, ReentrancyGuard {
using SafeMath for uint256;
address public rewtkn= 0x39FB7AF42ef12D92A0d577ca44cd54a0f24c4915;
uint256 public totalStakes = 0;
uint256 stakingFee = 10; // 1%
uint256 unstakingFee = 30; // 3%
uint256 public prevreward = 0;
REWARD public reward;
struct REWARD
{
uint256 rewardstart;
uint256 rewardend;
uint256 totalreward;
}
struct USER{
uint256 stakedTokens;
uint256 remainder;
uint256 creationTime;
uint256 lastClaim;
uint256 totalEarned;
}
mapping(address => USER) public stakers;
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event CLAIMEDREWARD(address staker, uint256 reward);
constructor() {
}
modifier onlyOwner() override{
}
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external nonReentrant {
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Stakers can unstake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external nonReentrant {
require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
uint256 _unstakingFee = (onePercent(tokens).mul(unstakingFee)).div(10);
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
reward.totalreward = (reward.totalreward).add(_unstakingFee);
require(<FILL_ME>)
stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens);
if (stakers[msg.sender].stakedTokens == 0)
{
stakers[msg.sender].creationTime = block.timestamp ;
}
totalStakes = totalStakes.sub(tokens);
emit UNSTAKED(msg.sender, tokens.sub(_unstakingFee), _unstakingFee);
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) private pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedREWARDTOKEN(address staker) external view returns(uint256 stakedTOKEN){
}
// ------------------------------------------------------------------------
// Get the TOKEN balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourREWARDTOKENBalance(address user) external view returns(uint256 TOKENBalance){
}
function CurrEsstematedRew(address user) external view returns (uint256 MojitoReward)
{
}
function CLAIMREWARD() external {
}
function WatchClaimTime() public view returns (uint ClaimTimeHours)
{
}
function WatchClaimTimeMins() public view returns (uint ClaimTimeHours)
{
}
}
| REWARDTOKEN(rewtkn).transfer(msg.sender,tokens.sub(_unstakingFee)),"Error in un-staking tokens" | 364,220 | REWARDTOKEN(rewtkn).transfer(msg.sender,tokens.sub(_unstakingFee)) |
"You have Already Claimed" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;
// ----------------------------------------------------------------------------
// 'HAPPYHOUR' Staking smart contract
//
// Enter our universe : cocktailbar.finance
//
// Come join the disscussion: https://t.me/cocktailbar_discussion
//
// Sincerely, Mr. Martini
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
contract ReentrancyGuard {
bool private _notEntered;
constructor () {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
modifier onlyOwner() virtual{
}
address payable owner;
address payable newOwner;
function changeOwner(address payable _newOwner) external onlyOwner {
}
function acceptOwnership() external {
}
}
interface ERC20 {
function balanceOf(address _owner) view external returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) view external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
contract Token is Owned, ERC20 {
using SafeMath for uint256;
uint256 public totalSupply;
string public symbol;
string public name;
uint8 public decimals;
mapping (address=>uint256) balances;
mapping (address=>mapping (address=>uint256)) allowed;
uint256 public rewardfee;
event TransferFee(address indexed _from, address indexed _to, uint256 _value);
function balanceOf(address _owner) view public override returns (uint256 balance) { }
function transfer(address _to, uint256 _amount) public override returns (bool success) {
}
function transferFrom(address _from,address _to,uint256 _amount) public override returns (bool success) {
}
function approve(address _spender, uint256 _amount) public override returns (bool success) {
}
function allowance(address _owner, address _spender) view public override returns (uint256 remaining) {
}
function onehalfPercent(uint256 _tokens) private pure returns (uint256){
}
}
contract Mojito is Token{
using SafeMath for uint256;
constructor() {
}
receive () payable external {
}
}
interface REWARDTOKEN {
function balanceOf(address _owner) view external returns (uint256 balance);
function allowance(address _owner, address _spender) view external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function transfer(address _to, uint256 _amount) external returns (bool success);
function transferFrom(address _from,address _to,uint256 _amount) external returns (bool success);
function approve(address _to, uint256 _amount) external returns (bool success);
function _mint(address account, uint256 amount) external ;
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract Stake is Mojito, ReentrancyGuard {
using SafeMath for uint256;
address public rewtkn= 0x39FB7AF42ef12D92A0d577ca44cd54a0f24c4915;
uint256 public totalStakes = 0;
uint256 stakingFee = 10; // 1%
uint256 unstakingFee = 30; // 3%
uint256 public prevreward = 0;
REWARD public reward;
struct REWARD
{
uint256 rewardstart;
uint256 rewardend;
uint256 totalreward;
}
struct USER{
uint256 stakedTokens;
uint256 remainder;
uint256 creationTime;
uint256 lastClaim;
uint256 totalEarned;
}
mapping(address => USER) public stakers;
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event CLAIMEDREWARD(address staker, uint256 reward);
constructor() {
}
modifier onlyOwner() override{
}
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external nonReentrant {
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Stakers can unstake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external nonReentrant {
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) private pure returns (uint256){
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedREWARDTOKEN(address staker) external view returns(uint256 stakedTOKEN){
}
// ------------------------------------------------------------------------
// Get the TOKEN balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourREWARDTOKENBalance(address user) external view returns(uint256 TOKENBalance){
}
function CurrEsstematedRew(address user) external view returns (uint256 MojitoReward)
{
}
function CLAIMREWARD() external {
uint256 time = block.timestamp - reward.rewardstart;
uint256 hour=time.div(3600);
if(hour >= 24)
{
prevreward = 0;
}
while(hour >= 24) //alligning days with outer clock
{
reward.rewardstart = reward.rewardstart.add(24 hours) ;
time = block.timestamp - reward.rewardstart;
hour=time.div(3600);
}
require(<FILL_ME>)
{
//this line is basically checking which hour is currently user trying to claim (can only claim at hour 20 - 24 )
time = (block.timestamp).sub(reward.rewardstart) ; //now can be greater than rewardend
uint256 rewhour = time.div(3600);
if((rewhour < 24) && (rewhour >= 20)) // checking if person is illigebal for reward
{
if(prevreward == 0 )
{
prevreward = rewardfee;
}
//calculating percent of staked tokens user has in the total pool
uint256 Cstaked = (stakers[msg.sender].stakedTokens).mul(10000000000);
uint256 CTS = totalStakes.mul(10000000000);
uint256 percent = (Cstaked.mul(prevreward));
uint256 rewardcal = percent.div(CTS);
if(reward.rewardstart < stakers[msg.sender].creationTime) //how mch difference
{
time = stakers[msg.sender].creationTime - reward.rewardstart;
uint256 stketime = time.div(3600);
//checking what was the stake time of the user. User should not get all amount if his stake time is less than 20 hours
//will change wif we go with starttime
//checktime
if(stketime < 20)
{
uint256 a = (stketime.mul(10**uint(2))).div(20);
uint256 finalreward = (a.mul(rewardcal)).div(10**uint(2));
if(rewardfee >= rewardcal)
{
Mojito(address(this)).transfer(msg.sender,finalreward);
rewardfee = rewardfee.sub(finalreward);
stakers[msg.sender].lastClaim = reward.rewardstart;
stakers[msg.sender].totalEarned = (stakers[msg.sender].totalEarned).add(finalreward);
emit CLAIMEDREWARD(msg.sender,finalreward);
}
}else
{
if(rewardfee >= rewardcal )
{
Mojito(address(this)).transfer(msg.sender,rewardcal);
rewardfee = rewardfee.sub(rewardcal);
stakers[msg.sender].lastClaim = reward.rewardstart;
stakers[msg.sender].totalEarned = (stakers[msg.sender].totalEarned).add(rewardcal);
emit CLAIMEDREWARD(msg.sender,rewardcal);
}
}
}else{
if(rewardfee >= rewardcal )
{
Mojito(address(this)).transfer(msg.sender,rewardcal);
rewardfee = rewardfee.sub(rewardcal);
stakers[msg.sender].lastClaim = reward.rewardstart ;
stakers[msg.sender].totalEarned = (stakers[msg.sender].totalEarned).add(rewardcal);
emit CLAIMEDREWARD(msg.sender,rewardcal);
}
}
}
}
reward.rewardend = reward.rewardstart + 24 hours;
}
function WatchClaimTime() public view returns (uint ClaimTimeHours)
{
}
function WatchClaimTimeMins() public view returns (uint ClaimTimeHours)
{
}
}
| stakers[msg.sender].lastClaim!=reward.rewardstart,"You have Already Claimed" | 364,220 | stakers[msg.sender].lastClaim!=reward.rewardstart |
null | contract EtherealFoundationOwned {
address private Owner;
function IsOwner(address addr) view public returns(bool)
{
}
function TransferOwner(address newOwner) public onlyOwner
{
}
function EtherealFoundationOwned() public
{
}
function Terminate() public onlyOwner
{
}
modifier onlyOwner(){
}
}
contract ERC20Basic {
function transfer(address to, uint256 value) public returns (bool);
}
contract Bassdrops is EtherealFoundationOwned {
string public constant CONTRACT_NAME = "Bassdrops";
string public constant CONTRACT_VERSION = "A";
string public constant QUOTE = "It’s a permanent, perfect SIMULTANEOUS dichotomy of total insignificance and total significance merged as one into every single flashing second.";
string public constant name = "Bassdrops, a Currency of Omnitempo Maximalism";
string public constant symbol = "BASS";
uint256 public constant decimals = 11;
bool private tradeable;
uint256 private currentSupply;
mapping(address => uint256) private balances;
mapping(address => mapping(address=> uint256)) private allowed;
mapping(address => bool) private lockedAccounts;
/*
Incomming Ether and ERC20
*/
event RecievedEth(address indexed _from, uint256 _value, uint256 timeStamp);
//this is the fallback
function () payable public {
}
event TransferedEth(address indexed _to, uint256 _value);
function FoundationTransfer(address _to, uint256 amtEth, uint256 amtToken) public onlyOwner
{
require(this.balance >= amtEth && balances[this] >= amtToken );
if(amtEth >0)
{
_to.transfer(amtEth);
TransferedEth(_to, amtEth);
}
if(amtToken > 0)
{
require(<FILL_ME>)
balances[this] -= amtToken;
balances[_to] += amtToken;
Transfer(this, _to, amtToken);
}
}
event TransferedERC20(address indexed _to, address indexed tokenContract, uint256 amtToken);
function TransferERC20Token(address _to, address tokenContract, uint256 amtToken) internal onlyOwner{
}
/*
End Incomming Ether
*/
function Bassdrops(
uint256 initialTotalSupply,
uint256 initialTokensPerEth
) public
{
}
uint256 private _tokenPerEth;
function TokensPerWei() view public returns(uint256){
}
function SetTokensPerWei(uint256 tpe) public onlyOwner{
}
event SoldToken(address indexed _buyer, uint256 _value, bytes32 note);
function BuyToken(bytes32 note) public payable
{
}
function LockAccount(address toLock) public onlyOwner
{
}
function UnlockAccount(address toUnlock) public onlyOwner
{
}
function SetTradeable(bool t) public onlyOwner
{
}
function IsTradeable() public view returns(bool)
{
}
function totalSupply() constant public returns (uint256)
{
}
function balanceOf(address _owner) constant public returns (uint256 balance)
{
}
function transfer(address _to, uint256 _value) public notLocked returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value)public notLocked returns (bool success) {
}
function approve(address _spender, uint _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) constant public returns (uint remaining){
}
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
modifier notLocked(){
}
}
| balances[_to]+amtToken>balances[_to] | 364,344 | balances[_to]+amtToken>balances[_to] |
null | contract EtherealFoundationOwned {
address private Owner;
function IsOwner(address addr) view public returns(bool)
{
}
function TransferOwner(address newOwner) public onlyOwner
{
}
function EtherealFoundationOwned() public
{
}
function Terminate() public onlyOwner
{
}
modifier onlyOwner(){
}
}
contract ERC20Basic {
function transfer(address to, uint256 value) public returns (bool);
}
contract Bassdrops is EtherealFoundationOwned {
string public constant CONTRACT_NAME = "Bassdrops";
string public constant CONTRACT_VERSION = "A";
string public constant QUOTE = "It’s a permanent, perfect SIMULTANEOUS dichotomy of total insignificance and total significance merged as one into every single flashing second.";
string public constant name = "Bassdrops, a Currency of Omnitempo Maximalism";
string public constant symbol = "BASS";
uint256 public constant decimals = 11;
bool private tradeable;
uint256 private currentSupply;
mapping(address => uint256) private balances;
mapping(address => mapping(address=> uint256)) private allowed;
mapping(address => bool) private lockedAccounts;
/*
Incomming Ether and ERC20
*/
event RecievedEth(address indexed _from, uint256 _value, uint256 timeStamp);
//this is the fallback
function () payable public {
}
event TransferedEth(address indexed _to, uint256 _value);
function FoundationTransfer(address _to, uint256 amtEth, uint256 amtToken) public onlyOwner
{
}
event TransferedERC20(address indexed _to, address indexed tokenContract, uint256 amtToken);
function TransferERC20Token(address _to, address tokenContract, uint256 amtToken) internal onlyOwner{
ERC20Basic token = ERC20Basic(tokenContract);
require(<FILL_ME>)
TransferedERC20(_to, tokenContract, amtToken);
}
/*
End Incomming Ether
*/
function Bassdrops(
uint256 initialTotalSupply,
uint256 initialTokensPerEth
) public
{
}
uint256 private _tokenPerEth;
function TokensPerWei() view public returns(uint256){
}
function SetTokensPerWei(uint256 tpe) public onlyOwner{
}
event SoldToken(address indexed _buyer, uint256 _value, bytes32 note);
function BuyToken(bytes32 note) public payable
{
}
function LockAccount(address toLock) public onlyOwner
{
}
function UnlockAccount(address toUnlock) public onlyOwner
{
}
function SetTradeable(bool t) public onlyOwner
{
}
function IsTradeable() public view returns(bool)
{
}
function totalSupply() constant public returns (uint256)
{
}
function balanceOf(address _owner) constant public returns (uint256 balance)
{
}
function transfer(address _to, uint256 _value) public notLocked returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value)public notLocked returns (bool success) {
}
function approve(address _spender, uint _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) constant public returns (uint remaining){
}
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
modifier notLocked(){
}
}
| token.transfer(_to,amtToken) | 364,344 | token.transfer(_to,amtToken) |
null | contract EtherealFoundationOwned {
address private Owner;
function IsOwner(address addr) view public returns(bool)
{
}
function TransferOwner(address newOwner) public onlyOwner
{
}
function EtherealFoundationOwned() public
{
}
function Terminate() public onlyOwner
{
}
modifier onlyOwner(){
}
}
contract ERC20Basic {
function transfer(address to, uint256 value) public returns (bool);
}
contract Bassdrops is EtherealFoundationOwned {
string public constant CONTRACT_NAME = "Bassdrops";
string public constant CONTRACT_VERSION = "A";
string public constant QUOTE = "It’s a permanent, perfect SIMULTANEOUS dichotomy of total insignificance and total significance merged as one into every single flashing second.";
string public constant name = "Bassdrops, a Currency of Omnitempo Maximalism";
string public constant symbol = "BASS";
uint256 public constant decimals = 11;
bool private tradeable;
uint256 private currentSupply;
mapping(address => uint256) private balances;
mapping(address => mapping(address=> uint256)) private allowed;
mapping(address => bool) private lockedAccounts;
/*
Incomming Ether and ERC20
*/
event RecievedEth(address indexed _from, uint256 _value, uint256 timeStamp);
//this is the fallback
function () payable public {
}
event TransferedEth(address indexed _to, uint256 _value);
function FoundationTransfer(address _to, uint256 amtEth, uint256 amtToken) public onlyOwner
{
}
event TransferedERC20(address indexed _to, address indexed tokenContract, uint256 amtToken);
function TransferERC20Token(address _to, address tokenContract, uint256 amtToken) internal onlyOwner{
}
/*
End Incomming Ether
*/
function Bassdrops(
uint256 initialTotalSupply,
uint256 initialTokensPerEth
) public
{
}
uint256 private _tokenPerEth;
function TokensPerWei() view public returns(uint256){
}
function SetTokensPerWei(uint256 tpe) public onlyOwner{
}
event SoldToken(address indexed _buyer, uint256 _value, bytes32 note);
function BuyToken(bytes32 note) public payable
{
require(msg.value > 0);
//calculate value
uint256 tokensToBuy = ((_tokenPerEth * (10**decimals)) * msg.value) / (10**18);
require(<FILL_ME>)
SoldToken(msg.sender, tokensToBuy, note);
Transfer(this,msg.sender,tokensToBuy);
currentSupply += tokensToBuy;
balances[msg.sender] += tokensToBuy;
}
function LockAccount(address toLock) public onlyOwner
{
}
function UnlockAccount(address toUnlock) public onlyOwner
{
}
function SetTradeable(bool t) public onlyOwner
{
}
function IsTradeable() public view returns(bool)
{
}
function totalSupply() constant public returns (uint256)
{
}
function balanceOf(address _owner) constant public returns (uint256 balance)
{
}
function transfer(address _to, uint256 _value) public notLocked returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value)public notLocked returns (bool success) {
}
function approve(address _spender, uint _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) constant public returns (uint remaining){
}
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
modifier notLocked(){
}
}
| balances[this]+tokensToBuy>balances[this] | 364,344 | balances[this]+tokensToBuy>balances[this] |
"StakeRewardRefill/cannot-refill" | pragma solidity ^0.6.7;
abstract contract ERC20Events {
event Approval(address indexed src, address indexed guy, uint wad);
event Transfer(address indexed src, address indexed dst, uint wad);
}
abstract contract ERC20 is ERC20Events {
function totalSupply() virtual public view returns (uint);
function balanceOf(address guy) virtual public view returns (uint);
function allowance(address src, address guy) virtual public view returns (uint);
function approve(address guy, uint wad) virtual public returns (bool);
function transfer(address dst, uint wad) virtual public returns (bool);
function transferFrom(
address src, address dst, uint wad
) virtual public returns (bool);
}
contract StakeRewardRefill {
// --- Auth ---
mapping (address => uint) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) external isAuthorized {
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) external isAuthorized {
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
}
/**
* @notice Checks whether msg.sender can refill
**/
modifier canRefill {
require(<FILL_ME>)
_;
}
// --- Variables ---
// Last timestamp for a refill
uint256 public lastRefillTime;
// The delay between two consecutive refills
uint256 public refillDelay;
// The amount to send per refill
uint256 public refillAmount;
// Whether anyone can refill or only authed accounts
uint256 public openRefill;
// The address that receives tokens
address public refillDestination;
// The token used as reward
ERC20 public rewardToken;
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event ModifyParameters(
bytes32 parameter,
address addr
);
event ModifyParameters(
bytes32 parameter,
uint256 val
);
event Refill(address refillDestination, uint256 amountToTransfer);
constructor(
address rewardToken_,
address refillDestination_,
uint256 openRefill_,
uint256 refillDelay_,
uint256 refillAmount_
) public {
}
// --- Boolean Logic ---
function either(bool x, bool y) internal pure returns (bool z) {
}
// --- Math ---
function subtract(uint x, uint y) public pure returns (uint z) {
}
function multiply(uint x, uint y) public pure returns (uint z) {
}
// --- Administration ---
/**
* @notice Modify an address parameter
* @param parameter The parameter name
* @param data The new parameter value
**/
function modifyParameters(bytes32 parameter, address data) external isAuthorized {
}
/**
* @notice Modify a uint256 parameter
* @param parameter The parameter name
* @param data The new parameter value
**/
function modifyParameters(bytes32 parameter, uint256 data) external isAuthorized {
}
/**
* @notice Transfer tokens to a custom address
* @param dst Transfer destination
* @param amount Amount of tokens to transfer
**/
function transferTokenOut(address dst, uint256 amount) external isAuthorized {
}
// --- Core Logic ---
/**
* @notice Send tokens to refillDestination
* @dev This function can only be called if msg.sender passes canRefill checks
**/
function refill() external canRefill {
}
}
| either(openRefill==1,authorizedAccounts[msg.sender]==1),"StakeRewardRefill/cannot-refill" | 364,407 | either(openRefill==1,authorizedAccounts[msg.sender]==1) |
"AegisGovernance::proposeFreed voting is not closed" | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
/**
* @notice AegisGovernance
* @author Aegis
*/
contract AegisGovernance {
string public constant name = "Aegis Governor";
function passVotes() public pure returns (uint) { }
function passMantissa() public pure returns (uint) { }
function proposalThreshold() public pure returns (uint) { } // 0.5% of AGS
function proposalMaxOperations() public pure returns (uint) { }
function votingDelay() public pure returns (uint) { }
function votingPeriod() public pure returns (uint) { }
TimelockInterface public timelock;
address public guardian;
uint public proposalCount;
mapping (uint => Proposal) public proposals;
mapping (address => uint) public latestProposalIds;
mapping(address => mapping(uint => uint)) public checkPointVotes;
mapping(address => uint) public checkPointProposal;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
event ProposalCreated(uint _id, address _proposer, address[] _targets, uint[] _values, string[] _signatures, bytes[] _calldatas, uint _startBlock, uint _endBlock, string _description);
event VoteCast(address _voter, uint _proposalId, bool _support, uint _votes);
event ProposalCanceled(uint _id);
event ProposalQueued(uint _id, uint _eta);
event ProposalExecuted(uint _id);
event VotesLockup(address _account, uint _number, uint _lockup);
event ProposeLockup(address _account, uint _number, uint _lockup);
event ProposeFreed(address _account, uint _number, uint _remaining);
event VotesFreed(address _account, uint _number, uint _remaining);
struct Proposal {
uint id;
address proposer;
uint eta;
address[] targets;
uint[] values;
string[] signatures;
bytes[] calldatas;
uint startBlock;
uint endBlock;
uint forVotes;
uint againstVotes;
bool canceled;
bool executed;
mapping (address => Receipt) receipts;
}
struct Receipt {
bool hasVoted;
bool support;
uint votes;
}
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
constructor(address _timelock, address _guardian) public {
}
function proposeLockup(uint _number) public {
}
function proposeFreed(address payable _account, uint _proposalId) public {
require(<FILL_ME>)
Proposal storage proposal = proposals[_proposalId];
require(_account == msg.sender && _account == proposal.proposer, "AegisGovernance::proposeFreed no permission to operate");
require(checkPointProposal[_account] > 0, "AegisGovernance::proposeFreed insufficient coins");
uint number = checkPointProposal[_account];
doTransferOut(_account, number);
checkPointProposal[_account] = 0;
emit ProposeFreed(_account, number, checkPointProposal[_account]);
}
function votesLockup(uint _number, uint _proposalId) public {
}
function votesFreed(address payable _account, uint _proposalId) public {
}
function getPriorVotes(address _account, uint _proposalId) public view returns (uint) {
}
function totalLockUp() public view returns (uint) {
}
function propose(address[] memory _targets, uint[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description) public returns (uint) {
}
function queue(uint _proposalId) public {
}
function _queueOrRevert(address _target, uint _value, string memory _signature, bytes memory _data, uint _eta) internal {
}
function execute(uint _proposalId) public payable {
}
function cancel(uint _proposalId) public {
}
function getActions(uint _proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
}
function getReceipt(uint _proposalId, address _voter) public view returns (Receipt memory) {
}
function state(uint _proposalId) public view returns (ProposalState) {
}
function castVote(uint _proposalId, bool _support) public {
}
function castVoteBySig(uint _proposalId, bool _support, uint8 _v, bytes32 _r, bytes32 _s) public {
}
function _castVote(address _voter, uint _proposalId, bool _support) internal {
}
function doTransferIn(address from, uint amount) internal returns (uint) {
}
function doTransferOut(address payable to, uint amount) internal {
}
function underlying() internal pure returns (address) {
}
function __acceptAdmin() public {
}
function __abdicate() public {
}
function __queueSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function __executeSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function add256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function sub256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function getChainId() internal pure returns (uint) {
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
| state(_proposalId)!=ProposalState.Active,"AegisGovernance::proposeFreed voting is not closed" | 364,418 | state(_proposalId)!=ProposalState.Active |
"AegisGovernance::proposeFreed insufficient coins" | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
/**
* @notice AegisGovernance
* @author Aegis
*/
contract AegisGovernance {
string public constant name = "Aegis Governor";
function passVotes() public pure returns (uint) { }
function passMantissa() public pure returns (uint) { }
function proposalThreshold() public pure returns (uint) { } // 0.5% of AGS
function proposalMaxOperations() public pure returns (uint) { }
function votingDelay() public pure returns (uint) { }
function votingPeriod() public pure returns (uint) { }
TimelockInterface public timelock;
address public guardian;
uint public proposalCount;
mapping (uint => Proposal) public proposals;
mapping (address => uint) public latestProposalIds;
mapping(address => mapping(uint => uint)) public checkPointVotes;
mapping(address => uint) public checkPointProposal;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
event ProposalCreated(uint _id, address _proposer, address[] _targets, uint[] _values, string[] _signatures, bytes[] _calldatas, uint _startBlock, uint _endBlock, string _description);
event VoteCast(address _voter, uint _proposalId, bool _support, uint _votes);
event ProposalCanceled(uint _id);
event ProposalQueued(uint _id, uint _eta);
event ProposalExecuted(uint _id);
event VotesLockup(address _account, uint _number, uint _lockup);
event ProposeLockup(address _account, uint _number, uint _lockup);
event ProposeFreed(address _account, uint _number, uint _remaining);
event VotesFreed(address _account, uint _number, uint _remaining);
struct Proposal {
uint id;
address proposer;
uint eta;
address[] targets;
uint[] values;
string[] signatures;
bytes[] calldatas;
uint startBlock;
uint endBlock;
uint forVotes;
uint againstVotes;
bool canceled;
bool executed;
mapping (address => Receipt) receipts;
}
struct Receipt {
bool hasVoted;
bool support;
uint votes;
}
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
constructor(address _timelock, address _guardian) public {
}
function proposeLockup(uint _number) public {
}
function proposeFreed(address payable _account, uint _proposalId) public {
require(state(_proposalId) != ProposalState.Active, "AegisGovernance::proposeFreed voting is not closed");
Proposal storage proposal = proposals[_proposalId];
require(_account == msg.sender && _account == proposal.proposer, "AegisGovernance::proposeFreed no permission to operate");
require(<FILL_ME>)
uint number = checkPointProposal[_account];
doTransferOut(_account, number);
checkPointProposal[_account] = 0;
emit ProposeFreed(_account, number, checkPointProposal[_account]);
}
function votesLockup(uint _number, uint _proposalId) public {
}
function votesFreed(address payable _account, uint _proposalId) public {
}
function getPriorVotes(address _account, uint _proposalId) public view returns (uint) {
}
function totalLockUp() public view returns (uint) {
}
function propose(address[] memory _targets, uint[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description) public returns (uint) {
}
function queue(uint _proposalId) public {
}
function _queueOrRevert(address _target, uint _value, string memory _signature, bytes memory _data, uint _eta) internal {
}
function execute(uint _proposalId) public payable {
}
function cancel(uint _proposalId) public {
}
function getActions(uint _proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
}
function getReceipt(uint _proposalId, address _voter) public view returns (Receipt memory) {
}
function state(uint _proposalId) public view returns (ProposalState) {
}
function castVote(uint _proposalId, bool _support) public {
}
function castVoteBySig(uint _proposalId, bool _support, uint8 _v, bytes32 _r, bytes32 _s) public {
}
function _castVote(address _voter, uint _proposalId, bool _support) internal {
}
function doTransferIn(address from, uint amount) internal returns (uint) {
}
function doTransferOut(address payable to, uint amount) internal {
}
function underlying() internal pure returns (address) {
}
function __acceptAdmin() public {
}
function __abdicate() public {
}
function __queueSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function __executeSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function add256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function sub256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function getChainId() internal pure returns (uint) {
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
| checkPointProposal[_account]>0,"AegisGovernance::proposeFreed insufficient coins" | 364,418 | checkPointProposal[_account]>0 |
"AegisGovernance::votesLockup voting is closed" | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
/**
* @notice AegisGovernance
* @author Aegis
*/
contract AegisGovernance {
string public constant name = "Aegis Governor";
function passVotes() public pure returns (uint) { }
function passMantissa() public pure returns (uint) { }
function proposalThreshold() public pure returns (uint) { } // 0.5% of AGS
function proposalMaxOperations() public pure returns (uint) { }
function votingDelay() public pure returns (uint) { }
function votingPeriod() public pure returns (uint) { }
TimelockInterface public timelock;
address public guardian;
uint public proposalCount;
mapping (uint => Proposal) public proposals;
mapping (address => uint) public latestProposalIds;
mapping(address => mapping(uint => uint)) public checkPointVotes;
mapping(address => uint) public checkPointProposal;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
event ProposalCreated(uint _id, address _proposer, address[] _targets, uint[] _values, string[] _signatures, bytes[] _calldatas, uint _startBlock, uint _endBlock, string _description);
event VoteCast(address _voter, uint _proposalId, bool _support, uint _votes);
event ProposalCanceled(uint _id);
event ProposalQueued(uint _id, uint _eta);
event ProposalExecuted(uint _id);
event VotesLockup(address _account, uint _number, uint _lockup);
event ProposeLockup(address _account, uint _number, uint _lockup);
event ProposeFreed(address _account, uint _number, uint _remaining);
event VotesFreed(address _account, uint _number, uint _remaining);
struct Proposal {
uint id;
address proposer;
uint eta;
address[] targets;
uint[] values;
string[] signatures;
bytes[] calldatas;
uint startBlock;
uint endBlock;
uint forVotes;
uint againstVotes;
bool canceled;
bool executed;
mapping (address => Receipt) receipts;
}
struct Receipt {
bool hasVoted;
bool support;
uint votes;
}
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
constructor(address _timelock, address _guardian) public {
}
function proposeLockup(uint _number) public {
}
function proposeFreed(address payable _account, uint _proposalId) public {
}
function votesLockup(uint _number, uint _proposalId) public {
require(_number > 0, "AegisGovernance::votesLockup number must be greater than 0");
require(<FILL_ME>)
uint actualAmount = doTransferIn(msg.sender, _number);
uint old = checkPointVotes[msg.sender][_proposalId];
checkPointVotes[msg.sender][_proposalId] = old + actualAmount;
emit VotesLockup(msg.sender, _number, getPriorVotes(msg.sender, _proposalId));
}
function votesFreed(address payable _account, uint _proposalId) public {
}
function getPriorVotes(address _account, uint _proposalId) public view returns (uint) {
}
function totalLockUp() public view returns (uint) {
}
function propose(address[] memory _targets, uint[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description) public returns (uint) {
}
function queue(uint _proposalId) public {
}
function _queueOrRevert(address _target, uint _value, string memory _signature, bytes memory _data, uint _eta) internal {
}
function execute(uint _proposalId) public payable {
}
function cancel(uint _proposalId) public {
}
function getActions(uint _proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
}
function getReceipt(uint _proposalId, address _voter) public view returns (Receipt memory) {
}
function state(uint _proposalId) public view returns (ProposalState) {
}
function castVote(uint _proposalId, bool _support) public {
}
function castVoteBySig(uint _proposalId, bool _support, uint8 _v, bytes32 _r, bytes32 _s) public {
}
function _castVote(address _voter, uint _proposalId, bool _support) internal {
}
function doTransferIn(address from, uint amount) internal returns (uint) {
}
function doTransferOut(address payable to, uint amount) internal {
}
function underlying() internal pure returns (address) {
}
function __acceptAdmin() public {
}
function __abdicate() public {
}
function __queueSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function __executeSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function add256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function sub256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function getChainId() internal pure returns (uint) {
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
| state(_proposalId)==ProposalState.Active,"AegisGovernance::votesLockup voting is closed" | 364,418 | state(_proposalId)==ProposalState.Active |
"AegisGovernance::propose: proposer votes below proposal threshold" | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
/**
* @notice AegisGovernance
* @author Aegis
*/
contract AegisGovernance {
string public constant name = "Aegis Governor";
function passVotes() public pure returns (uint) { }
function passMantissa() public pure returns (uint) { }
function proposalThreshold() public pure returns (uint) { } // 0.5% of AGS
function proposalMaxOperations() public pure returns (uint) { }
function votingDelay() public pure returns (uint) { }
function votingPeriod() public pure returns (uint) { }
TimelockInterface public timelock;
address public guardian;
uint public proposalCount;
mapping (uint => Proposal) public proposals;
mapping (address => uint) public latestProposalIds;
mapping(address => mapping(uint => uint)) public checkPointVotes;
mapping(address => uint) public checkPointProposal;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
event ProposalCreated(uint _id, address _proposer, address[] _targets, uint[] _values, string[] _signatures, bytes[] _calldatas, uint _startBlock, uint _endBlock, string _description);
event VoteCast(address _voter, uint _proposalId, bool _support, uint _votes);
event ProposalCanceled(uint _id);
event ProposalQueued(uint _id, uint _eta);
event ProposalExecuted(uint _id);
event VotesLockup(address _account, uint _number, uint _lockup);
event ProposeLockup(address _account, uint _number, uint _lockup);
event ProposeFreed(address _account, uint _number, uint _remaining);
event VotesFreed(address _account, uint _number, uint _remaining);
struct Proposal {
uint id;
address proposer;
uint eta;
address[] targets;
uint[] values;
string[] signatures;
bytes[] calldatas;
uint startBlock;
uint endBlock;
uint forVotes;
uint againstVotes;
bool canceled;
bool executed;
mapping (address => Receipt) receipts;
}
struct Receipt {
bool hasVoted;
bool support;
uint votes;
}
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
constructor(address _timelock, address _guardian) public {
}
function proposeLockup(uint _number) public {
}
function proposeFreed(address payable _account, uint _proposalId) public {
}
function votesLockup(uint _number, uint _proposalId) public {
}
function votesFreed(address payable _account, uint _proposalId) public {
}
function getPriorVotes(address _account, uint _proposalId) public view returns (uint) {
}
function totalLockUp() public view returns (uint) {
}
function propose(address[] memory _targets, uint[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description) public returns (uint) {
require(<FILL_ME>)
require(_targets.length == _values.length && _targets.length == _signatures.length && _targets.length == _calldatas.length, "AegisGovernance::propose: proposal function information arity mismatch");
require(_targets.length != 0, "AegisGovernance::propose: must provide actions");
require(_targets.length <= proposalMaxOperations(), "AegisGovernance::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "AegisGovernance::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "AegisGovernance::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: _targets,
values: _values,
signatures: _signatures,
calldatas: _calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, _targets, _values, _signatures, _calldatas, startBlock, endBlock, _description);
return newProposal.id;
}
function queue(uint _proposalId) public {
}
function _queueOrRevert(address _target, uint _value, string memory _signature, bytes memory _data, uint _eta) internal {
}
function execute(uint _proposalId) public payable {
}
function cancel(uint _proposalId) public {
}
function getActions(uint _proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
}
function getReceipt(uint _proposalId, address _voter) public view returns (Receipt memory) {
}
function state(uint _proposalId) public view returns (ProposalState) {
}
function castVote(uint _proposalId, bool _support) public {
}
function castVoteBySig(uint _proposalId, bool _support, uint8 _v, bytes32 _r, bytes32 _s) public {
}
function _castVote(address _voter, uint _proposalId, bool _support) internal {
}
function doTransferIn(address from, uint amount) internal returns (uint) {
}
function doTransferOut(address payable to, uint amount) internal {
}
function underlying() internal pure returns (address) {
}
function __acceptAdmin() public {
}
function __abdicate() public {
}
function __queueSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function __executeSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function add256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function sub256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function getChainId() internal pure returns (uint) {
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
| checkPointProposal[msg.sender]>=proposalThreshold(),"AegisGovernance::propose: proposer votes below proposal threshold" | 364,418 | checkPointProposal[msg.sender]>=proposalThreshold() |
"AegisGovernance::queue: proposal can only be queued if it is succeeded" | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
/**
* @notice AegisGovernance
* @author Aegis
*/
contract AegisGovernance {
string public constant name = "Aegis Governor";
function passVotes() public pure returns (uint) { }
function passMantissa() public pure returns (uint) { }
function proposalThreshold() public pure returns (uint) { } // 0.5% of AGS
function proposalMaxOperations() public pure returns (uint) { }
function votingDelay() public pure returns (uint) { }
function votingPeriod() public pure returns (uint) { }
TimelockInterface public timelock;
address public guardian;
uint public proposalCount;
mapping (uint => Proposal) public proposals;
mapping (address => uint) public latestProposalIds;
mapping(address => mapping(uint => uint)) public checkPointVotes;
mapping(address => uint) public checkPointProposal;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
event ProposalCreated(uint _id, address _proposer, address[] _targets, uint[] _values, string[] _signatures, bytes[] _calldatas, uint _startBlock, uint _endBlock, string _description);
event VoteCast(address _voter, uint _proposalId, bool _support, uint _votes);
event ProposalCanceled(uint _id);
event ProposalQueued(uint _id, uint _eta);
event ProposalExecuted(uint _id);
event VotesLockup(address _account, uint _number, uint _lockup);
event ProposeLockup(address _account, uint _number, uint _lockup);
event ProposeFreed(address _account, uint _number, uint _remaining);
event VotesFreed(address _account, uint _number, uint _remaining);
struct Proposal {
uint id;
address proposer;
uint eta;
address[] targets;
uint[] values;
string[] signatures;
bytes[] calldatas;
uint startBlock;
uint endBlock;
uint forVotes;
uint againstVotes;
bool canceled;
bool executed;
mapping (address => Receipt) receipts;
}
struct Receipt {
bool hasVoted;
bool support;
uint votes;
}
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
constructor(address _timelock, address _guardian) public {
}
function proposeLockup(uint _number) public {
}
function proposeFreed(address payable _account, uint _proposalId) public {
}
function votesLockup(uint _number, uint _proposalId) public {
}
function votesFreed(address payable _account, uint _proposalId) public {
}
function getPriorVotes(address _account, uint _proposalId) public view returns (uint) {
}
function totalLockUp() public view returns (uint) {
}
function propose(address[] memory _targets, uint[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description) public returns (uint) {
}
function queue(uint _proposalId) public {
require(<FILL_ME>)
Proposal storage proposal = proposals[_proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(_proposalId, eta);
}
function _queueOrRevert(address _target, uint _value, string memory _signature, bytes memory _data, uint _eta) internal {
}
function execute(uint _proposalId) public payable {
}
function cancel(uint _proposalId) public {
}
function getActions(uint _proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
}
function getReceipt(uint _proposalId, address _voter) public view returns (Receipt memory) {
}
function state(uint _proposalId) public view returns (ProposalState) {
}
function castVote(uint _proposalId, bool _support) public {
}
function castVoteBySig(uint _proposalId, bool _support, uint8 _v, bytes32 _r, bytes32 _s) public {
}
function _castVote(address _voter, uint _proposalId, bool _support) internal {
}
function doTransferIn(address from, uint amount) internal returns (uint) {
}
function doTransferOut(address payable to, uint amount) internal {
}
function underlying() internal pure returns (address) {
}
function __acceptAdmin() public {
}
function __abdicate() public {
}
function __queueSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function __executeSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function add256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function sub256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function getChainId() internal pure returns (uint) {
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
| state(_proposalId)==ProposalState.Succeeded,"AegisGovernance::queue: proposal can only be queued if it is succeeded" | 364,418 | state(_proposalId)==ProposalState.Succeeded |
"AegisGovernance::_queueOrRevert: proposal action already queued at eta" | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
/**
* @notice AegisGovernance
* @author Aegis
*/
contract AegisGovernance {
string public constant name = "Aegis Governor";
function passVotes() public pure returns (uint) { }
function passMantissa() public pure returns (uint) { }
function proposalThreshold() public pure returns (uint) { } // 0.5% of AGS
function proposalMaxOperations() public pure returns (uint) { }
function votingDelay() public pure returns (uint) { }
function votingPeriod() public pure returns (uint) { }
TimelockInterface public timelock;
address public guardian;
uint public proposalCount;
mapping (uint => Proposal) public proposals;
mapping (address => uint) public latestProposalIds;
mapping(address => mapping(uint => uint)) public checkPointVotes;
mapping(address => uint) public checkPointProposal;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
event ProposalCreated(uint _id, address _proposer, address[] _targets, uint[] _values, string[] _signatures, bytes[] _calldatas, uint _startBlock, uint _endBlock, string _description);
event VoteCast(address _voter, uint _proposalId, bool _support, uint _votes);
event ProposalCanceled(uint _id);
event ProposalQueued(uint _id, uint _eta);
event ProposalExecuted(uint _id);
event VotesLockup(address _account, uint _number, uint _lockup);
event ProposeLockup(address _account, uint _number, uint _lockup);
event ProposeFreed(address _account, uint _number, uint _remaining);
event VotesFreed(address _account, uint _number, uint _remaining);
struct Proposal {
uint id;
address proposer;
uint eta;
address[] targets;
uint[] values;
string[] signatures;
bytes[] calldatas;
uint startBlock;
uint endBlock;
uint forVotes;
uint againstVotes;
bool canceled;
bool executed;
mapping (address => Receipt) receipts;
}
struct Receipt {
bool hasVoted;
bool support;
uint votes;
}
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
constructor(address _timelock, address _guardian) public {
}
function proposeLockup(uint _number) public {
}
function proposeFreed(address payable _account, uint _proposalId) public {
}
function votesLockup(uint _number, uint _proposalId) public {
}
function votesFreed(address payable _account, uint _proposalId) public {
}
function getPriorVotes(address _account, uint _proposalId) public view returns (uint) {
}
function totalLockUp() public view returns (uint) {
}
function propose(address[] memory _targets, uint[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description) public returns (uint) {
}
function queue(uint _proposalId) public {
}
function _queueOrRevert(address _target, uint _value, string memory _signature, bytes memory _data, uint _eta) internal {
require(<FILL_ME>)
timelock.queueTransaction(_target, _value, _signature, _data, _eta);
}
function execute(uint _proposalId) public payable {
}
function cancel(uint _proposalId) public {
}
function getActions(uint _proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
}
function getReceipt(uint _proposalId, address _voter) public view returns (Receipt memory) {
}
function state(uint _proposalId) public view returns (ProposalState) {
}
function castVote(uint _proposalId, bool _support) public {
}
function castVoteBySig(uint _proposalId, bool _support, uint8 _v, bytes32 _r, bytes32 _s) public {
}
function _castVote(address _voter, uint _proposalId, bool _support) internal {
}
function doTransferIn(address from, uint amount) internal returns (uint) {
}
function doTransferOut(address payable to, uint amount) internal {
}
function underlying() internal pure returns (address) {
}
function __acceptAdmin() public {
}
function __abdicate() public {
}
function __queueSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function __executeSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function add256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function sub256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function getChainId() internal pure returns (uint) {
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
| !timelock.queuedTransactions(keccak256(abi.encode(_target,_value,_signature,_data,_eta))),"AegisGovernance::_queueOrRevert: proposal action already queued at eta" | 364,418 | !timelock.queuedTransactions(keccak256(abi.encode(_target,_value,_signature,_data,_eta))) |
"AegisGovernance::execute: proposal can only be executed if it is queued" | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
/**
* @notice AegisGovernance
* @author Aegis
*/
contract AegisGovernance {
string public constant name = "Aegis Governor";
function passVotes() public pure returns (uint) { }
function passMantissa() public pure returns (uint) { }
function proposalThreshold() public pure returns (uint) { } // 0.5% of AGS
function proposalMaxOperations() public pure returns (uint) { }
function votingDelay() public pure returns (uint) { }
function votingPeriod() public pure returns (uint) { }
TimelockInterface public timelock;
address public guardian;
uint public proposalCount;
mapping (uint => Proposal) public proposals;
mapping (address => uint) public latestProposalIds;
mapping(address => mapping(uint => uint)) public checkPointVotes;
mapping(address => uint) public checkPointProposal;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
event ProposalCreated(uint _id, address _proposer, address[] _targets, uint[] _values, string[] _signatures, bytes[] _calldatas, uint _startBlock, uint _endBlock, string _description);
event VoteCast(address _voter, uint _proposalId, bool _support, uint _votes);
event ProposalCanceled(uint _id);
event ProposalQueued(uint _id, uint _eta);
event ProposalExecuted(uint _id);
event VotesLockup(address _account, uint _number, uint _lockup);
event ProposeLockup(address _account, uint _number, uint _lockup);
event ProposeFreed(address _account, uint _number, uint _remaining);
event VotesFreed(address _account, uint _number, uint _remaining);
struct Proposal {
uint id;
address proposer;
uint eta;
address[] targets;
uint[] values;
string[] signatures;
bytes[] calldatas;
uint startBlock;
uint endBlock;
uint forVotes;
uint againstVotes;
bool canceled;
bool executed;
mapping (address => Receipt) receipts;
}
struct Receipt {
bool hasVoted;
bool support;
uint votes;
}
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
constructor(address _timelock, address _guardian) public {
}
function proposeLockup(uint _number) public {
}
function proposeFreed(address payable _account, uint _proposalId) public {
}
function votesLockup(uint _number, uint _proposalId) public {
}
function votesFreed(address payable _account, uint _proposalId) public {
}
function getPriorVotes(address _account, uint _proposalId) public view returns (uint) {
}
function totalLockUp() public view returns (uint) {
}
function propose(address[] memory _targets, uint[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description) public returns (uint) {
}
function queue(uint _proposalId) public {
}
function _queueOrRevert(address _target, uint _value, string memory _signature, bytes memory _data, uint _eta) internal {
}
function execute(uint _proposalId) public payable {
require(<FILL_ME>)
Proposal storage proposal = proposals[_proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(_proposalId);
}
function cancel(uint _proposalId) public {
}
function getActions(uint _proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
}
function getReceipt(uint _proposalId, address _voter) public view returns (Receipt memory) {
}
function state(uint _proposalId) public view returns (ProposalState) {
}
function castVote(uint _proposalId, bool _support) public {
}
function castVoteBySig(uint _proposalId, bool _support, uint8 _v, bytes32 _r, bytes32 _s) public {
}
function _castVote(address _voter, uint _proposalId, bool _support) internal {
}
function doTransferIn(address from, uint amount) internal returns (uint) {
}
function doTransferOut(address payable to, uint amount) internal {
}
function underlying() internal pure returns (address) {
}
function __acceptAdmin() public {
}
function __abdicate() public {
}
function __queueSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function __executeSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function add256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function sub256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function getChainId() internal pure returns (uint) {
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
| state(_proposalId)==ProposalState.Queued,"AegisGovernance::execute: proposal can only be executed if it is queued" | 364,418 | state(_proposalId)==ProposalState.Queued |
"AegisGovernance::castVote not enough votes" | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
/**
* @notice AegisGovernance
* @author Aegis
*/
contract AegisGovernance {
string public constant name = "Aegis Governor";
function passVotes() public pure returns (uint) { }
function passMantissa() public pure returns (uint) { }
function proposalThreshold() public pure returns (uint) { } // 0.5% of AGS
function proposalMaxOperations() public pure returns (uint) { }
function votingDelay() public pure returns (uint) { }
function votingPeriod() public pure returns (uint) { }
TimelockInterface public timelock;
address public guardian;
uint public proposalCount;
mapping (uint => Proposal) public proposals;
mapping (address => uint) public latestProposalIds;
mapping(address => mapping(uint => uint)) public checkPointVotes;
mapping(address => uint) public checkPointProposal;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
event ProposalCreated(uint _id, address _proposer, address[] _targets, uint[] _values, string[] _signatures, bytes[] _calldatas, uint _startBlock, uint _endBlock, string _description);
event VoteCast(address _voter, uint _proposalId, bool _support, uint _votes);
event ProposalCanceled(uint _id);
event ProposalQueued(uint _id, uint _eta);
event ProposalExecuted(uint _id);
event VotesLockup(address _account, uint _number, uint _lockup);
event ProposeLockup(address _account, uint _number, uint _lockup);
event ProposeFreed(address _account, uint _number, uint _remaining);
event VotesFreed(address _account, uint _number, uint _remaining);
struct Proposal {
uint id;
address proposer;
uint eta;
address[] targets;
uint[] values;
string[] signatures;
bytes[] calldatas;
uint startBlock;
uint endBlock;
uint forVotes;
uint againstVotes;
bool canceled;
bool executed;
mapping (address => Receipt) receipts;
}
struct Receipt {
bool hasVoted;
bool support;
uint votes;
}
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
constructor(address _timelock, address _guardian) public {
}
function proposeLockup(uint _number) public {
}
function proposeFreed(address payable _account, uint _proposalId) public {
}
function votesLockup(uint _number, uint _proposalId) public {
}
function votesFreed(address payable _account, uint _proposalId) public {
}
function getPriorVotes(address _account, uint _proposalId) public view returns (uint) {
}
function totalLockUp() public view returns (uint) {
}
function propose(address[] memory _targets, uint[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description) public returns (uint) {
}
function queue(uint _proposalId) public {
}
function _queueOrRevert(address _target, uint _value, string memory _signature, bytes memory _data, uint _eta) internal {
}
function execute(uint _proposalId) public payable {
}
function cancel(uint _proposalId) public {
}
function getActions(uint _proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
}
function getReceipt(uint _proposalId, address _voter) public view returns (Receipt memory) {
}
function state(uint _proposalId) public view returns (ProposalState) {
}
function castVote(uint _proposalId, bool _support) public {
require(<FILL_ME>)
return _castVote(msg.sender, _proposalId, _support);
}
function castVoteBySig(uint _proposalId, bool _support, uint8 _v, bytes32 _r, bytes32 _s) public {
}
function _castVote(address _voter, uint _proposalId, bool _support) internal {
}
function doTransferIn(address from, uint amount) internal returns (uint) {
}
function doTransferOut(address payable to, uint amount) internal {
}
function underlying() internal pure returns (address) {
}
function __acceptAdmin() public {
}
function __abdicate() public {
}
function __queueSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function __executeSetTimelockPendingAdmin(address _newPendingAdmin, uint _eta) public {
}
function add256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function sub256(uint256 _a, uint256 _b) internal pure returns (uint) {
}
function getChainId() internal pure returns (uint) {
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
| getPriorVotes(msg.sender,_proposalId)>0,"AegisGovernance::castVote not enough votes" | 364,418 | getPriorVotes(msg.sender,_proposalId)>0 |
"Max supply reached" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721Tradable.sol";
contract Lady is ERC721Tradable {
bool public saleIsActive;
uint256 public maxByMint;
uint256 public maxSupply;
uint256 public maxPublicSupply;
uint256 public maxReservedSupply;
uint256 public totalPublicSupply;
uint256 public totalReservedSupply;
uint256 public fixedPrice;
address public daoAddress;
string internal baseTokenURI;
constructor(
string memory _name,
string memory _symbol,
address _proxyRegistryAddress
) ERC721Tradable(_name, _symbol, _proxyRegistryAddress) {
}
function contractURI() public pure returns (string memory) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function mintPublic(uint numberOfTokens) external payable {
require(saleIsActive, "Sale not active");
require(numberOfTokens <= maxByMint, "Max mint exceeded");
require(<FILL_ME>)
require(fixedPrice * numberOfTokens <= msg.value, "Eth val incorrect");
for(uint i = 0; i < numberOfTokens; i++) {
_mint(msg.sender, totalPublicSupply + 1);
totalPublicSupply++;
}
}
function mintReserved(address _to) external onlyOwner {
}
function flipSaleStatus() external onlyOwner {
}
function setDaoAddress(address _daoAddress) external onlyOwner {
}
function setBaseTokenURI(string memory _baseTokenURI) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
}
| totalPublicSupply+numberOfTokens<=maxPublicSupply,"Max supply reached" | 364,480 | totalPublicSupply+numberOfTokens<=maxPublicSupply |
"Eth val incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721Tradable.sol";
contract Lady is ERC721Tradable {
bool public saleIsActive;
uint256 public maxByMint;
uint256 public maxSupply;
uint256 public maxPublicSupply;
uint256 public maxReservedSupply;
uint256 public totalPublicSupply;
uint256 public totalReservedSupply;
uint256 public fixedPrice;
address public daoAddress;
string internal baseTokenURI;
constructor(
string memory _name,
string memory _symbol,
address _proxyRegistryAddress
) ERC721Tradable(_name, _symbol, _proxyRegistryAddress) {
}
function contractURI() public pure returns (string memory) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function mintPublic(uint numberOfTokens) external payable {
require(saleIsActive, "Sale not active");
require(numberOfTokens <= maxByMint, "Max mint exceeded");
require(totalPublicSupply + numberOfTokens <= maxPublicSupply, "Max supply reached");
require(<FILL_ME>)
for(uint i = 0; i < numberOfTokens; i++) {
_mint(msg.sender, totalPublicSupply + 1);
totalPublicSupply++;
}
}
function mintReserved(address _to) external onlyOwner {
}
function flipSaleStatus() external onlyOwner {
}
function setDaoAddress(address _daoAddress) external onlyOwner {
}
function setBaseTokenURI(string memory _baseTokenURI) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
}
| fixedPrice*numberOfTokens<=msg.value,"Eth val incorrect" | 364,480 | fixedPrice*numberOfTokens<=msg.value |
null | pragma solidity ^0.4.23;
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
}
/**
* @dev remove an address' access to this role
*/
function remove(Role storage role, address addr)
internal
{
}
/**
* @dev check if an address has this role
* // reverts
*/
function check(Role storage role, address addr)
view
internal
{
}
/**
* @dev check if an address has this role
* @return bool
*/
function has(Role storage role, address addr)
view
internal
returns (bool)
{
}
}
contract RBAC {
using Roles for Roles.Role;
mapping (string => Roles.Role) private roles;
event RoleAdded(address addr, string roleName);
event RoleRemoved(address addr, string roleName);
/**
* @dev reverts if addr does not have role
* @param addr address
* @param roleName the name of the role
* // reverts
*/
function checkRole(address addr, string roleName)
view
public
{
}
/**
* @dev determine if addr has role
* @param addr address
* @param roleName the name of the role
* @return bool
*/
function hasRole(address addr, string roleName)
view
public
returns (bool)
{
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function addRole(address addr, string roleName)
internal
{
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function removeRole(address addr, string roleName)
internal
{
}
/**
* @dev modifier to scope access to a single role (uses msg.sender as addr)
* @param roleName the name of the role
* // reverts
*/
modifier onlyRole(string roleName)
{
}
/**
* @dev modifier to scope access to a set of roles (uses msg.sender as addr)
* @param roleNames the names of the roles to scope access to
* // reverts
*
* @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
* see: https://github.com/ethereum/solidity/issues/2467
*/
// modifier onlyRoles(string[] roleNames) {
// bool hasAnyRole = false;
// for (uint8 i = 0; i < roleNames.length; i++) {
// if (hasRole(msg.sender, roleNames[i])) {
// hasAnyRole = true;
// break;
// }
// }
// require(hasAnyRole);
// _;
// }
}
contract RBACWithAdmin is RBAC {
/**
* A constant role name for indicating admins.
*/
string public constant ROLE_ADMIN = "admin";
string public constant ROLE_PAUSE_ADMIN = "pauseAdmin";
/**
* @dev modifier to scope access to admins
* // reverts
*/
modifier onlyAdmin()
{
}
modifier onlyPauseAdmin()
{
}
/**
* @dev constructor. Sets msg.sender as admin by default
*/
constructor()
public
{
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function adminAddRole(address addr, string roleName)
onlyAdmin
public
{
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function adminRemoveRole(address addr, string roleName)
onlyAdmin
public
{
}
}
contract DragonStats is RBACWithAdmin {
uint256 constant UINT128_MAX = 340282366920938463463374607431768211455;
uint256 constant UINT248_MAX = 452312848583266388373324160190187140051835877600158453279131187530910662655;
struct parent {
uint128 parentOne;
uint128 parentTwo;
}
struct lastAction {
uint8 lastActionID;
uint248 lastActionDragonID;
}
struct dragonStat {
uint32 fightWin;
uint32 fightLose;
uint32 children;
uint32 fightToDeathWin;
uint32 mutagenFace;
uint32 mutagenFight;
uint32 genLabFace;
uint32 genLabFight;
}
mapping(uint256 => uint256) public birthBlock;
mapping(uint256 => uint256) public deathBlock;
mapping(uint256 => parent) public parents;
mapping(uint256 => lastAction) public lastActions;
mapping(uint256 => dragonStat) public dragonStats;
function setBirthBlock(uint256 _dragonID) external onlyRole("MainContract") {
require(<FILL_ME>)
birthBlock[_dragonID] = block.number;
}
function setDeathBlock(uint256 _dragonID) external onlyRole("MainContract") {
}
function setParents(uint256 _dragonID, uint256 _parentOne, uint256 _parentTwo)
external
onlyRole("MainContract")
{
}
function setLastAction(uint256 _dragonID, uint256 _lastActionDragonID, uint8 _lastActionID)
external
onlyRole("ActionContract")
{
}
function incFightWin(uint256 _dragonID) external onlyRole("FightContract") {
}
function incFightLose(uint256 _dragonID) external onlyRole("FightContract") {
}
function incFightToDeathWin(uint256 _dragonID) external onlyRole("DeathContract") {
}
function incChildren(uint256 _dragonID) external onlyRole("MainContract") {
}
function addMutagenFace(uint256 _dragonID, uint256 _mutagenCount)
external
onlyRole("MutagenFaceContract")
{
}
function addMutagenFight(uint256 _dragonID, uint256 _mutagenCount)
external
onlyRole("MutagenFightContract")
{
}
function incGenLabFace(uint256 _dragonID) external onlyRole("GenLabContract") {
}
function incGenLabFight(uint256 _dragonID) external onlyRole("GenLabContract") {
}
function getDragonFight(uint256 _dragonID) external view returns (uint256){
}
}
| birthBlock[_dragonID]==0 | 364,515 | birthBlock[_dragonID]==0 |
null | pragma solidity ^0.4.23;
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
}
/**
* @dev remove an address' access to this role
*/
function remove(Role storage role, address addr)
internal
{
}
/**
* @dev check if an address has this role
* // reverts
*/
function check(Role storage role, address addr)
view
internal
{
}
/**
* @dev check if an address has this role
* @return bool
*/
function has(Role storage role, address addr)
view
internal
returns (bool)
{
}
}
contract RBAC {
using Roles for Roles.Role;
mapping (string => Roles.Role) private roles;
event RoleAdded(address addr, string roleName);
event RoleRemoved(address addr, string roleName);
/**
* @dev reverts if addr does not have role
* @param addr address
* @param roleName the name of the role
* // reverts
*/
function checkRole(address addr, string roleName)
view
public
{
}
/**
* @dev determine if addr has role
* @param addr address
* @param roleName the name of the role
* @return bool
*/
function hasRole(address addr, string roleName)
view
public
returns (bool)
{
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function addRole(address addr, string roleName)
internal
{
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function removeRole(address addr, string roleName)
internal
{
}
/**
* @dev modifier to scope access to a single role (uses msg.sender as addr)
* @param roleName the name of the role
* // reverts
*/
modifier onlyRole(string roleName)
{
}
/**
* @dev modifier to scope access to a set of roles (uses msg.sender as addr)
* @param roleNames the names of the roles to scope access to
* // reverts
*
* @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
* see: https://github.com/ethereum/solidity/issues/2467
*/
// modifier onlyRoles(string[] roleNames) {
// bool hasAnyRole = false;
// for (uint8 i = 0; i < roleNames.length; i++) {
// if (hasRole(msg.sender, roleNames[i])) {
// hasAnyRole = true;
// break;
// }
// }
// require(hasAnyRole);
// _;
// }
}
contract RBACWithAdmin is RBAC {
/**
* A constant role name for indicating admins.
*/
string public constant ROLE_ADMIN = "admin";
string public constant ROLE_PAUSE_ADMIN = "pauseAdmin";
/**
* @dev modifier to scope access to admins
* // reverts
*/
modifier onlyAdmin()
{
}
modifier onlyPauseAdmin()
{
}
/**
* @dev constructor. Sets msg.sender as admin by default
*/
constructor()
public
{
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function adminAddRole(address addr, string roleName)
onlyAdmin
public
{
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function adminRemoveRole(address addr, string roleName)
onlyAdmin
public
{
}
}
contract DragonStats is RBACWithAdmin {
uint256 constant UINT128_MAX = 340282366920938463463374607431768211455;
uint256 constant UINT248_MAX = 452312848583266388373324160190187140051835877600158453279131187530910662655;
struct parent {
uint128 parentOne;
uint128 parentTwo;
}
struct lastAction {
uint8 lastActionID;
uint248 lastActionDragonID;
}
struct dragonStat {
uint32 fightWin;
uint32 fightLose;
uint32 children;
uint32 fightToDeathWin;
uint32 mutagenFace;
uint32 mutagenFight;
uint32 genLabFace;
uint32 genLabFight;
}
mapping(uint256 => uint256) public birthBlock;
mapping(uint256 => uint256) public deathBlock;
mapping(uint256 => parent) public parents;
mapping(uint256 => lastAction) public lastActions;
mapping(uint256 => dragonStat) public dragonStats;
function setBirthBlock(uint256 _dragonID) external onlyRole("MainContract") {
}
function setDeathBlock(uint256 _dragonID) external onlyRole("MainContract") {
require(<FILL_ME>)
deathBlock[_dragonID] = block.number;
}
function setParents(uint256 _dragonID, uint256 _parentOne, uint256 _parentTwo)
external
onlyRole("MainContract")
{
}
function setLastAction(uint256 _dragonID, uint256 _lastActionDragonID, uint8 _lastActionID)
external
onlyRole("ActionContract")
{
}
function incFightWin(uint256 _dragonID) external onlyRole("FightContract") {
}
function incFightLose(uint256 _dragonID) external onlyRole("FightContract") {
}
function incFightToDeathWin(uint256 _dragonID) external onlyRole("DeathContract") {
}
function incChildren(uint256 _dragonID) external onlyRole("MainContract") {
}
function addMutagenFace(uint256 _dragonID, uint256 _mutagenCount)
external
onlyRole("MutagenFaceContract")
{
}
function addMutagenFight(uint256 _dragonID, uint256 _mutagenCount)
external
onlyRole("MutagenFightContract")
{
}
function incGenLabFace(uint256 _dragonID) external onlyRole("GenLabContract") {
}
function incGenLabFight(uint256 _dragonID) external onlyRole("GenLabContract") {
}
function getDragonFight(uint256 _dragonID) external view returns (uint256){
}
}
| deathBlock[_dragonID]==0 | 364,515 | deathBlock[_dragonID]==0 |
"PRESALE_NOT_LIVE" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
require(<FILL_ME>)
_;
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| !isPublicSaleLive&&isPresaleLive,"PRESALE_NOT_LIVE" | 364,610 | !isPublicSaleLive&&isPresaleLive |
"ALL_FOXS_SOLD_OUT" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
require(<FILL_ME>)
for (uint256 i = 0; i < addr.length; i++)
{
reservationAmount++;
_safeMint(addr[i], totalSupply() + 1);
}
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| totalSupply()<FOX_TOTAL_SUPPLY,"ALL_FOXS_SOLD_OUT" | 364,610 | totalSupply()<FOX_TOTAL_SUPPLY |
"INVALID_HASH" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
require(matchAddresSigner(hash, signature), "INVALID_SIGNER_ADDRESS");
require(<FILL_ME>)
require(_presalerQuantity[msg.sender] < 3, "EXCEED_PRESALES_MINT");
require(quantity > 0 && quantity <= 3, "INVALID_QUANTITY");
require(totalSupply() < FOX_TOTAL_SUPPLY, "ALL_FOXS_SOLD_OUT");
require(totalSupply() + quantity <= FOX_TOTAL_SUPPLY, "EXCEED_PUBLIC_SUPPLY");
if (isOG)
require(OG_PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
else
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
for (uint256 i = 0; i < quantity; i++)
{
_presalerQuantity[msg.sender]++;
_safeMint(msg.sender, totalSupply() + 1);
}
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| hashTransaction(msg.sender,quantity,isOG)==hash,"INVALID_HASH" | 364,610 | hashTransaction(msg.sender,quantity,isOG)==hash |
"EXCEED_PRESALES_MINT" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
require(matchAddresSigner(hash, signature), "INVALID_SIGNER_ADDRESS");
require(hashTransaction(msg.sender, quantity, isOG) == hash, "INVALID_HASH");
require(<FILL_ME>)
require(quantity > 0 && quantity <= 3, "INVALID_QUANTITY");
require(totalSupply() < FOX_TOTAL_SUPPLY, "ALL_FOXS_SOLD_OUT");
require(totalSupply() + quantity <= FOX_TOTAL_SUPPLY, "EXCEED_PUBLIC_SUPPLY");
if (isOG)
require(OG_PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
else
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
for (uint256 i = 0; i < quantity; i++)
{
_presalerQuantity[msg.sender]++;
_safeMint(msg.sender, totalSupply() + 1);
}
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| _presalerQuantity[msg.sender]<3,"EXCEED_PRESALES_MINT" | 364,610 | _presalerQuantity[msg.sender]<3 |
"EXCEED_PUBLIC_SUPPLY" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
require(matchAddresSigner(hash, signature), "INVALID_SIGNER_ADDRESS");
require(hashTransaction(msg.sender, quantity, isOG) == hash, "INVALID_HASH");
require(_presalerQuantity[msg.sender] < 3, "EXCEED_PRESALES_MINT");
require(quantity > 0 && quantity <= 3, "INVALID_QUANTITY");
require(totalSupply() < FOX_TOTAL_SUPPLY, "ALL_FOXS_SOLD_OUT");
require(<FILL_ME>)
if (isOG)
require(OG_PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
else
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
for (uint256 i = 0; i < quantity; i++)
{
_presalerQuantity[msg.sender]++;
_safeMint(msg.sender, totalSupply() + 1);
}
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| totalSupply()+quantity<=FOX_TOTAL_SUPPLY,"EXCEED_PUBLIC_SUPPLY" | 364,610 | totalSupply()+quantity<=FOX_TOTAL_SUPPLY |
"INVALID_ETH_AMOUNT" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
require(matchAddresSigner(hash, signature), "INVALID_SIGNER_ADDRESS");
require(hashTransaction(msg.sender, quantity, isOG) == hash, "INVALID_HASH");
require(_presalerQuantity[msg.sender] < 3, "EXCEED_PRESALES_MINT");
require(quantity > 0 && quantity <= 3, "INVALID_QUANTITY");
require(totalSupply() < FOX_TOTAL_SUPPLY, "ALL_FOXS_SOLD_OUT");
require(totalSupply() + quantity <= FOX_TOTAL_SUPPLY, "EXCEED_PUBLIC_SUPPLY");
if (isOG)
require(<FILL_ME>)
else
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
for (uint256 i = 0; i < quantity; i++)
{
_presalerQuantity[msg.sender]++;
_safeMint(msg.sender, totalSupply() + 1);
}
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| OG_PRICE*quantity==msg.value,"INVALID_ETH_AMOUNT" | 364,610 | OG_PRICE*quantity==msg.value |
"SEND_FAIL_TO_A1" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
uint256 _a1 = address(this).balance.div(100).mul(30);
uint256 _a2 = address(this).balance.div(100).mul(30);
uint256 _a3 = address(this).balance.div(100).mul(30);
require(<FILL_ME>)
require(payable(_hAddress).send(_a2), "SEND_FAIL_TO_A2");
require(payable(_mAddress).send(_a3), "SEND_FAIL_TO_A3");
require(payable(owner()).send(address(this).balance), "SEND_FAIL_TO_A4");
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| payable(_oAddress).send(_a1),"SEND_FAIL_TO_A1" | 364,610 | payable(_oAddress).send(_a1) |
"SEND_FAIL_TO_A2" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
uint256 _a1 = address(this).balance.div(100).mul(30);
uint256 _a2 = address(this).balance.div(100).mul(30);
uint256 _a3 = address(this).balance.div(100).mul(30);
require(payable(_oAddress).send(_a1), "SEND_FAIL_TO_A1");
require(<FILL_ME>)
require(payable(_mAddress).send(_a3), "SEND_FAIL_TO_A3");
require(payable(owner()).send(address(this).balance), "SEND_FAIL_TO_A4");
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| payable(_hAddress).send(_a2),"SEND_FAIL_TO_A2" | 364,610 | payable(_hAddress).send(_a2) |
"SEND_FAIL_TO_A3" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract SacredFoxes is ERC721Enumerable, ReentrancyGuard, Ownable
{
using Strings for uint256;
using ECDSA for bytes32;
using SafeMath for uint256;
// Constant variables
// *******************************************************************
uint256 public constant FOX_TOTAL_SUPPLY = 2000; // Total fox supply : 2000
uint256 public constant PRICE = 0.06 ether; //0.05 ETH
uint256 public constant OG_PRICE = 0.05 ether; //0.06 ETH
// Team addresses
// *******************************************************************
address private constant _oAddress = 0x3b568991cFeED9CD7591e6caB8Dafc717d3b79FC;
address private constant _hAddress = 0xb409603dFb712C6e6025ec7Da216E8871B5D9E90;
address private constant _mAddress = 0x7F17fA42D9ae6E4dC1a10ce70798b3aFb7cc4D84;
// Signer address
// *******************************************************************
address private _signerAddress = 0x4633519d554d9819cf4Edd82Edb60CBF859d0e07;
// State variables
// *******************************************************************
bool public isPresaleLive;
bool public isPublicSaleLive;
bool public freezed;
string public FOXS_PROVENANCE;
uint256 public reservationAmount;
// Presale arrays
// *******************************************************************
mapping(address => uint256) public _presalerQuantity; // Amount of foxs get for pre-sales
// URI variables
// *******************************************************************
string private _osContractURI;
string private _baseTokenURI;
// Constructor
// *******************************************************************
constructor(string memory osURI, string memory baseURI) ERC721("Sacred Foxes", "SF")
{
}
// Modifiers
// *******************************************************************
modifier onlyPresale()
{
}
modifier onlyPublicSale()
{
}
modifier notFreezed
{
}
function togglePresaleStatus() external onlyOwner
{
}
function togglePublicSaleStatus() external onlyOwner
{
}
// Mint functions
// *******************************************************************
function sendGift(address[] calldata addr) external onlyOwner
{
}
function presalesMint(bytes32 hash, bytes memory signature, uint256 quantity, bool isOG) external payable nonReentrant onlyPresale
{
}
function publicMint(uint256 quantity) external payable nonReentrant onlyPublicSale
{
}
// Hash Functions
// *******************************************************************
function setSignerAddress(address addr) external onlyOwner
{
}
function hashTransaction(address sender, uint256 quantity, bool isOG) private pure returns(bytes32)
{
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool)
{
}
// Base URI Functions
// *******************************************************************
function setContractURI(string calldata URI) external onlyOwner notFreezed
{
}
function contractURI() public view returns (string memory)
{
}
function setBaseTokenURI(string calldata URI) external onlyOwner notFreezed
{
}
function baseTokenURI() public view returns (string memory)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory)
{
}
// Freeze metadata
// *******************************************************************
function freezedMetadata() external onlyOwner
{
}
function setProvenanceHash(string calldata hash) external onlyOwner notFreezed
{
}
// Withdrawal function
// *******************************************************************
function withdrawAll() external onlyOwner
{
uint256 _a1 = address(this).balance.div(100).mul(30);
uint256 _a2 = address(this).balance.div(100).mul(30);
uint256 _a3 = address(this).balance.div(100).mul(30);
require(payable(_oAddress).send(_a1), "SEND_FAIL_TO_A1");
require(payable(_hAddress).send(_a2), "SEND_FAIL_TO_A2");
require(<FILL_ME>)
require(payable(owner()).send(address(this).balance), "SEND_FAIL_TO_A4");
}
// Call function
// *******************************************************************
function callData() external view returns (bool, bool, uint256)
{
}
}
| payable(_mAddress).send(_a3),"SEND_FAIL_TO_A3" | 364,610 | payable(_mAddress).send(_a3) |
null | pragma solidity ^0.4.23;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint256 a, uint256 b) public pure returns (uint256) {
}
function div(uint256 a, uint256 b) public pure returns (uint256) {
}
function sub(uint256 a, uint256 b) public pure returns (uint256) {
}
function add(uint256 a, uint256 b) public pure returns (uint256) {
}
function max64(uint64 a, uint64 b) public pure returns (uint64) {
}
function min64(uint64 a, uint64 b) public pure returns (uint64) {
}
function max256(uint256 a, uint256 b) external pure returns (uint256) {
}
function min256(uint256 a, uint256 b) external pure returns (uint256) {
}
}
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) onlyOwner public{
}
function acceptOnwership() public {
}
}
contract ContractReceiver { function tokenFallback(address _from,uint _value,bytes _data) external;}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC223 is Owned{
//Use safemath library to check overflows and underflows
using SafeMath for uint256;
// Public variables of the token
string public name="Littafi Token";
string public symbol="LITT";
uint8 public decimals = 18;// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply=1000000000; //1,000,000,000 tokens
address[] public littHolders;
uint256 public buyRate=10000;
bool public saleIsOn=true;
//Admin structure
struct Admin{
bool isAdmin;
address beAdmin;
}
//Contract mutation access modifier
modifier onlyAdmin{
}
//Create an array of admins
mapping(address => Admin) admins;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
// This generates a public event on the blockchain that will notify clients
event FrozenFunds(address target, bool frozen);
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
//This notifies clients about an approval request for transferFrom()
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//Notifies contract owner about a successfult terminated/destroyed contract
event LogContractDestroyed(address indexed contractAddress, bytes30 _extraData);
//Notifies clients about token sale
event LogTokenSale(address indexed _client, uint256 _amountTransacted);
//Notifies clients of newly set buy/sell prices
event LogNewPrices(address indexed _admin, uint256 _buyRate);
//Notifies of newly minted tokensevent
event LogMintedTokens(address indexed _this, uint256 _amount);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor() public {
}
function transfer(address _to, uint256 _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(<FILL_ME>)
if(isContract(_to)) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
emit Transfer(msg.sender, _to, _value);
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint256 _value, bytes _data)public returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint256 _value)public returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) public view returns (bool) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint256 _value, bytes _data) private returns (bool success) {
}
function transferToOwner(uint256 _amount) public onlyOwner(){
}
/**
* Conversion
*
* @param _value convert to proper value for math operations
*///0x44b6782dde9118baafe20a39098b1b46589cd378
function convert(uint256 _value) internal view returns (uint256) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public onlyOwner {
}
function freezeAccount(address target, bool freeze) public onlyAdmin {
}
function mintToken(uint256 mintedAmount) public onlyOwner {
}
function setPrices(uint256 newBuyRate) public onlyAdmin{
}
function buy() payable public {
}
function () public payable {
}
function destroyContract() public onlyOwner {
}
function getEthRate(uint256 _value) private pure returns(uint256){
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)public returns (bool success) {
}
function setName(string _name) public onlyOwner() returns (bool success) {
}
function setSaleStatus(bool _bool) public onlyOwner() returns (bool success){
}
}
| !frozenAccount[msg.sender]&&!frozenAccount[_to] | 364,682 | !frozenAccount[msg.sender]&&!frozenAccount[_to] |
null | pragma solidity ^0.4.23;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint256 a, uint256 b) public pure returns (uint256) {
}
function div(uint256 a, uint256 b) public pure returns (uint256) {
}
function sub(uint256 a, uint256 b) public pure returns (uint256) {
}
function add(uint256 a, uint256 b) public pure returns (uint256) {
}
function max64(uint64 a, uint64 b) public pure returns (uint64) {
}
function min64(uint64 a, uint64 b) public pure returns (uint64) {
}
function max256(uint256 a, uint256 b) external pure returns (uint256) {
}
function min256(uint256 a, uint256 b) external pure returns (uint256) {
}
}
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) onlyOwner public{
}
function acceptOnwership() public {
}
}
contract ContractReceiver { function tokenFallback(address _from,uint _value,bytes _data) external;}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC223 is Owned{
//Use safemath library to check overflows and underflows
using SafeMath for uint256;
// Public variables of the token
string public name="Littafi Token";
string public symbol="LITT";
uint8 public decimals = 18;// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply=1000000000; //1,000,000,000 tokens
address[] public littHolders;
uint256 public buyRate=10000;
bool public saleIsOn=true;
//Admin structure
struct Admin{
bool isAdmin;
address beAdmin;
}
//Contract mutation access modifier
modifier onlyAdmin{
}
//Create an array of admins
mapping(address => Admin) admins;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
// This generates a public event on the blockchain that will notify clients
event FrozenFunds(address target, bool frozen);
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
//This notifies clients about an approval request for transferFrom()
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//Notifies contract owner about a successfult terminated/destroyed contract
event LogContractDestroyed(address indexed contractAddress, bytes30 _extraData);
//Notifies clients about token sale
event LogTokenSale(address indexed _client, uint256 _amountTransacted);
//Notifies clients of newly set buy/sell prices
event LogNewPrices(address indexed _admin, uint256 _buyRate);
//Notifies of newly minted tokensevent
event LogMintedTokens(address indexed _this, uint256 _amount);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor() public {
}
function transfer(address _to, uint256 _value, bytes _data, string _custom_fallback) public returns (bool success) {
}
function transfer(address _to, uint256 _value, bytes _data)public returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint256 _value)public returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) public view returns (bool) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint256 _value, bytes _data) private returns (bool success) {
}
function transferToOwner(uint256 _amount) public onlyOwner(){
require(<FILL_ME>)
uint256 amount=convert(_amount);
balanceOf[this]=balanceOf[this].sub(amount);
balanceOf[owner]=balanceOf[owner].add(amount);
emit Transfer(this,owner,amount);
}
/**
* Conversion
*
* @param _value convert to proper value for math operations
*///0x44b6782dde9118baafe20a39098b1b46589cd378
function convert(uint256 _value) internal view returns (uint256) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public onlyOwner {
}
function freezeAccount(address target, bool freeze) public onlyAdmin {
}
function mintToken(uint256 mintedAmount) public onlyOwner {
}
function setPrices(uint256 newBuyRate) public onlyAdmin{
}
function buy() payable public {
}
function () public payable {
}
function destroyContract() public onlyOwner {
}
function getEthRate(uint256 _value) private pure returns(uint256){
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)public returns (bool success) {
}
function setName(string _name) public onlyOwner() returns (bool success) {
}
function setSaleStatus(bool _bool) public onlyOwner() returns (bool success){
}
}
| balanceOf[this]>convert(_amount) | 364,682 | balanceOf[this]>convert(_amount) |
null | pragma solidity ^0.4.23;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint256 a, uint256 b) public pure returns (uint256) {
}
function div(uint256 a, uint256 b) public pure returns (uint256) {
}
function sub(uint256 a, uint256 b) public pure returns (uint256) {
}
function add(uint256 a, uint256 b) public pure returns (uint256) {
}
function max64(uint64 a, uint64 b) public pure returns (uint64) {
}
function min64(uint64 a, uint64 b) public pure returns (uint64) {
}
function max256(uint256 a, uint256 b) external pure returns (uint256) {
}
function min256(uint256 a, uint256 b) external pure returns (uint256) {
}
}
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) onlyOwner public{
}
function acceptOnwership() public {
}
}
contract ContractReceiver { function tokenFallback(address _from,uint _value,bytes _data) external;}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC223 is Owned{
//Use safemath library to check overflows and underflows
using SafeMath for uint256;
// Public variables of the token
string public name="Littafi Token";
string public symbol="LITT";
uint8 public decimals = 18;// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply=1000000000; //1,000,000,000 tokens
address[] public littHolders;
uint256 public buyRate=10000;
bool public saleIsOn=true;
//Admin structure
struct Admin{
bool isAdmin;
address beAdmin;
}
//Contract mutation access modifier
modifier onlyAdmin{
}
//Create an array of admins
mapping(address => Admin) admins;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
// This generates a public event on the blockchain that will notify clients
event FrozenFunds(address target, bool frozen);
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
//This notifies clients about an approval request for transferFrom()
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//Notifies contract owner about a successfult terminated/destroyed contract
event LogContractDestroyed(address indexed contractAddress, bytes30 _extraData);
//Notifies clients about token sale
event LogTokenSale(address indexed _client, uint256 _amountTransacted);
//Notifies clients of newly set buy/sell prices
event LogNewPrices(address indexed _admin, uint256 _buyRate);
//Notifies of newly minted tokensevent
event LogMintedTokens(address indexed _this, uint256 _amount);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor() public {
}
function transfer(address _to, uint256 _value, bytes _data, string _custom_fallback) public returns (bool success) {
}
function transfer(address _to, uint256 _value, bytes _data)public returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint256 _value)public returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) public view returns (bool) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint256 _value, bytes _data) private returns (bool success) {
}
function transferToOwner(uint256 _amount) public onlyOwner(){
}
/**
* Conversion
*
* @param _value convert to proper value for math operations
*///0x44b6782dde9118baafe20a39098b1b46589cd378
function convert(uint256 _value) internal view returns (uint256) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public onlyOwner {
require(<FILL_ME>)
uint256 value=convert(_value);
// Check if the contract has enough
balanceOf[this]=balanceOf[this].sub(value); // Subtract from the contract
totalSupply=totalSupply.sub(value); // Updates totalSupply
emit Burn(this, value);
}
function freezeAccount(address target, bool freeze) public onlyAdmin {
}
function mintToken(uint256 mintedAmount) public onlyOwner {
}
function setPrices(uint256 newBuyRate) public onlyAdmin{
}
function buy() payable public {
}
function () public payable {
}
function destroyContract() public onlyOwner {
}
function getEthRate(uint256 _value) private pure returns(uint256){
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)public returns (bool success) {
}
function setName(string _name) public onlyOwner() returns (bool success) {
}
function setSaleStatus(bool _bool) public onlyOwner() returns (bool success){
}
}
| balanceOf[this]>=convert(_value) | 364,682 | balanceOf[this]>=convert(_value) |
null | pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'Kaasy' CROWDSALE token contract
//
// Deployed to : 0x06d5697043f8e611807b221e74f08a28bb4e6e13
// Symbol : KAAS
// Name : KAASY.AI Token
// Total supply: 500000000
// Decimals : 18
//
// Enjoy.
//
// (c) by KAASY AI LTD. The MIT Licence.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
address public ownerAPI;
address public newOwnerAPI;
event OwnershipTransferred(address indexed _from, address indexed _to);
event OwnershipAPITransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
modifier onlyOwnerAPI {
}
modifier onlyOwnerOrOwnerAPI {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function transferAPIOwnership(address _newOwnerAPI) public onlyOwner {
}
function acceptOwnership() public {
}
function acceptOwnershipAPI() public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Owned {
event Pause();
event Unpause();
bool public isPaused = false;
function paused() public view returns (bool currentlyPaused) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract KaasyToken is ERC20Interface, Pausable, SafeMath {
string public symbol = "KAAS";
string public name = "KAASY.AI Token";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
uint public bonusEnd20;
uint public bonusEnd10;
uint public bonusEnd05;
uint public endDate;
uint public tradingDate;
uint public exchangeRate = 30000; // IN Euro cents = 300E
uint256 public maxSupply;
uint256 public soldSupply;
uint256 public maxSellable;
uint8 private teamWOVestingPercentage = 5;
uint256 public minAmountETH;
uint256 public maxAmountETH;
address public currentRunningAddress;
mapping(address => uint256) balances; //keeps ERC20 balances, in Symbol
mapping(address => uint256) ethDeposits; //keeps balances, in ETH
mapping(address => bool) kycAddressState; //keeps list of addresses which can send ETH without direct fail
mapping(address => mapping(address => uint256)) allowed;
mapping(address => uint256) burnedBalances; //keeps ERC20 balances, in Symbol
//event KYCStateUpdate(address indexed addr, bool state);
event MintingFinished(uint indexed moment);
bool isMintingFinished = false;
event OwnBlockchainLaunched(uint indexed moment);
event TokensBurned(address indexed exOwner, uint256 indexed amount, uint indexed moment);
bool isOwnBlockchainLaunched = false;
uint momentOwnBlockchainLaunched = 0;
uint8 public versionIndex = 1;
address addrUniversity;
address addrEarlySkills;
address addrHackathons;
address addrLegal;
address addrMarketing;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
// ------------------------------------------------------------------------
// token minter function
// ------------------------------------------------------------------------
function () public payable whenNotPaused {
if(now > endDate && isMintingFinished == false) {
finishMinting();
msg.sender.transfer(msg.value); //return this transfer, as it is too late.
} else {
require(now >= startDate && now <= endDate && isMintingFinished == false);
require(msg.value >= minAmountETH && msg.value <= maxAmountETH);
require(<FILL_ME>)
require(kycAddressState[msg.sender] == true);
uint tokens = getAmountToIssue(msg.value);
require(safeAdd(soldSupply, tokens) <= maxSellable);
soldSupply = safeAdd(soldSupply, tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
ethDeposits[msg.sender] = safeAdd(ethDeposits[msg.sender], msg.value);
emit Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value * 15 / 100); //transfer 15% of the ETH now, the other 85% at the end of the ICO process
}
}
// ------------------------------------------------------------------------
// Burns tokens of `msg.sender` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnMyTokensAndSetAmountForNewBlockchain() public {
}
// ------------------------------------------------------------------------
// Burns tokens of `exOwner` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnTokensAndSetAmountForNewBlockchain(address exOwner) onlyOwnerOrOwnerAPI public {
}
// ------------------------------------------------------------------------
// Enables the burning of tokens to move to the new KAASY blockchain
// ------------------------------------------------------------------------
function SetNewBlockchainEnabled() onlyOwner public {
}
// ------------------------------------------------------------------------
// Evaluates conditions for finishing the ICO and does that if conditions are met
// ------------------------------------------------------------------------
function finishMinting() public returns (bool finished) {
}
// ------------------------------------------------------------------------
// Actually executes the finish of the ICO,
// no longer minting tokens,
// releasing the 85% of ETH kept by contract and
// enables trading 2 weeks after this moment
// ------------------------------------------------------------------------
function internalFinishMinting() internal {
}
// ------------------------------------------------------------------------
// Calculates amount of KAAS to issue to `msg.sender` for `ethAmount`
// Can be called by any interested party, to evaluate the amount of KAAS obtained for `ethAmount` specified
// ------------------------------------------------------------------------
function getAmountToIssue(uint256 ethAmount) public view returns(uint256) {
}
// ------------------------------------------------------------------------
// Calculates EUR amount for ethAmount
// ------------------------------------------------------------------------
function exchangeEthToEur(uint256 ethAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates KAAS amount for eurAmount
// ------------------------------------------------------------------------
function exchangeEurToEth(uint256 eurAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates and transfers monthly vesting amount to founders, into the balance of `owner` address
// ------------------------------------------------------------------------
function transferVestingMonthlyAmount(address destination) public onlyOwner returns (bool) {
}
// ------------------------------------------------------------------------
// Set KYC state for `depositer` to `isAllowed`, by admins
// ------------------------------------------------------------------------
function setAddressKYC(address depositer, bool isAllowed) public onlyOwnerOrOwnerAPI returns (bool) {
}
// ------------------------------------------------------------------------
// Get an addresses KYC state
// ------------------------------------------------------------------------
function getAddressKYCState(address depositer) public view returns (bool) {
}
// ------------------------------------------------------------------------
// Token name, as seen by the network
// ------------------------------------------------------------------------
function name() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token symbol, as seen by the network
// ------------------------------------------------------------------------
function symbol() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token decimals
// ------------------------------------------------------------------------
function decimals() public view returns (uint8) {
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Circulating supply
// ------------------------------------------------------------------------
function circulatingSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total ETH deposited by `depositer`
// ------------------------------------------------------------------------
function depositsOf(address depositer) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total KAAS burned by `exOwner`
// ------------------------------------------------------------------------
function burnedBalanceOf(address exOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// !! fund source is the address calling this function !!
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `destination` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// !!! When called, the amount of tokens DESTINATION can retrieve from MSG.SENDER is set to AMOUNT
// !!! This is used when another account C calls and pays gas for the transfer between A and B, like bank cheques
// !!! meaning: Allow DESTINATION to transfer a total AMOUNT from ME=callerOfThisFunction, from this point on, ignoring previous allows
// ------------------------------------------------------------------------
function approve(address destination, uint amount) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the requester's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address requester) public constant returns (uint remaining) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `requester` to transferFrom(...) `tokens`
// from the token owner's account. The `requester` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address requester, uint tokens, bytes data) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out `tokens` amount of accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAllERC20Token(address tokenAddress, uint tokens) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out all accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function updateExchangeRate(uint newEthEurRate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Get the current ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function getExchangeRate() public view returns (uint256 rate) {
}
// ------------------------------------------------------------------------
// Set the new EndDate
// ------------------------------------------------------------------------
function updateEndDate(uint256 newDate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new Token name, Symbol, Contract address when updating
// ------------------------------------------------------------------------
function updateTokenNameSymbolAddress(string newTokenName, string newSymbol, address newContractAddress) public whenPaused onlyOwnerOrOwnerAPI returns (bool success) {
}
}
| msg.value+ethDeposits[msg.sender]<=maxAmountETH | 364,693 | msg.value+ethDeposits[msg.sender]<=maxAmountETH |
null | pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'Kaasy' CROWDSALE token contract
//
// Deployed to : 0x06d5697043f8e611807b221e74f08a28bb4e6e13
// Symbol : KAAS
// Name : KAASY.AI Token
// Total supply: 500000000
// Decimals : 18
//
// Enjoy.
//
// (c) by KAASY AI LTD. The MIT Licence.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
address public ownerAPI;
address public newOwnerAPI;
event OwnershipTransferred(address indexed _from, address indexed _to);
event OwnershipAPITransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
modifier onlyOwnerAPI {
}
modifier onlyOwnerOrOwnerAPI {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function transferAPIOwnership(address _newOwnerAPI) public onlyOwner {
}
function acceptOwnership() public {
}
function acceptOwnershipAPI() public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Owned {
event Pause();
event Unpause();
bool public isPaused = false;
function paused() public view returns (bool currentlyPaused) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract KaasyToken is ERC20Interface, Pausable, SafeMath {
string public symbol = "KAAS";
string public name = "KAASY.AI Token";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
uint public bonusEnd20;
uint public bonusEnd10;
uint public bonusEnd05;
uint public endDate;
uint public tradingDate;
uint public exchangeRate = 30000; // IN Euro cents = 300E
uint256 public maxSupply;
uint256 public soldSupply;
uint256 public maxSellable;
uint8 private teamWOVestingPercentage = 5;
uint256 public minAmountETH;
uint256 public maxAmountETH;
address public currentRunningAddress;
mapping(address => uint256) balances; //keeps ERC20 balances, in Symbol
mapping(address => uint256) ethDeposits; //keeps balances, in ETH
mapping(address => bool) kycAddressState; //keeps list of addresses which can send ETH without direct fail
mapping(address => mapping(address => uint256)) allowed;
mapping(address => uint256) burnedBalances; //keeps ERC20 balances, in Symbol
//event KYCStateUpdate(address indexed addr, bool state);
event MintingFinished(uint indexed moment);
bool isMintingFinished = false;
event OwnBlockchainLaunched(uint indexed moment);
event TokensBurned(address indexed exOwner, uint256 indexed amount, uint indexed moment);
bool isOwnBlockchainLaunched = false;
uint momentOwnBlockchainLaunched = 0;
uint8 public versionIndex = 1;
address addrUniversity;
address addrEarlySkills;
address addrHackathons;
address addrLegal;
address addrMarketing;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
// ------------------------------------------------------------------------
// token minter function
// ------------------------------------------------------------------------
function () public payable whenNotPaused {
if(now > endDate && isMintingFinished == false) {
finishMinting();
msg.sender.transfer(msg.value); //return this transfer, as it is too late.
} else {
require(now >= startDate && now <= endDate && isMintingFinished == false);
require(msg.value >= minAmountETH && msg.value <= maxAmountETH);
require(msg.value + ethDeposits[msg.sender] <= maxAmountETH);
require(<FILL_ME>)
uint tokens = getAmountToIssue(msg.value);
require(safeAdd(soldSupply, tokens) <= maxSellable);
soldSupply = safeAdd(soldSupply, tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
ethDeposits[msg.sender] = safeAdd(ethDeposits[msg.sender], msg.value);
emit Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value * 15 / 100); //transfer 15% of the ETH now, the other 85% at the end of the ICO process
}
}
// ------------------------------------------------------------------------
// Burns tokens of `msg.sender` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnMyTokensAndSetAmountForNewBlockchain() public {
}
// ------------------------------------------------------------------------
// Burns tokens of `exOwner` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnTokensAndSetAmountForNewBlockchain(address exOwner) onlyOwnerOrOwnerAPI public {
}
// ------------------------------------------------------------------------
// Enables the burning of tokens to move to the new KAASY blockchain
// ------------------------------------------------------------------------
function SetNewBlockchainEnabled() onlyOwner public {
}
// ------------------------------------------------------------------------
// Evaluates conditions for finishing the ICO and does that if conditions are met
// ------------------------------------------------------------------------
function finishMinting() public returns (bool finished) {
}
// ------------------------------------------------------------------------
// Actually executes the finish of the ICO,
// no longer minting tokens,
// releasing the 85% of ETH kept by contract and
// enables trading 2 weeks after this moment
// ------------------------------------------------------------------------
function internalFinishMinting() internal {
}
// ------------------------------------------------------------------------
// Calculates amount of KAAS to issue to `msg.sender` for `ethAmount`
// Can be called by any interested party, to evaluate the amount of KAAS obtained for `ethAmount` specified
// ------------------------------------------------------------------------
function getAmountToIssue(uint256 ethAmount) public view returns(uint256) {
}
// ------------------------------------------------------------------------
// Calculates EUR amount for ethAmount
// ------------------------------------------------------------------------
function exchangeEthToEur(uint256 ethAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates KAAS amount for eurAmount
// ------------------------------------------------------------------------
function exchangeEurToEth(uint256 eurAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates and transfers monthly vesting amount to founders, into the balance of `owner` address
// ------------------------------------------------------------------------
function transferVestingMonthlyAmount(address destination) public onlyOwner returns (bool) {
}
// ------------------------------------------------------------------------
// Set KYC state for `depositer` to `isAllowed`, by admins
// ------------------------------------------------------------------------
function setAddressKYC(address depositer, bool isAllowed) public onlyOwnerOrOwnerAPI returns (bool) {
}
// ------------------------------------------------------------------------
// Get an addresses KYC state
// ------------------------------------------------------------------------
function getAddressKYCState(address depositer) public view returns (bool) {
}
// ------------------------------------------------------------------------
// Token name, as seen by the network
// ------------------------------------------------------------------------
function name() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token symbol, as seen by the network
// ------------------------------------------------------------------------
function symbol() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token decimals
// ------------------------------------------------------------------------
function decimals() public view returns (uint8) {
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Circulating supply
// ------------------------------------------------------------------------
function circulatingSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total ETH deposited by `depositer`
// ------------------------------------------------------------------------
function depositsOf(address depositer) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total KAAS burned by `exOwner`
// ------------------------------------------------------------------------
function burnedBalanceOf(address exOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// !! fund source is the address calling this function !!
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `destination` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// !!! When called, the amount of tokens DESTINATION can retrieve from MSG.SENDER is set to AMOUNT
// !!! This is used when another account C calls and pays gas for the transfer between A and B, like bank cheques
// !!! meaning: Allow DESTINATION to transfer a total AMOUNT from ME=callerOfThisFunction, from this point on, ignoring previous allows
// ------------------------------------------------------------------------
function approve(address destination, uint amount) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the requester's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address requester) public constant returns (uint remaining) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `requester` to transferFrom(...) `tokens`
// from the token owner's account. The `requester` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address requester, uint tokens, bytes data) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out `tokens` amount of accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAllERC20Token(address tokenAddress, uint tokens) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out all accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function updateExchangeRate(uint newEthEurRate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Get the current ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function getExchangeRate() public view returns (uint256 rate) {
}
// ------------------------------------------------------------------------
// Set the new EndDate
// ------------------------------------------------------------------------
function updateEndDate(uint256 newDate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new Token name, Symbol, Contract address when updating
// ------------------------------------------------------------------------
function updateTokenNameSymbolAddress(string newTokenName, string newSymbol, address newContractAddress) public whenPaused onlyOwnerOrOwnerAPI returns (bool success) {
}
}
| kycAddressState[msg.sender]==true | 364,693 | kycAddressState[msg.sender]==true |
null | pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'Kaasy' CROWDSALE token contract
//
// Deployed to : 0x06d5697043f8e611807b221e74f08a28bb4e6e13
// Symbol : KAAS
// Name : KAASY.AI Token
// Total supply: 500000000
// Decimals : 18
//
// Enjoy.
//
// (c) by KAASY AI LTD. The MIT Licence.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
address public ownerAPI;
address public newOwnerAPI;
event OwnershipTransferred(address indexed _from, address indexed _to);
event OwnershipAPITransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
modifier onlyOwnerAPI {
}
modifier onlyOwnerOrOwnerAPI {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function transferAPIOwnership(address _newOwnerAPI) public onlyOwner {
}
function acceptOwnership() public {
}
function acceptOwnershipAPI() public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Owned {
event Pause();
event Unpause();
bool public isPaused = false;
function paused() public view returns (bool currentlyPaused) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract KaasyToken is ERC20Interface, Pausable, SafeMath {
string public symbol = "KAAS";
string public name = "KAASY.AI Token";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
uint public bonusEnd20;
uint public bonusEnd10;
uint public bonusEnd05;
uint public endDate;
uint public tradingDate;
uint public exchangeRate = 30000; // IN Euro cents = 300E
uint256 public maxSupply;
uint256 public soldSupply;
uint256 public maxSellable;
uint8 private teamWOVestingPercentage = 5;
uint256 public minAmountETH;
uint256 public maxAmountETH;
address public currentRunningAddress;
mapping(address => uint256) balances; //keeps ERC20 balances, in Symbol
mapping(address => uint256) ethDeposits; //keeps balances, in ETH
mapping(address => bool) kycAddressState; //keeps list of addresses which can send ETH without direct fail
mapping(address => mapping(address => uint256)) allowed;
mapping(address => uint256) burnedBalances; //keeps ERC20 balances, in Symbol
//event KYCStateUpdate(address indexed addr, bool state);
event MintingFinished(uint indexed moment);
bool isMintingFinished = false;
event OwnBlockchainLaunched(uint indexed moment);
event TokensBurned(address indexed exOwner, uint256 indexed amount, uint indexed moment);
bool isOwnBlockchainLaunched = false;
uint momentOwnBlockchainLaunched = 0;
uint8 public versionIndex = 1;
address addrUniversity;
address addrEarlySkills;
address addrHackathons;
address addrLegal;
address addrMarketing;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
// ------------------------------------------------------------------------
// token minter function
// ------------------------------------------------------------------------
function () public payable whenNotPaused {
if(now > endDate && isMintingFinished == false) {
finishMinting();
msg.sender.transfer(msg.value); //return this transfer, as it is too late.
} else {
require(now >= startDate && now <= endDate && isMintingFinished == false);
require(msg.value >= minAmountETH && msg.value <= maxAmountETH);
require(msg.value + ethDeposits[msg.sender] <= maxAmountETH);
require(kycAddressState[msg.sender] == true);
uint tokens = getAmountToIssue(msg.value);
require(<FILL_ME>)
soldSupply = safeAdd(soldSupply, tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
ethDeposits[msg.sender] = safeAdd(ethDeposits[msg.sender], msg.value);
emit Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value * 15 / 100); //transfer 15% of the ETH now, the other 85% at the end of the ICO process
}
}
// ------------------------------------------------------------------------
// Burns tokens of `msg.sender` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnMyTokensAndSetAmountForNewBlockchain() public {
}
// ------------------------------------------------------------------------
// Burns tokens of `exOwner` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnTokensAndSetAmountForNewBlockchain(address exOwner) onlyOwnerOrOwnerAPI public {
}
// ------------------------------------------------------------------------
// Enables the burning of tokens to move to the new KAASY blockchain
// ------------------------------------------------------------------------
function SetNewBlockchainEnabled() onlyOwner public {
}
// ------------------------------------------------------------------------
// Evaluates conditions for finishing the ICO and does that if conditions are met
// ------------------------------------------------------------------------
function finishMinting() public returns (bool finished) {
}
// ------------------------------------------------------------------------
// Actually executes the finish of the ICO,
// no longer minting tokens,
// releasing the 85% of ETH kept by contract and
// enables trading 2 weeks after this moment
// ------------------------------------------------------------------------
function internalFinishMinting() internal {
}
// ------------------------------------------------------------------------
// Calculates amount of KAAS to issue to `msg.sender` for `ethAmount`
// Can be called by any interested party, to evaluate the amount of KAAS obtained for `ethAmount` specified
// ------------------------------------------------------------------------
function getAmountToIssue(uint256 ethAmount) public view returns(uint256) {
}
// ------------------------------------------------------------------------
// Calculates EUR amount for ethAmount
// ------------------------------------------------------------------------
function exchangeEthToEur(uint256 ethAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates KAAS amount for eurAmount
// ------------------------------------------------------------------------
function exchangeEurToEth(uint256 eurAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates and transfers monthly vesting amount to founders, into the balance of `owner` address
// ------------------------------------------------------------------------
function transferVestingMonthlyAmount(address destination) public onlyOwner returns (bool) {
}
// ------------------------------------------------------------------------
// Set KYC state for `depositer` to `isAllowed`, by admins
// ------------------------------------------------------------------------
function setAddressKYC(address depositer, bool isAllowed) public onlyOwnerOrOwnerAPI returns (bool) {
}
// ------------------------------------------------------------------------
// Get an addresses KYC state
// ------------------------------------------------------------------------
function getAddressKYCState(address depositer) public view returns (bool) {
}
// ------------------------------------------------------------------------
// Token name, as seen by the network
// ------------------------------------------------------------------------
function name() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token symbol, as seen by the network
// ------------------------------------------------------------------------
function symbol() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token decimals
// ------------------------------------------------------------------------
function decimals() public view returns (uint8) {
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Circulating supply
// ------------------------------------------------------------------------
function circulatingSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total ETH deposited by `depositer`
// ------------------------------------------------------------------------
function depositsOf(address depositer) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total KAAS burned by `exOwner`
// ------------------------------------------------------------------------
function burnedBalanceOf(address exOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// !! fund source is the address calling this function !!
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `destination` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// !!! When called, the amount of tokens DESTINATION can retrieve from MSG.SENDER is set to AMOUNT
// !!! This is used when another account C calls and pays gas for the transfer between A and B, like bank cheques
// !!! meaning: Allow DESTINATION to transfer a total AMOUNT from ME=callerOfThisFunction, from this point on, ignoring previous allows
// ------------------------------------------------------------------------
function approve(address destination, uint amount) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the requester's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address requester) public constant returns (uint remaining) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `requester` to transferFrom(...) `tokens`
// from the token owner's account. The `requester` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address requester, uint tokens, bytes data) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out `tokens` amount of accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAllERC20Token(address tokenAddress, uint tokens) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out all accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function updateExchangeRate(uint newEthEurRate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Get the current ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function getExchangeRate() public view returns (uint256 rate) {
}
// ------------------------------------------------------------------------
// Set the new EndDate
// ------------------------------------------------------------------------
function updateEndDate(uint256 newDate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new Token name, Symbol, Contract address when updating
// ------------------------------------------------------------------------
function updateTokenNameSymbolAddress(string newTokenName, string newSymbol, address newContractAddress) public whenPaused onlyOwnerOrOwnerAPI returns (bool success) {
}
}
| safeAdd(soldSupply,tokens)<=maxSellable | 364,693 | safeAdd(soldSupply,tokens)<=maxSellable |
null | pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'Kaasy' CROWDSALE token contract
//
// Deployed to : 0x06d5697043f8e611807b221e74f08a28bb4e6e13
// Symbol : KAAS
// Name : KAASY.AI Token
// Total supply: 500000000
// Decimals : 18
//
// Enjoy.
//
// (c) by KAASY AI LTD. The MIT Licence.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
address public ownerAPI;
address public newOwnerAPI;
event OwnershipTransferred(address indexed _from, address indexed _to);
event OwnershipAPITransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
modifier onlyOwnerAPI {
}
modifier onlyOwnerOrOwnerAPI {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function transferAPIOwnership(address _newOwnerAPI) public onlyOwner {
}
function acceptOwnership() public {
}
function acceptOwnershipAPI() public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Owned {
event Pause();
event Unpause();
bool public isPaused = false;
function paused() public view returns (bool currentlyPaused) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract KaasyToken is ERC20Interface, Pausable, SafeMath {
string public symbol = "KAAS";
string public name = "KAASY.AI Token";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
uint public bonusEnd20;
uint public bonusEnd10;
uint public bonusEnd05;
uint public endDate;
uint public tradingDate;
uint public exchangeRate = 30000; // IN Euro cents = 300E
uint256 public maxSupply;
uint256 public soldSupply;
uint256 public maxSellable;
uint8 private teamWOVestingPercentage = 5;
uint256 public minAmountETH;
uint256 public maxAmountETH;
address public currentRunningAddress;
mapping(address => uint256) balances; //keeps ERC20 balances, in Symbol
mapping(address => uint256) ethDeposits; //keeps balances, in ETH
mapping(address => bool) kycAddressState; //keeps list of addresses which can send ETH without direct fail
mapping(address => mapping(address => uint256)) allowed;
mapping(address => uint256) burnedBalances; //keeps ERC20 balances, in Symbol
//event KYCStateUpdate(address indexed addr, bool state);
event MintingFinished(uint indexed moment);
bool isMintingFinished = false;
event OwnBlockchainLaunched(uint indexed moment);
event TokensBurned(address indexed exOwner, uint256 indexed amount, uint indexed moment);
bool isOwnBlockchainLaunched = false;
uint momentOwnBlockchainLaunched = 0;
uint8 public versionIndex = 1;
address addrUniversity;
address addrEarlySkills;
address addrHackathons;
address addrLegal;
address addrMarketing;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
// ------------------------------------------------------------------------
// token minter function
// ------------------------------------------------------------------------
function () public payable whenNotPaused {
}
// ------------------------------------------------------------------------
// Burns tokens of `msg.sender` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnMyTokensAndSetAmountForNewBlockchain() public {
}
// ------------------------------------------------------------------------
// Burns tokens of `exOwner` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnTokensAndSetAmountForNewBlockchain(address exOwner) onlyOwnerOrOwnerAPI public {
}
// ------------------------------------------------------------------------
// Enables the burning of tokens to move to the new KAASY blockchain
// ------------------------------------------------------------------------
function SetNewBlockchainEnabled() onlyOwner public {
require(<FILL_ME>)
isOwnBlockchainLaunched = true;
momentOwnBlockchainLaunched = now;
emit OwnBlockchainLaunched(now);
}
// ------------------------------------------------------------------------
// Evaluates conditions for finishing the ICO and does that if conditions are met
// ------------------------------------------------------------------------
function finishMinting() public returns (bool finished) {
}
// ------------------------------------------------------------------------
// Actually executes the finish of the ICO,
// no longer minting tokens,
// releasing the 85% of ETH kept by contract and
// enables trading 2 weeks after this moment
// ------------------------------------------------------------------------
function internalFinishMinting() internal {
}
// ------------------------------------------------------------------------
// Calculates amount of KAAS to issue to `msg.sender` for `ethAmount`
// Can be called by any interested party, to evaluate the amount of KAAS obtained for `ethAmount` specified
// ------------------------------------------------------------------------
function getAmountToIssue(uint256 ethAmount) public view returns(uint256) {
}
// ------------------------------------------------------------------------
// Calculates EUR amount for ethAmount
// ------------------------------------------------------------------------
function exchangeEthToEur(uint256 ethAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates KAAS amount for eurAmount
// ------------------------------------------------------------------------
function exchangeEurToEth(uint256 eurAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates and transfers monthly vesting amount to founders, into the balance of `owner` address
// ------------------------------------------------------------------------
function transferVestingMonthlyAmount(address destination) public onlyOwner returns (bool) {
}
// ------------------------------------------------------------------------
// Set KYC state for `depositer` to `isAllowed`, by admins
// ------------------------------------------------------------------------
function setAddressKYC(address depositer, bool isAllowed) public onlyOwnerOrOwnerAPI returns (bool) {
}
// ------------------------------------------------------------------------
// Get an addresses KYC state
// ------------------------------------------------------------------------
function getAddressKYCState(address depositer) public view returns (bool) {
}
// ------------------------------------------------------------------------
// Token name, as seen by the network
// ------------------------------------------------------------------------
function name() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token symbol, as seen by the network
// ------------------------------------------------------------------------
function symbol() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token decimals
// ------------------------------------------------------------------------
function decimals() public view returns (uint8) {
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Circulating supply
// ------------------------------------------------------------------------
function circulatingSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total ETH deposited by `depositer`
// ------------------------------------------------------------------------
function depositsOf(address depositer) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total KAAS burned by `exOwner`
// ------------------------------------------------------------------------
function burnedBalanceOf(address exOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// !! fund source is the address calling this function !!
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `destination` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// !!! When called, the amount of tokens DESTINATION can retrieve from MSG.SENDER is set to AMOUNT
// !!! This is used when another account C calls and pays gas for the transfer between A and B, like bank cheques
// !!! meaning: Allow DESTINATION to transfer a total AMOUNT from ME=callerOfThisFunction, from this point on, ignoring previous allows
// ------------------------------------------------------------------------
function approve(address destination, uint amount) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the requester's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address requester) public constant returns (uint remaining) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `requester` to transferFrom(...) `tokens`
// from the token owner's account. The `requester` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address requester, uint tokens, bytes data) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out `tokens` amount of accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAllERC20Token(address tokenAddress, uint tokens) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out all accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function updateExchangeRate(uint newEthEurRate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Get the current ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function getExchangeRate() public view returns (uint256 rate) {
}
// ------------------------------------------------------------------------
// Set the new EndDate
// ------------------------------------------------------------------------
function updateEndDate(uint256 newDate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new Token name, Symbol, Contract address when updating
// ------------------------------------------------------------------------
function updateTokenNameSymbolAddress(string newTokenName, string newSymbol, address newContractAddress) public whenPaused onlyOwnerOrOwnerAPI returns (bool success) {
}
}
| isMintingFinished&&isOwnBlockchainLaunched==false | 364,693 | isMintingFinished&&isOwnBlockchainLaunched==false |
null | pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'Kaasy' CROWDSALE token contract
//
// Deployed to : 0x06d5697043f8e611807b221e74f08a28bb4e6e13
// Symbol : KAAS
// Name : KAASY.AI Token
// Total supply: 500000000
// Decimals : 18
//
// Enjoy.
//
// (c) by KAASY AI LTD. The MIT Licence.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
address public ownerAPI;
address public newOwnerAPI;
event OwnershipTransferred(address indexed _from, address indexed _to);
event OwnershipAPITransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
modifier onlyOwnerAPI {
}
modifier onlyOwnerOrOwnerAPI {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function transferAPIOwnership(address _newOwnerAPI) public onlyOwner {
}
function acceptOwnership() public {
}
function acceptOwnershipAPI() public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Owned {
event Pause();
event Unpause();
bool public isPaused = false;
function paused() public view returns (bool currentlyPaused) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract KaasyToken is ERC20Interface, Pausable, SafeMath {
string public symbol = "KAAS";
string public name = "KAASY.AI Token";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
uint public bonusEnd20;
uint public bonusEnd10;
uint public bonusEnd05;
uint public endDate;
uint public tradingDate;
uint public exchangeRate = 30000; // IN Euro cents = 300E
uint256 public maxSupply;
uint256 public soldSupply;
uint256 public maxSellable;
uint8 private teamWOVestingPercentage = 5;
uint256 public minAmountETH;
uint256 public maxAmountETH;
address public currentRunningAddress;
mapping(address => uint256) balances; //keeps ERC20 balances, in Symbol
mapping(address => uint256) ethDeposits; //keeps balances, in ETH
mapping(address => bool) kycAddressState; //keeps list of addresses which can send ETH without direct fail
mapping(address => mapping(address => uint256)) allowed;
mapping(address => uint256) burnedBalances; //keeps ERC20 balances, in Symbol
//event KYCStateUpdate(address indexed addr, bool state);
event MintingFinished(uint indexed moment);
bool isMintingFinished = false;
event OwnBlockchainLaunched(uint indexed moment);
event TokensBurned(address indexed exOwner, uint256 indexed amount, uint indexed moment);
bool isOwnBlockchainLaunched = false;
uint momentOwnBlockchainLaunched = 0;
uint8 public versionIndex = 1;
address addrUniversity;
address addrEarlySkills;
address addrHackathons;
address addrLegal;
address addrMarketing;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
// ------------------------------------------------------------------------
// token minter function
// ------------------------------------------------------------------------
function () public payable whenNotPaused {
}
// ------------------------------------------------------------------------
// Burns tokens of `msg.sender` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnMyTokensAndSetAmountForNewBlockchain() public {
}
// ------------------------------------------------------------------------
// Burns tokens of `exOwner` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnTokensAndSetAmountForNewBlockchain(address exOwner) onlyOwnerOrOwnerAPI public {
}
// ------------------------------------------------------------------------
// Enables the burning of tokens to move to the new KAASY blockchain
// ------------------------------------------------------------------------
function SetNewBlockchainEnabled() onlyOwner public {
}
// ------------------------------------------------------------------------
// Evaluates conditions for finishing the ICO and does that if conditions are met
// ------------------------------------------------------------------------
function finishMinting() public returns (bool finished) {
}
// ------------------------------------------------------------------------
// Actually executes the finish of the ICO,
// no longer minting tokens,
// releasing the 85% of ETH kept by contract and
// enables trading 2 weeks after this moment
// ------------------------------------------------------------------------
function internalFinishMinting() internal {
}
// ------------------------------------------------------------------------
// Calculates amount of KAAS to issue to `msg.sender` for `ethAmount`
// Can be called by any interested party, to evaluate the amount of KAAS obtained for `ethAmount` specified
// ------------------------------------------------------------------------
function getAmountToIssue(uint256 ethAmount) public view returns(uint256) {
}
// ------------------------------------------------------------------------
// Calculates EUR amount for ethAmount
// ------------------------------------------------------------------------
function exchangeEthToEur(uint256 ethAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates KAAS amount for eurAmount
// ------------------------------------------------------------------------
function exchangeEurToEth(uint256 eurAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates and transfers monthly vesting amount to founders, into the balance of `owner` address
// ------------------------------------------------------------------------
function transferVestingMonthlyAmount(address destination) public onlyOwner returns (bool) {
}
// ------------------------------------------------------------------------
// Set KYC state for `depositer` to `isAllowed`, by admins
// ------------------------------------------------------------------------
function setAddressKYC(address depositer, bool isAllowed) public onlyOwnerOrOwnerAPI returns (bool) {
}
// ------------------------------------------------------------------------
// Get an addresses KYC state
// ------------------------------------------------------------------------
function getAddressKYCState(address depositer) public view returns (bool) {
}
// ------------------------------------------------------------------------
// Token name, as seen by the network
// ------------------------------------------------------------------------
function name() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token symbol, as seen by the network
// ------------------------------------------------------------------------
function symbol() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token decimals
// ------------------------------------------------------------------------
function decimals() public view returns (uint8) {
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Circulating supply
// ------------------------------------------------------------------------
function circulatingSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total ETH deposited by `depositer`
// ------------------------------------------------------------------------
function depositsOf(address depositer) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total KAAS burned by `exOwner`
// ------------------------------------------------------------------------
function burnedBalanceOf(address exOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// !! fund source is the address calling this function !!
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `destination` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// !!! When called, the amount of tokens DESTINATION can retrieve from MSG.SENDER is set to AMOUNT
// !!! This is used when another account C calls and pays gas for the transfer between A and B, like bank cheques
// !!! meaning: Allow DESTINATION to transfer a total AMOUNT from ME=callerOfThisFunction, from this point on, ignoring previous allows
// ------------------------------------------------------------------------
function approve(address destination, uint amount) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the requester's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address requester) public constant returns (uint remaining) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `requester` to transferFrom(...) `tokens`
// from the token owner's account. The `requester` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address requester, uint tokens, bytes data) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out `tokens` amount of accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAllERC20Token(address tokenAddress, uint tokens) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out all accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function updateExchangeRate(uint newEthEurRate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Get the current ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function getExchangeRate() public view returns (uint256 rate) {
}
// ------------------------------------------------------------------------
// Set the new EndDate
// ------------------------------------------------------------------------
function updateEndDate(uint256 newDate) public onlyOwnerOrOwnerAPI returns (bool success) {
require(<FILL_ME>)
require(!isOwnBlockchainLaunched);
endDate = newDate;
return true;
}
// ------------------------------------------------------------------------
// Set the new Token name, Symbol, Contract address when updating
// ------------------------------------------------------------------------
function updateTokenNameSymbolAddress(string newTokenName, string newSymbol, address newContractAddress) public whenPaused onlyOwnerOrOwnerAPI returns (bool success) {
}
}
| !isMintingFinished | 364,693 | !isMintingFinished |
null | pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'Kaasy' CROWDSALE token contract
//
// Deployed to : 0x06d5697043f8e611807b221e74f08a28bb4e6e13
// Symbol : KAAS
// Name : KAASY.AI Token
// Total supply: 500000000
// Decimals : 18
//
// Enjoy.
//
// (c) by KAASY AI LTD. The MIT Licence.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
address public ownerAPI;
address public newOwnerAPI;
event OwnershipTransferred(address indexed _from, address indexed _to);
event OwnershipAPITransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
modifier onlyOwnerAPI {
}
modifier onlyOwnerOrOwnerAPI {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function transferAPIOwnership(address _newOwnerAPI) public onlyOwner {
}
function acceptOwnership() public {
}
function acceptOwnershipAPI() public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Owned {
event Pause();
event Unpause();
bool public isPaused = false;
function paused() public view returns (bool currentlyPaused) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract KaasyToken is ERC20Interface, Pausable, SafeMath {
string public symbol = "KAAS";
string public name = "KAASY.AI Token";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
uint public bonusEnd20;
uint public bonusEnd10;
uint public bonusEnd05;
uint public endDate;
uint public tradingDate;
uint public exchangeRate = 30000; // IN Euro cents = 300E
uint256 public maxSupply;
uint256 public soldSupply;
uint256 public maxSellable;
uint8 private teamWOVestingPercentage = 5;
uint256 public minAmountETH;
uint256 public maxAmountETH;
address public currentRunningAddress;
mapping(address => uint256) balances; //keeps ERC20 balances, in Symbol
mapping(address => uint256) ethDeposits; //keeps balances, in ETH
mapping(address => bool) kycAddressState; //keeps list of addresses which can send ETH without direct fail
mapping(address => mapping(address => uint256)) allowed;
mapping(address => uint256) burnedBalances; //keeps ERC20 balances, in Symbol
//event KYCStateUpdate(address indexed addr, bool state);
event MintingFinished(uint indexed moment);
bool isMintingFinished = false;
event OwnBlockchainLaunched(uint indexed moment);
event TokensBurned(address indexed exOwner, uint256 indexed amount, uint indexed moment);
bool isOwnBlockchainLaunched = false;
uint momentOwnBlockchainLaunched = 0;
uint8 public versionIndex = 1;
address addrUniversity;
address addrEarlySkills;
address addrHackathons;
address addrLegal;
address addrMarketing;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
// ------------------------------------------------------------------------
// token minter function
// ------------------------------------------------------------------------
function () public payable whenNotPaused {
}
// ------------------------------------------------------------------------
// Burns tokens of `msg.sender` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnMyTokensAndSetAmountForNewBlockchain() public {
}
// ------------------------------------------------------------------------
// Burns tokens of `exOwner` and sets them as redeemable on KAASY blokchain
// ------------------------------------------------------------------------
function BurnTokensAndSetAmountForNewBlockchain(address exOwner) onlyOwnerOrOwnerAPI public {
}
// ------------------------------------------------------------------------
// Enables the burning of tokens to move to the new KAASY blockchain
// ------------------------------------------------------------------------
function SetNewBlockchainEnabled() onlyOwner public {
}
// ------------------------------------------------------------------------
// Evaluates conditions for finishing the ICO and does that if conditions are met
// ------------------------------------------------------------------------
function finishMinting() public returns (bool finished) {
}
// ------------------------------------------------------------------------
// Actually executes the finish of the ICO,
// no longer minting tokens,
// releasing the 85% of ETH kept by contract and
// enables trading 2 weeks after this moment
// ------------------------------------------------------------------------
function internalFinishMinting() internal {
}
// ------------------------------------------------------------------------
// Calculates amount of KAAS to issue to `msg.sender` for `ethAmount`
// Can be called by any interested party, to evaluate the amount of KAAS obtained for `ethAmount` specified
// ------------------------------------------------------------------------
function getAmountToIssue(uint256 ethAmount) public view returns(uint256) {
}
// ------------------------------------------------------------------------
// Calculates EUR amount for ethAmount
// ------------------------------------------------------------------------
function exchangeEthToEur(uint256 ethAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates KAAS amount for eurAmount
// ------------------------------------------------------------------------
function exchangeEurToEth(uint256 eurAmount) internal view returns(uint256 rate) {
}
// ------------------------------------------------------------------------
// Calculates and transfers monthly vesting amount to founders, into the balance of `owner` address
// ------------------------------------------------------------------------
function transferVestingMonthlyAmount(address destination) public onlyOwner returns (bool) {
}
// ------------------------------------------------------------------------
// Set KYC state for `depositer` to `isAllowed`, by admins
// ------------------------------------------------------------------------
function setAddressKYC(address depositer, bool isAllowed) public onlyOwnerOrOwnerAPI returns (bool) {
}
// ------------------------------------------------------------------------
// Get an addresses KYC state
// ------------------------------------------------------------------------
function getAddressKYCState(address depositer) public view returns (bool) {
}
// ------------------------------------------------------------------------
// Token name, as seen by the network
// ------------------------------------------------------------------------
function name() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token symbol, as seen by the network
// ------------------------------------------------------------------------
function symbol() public view returns (string) {
}
// ------------------------------------------------------------------------
// Token decimals
// ------------------------------------------------------------------------
function decimals() public view returns (uint8) {
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Circulating supply
// ------------------------------------------------------------------------
function circulatingSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total ETH deposited by `depositer`
// ------------------------------------------------------------------------
function depositsOf(address depositer) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Get the total KAAS burned by `exOwner`
// ------------------------------------------------------------------------
function burnedBalanceOf(address exOwner) public constant returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// !! fund source is the address calling this function !!
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `destination` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// !!! When called, the amount of tokens DESTINATION can retrieve from MSG.SENDER is set to AMOUNT
// !!! This is used when another account C calls and pays gas for the transfer between A and B, like bank cheques
// !!! meaning: Allow DESTINATION to transfer a total AMOUNT from ME=callerOfThisFunction, from this point on, ignoring previous allows
// ------------------------------------------------------------------------
function approve(address destination, uint amount) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the requester's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address requester) public constant returns (uint remaining) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `requester` to transferFrom(...) `tokens`
// from the token owner's account. The `requester` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address requester, uint tokens, bytes data) public whenNotPaused returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out `tokens` amount of accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAllERC20Token(address tokenAddress, uint tokens) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Owner can transfer out all accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Set the new ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function updateExchangeRate(uint newEthEurRate) public onlyOwnerOrOwnerAPI returns (bool success) {
}
// ------------------------------------------------------------------------
// Get the current ETH-EUR exchange rate, in cents
// ------------------------------------------------------------------------
function getExchangeRate() public view returns (uint256 rate) {
}
// ------------------------------------------------------------------------
// Set the new EndDate
// ------------------------------------------------------------------------
function updateEndDate(uint256 newDate) public onlyOwnerOrOwnerAPI returns (bool success) {
require(!isMintingFinished);
require(<FILL_ME>)
endDate = newDate;
return true;
}
// ------------------------------------------------------------------------
// Set the new Token name, Symbol, Contract address when updating
// ------------------------------------------------------------------------
function updateTokenNameSymbolAddress(string newTokenName, string newSymbol, address newContractAddress) public whenPaused onlyOwnerOrOwnerAPI returns (bool success) {
}
}
| !isOwnBlockchainLaunched | 364,693 | !isOwnBlockchainLaunched |
'The token is locked and you cannot change its metadata.' | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";
import "@manifoldxyz/royalty-registry-solidity/contracts/specs/IEIP2981.sol";
// The Token
// Look beyond the Image, the Token is the only constant.
//
// @artist: Del
// @dev: 0xG
contract TheToken is AdminControl, IEIP2981, ERC1155 {
struct Royalties {
address recipient;
uint256 amount;
}
struct Config {
string[] uris;
uint256 start;
uint256 interval;
bool locked;
Royalties royalties;
}
mapping(uint256 => Config) private _configs;
constructor() ERC1155("") { }
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AdminControl, ERC1155)
returns (bool)
{
}
function setConfig(uint256 tokenId, Config calldata config_) external adminRequired {
require(<FILL_ME>)
_configs[tokenId] = config_;
}
function lockConfig(uint256 tokenId) external adminRequired {
}
function mint(
address to,
uint256[] calldata ids,
uint256[] calldata amounts
) external adminRequired {
}
function mintWithConfig(
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
Config calldata config_
) external adminRequired {
}
function burn(
uint256[] calldata ids,
uint256[] calldata amounts
) external adminRequired {
}
function setGlobalUri(string calldata newuri) external adminRequired {
}
function uri(uint256 tokenId) public view virtual override returns (string memory) {
}
function setRoyalties(uint256 tokenId, Royalties calldata royaltiesConfig) external adminRequired {
}
function royaltyInfo(uint256 tokenId, uint256 salePrice) public override view returns (address, uint256) {
}
function withdraw(address recipient) external adminRequired {
}
}
| !_configs[tokenId].locked,'The token is locked and you cannot change its metadata.' | 364,696 | !_configs[tokenId].locked |
'A token is locked and you cannot mint with this configuration.' | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";
import "@manifoldxyz/royalty-registry-solidity/contracts/specs/IEIP2981.sol";
// The Token
// Look beyond the Image, the Token is the only constant.
//
// @artist: Del
// @dev: 0xG
contract TheToken is AdminControl, IEIP2981, ERC1155 {
struct Royalties {
address recipient;
uint256 amount;
}
struct Config {
string[] uris;
uint256 start;
uint256 interval;
bool locked;
Royalties royalties;
}
mapping(uint256 => Config) private _configs;
constructor() ERC1155("") { }
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AdminControl, ERC1155)
returns (bool)
{
}
function setConfig(uint256 tokenId, Config calldata config_) external adminRequired {
}
function lockConfig(uint256 tokenId) external adminRequired {
}
function mint(
address to,
uint256[] calldata ids,
uint256[] calldata amounts
) external adminRequired {
for (uint256 i = 0; i < ids.length; ++i) {
require(<FILL_ME>)
}
_mintBatch(to, ids, amounts, "");
}
function mintWithConfig(
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
Config calldata config_
) external adminRequired {
}
function burn(
uint256[] calldata ids,
uint256[] calldata amounts
) external adminRequired {
}
function setGlobalUri(string calldata newuri) external adminRequired {
}
function uri(uint256 tokenId) public view virtual override returns (string memory) {
}
function setRoyalties(uint256 tokenId, Royalties calldata royaltiesConfig) external adminRequired {
}
function royaltyInfo(uint256 tokenId, uint256 salePrice) public override view returns (address, uint256) {
}
function withdraw(address recipient) external adminRequired {
}
}
| !_configs[ids[i]].locked,'A token is locked and you cannot mint with this configuration.' | 364,696 | !_configs[ids[i]].locked |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
uint256 charonsObol;
string storage has_reason = reasons[msg.sender];
// require that user gives a reason
require(<FILL_ME>)
// require to pay bookingFee
require(msg.value >= bookingFee);
// you cannot give away your soul for free, at least Charon wants some share
charonsObol = price / obol;
require(charonsObol > 0);
// assert has not sold her or his soul, yet
require(bytes(has_reason).length == 0);
require(soulPrices[msg.sender] == 0);
require(ownedBy[msg.sender] == address(0));
// pay book keeping fee
payCharon(msg.value);
// store the reason forever on the blockchain
reasons[msg.sender] = reason;
// also the price is forever kept on the blockchain, so do not be too cheap
soulPrices[msg.sender] = price;
// and keep the soul in the soul book
soulBook[soulsForSale + soulsSold] = msg.sender;
soulsForSale += 1;
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| bytes(reason).length>0 | 364,728 | bytes(reason).length>0 |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
uint256 charonsObol;
string storage has_reason = reasons[msg.sender];
// require that user gives a reason
require(bytes(reason).length > 0);
// require to pay bookingFee
require(msg.value >= bookingFee);
// you cannot give away your soul for free, at least Charon wants some share
charonsObol = price / obol;
require(charonsObol > 0);
// assert has not sold her or his soul, yet
require(<FILL_ME>)
require(soulPrices[msg.sender] == 0);
require(ownedBy[msg.sender] == address(0));
// pay book keeping fee
payCharon(msg.value);
// store the reason forever on the blockchain
reasons[msg.sender] = reason;
// also the price is forever kept on the blockchain, so do not be too cheap
soulPrices[msg.sender] = price;
// and keep the soul in the soul book
soulBook[soulsForSale + soulsSold] = msg.sender;
soulsForSale += 1;
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| bytes(has_reason).length==0 | 364,728 | bytes(has_reason).length==0 |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
uint256 charonsObol;
string storage has_reason = reasons[msg.sender];
// require that user gives a reason
require(bytes(reason).length > 0);
// require to pay bookingFee
require(msg.value >= bookingFee);
// you cannot give away your soul for free, at least Charon wants some share
charonsObol = price / obol;
require(charonsObol > 0);
// assert has not sold her or his soul, yet
require(bytes(has_reason).length == 0);
require(<FILL_ME>)
require(ownedBy[msg.sender] == address(0));
// pay book keeping fee
payCharon(msg.value);
// store the reason forever on the blockchain
reasons[msg.sender] = reason;
// also the price is forever kept on the blockchain, so do not be too cheap
soulPrices[msg.sender] = price;
// and keep the soul in the soul book
soulBook[soulsForSale + soulsSold] = msg.sender;
soulsForSale += 1;
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| soulPrices[msg.sender]==0 | 364,728 | soulPrices[msg.sender]==0 |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
uint256 charonsObol;
string storage has_reason = reasons[msg.sender];
// require that user gives a reason
require(bytes(reason).length > 0);
// require to pay bookingFee
require(msg.value >= bookingFee);
// you cannot give away your soul for free, at least Charon wants some share
charonsObol = price / obol;
require(charonsObol > 0);
// assert has not sold her or his soul, yet
require(bytes(has_reason).length == 0);
require(soulPrices[msg.sender] == 0);
require(<FILL_ME>)
// pay book keeping fee
payCharon(msg.value);
// store the reason forever on the blockchain
reasons[msg.sender] = reason;
// also the price is forever kept on the blockchain, so do not be too cheap
soulPrices[msg.sender] = price;
// and keep the soul in the soul book
soulBook[soulsForSale + soulsSold] = msg.sender;
soulsForSale += 1;
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| ownedBy[msg.sender]==address(0) | 364,728 | ownedBy[msg.sender]==address(0) |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
uint256 charonsObol;
uint256 price;
// you cannot buy an owned soul:
require(<FILL_ME>)
// get the price of the soul
price = soulPrices[noSoulMate];
// Soul must be for sale
require(price > 0);
require(bytes(reasons[noSoulMate]).length > 0);
// Msg sender needs to pay the soul price
require(msg.value >= price);
charonsObol = msg.value / obol;
// check for wrap around
require(soulsOwned[msg.sender] + 1 > soulsOwned[msg.sender]);
// pay Charon
payCharon(charonsObol);
// pay the soul owner
noSoulMate.transfer(msg.value - charonsObol);
// Update the soul stats
soulsForSale -= 1;
soulsSold += 1;
// Increase the sender's balance by the appropriate amount of souls ;-)
soulsOwned[msg.sender] += 1;
ownedBy[noSoulMate] = msg.sender;
// log the transfer
SoulTransfer(noSoulMate, msg.sender);
// and give away napkins proportional to obol plus 1 bonus napkin ;-)
amount = charonsObol / napkinPrice + unit;
amount = checkAmount(amount);
if (amount > 0){
// only payout napkins if they are available
payOutNapkins(amount);
}
return amount;
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| ownedBy[noSoulMate]==address(0) | 364,728 | ownedBy[noSoulMate]==address(0) |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
uint256 charonsObol;
uint256 price;
// you cannot buy an owned soul:
require(ownedBy[noSoulMate] == address(0));
// get the price of the soul
price = soulPrices[noSoulMate];
// Soul must be for sale
require(price > 0);
require(<FILL_ME>)
// Msg sender needs to pay the soul price
require(msg.value >= price);
charonsObol = msg.value / obol;
// check for wrap around
require(soulsOwned[msg.sender] + 1 > soulsOwned[msg.sender]);
// pay Charon
payCharon(charonsObol);
// pay the soul owner
noSoulMate.transfer(msg.value - charonsObol);
// Update the soul stats
soulsForSale -= 1;
soulsSold += 1;
// Increase the sender's balance by the appropriate amount of souls ;-)
soulsOwned[msg.sender] += 1;
ownedBy[noSoulMate] = msg.sender;
// log the transfer
SoulTransfer(noSoulMate, msg.sender);
// and give away napkins proportional to obol plus 1 bonus napkin ;-)
amount = charonsObol / napkinPrice + unit;
amount = checkAmount(amount);
if (amount > 0){
// only payout napkins if they are available
payOutNapkins(amount);
}
return amount;
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| bytes(reasons[noSoulMate]).length>0 | 364,728 | bytes(reasons[noSoulMate]).length>0 |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
uint256 charonsObol;
uint256 price;
// you cannot buy an owned soul:
require(ownedBy[noSoulMate] == address(0));
// get the price of the soul
price = soulPrices[noSoulMate];
// Soul must be for sale
require(price > 0);
require(bytes(reasons[noSoulMate]).length > 0);
// Msg sender needs to pay the soul price
require(msg.value >= price);
charonsObol = msg.value / obol;
// check for wrap around
require(<FILL_ME>)
// pay Charon
payCharon(charonsObol);
// pay the soul owner
noSoulMate.transfer(msg.value - charonsObol);
// Update the soul stats
soulsForSale -= 1;
soulsSold += 1;
// Increase the sender's balance by the appropriate amount of souls ;-)
soulsOwned[msg.sender] += 1;
ownedBy[noSoulMate] = msg.sender;
// log the transfer
SoulTransfer(noSoulMate, msg.sender);
// and give away napkins proportional to obol plus 1 bonus napkin ;-)
amount = charonsObol / napkinPrice + unit;
amount = checkAmount(amount);
if (amount > 0){
// only payout napkins if they are available
payOutNapkins(amount);
}
return amount;
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| soulsOwned[msg.sender]+1>soulsOwned[msg.sender] | 364,728 | soulsOwned[msg.sender]+1>soulsOwned[msg.sender] |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
uint256 charonsObol;
// require correct ownership
require(<FILL_ME>)
require(soulsOwned[_to] + 1 > soulsOwned[_to]);
// require transfer fee is payed again
charonsObol = soulPrices[noSoulMate] / obol;
require(msg.value >= charonsObol);
// pay Charon
payCharon(msg.value);
// transfer the soul
soulsOwned[msg.sender] -= 1;
soulsOwned[_to] += 1;
ownedBy[noSoulMate] = _to;
// Log the soul transfer
SoulTransfer(msg.sender, _to);
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| ownedBy[noSoulMate]==msg.sender | 364,728 | ownedBy[noSoulMate]==msg.sender |
null | /*
* This is the source code of the smart contract for the SOUL token, aka Soul Napkins.
* Copyright 2017 and all rights reserved by the owner of the following Ethereum address:
* 0x10E44C6bc685c4E4eABda326c211561d5367EEec
*/
pragma solidity ^0.4.17;
// ERC Token standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Token symbol
string public constant symbol = "TBA";
// Name of token
string public constant name ="TBA";
// Decimals of token
uint8 public constant decimals = 18;
// Total token supply
function totalSupply() public constant returns (uint256 supply);
// The balance of account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Implementation of ERC20Interface
contract ERC20Token is ERC20Interface{
// account balances
mapping(address => uint256) balances;
// Owner of account approves the transfer of amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Function to access acount balances
function balanceOf(address _owner) public constant returns (uint256) {
}
// Transfer the _amount from msg.sender to _to account
function transfer(address _to, uint256 _amount) public returns (bool) {
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool) {
}
// Function to specify how much _spender is allowed to transfer on _owner's behalf
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
// Token implementation that allows selling of souls and distribution of napkins
contract SoulToken is ERC20Token{
// The three letter symbol of token
string public constant symbol = "SOUL";
// Name of token
string public constant name = "Soul Napkins";
// 6 is a holy number (2*3) so there are 6 decimals
uint8 public constant decimals = 6;
// With 6 decimals, a single unit is 10**6
uint256 public constant unit = 1000000;
// fee to pay to transfer soul, 10% like the ecclesiastical tithe
uint8 public constant obol = 10;
// price per token, 100 napkins per Ether
uint256 public constant napkinPrice = 10 finney / unit;
// Total number of napkins available
// 144,000 (get it?)
uint256 constant totalSupply_ = 144000 * unit;
// mapping to keep the reason of the soul sale!
mapping(address => string) reasons;
// prices that people put up for their soul
mapping(address => uint256) soulPrices;
// who owns a particular soul
mapping(address => address) ownedBy;
// number of souls owned by someone
mapping(address => uint256) soulsOwned;
// book of souls, listing all souls on sale and sold
mapping(uint256 => address) soulBook;
// owner of the contract
address public owner;
// Address where soul obol is due to
address public charonsBoat;
// small fee to insert soul into soulbook
uint256 public bookingFee;
// souls for sale
uint256 public soulsForSale;
// souls already sold
uint256 public soulsSold;
// total amount of Wei collected by Charon
uint256 public totalObol;
// Logs a soul transfer
event SoulTransfer(address indexed _from, address indexed _to);
function SoulToken() public{
}
// fallback function, Charon sells napkins as merchandise!
function () public payable {
}
// allows changing of the booking fee, note obol and token price are fixed and cannot change
function changeBookingFee(uint256 fee) public {
}
// changes Charon's boat, i.e. the address where the obol is paid to
function changeBoat(address newBoat) public{
}
// total number of napkins distributed by Charon
function totalSupply() public constant returns (uint256){
}
// returns the reason for the selling of one's soul
function soldSoulBecause(address noSoulMate) public constant returns(string){
}
// returns the owner of a soul
function soulIsOwnedBy(address noSoulMate) public constant returns(address){
}
// returns number of souls owned by someone
function ownsSouls(address soulOwner) public constant returns(uint256){
}
// returns price of a soul
function soldSoulFor(address noSoulMate) public constant returns(uint256){
}
// returns the nth entry in the soulbook
function soulBookPage(uint256 page) public constant returns(address){
}
// sells your soul for a given price and a given reason!
function sellSoul(string reason, uint256 price) public payable{
}
// buys msg.sender a soul and rewards him with tokens!
function buySoul(address noSoulMate) public payable returns(uint256 amount){
}
// can transfer a soul to a different account, but beware you have to pay Charon again!
function transferSoul(address _to, address noSoulMate) public payable{
uint256 charonsObol;
// require correct ownership
require(ownedBy[noSoulMate] == msg.sender);
require(<FILL_ME>)
// require transfer fee is payed again
charonsObol = soulPrices[noSoulMate] / obol;
require(msg.value >= charonsObol);
// pay Charon
payCharon(msg.value);
// transfer the soul
soulsOwned[msg.sender] -= 1;
soulsOwned[_to] += 1;
ownedBy[noSoulMate] = _to;
// Log the soul transfer
SoulTransfer(msg.sender, _to);
}
// logs and pays charon fees
function payCharon(uint256 obolValue) internal{
}
// checks if napkins are still available and adjusts amount accordingly
function checkAmount(uint256 amount) internal constant returns(uint256 checkedAmount){
}
// transfers napkins to people
function payOutNapkins(uint256 amount) internal{
}
}
| soulsOwned[_to]+1>soulsOwned[_to] | 364,728 | soulsOwned[_to]+1>soulsOwned[_to] |
"DUPLICATE_ENTRY" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
for(uint256 i = 0; i < entries.length; i++) {
address entry = entries[i];
require(entry != address(0), "NULL_ADDRESS");
require(<FILL_ME>)
presalerListAlloc[entry] = true;
}
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| !presalerListAlloc[entry],"DUPLICATE_ENTRY" | 364,922 | !presalerListAlloc[entry] |
"OUT_OF_STOCK" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
uint256 totalAmountMintedLocal = totalAmountMinted;
require(<FILL_ME>)
require(OTTER_MINT_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for(uint256 i = 0; i < tokenQuantity; i++) {
totalAmountMintedLocal++;
shuffleMint(msg.sender, totalAmountMintedLocal);
}
totalAmountMinted = totalAmountMintedLocal;
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| totalAmountMintedLocal+tokenQuantity<=OTTER_MAX,"OUT_OF_STOCK" | 364,922 | totalAmountMintedLocal+tokenQuantity<=OTTER_MAX |
"INSUFFICIENT_ETH" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
uint256 totalAmountMintedLocal = totalAmountMinted;
require(totalAmountMintedLocal + tokenQuantity <= OTTER_MAX, "OUT_OF_STOCK");
require(<FILL_ME>)
for(uint256 i = 0; i < tokenQuantity; i++) {
totalAmountMintedLocal++;
shuffleMint(msg.sender, totalAmountMintedLocal);
}
totalAmountMinted = totalAmountMintedLocal;
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| OTTER_MINT_PRICE*tokenQuantity<=msg.value,"INSUFFICIENT_ETH" | 364,922 | OTTER_MINT_PRICE*tokenQuantity<=msg.value |
"EXCEED_PRIVATE" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
require(presaleLive, "PRESALE_CLOSED");
uint256 totalAmountMintedLocal = totalAmountMinted;
uint256 privateAmountMintedLocal = privateAmountMinted;
require(totalAmountMintedLocal + tokenQuantity <= OTTER_MAX, "OUT_OF_STOCK");
require(<FILL_ME>)
require(presalerListAlloc[msg.sender], "NOT_ELIGIBLE");
require(OTTER_PRESALE_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for (uint256 i = 0; i < tokenQuantity; i++) {
privateAmountMintedLocal++;
totalAmountMintedLocal++;
shuffleMint(msg.sender, totalAmountMintedLocal);
}
privateAmountMinted = privateAmountMintedLocal;
totalAmountMinted = totalAmountMintedLocal;
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| privateAmountMintedLocal+tokenQuantity<=OTTER_PRESALE_MAX,"EXCEED_PRIVATE" | 364,922 | privateAmountMintedLocal+tokenQuantity<=OTTER_PRESALE_MAX |
"NOT_ELIGIBLE" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
require(presaleLive, "PRESALE_CLOSED");
uint256 totalAmountMintedLocal = totalAmountMinted;
uint256 privateAmountMintedLocal = privateAmountMinted;
require(totalAmountMintedLocal + tokenQuantity <= OTTER_MAX, "OUT_OF_STOCK");
require(privateAmountMintedLocal + tokenQuantity <= OTTER_PRESALE_MAX, "EXCEED_PRIVATE");
require(<FILL_ME>)
require(OTTER_PRESALE_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for (uint256 i = 0; i < tokenQuantity; i++) {
privateAmountMintedLocal++;
totalAmountMintedLocal++;
shuffleMint(msg.sender, totalAmountMintedLocal);
}
privateAmountMinted = privateAmountMintedLocal;
totalAmountMinted = totalAmountMintedLocal;
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| presalerListAlloc[msg.sender],"NOT_ELIGIBLE" | 364,922 | presalerListAlloc[msg.sender] |
"INSUFFICIENT_ETH" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
require(presaleLive, "PRESALE_CLOSED");
uint256 totalAmountMintedLocal = totalAmountMinted;
uint256 privateAmountMintedLocal = privateAmountMinted;
require(totalAmountMintedLocal + tokenQuantity <= OTTER_MAX, "OUT_OF_STOCK");
require(privateAmountMintedLocal + tokenQuantity <= OTTER_PRESALE_MAX, "EXCEED_PRIVATE");
require(presalerListAlloc[msg.sender], "NOT_ELIGIBLE");
require(<FILL_ME>)
for (uint256 i = 0; i < tokenQuantity; i++) {
privateAmountMintedLocal++;
totalAmountMintedLocal++;
shuffleMint(msg.sender, totalAmountMintedLocal);
}
privateAmountMinted = privateAmountMintedLocal;
totalAmountMinted = totalAmountMintedLocal;
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| OTTER_PRESALE_PRICE*tokenQuantity<=msg.value,"INSUFFICIENT_ETH" | 364,922 | OTTER_PRESALE_PRICE*tokenQuantity<=msg.value |
"OUT_OF_STOCK" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
require(giveAwayLive, "GIVE_AWAY_CLOSED");
require(<FILL_ME>)
require(giveAwayAmountMinted + 1 <= OTTER_GIVE_AWAY_MAX, "EXCEED_GIVE_AWAY");
require(giveAwayListAlloc[msg.sender] > 0, "NOT_QUALIFIED");
giveAwayAmountMinted++;
giveAwayListAlloc[msg.sender]--;
totalAmountMinted++;
shuffleMint(msg.sender, totalAmountMinted);
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| totalAmountMinted+1<=OTTER_MAX,"OUT_OF_STOCK" | 364,922 | totalAmountMinted+1<=OTTER_MAX |
"EXCEED_GIVE_AWAY" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
require(giveAwayLive, "GIVE_AWAY_CLOSED");
require(totalAmountMinted + 1 <= OTTER_MAX, "OUT_OF_STOCK");
require(<FILL_ME>)
require(giveAwayListAlloc[msg.sender] > 0, "NOT_QUALIFIED");
giveAwayAmountMinted++;
giveAwayListAlloc[msg.sender]--;
totalAmountMinted++;
shuffleMint(msg.sender, totalAmountMinted);
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| giveAwayAmountMinted+1<=OTTER_GIVE_AWAY_MAX,"EXCEED_GIVE_AWAY" | 364,922 | giveAwayAmountMinted+1<=OTTER_GIVE_AWAY_MAX |
"NOT_QUALIFIED" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
require(giveAwayLive, "GIVE_AWAY_CLOSED");
require(totalAmountMinted + 1 <= OTTER_MAX, "OUT_OF_STOCK");
require(giveAwayAmountMinted + 1 <= OTTER_GIVE_AWAY_MAX, "EXCEED_GIVE_AWAY");
require(<FILL_ME>)
giveAwayAmountMinted++;
giveAwayListAlloc[msg.sender]--;
totalAmountMinted++;
shuffleMint(msg.sender, totalAmountMinted);
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| giveAwayListAlloc[msg.sender]>0,"NOT_QUALIFIED" | 364,922 | giveAwayListAlloc[msg.sender]>0 |
"MAX_MINT" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
require(<FILL_ME>)
uint256 airDropAmountLocal = airDropAmount;
uint256 totalAmountMintedLocal = totalAmountMinted;
require(airDropAmount + receivers.length <= OTTER_AIR_DROP_MAX, "EXCEED_AIR_DROP");
for (uint256 i = 0; i < receivers.length; i++) {
airDropAmountLocal++;
totalAmountMintedLocal++;
shuffleMint(receivers[i], totalAmountMintedLocal);
}
airDropAmount = airDropAmountLocal;
totalAmountMinted = totalAmountMintedLocal;
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| totalAmountMinted+receivers.length<=OTTER_MAX,"MAX_MINT" | 364,922 | totalAmountMinted+receivers.length<=OTTER_MAX |
"EXCEED_AIR_DROP" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
require(totalAmountMinted + receivers.length <= OTTER_MAX, "MAX_MINT");
uint256 airDropAmountLocal = airDropAmount;
uint256 totalAmountMintedLocal = totalAmountMinted;
require(<FILL_ME>)
for (uint256 i = 0; i < receivers.length; i++) {
airDropAmountLocal++;
totalAmountMintedLocal++;
shuffleMint(receivers[i], totalAmountMintedLocal);
}
airDropAmount = airDropAmountLocal;
totalAmountMinted = totalAmountMintedLocal;
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| airDropAmount+receivers.length<=OTTER_AIR_DROP_MAX,"EXCEED_AIR_DROP" | 364,922 | airDropAmount+receivers.length<=OTTER_AIR_DROP_MAX |
"INSUFFICIENT_ETH" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
require(_exists(tokenId), "Cannot query non-existent token");
require(companionsAvailable, "Companion changes are not available");
require(ownerOf(tokenId) == msg.sender, "Only token owner can change companions");
bool isDelete = compare(companionType, "");
// Deletion is free.
require(<FILL_ME>)
if (isDelete) {
delete tokenIdToAddons[tokenId].companion;
} else {
tokenIdToAddons[tokenId].companion = companionType;
}
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| isDelete||OTTER_COMPANION_PRICE<=msg.value,"INSUFFICIENT_ETH" | 364,922 | isDelete||OTTER_COMPANION_PRICE<=msg.value |
"INSUFFICIENT_ETH" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
require(_exists(tokenId), "Cannot query non-existent token");
require(wingsAvailable, "Wing changes are not available");
require(ownerOf(tokenId) == msg.sender, "Only token owner can change wings");
bool isDelete = compare(wingType, "");
// Deletion is free.
require(<FILL_ME>)
if (isDelete) {
delete tokenIdToAddons[tokenId].wing;
} else {
tokenIdToAddons[tokenId].wing = wingType;
}
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| isDelete||OTTER_WING_PRICE<=msg.value,"INSUFFICIENT_ETH" | 364,922 | isDelete||OTTER_WING_PRICE<=msg.value |
"Fair minting has already completed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
require(<FILL_ME>)
uint256 target = rangedRandomNum(tokenId);
_safeMint(to, tokenId);
// Swap target and tokenId image mapping.
tokenIdToImageId[tokenId] = target;
tokenIdToImageId[target] = tokenId;
if(tokenId == OTTER_MAX) {
finalizeMinting();
}
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| !mintingFinalized,"Fair minting has already completed" | 364,922 | !mintingFinalized |
"Cannot query non-existent imageId" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
require(_exists(tokenId), "Cannot query non-existent token");
require(<FILL_ME>)
uint256 imageId = 0; // "Wait for minting to complete"
if(mintingFinalized) {
imageId = tokenIdToImageId[tokenId];
if(tokenId != FLIPPENING_OTTER_TOKEN_ID) {
imageId = (imageId + finalShifter)%OTTER_MAX + 1;
}
}
string memory uri = string(abi.encodePacked(_tokenBaseURI, Strings.toString(imageId), "/base"));
if(bytes(tokenIdToAddons[tokenId].wing).length != 0) {
uri = string(abi.encodePacked(uri, "_", tokenIdToAddons[tokenId].wing));
}
if(bytes(tokenIdToAddons[tokenId].companion).length != 0) {
uri = string(abi.encodePacked(uri, "_", tokenIdToAddons[tokenId].companion));
}
uri = string(abi.encodePacked(uri, ".json"));
return uri;
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| tokenIdToImageId[tokenId]>0,"Cannot query non-existent imageId" | 364,922 | tokenIdToImageId[tokenId]>0 |
"Not enough LINK - fill contract with faucet" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
require(<FILL_ME>)
return requestRandomness(randomKeyHash, randomLinkFee);
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| LINK.balanceOf(address(this))>=randomLinkFee,"Not enough LINK - fill contract with faucet" | 364,922 | LINK.balanceOf(address(this))>=randomLinkFee |
"Flippening otter should only be assigned once" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
require(<FILL_ME>)
require(isFlipped(), "Flippening event must have already happened");
// Mint the Flippening Otter
flipped = true;
uint256 counter = block.timestamp;
uint256 tokenId = rangedRandomNumWithSeed(totalAmountMinted, counter);
// Find a tokenId with valid owner. This is required to handle burned tokens.
while(ownerOf(tokenId) == address(0)) {
counter++;
tokenId = rangedRandomNumWithSeed(totalAmountMinted, counter);
}
// Assign Flippening Otter to owner of one of the existing otters.
_safeMint(ownerOf(tokenId), FLIPPENING_OTTER_TOKEN_ID);
tokenIdToImageId[FLIPPENING_OTTER_TOKEN_ID] = FLIPPENING_OTTER_TOKEN_ID;
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| !flipped,"Flippening otter should only be assigned once" | 364,922 | !flipped |
"Flippening event must have already happened" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
/$$$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$ /$$
| $$_____/| $$|__/ |__/ /$$__ $$ | $$ | $$
| $$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$
| $$$$$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$| $$| $$__ $$ /$$__ $$| $$ | $$|_ $$_/|_ $$_/ /$$__ $$ /$$__ $$ /$$_____/
| $$__/ | $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ | $$$$$$$$| $$ \__/| $$$$$$
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$ | $$ /$$| $$ /$$| $$_____/| $$ \____ $$
| $$ | $$| $$| $$$$$$$/| $$$$$$$/| $$$$$$$| $$ | $$| $$| $$ | $$| $$$$$$$| $$$$$$/ | $$$$/| $$$$/| $$$$$$$| $$ /$$$$$$$/
|__/ |__/|__/| $$____/ | $$____/ \_______/|__/ |__/|__/|__/ |__/ \____ $$ \______/ \___/ \___/ \_______/|__/ |_______/
| $$ | $$ /$$ \ $$
| $$ | $$ | $$$$$$/
|__/ |__/ \______/
*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
/**
* Contract Timeline:
* 1. Deploy the contract with right constructor params
* 2. Send Link tokens to contract address
* 3. Call getRandomNumber
* 4. Set BaseURI, contractURI, lockMetadata
* 5. Add presale address presale allocation
* 6. Enable presale
* 7. Add presale address giveaway allocation
* 9. Enable sale
* 10. Enable give away at 25% minting
* 11. Enable companionUpdates at 50% minting
* 12. Enable wingUpdates at 75% minting
*/
contract FlippeningOtters is ERC721, Ownable, KeeperCompatibleInterface, VRFConsumerBase {
uint256 public constant OTTER_AIR_DROP_MAX = 300;
uint256 public constant OTTER_GIVE_AWAY_MAX = 500;
uint256 public constant OTTER_PRESALE_MAX = 300;
uint256 public constant OTTER_MAX = 9999;
uint256 public constant FLIPPENING_OTTER_TOKEN_ID = OTTER_MAX + 1;
uint256 public constant OTTER_WING_PRICE = 0.02 ether;
uint256 public constant OTTER_COMPANION_PRICE = 0.02 ether;
uint256 public constant OTTER_PRESALE_PRICE = 0.01 ether;
uint256 public OTTER_MINT_PRICE = 0.05 ether;
address public gnosis_safe = 0xB836140717e545bCd59691aC1E4d50f1f94fb6b3;
struct OtterAddOns {
string wing;
string companion;
}
mapping(address => uint256) public giveAwayListAlloc;
mapping(address => bool) public presalerListAlloc;
mapping(uint256 => uint256) public tokenIdToImageId;
mapping(uint256 => OtterAddOns) public tokenIdToAddons;
string private _contractURI;
string private _tokenBaseURI = "ipfs://Qmf41u6GGzoZeJWR3UccXVXvEvmxfrwczSUMvsLec6MU3j/";
uint256 public airDropAmount;
uint256 public giveAwayAmountMinted;
uint256 public privateAmountMinted;
uint256 public totalAmountMinted;
uint256 public finalShifter;
bytes32 mintingFinalRandRequestId;
bool public mintingFinalized;
bool public presaleLive;
bool public giveAwayLive;
bool public saleLive;
bool public companionsAvailable;
bool public wingsAvailable;
bool public locked;
AggregatorV3Interface internal ethMarketCapFeed;
AggregatorV3Interface internal btcMarketCapFeed;
bool public flipped;
bool internal enableKeeper;
bytes32 internal randomKeyHash;
uint256 internal randomLinkFee;
uint256 public randomResult;
// ETH Mainnet params.
//
// https://docs.chain.link/docs/ethereum-addresses
// ethFeed: 0xAA2FE1324b84981832AafCf7Dc6E6Fe6cF124283
// btcFeed: 0x47E1e89570689c13E723819bf633548d611D630C
//
// https://docs.chain.link/docs/vrf-contracts/
// vrfLinkToken: 0x514910771AF9Ca656af840dff83E8264EcF986CA
// vrfCoordinator: 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
// keyHash: 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445
// Fee: 2000000000000000000
//
// Kovan: 0x9326BFA02ADD2366b30bacB125260Af641031331,0x6135b13325bfC4B00278B4abC5e20bbce2D6580e,0xa36085F69e2889c224210F603D836748e7dC0088,0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9,0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4,100000000000000000
// Rinkeby: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e,0x2431452A0010a43878bF198e170F6319Af6d27F4,0x01BE23585060835E02B77ef475b0Cc51aA1e0709,0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B,0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311,100000000000000000
constructor(address ethFeed, address btcFeed, address vrfLinkToken, address vrfCoordinator, bytes32 keyHash, uint256 linkFee)
ERC721("Flippening Otters", "FOT")
VRFConsumerBase(
vrfCoordinator, // VRF Coordinator
vrfLinkToken // LINK Token
) {
}
modifier notLocked {
}
function increaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function decreaseGiveAwayBudget(address[] calldata entries) external onlyOwner {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function mint(uint256 tokenQuantity) external payable {
}
function presaleBuy(uint256 tokenQuantity) external payable {
}
// Free give away.
function giveAwayBuy() external {
}
function airDrop(address[] calldata receivers) external onlyOwner {
}
function updateCompanion(uint256 tokenId, string calldata companionType) external payable {
}
function updateWing(uint256 tokenId, string calldata wingType) external payable {
}
/**
* Generates a number between 1 to num (inclusive).
*/
function rangedRandomNum(uint256 num) internal view returns (uint256) {
}
function rangedRandomNumWithSeed(uint256 num, uint256 counter) internal view returns (uint256) {
}
// Finalize the allocation of Otters and stop minting forever.
function finalizeMinting() public onlyOwner {
}
function shuffleMint(address to, uint256 tokenId) internal {
}
function withdraw() external onlyOwner {
}
function setDesstinationAddress(address addr) external onlyOwner {
}
function burn(uint256[] calldata tokenIds) external onlyOwner() {
}
// Owner functions for enabling presale, sale, revealing and setting the provenance hash
function lockMetadata() external onlyOwner {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleGiveAwayStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function toggleCompanionsAvailable() external onlyOwner {
}
function toggleWingsAvailable() external onlyOwner {
}
function contractURI() public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function compare(string memory s1, string memory s2) public pure returns (bool) {
}
function updateLinkFee(uint256 linkFee) external onlyOwner {
}
function updateKeyHash(bytes32 keyHash) external onlyOwner {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
// TODO: change it to internal function after testing.
function isFlipped() public view returns (bool) {
}
function setEnableKeeper() public onlyOwner {
}
function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
}
function performUpkeep(bytes calldata /* performData */) external override {
require(!flipped, "Flippening otter should only be assigned once");
require(<FILL_ME>)
// Mint the Flippening Otter
flipped = true;
uint256 counter = block.timestamp;
uint256 tokenId = rangedRandomNumWithSeed(totalAmountMinted, counter);
// Find a tokenId with valid owner. This is required to handle burned tokens.
while(ownerOf(tokenId) == address(0)) {
counter++;
tokenId = rangedRandomNumWithSeed(totalAmountMinted, counter);
}
// Assign Flippening Otter to owner of one of the existing otters.
_safeMint(ownerOf(tokenId), FLIPPENING_OTTER_TOKEN_ID);
tokenIdToImageId[FLIPPENING_OTTER_TOKEN_ID] = FLIPPENING_OTTER_TOKEN_ID;
}
function setContractURI(string calldata URI) external onlyOwner notLocked {
}
function setBaseURI(string calldata URI) external onlyOwner notLocked {
}
function setOtterMintPrice(uint256 price) external onlyOwner {
}
}
| isFlipped(),"Flippening event must have already happened" | 364,922 | isFlipped() |
"Non-mintable project" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
/**
Checks
*/
//Validate the project exists.
validProject(projectId);
//Validate it's mintable.
require(<FILL_ME>)
//Validate there are still quantities available.
require(_mappings.projects[projectId].minted < _mappings.projects[projectId].maxSupply, "Max supply minted");
//Get cost
uint256 burnFee = _mappings.projects[projectId].burnFee;
require(burnFee > 0, "No burn fee."); //Sanity check. Already can't add a project with a zero burn fee.
//Validate we have enough baseballs.
require(_contracts.baseballs.balanceOf(_msgSender()) >= burnFee, "Not enough balls");
//Get balance
/**
Effects
*/
//Increase max project index
uint256 index = ++_mappings.projectTokenIndexNonce[projectId];
uint256 tokenId = projectId | index;
//Loop through all the attribute categories and pick an attribute for this NFT
uint256[] memory attributeCategoryIds = _mappings.projects[projectId].attributeCategoryIds;
for (uint256 i=0; i < attributeCategoryIds.length; i++) {
_tokenAttributes[attributeCategoryIds[i]][tokenId] = _getAttribute(projectId, attributeCategoryIds[i]);
attributeNonce++;
}
//Increase minted
_mappings.projects[projectId].minted++;
//Burn Baseballs
_contracts.baseballs.burnFrom(_msgSender(), burnFee);
/**
Interactions
*/
//Mint
_safeMint(_msgSender(), tokenId, "");
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| _mappings.projects[projectId].mintable==true,"Non-mintable project" | 365,035 | _mappings.projects[projectId].mintable==true |
"Max supply minted" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
/**
Checks
*/
//Validate the project exists.
validProject(projectId);
//Validate it's mintable.
require(_mappings.projects[projectId].mintable == true, "Non-mintable project");
//Validate there are still quantities available.
require(<FILL_ME>)
//Get cost
uint256 burnFee = _mappings.projects[projectId].burnFee;
require(burnFee > 0, "No burn fee."); //Sanity check. Already can't add a project with a zero burn fee.
//Validate we have enough baseballs.
require(_contracts.baseballs.balanceOf(_msgSender()) >= burnFee, "Not enough balls");
//Get balance
/**
Effects
*/
//Increase max project index
uint256 index = ++_mappings.projectTokenIndexNonce[projectId];
uint256 tokenId = projectId | index;
//Loop through all the attribute categories and pick an attribute for this NFT
uint256[] memory attributeCategoryIds = _mappings.projects[projectId].attributeCategoryIds;
for (uint256 i=0; i < attributeCategoryIds.length; i++) {
_tokenAttributes[attributeCategoryIds[i]][tokenId] = _getAttribute(projectId, attributeCategoryIds[i]);
attributeNonce++;
}
//Increase minted
_mappings.projects[projectId].minted++;
//Burn Baseballs
_contracts.baseballs.burnFrom(_msgSender(), burnFee);
/**
Interactions
*/
//Mint
_safeMint(_msgSender(), tokenId, "");
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| _mappings.projects[projectId].minted<_mappings.projects[projectId].maxSupply,"Max supply minted" | 365,035 | _mappings.projects[projectId].minted<_mappings.projects[projectId].maxSupply |
"Not enough balls" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
/**
Checks
*/
//Validate the project exists.
validProject(projectId);
//Validate it's mintable.
require(_mappings.projects[projectId].mintable == true, "Non-mintable project");
//Validate there are still quantities available.
require(_mappings.projects[projectId].minted < _mappings.projects[projectId].maxSupply, "Max supply minted");
//Get cost
uint256 burnFee = _mappings.projects[projectId].burnFee;
require(burnFee > 0, "No burn fee."); //Sanity check. Already can't add a project with a zero burn fee.
//Validate we have enough baseballs.
require(<FILL_ME>)
//Get balance
/**
Effects
*/
//Increase max project index
uint256 index = ++_mappings.projectTokenIndexNonce[projectId];
uint256 tokenId = projectId | index;
//Loop through all the attribute categories and pick an attribute for this NFT
uint256[] memory attributeCategoryIds = _mappings.projects[projectId].attributeCategoryIds;
for (uint256 i=0; i < attributeCategoryIds.length; i++) {
_tokenAttributes[attributeCategoryIds[i]][tokenId] = _getAttribute(projectId, attributeCategoryIds[i]);
attributeNonce++;
}
//Increase minted
_mappings.projects[projectId].minted++;
//Burn Baseballs
_contracts.baseballs.burnFrom(_msgSender(), burnFee);
/**
Interactions
*/
//Mint
_safeMint(_msgSender(), tokenId, "");
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| _contracts.baseballs.balanceOf(_msgSender())>=burnFee,"Not enough balls" | 365,035 | _contracts.baseballs.balanceOf(_msgSender())>=burnFee |
"Name is empty" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
require(<FILL_ME>)
require(bytes(text[1]).length > 0, "Description is empty");
require(mintInfo[0] > 0, "Max supply is zero");
require(bytes(text[2]).length > 0, "IPFS is empty");
require(mintInfo[1] > 0, "Invalid burnFee");
require(attributeCategoryIds.length > 0, "No attribute categories");
require(attributeProbabilities.length == attributeCategoryIds.length, "Input size mismatch");
uint256 totalBurnFee = mintInfo[0] * mintInfo[1];
require(totalBurnFee + _burnFeeSum < 249173 ether, "Burn fee too high");
//Update burn fee
_burnFeeSum = totalBurnFee + _burnFeeSum;
// Store the type in the upper 128 bits
uint256 _id = (++_projectNonce << 128);
//Create project attributes
_createProjectAttributes(_id, attributeCategoryIds, attributeProbabilities);
//Map struct
_mappings.projects[_id].id = _id;
_mappings.projects[_id].name = text[0];
_mappings.projects[_id].description = text[1];
_mappings.projects[_id].maxSupply = mintInfo[0];
_mappings.projects[_id].burnFee = mintInfo[1];
_mappings.projects[_id].ipfs = text[2];
_mappings.projects[_id].mintable = false;
_mappings.projects[_id].attributeCategoryIds = attributeCategoryIds;
projectIds.push(_id);
return _id;
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| bytes(text[0]).length>0,"Name is empty" | 365,035 | bytes(text[0]).length>0 |
"Description is empty" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
require(bytes(text[0]).length > 0, "Name is empty");
require(<FILL_ME>)
require(mintInfo[0] > 0, "Max supply is zero");
require(bytes(text[2]).length > 0, "IPFS is empty");
require(mintInfo[1] > 0, "Invalid burnFee");
require(attributeCategoryIds.length > 0, "No attribute categories");
require(attributeProbabilities.length == attributeCategoryIds.length, "Input size mismatch");
uint256 totalBurnFee = mintInfo[0] * mintInfo[1];
require(totalBurnFee + _burnFeeSum < 249173 ether, "Burn fee too high");
//Update burn fee
_burnFeeSum = totalBurnFee + _burnFeeSum;
// Store the type in the upper 128 bits
uint256 _id = (++_projectNonce << 128);
//Create project attributes
_createProjectAttributes(_id, attributeCategoryIds, attributeProbabilities);
//Map struct
_mappings.projects[_id].id = _id;
_mappings.projects[_id].name = text[0];
_mappings.projects[_id].description = text[1];
_mappings.projects[_id].maxSupply = mintInfo[0];
_mappings.projects[_id].burnFee = mintInfo[1];
_mappings.projects[_id].ipfs = text[2];
_mappings.projects[_id].mintable = false;
_mappings.projects[_id].attributeCategoryIds = attributeCategoryIds;
projectIds.push(_id);
return _id;
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| bytes(text[1]).length>0,"Description is empty" | 365,035 | bytes(text[1]).length>0 |
"Max supply is zero" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
require(bytes(text[0]).length > 0, "Name is empty");
require(bytes(text[1]).length > 0, "Description is empty");
require(<FILL_ME>)
require(bytes(text[2]).length > 0, "IPFS is empty");
require(mintInfo[1] > 0, "Invalid burnFee");
require(attributeCategoryIds.length > 0, "No attribute categories");
require(attributeProbabilities.length == attributeCategoryIds.length, "Input size mismatch");
uint256 totalBurnFee = mintInfo[0] * mintInfo[1];
require(totalBurnFee + _burnFeeSum < 249173 ether, "Burn fee too high");
//Update burn fee
_burnFeeSum = totalBurnFee + _burnFeeSum;
// Store the type in the upper 128 bits
uint256 _id = (++_projectNonce << 128);
//Create project attributes
_createProjectAttributes(_id, attributeCategoryIds, attributeProbabilities);
//Map struct
_mappings.projects[_id].id = _id;
_mappings.projects[_id].name = text[0];
_mappings.projects[_id].description = text[1];
_mappings.projects[_id].maxSupply = mintInfo[0];
_mappings.projects[_id].burnFee = mintInfo[1];
_mappings.projects[_id].ipfs = text[2];
_mappings.projects[_id].mintable = false;
_mappings.projects[_id].attributeCategoryIds = attributeCategoryIds;
projectIds.push(_id);
return _id;
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| mintInfo[0]>0,"Max supply is zero" | 365,035 | mintInfo[0]>0 |
"IPFS is empty" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
require(bytes(text[0]).length > 0, "Name is empty");
require(bytes(text[1]).length > 0, "Description is empty");
require(mintInfo[0] > 0, "Max supply is zero");
require(<FILL_ME>)
require(mintInfo[1] > 0, "Invalid burnFee");
require(attributeCategoryIds.length > 0, "No attribute categories");
require(attributeProbabilities.length == attributeCategoryIds.length, "Input size mismatch");
uint256 totalBurnFee = mintInfo[0] * mintInfo[1];
require(totalBurnFee + _burnFeeSum < 249173 ether, "Burn fee too high");
//Update burn fee
_burnFeeSum = totalBurnFee + _burnFeeSum;
// Store the type in the upper 128 bits
uint256 _id = (++_projectNonce << 128);
//Create project attributes
_createProjectAttributes(_id, attributeCategoryIds, attributeProbabilities);
//Map struct
_mappings.projects[_id].id = _id;
_mappings.projects[_id].name = text[0];
_mappings.projects[_id].description = text[1];
_mappings.projects[_id].maxSupply = mintInfo[0];
_mappings.projects[_id].burnFee = mintInfo[1];
_mappings.projects[_id].ipfs = text[2];
_mappings.projects[_id].mintable = false;
_mappings.projects[_id].attributeCategoryIds = attributeCategoryIds;
projectIds.push(_id);
return _id;
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| bytes(text[2]).length>0,"IPFS is empty" | 365,035 | bytes(text[2]).length>0 |
"Invalid burnFee" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
require(bytes(text[0]).length > 0, "Name is empty");
require(bytes(text[1]).length > 0, "Description is empty");
require(mintInfo[0] > 0, "Max supply is zero");
require(bytes(text[2]).length > 0, "IPFS is empty");
require(<FILL_ME>)
require(attributeCategoryIds.length > 0, "No attribute categories");
require(attributeProbabilities.length == attributeCategoryIds.length, "Input size mismatch");
uint256 totalBurnFee = mintInfo[0] * mintInfo[1];
require(totalBurnFee + _burnFeeSum < 249173 ether, "Burn fee too high");
//Update burn fee
_burnFeeSum = totalBurnFee + _burnFeeSum;
// Store the type in the upper 128 bits
uint256 _id = (++_projectNonce << 128);
//Create project attributes
_createProjectAttributes(_id, attributeCategoryIds, attributeProbabilities);
//Map struct
_mappings.projects[_id].id = _id;
_mappings.projects[_id].name = text[0];
_mappings.projects[_id].description = text[1];
_mappings.projects[_id].maxSupply = mintInfo[0];
_mappings.projects[_id].burnFee = mintInfo[1];
_mappings.projects[_id].ipfs = text[2];
_mappings.projects[_id].mintable = false;
_mappings.projects[_id].attributeCategoryIds = attributeCategoryIds;
projectIds.push(_id);
return _id;
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| mintInfo[1]>0,"Invalid burnFee" | 365,035 | mintInfo[1]>0 |
"Burn fee too high" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
require(bytes(text[0]).length > 0, "Name is empty");
require(bytes(text[1]).length > 0, "Description is empty");
require(mintInfo[0] > 0, "Max supply is zero");
require(bytes(text[2]).length > 0, "IPFS is empty");
require(mintInfo[1] > 0, "Invalid burnFee");
require(attributeCategoryIds.length > 0, "No attribute categories");
require(attributeProbabilities.length == attributeCategoryIds.length, "Input size mismatch");
uint256 totalBurnFee = mintInfo[0] * mintInfo[1];
require(<FILL_ME>)
//Update burn fee
_burnFeeSum = totalBurnFee + _burnFeeSum;
// Store the type in the upper 128 bits
uint256 _id = (++_projectNonce << 128);
//Create project attributes
_createProjectAttributes(_id, attributeCategoryIds, attributeProbabilities);
//Map struct
_mappings.projects[_id].id = _id;
_mappings.projects[_id].name = text[0];
_mappings.projects[_id].description = text[1];
_mappings.projects[_id].maxSupply = mintInfo[0];
_mappings.projects[_id].burnFee = mintInfo[1];
_mappings.projects[_id].ipfs = text[2];
_mappings.projects[_id].mintable = false;
_mappings.projects[_id].attributeCategoryIds = attributeCategoryIds;
projectIds.push(_id);
return _id;
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| totalBurnFee+_burnFeeSum<249173ether,"Burn fee too high" | 365,035 | totalBurnFee+_burnFeeSum<249173ether |
"Invalid project" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
//Validate the project exists.
require(projectId > 0, "Invalid project id");
require(<FILL_ME>)
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
}
}
| _mappings.projects[projectId].id==projectId,"Invalid project" | 365,035 | _mappings.projects[projectId].id==projectId |
"Invalid attribute category" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
for (uint256 i=0; i < attributeProbabilities.length; i++) {
uint256 categoryId = attributeCategoryIds[i];
//Make sure category exists
require(<FILL_ME>)
uint256[] memory row = attributeProbabilities[i];
uint probabilityTotal = 0;
uint lastProbability = 0;
//Validate
//Odd indexes are attribute ids. Look one index further to get the probability.
//Probabilities need to be loaded in ascending order
for (uint256 j=0; j < row.length; j+=2) {
uint256 attributeId = row[j];
uint256 probability = row[j+1];
require(bytes(_contracts.words.word(attributeId)).length > 0, "Invalid attribute");
require(probability > 0, "Invalid probability");
require(probability >= lastProbability, "Descending probability");
probabilityTotal += probability;
lastProbability = probability;
}
require(probabilityTotal == 1000000, "Invalid probability total");
//Push AttributeProbability to storage
for (uint256 j=0; j < row.length; j+=2) {
_mappings.attributeProbabilities[projectId][categoryId].push(AttributeProbability(row[j], row[j+1]));
}
}
}
}
| bytes(_contracts.words.word(categoryId)).length>0,"Invalid attribute category" | 365,035 | bytes(_contracts.words.word(categoryId)).length>0 |
"Invalid attribute" | // contracts/BaseballWords.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "./util/console.sol";
import "./util/base64.sol";
import "./structs.sol";
import "./Words.sol";
import "./Baseballs.sol";
import "./TokenUri.sol";
contract BaseballWords is ERC721Enumerable, Ownable {
struct Mappings {
//Map project id to token index nonce
mapping(uint256 => uint256) projectTokenIndexNonce;
//Map project id to project
mapping(uint256 => Project) projects;
//Map project id and attribute category id to AttributeProbability[]
mapping(uint256 => mapping(uint256 => AttributeProbability[])) attributeProbabilities;
}
struct Contracts {
Words words;
Baseballs baseballs;
TokenUri tokenUri;
}
Contracts private _contracts;
Mappings private _mappings;
uint256 public attributeNonce = 0;
// Use a split bit implementation.
// Store the type in the upper 128 bits..
uint256 constant TYPE_MASK = uint256(type(uint128).max) << 128;
// ..and the non-fungible index in the lower 128
uint256 constant NF_INDEX_MASK = type(uint128).max;
constructor(address wordsAddress, address baseballsAddress, address tokenUriAddress) ERC721("Baseball Words", "BWORDS") {
}
// Map attributeCategory id + tokenId to attribute id
mapping(uint256 => mapping(uint256 => uint256)) private _tokenAttributes;
function tokenAttribute(uint256 attributeCategoryId, uint256 tokenId) public view returns (uint256) {
}
function tokenIdToProjectId(uint256 _tokenId) public pure returns (uint256 _projectId) {
}
function tokenIdToIndex(uint256 _tokenId) public pure returns(uint256) {
}
function tokenByProjectAndIndex(uint256 projectId, uint256 index) public pure returns (uint256) {
}
function mint(uint256 projectId) external {
}
function _getAttribute(uint256 projectId, uint256 categoryId) private view returns (uint256 _attributeId) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function exists(uint256 tokenId) public view virtual returns (bool) {
}
function createProject(
string[] calldata text, // [0] name, [1] description, [2] ipfs
uint256[] calldata mintInfo, // [0] maxSupply, [1] burnFee
uint256[] calldata attributeCategoryIds,
uint256[][] calldata attributeProbabilities
) external onlyOwner returns (uint256) {
}
function activateProject(uint projectId) external onlyOwner {
}
function attributeRoll(uint256 projectId, uint256 counter) public pure returns (uint256) {
}
function svg(uint256 tokenIndex, uint256 maxSupply) public view returns (string memory) {
}
/**
PROJECT
*/
uint256 private _projectNonce = 0;
uint256 private _burnFeeSum = 0;
uint256[] public projectIds;
function getProject(uint256 projectId) public view returns (Project memory) {
}
function projectAttributeCategories(uint256 projectId) public view returns (uint256[] memory c) {
}
function projectCount() public view returns (uint256) {
}
/**
ATTRIBUTE PROBABILITIES
*/
function getAttributeProbabilities(uint256 projectId, uint256 attributeCategoryId) public view returns (AttributeProbability[] memory _attrProb) {
}
function validProject(uint256 projectId) view public {
}
function _createProjectAttributes(uint256 projectId, uint256[] memory attributeCategoryIds, uint256[][] memory attributeProbabilities) private {
for (uint256 i=0; i < attributeProbabilities.length; i++) {
uint256 categoryId = attributeCategoryIds[i];
//Make sure category exists
require(bytes(_contracts.words.word(categoryId)).length > 0, "Invalid attribute category");
uint256[] memory row = attributeProbabilities[i];
uint probabilityTotal = 0;
uint lastProbability = 0;
//Validate
//Odd indexes are attribute ids. Look one index further to get the probability.
//Probabilities need to be loaded in ascending order
for (uint256 j=0; j < row.length; j+=2) {
uint256 attributeId = row[j];
uint256 probability = row[j+1];
require(<FILL_ME>)
require(probability > 0, "Invalid probability");
require(probability >= lastProbability, "Descending probability");
probabilityTotal += probability;
lastProbability = probability;
}
require(probabilityTotal == 1000000, "Invalid probability total");
//Push AttributeProbability to storage
for (uint256 j=0; j < row.length; j+=2) {
_mappings.attributeProbabilities[projectId][categoryId].push(AttributeProbability(row[j], row[j+1]));
}
}
}
}
| bytes(_contracts.words.word(attributeId)).length>0,"Invalid attribute" | 365,035 | bytes(_contracts.words.word(attributeId)).length>0 |
"Purchase would exceed max supply of monster" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
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);
}
pragma solidity ^0.7.0;
/**
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract monster is ERC721, Ownable {
using SafeMath for uint256;
string public LASD_PROVENANCE = "";
uint256 public startingIndexBlock;
uint256 public startingIndex;
uint256 public monsterPrice = 200000000000000000000; //the minimum amount of saletoken required to buy MonstaNFTs
uint256 public MAX_monster;
bool public saleIsActive = false;
bool public whiteListIsActive = false;
IERC20 public saletoken;
bytes32 treeRoot;
address walletToRecieveToken=0x000000000000000000000000000000000000dEaD;
uint256 public REVEAL_TIMESTAMP;
event minted(address indexed to, uint256 indexed tokenId, string message);
constructor(string memory name, string memory symbol, uint256 maxNftSupply, uint256 saleStart) ERC721(name, symbol) {
}
function withdrawToken() public onlyOwner {
}
function setPurchaseToken(IERC20 token) public onlyOwner {
}
function setNFTprice(uint newPrice) public onlyOwner {
}
function setWalletToRecieveToken(address deadwallet) public onlyOwner {
}
/**
* Set monster aside
*/
function reservemonster(uint256 _count) public onlyOwner {
}
function setRevealTimestamp(uint256 revealTimeStamp) public onlyOwner {
}
/*
* Set provenance once it's calculated
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
// Merkle Verification
function setRoot(bytes32 newRoot) public onlyOwner {
}
function verify(
bytes32 root,
bytes32 leaf,
bytes32[] memory proof
)
public
pure
returns (bool)
{
}
function claim(bytes32 leaf,bytes32[] memory proof) public view returns (bool){
}
/**
* Mints monster
*/
function mintmonster( string calldata message) public {
require(saleIsActive, "Sale must be active to mint monster");
require(<FILL_ME>)
require(saletoken.allowance(msg.sender, address(this)) >= monsterPrice, "This contract is not approved to spend your token" );
saletoken.approve(walletToRecieveToken, monsterPrice);
saletoken.transferFrom(msg.sender, walletToRecieveToken, monsterPrice);
uint mintIndex = totalSupply();
if (totalSupply() < MAX_monster) {
super._safeMint(msg.sender, mintIndex+1);
super._setTokenURI(mintIndex+1,message);
emit minted(msg.sender, mintIndex+1, message);
}
// If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after
// the end of pre-sale, set the starting index block
if (startingIndexBlock == 0 && (totalSupply() == MAX_monster || block.timestamp >= REVEAL_TIMESTAMP)) {
startingIndexBlock = block.number;
}
}
function whiteListMintMonster( bytes32 leaf, bytes32[] memory proof, string calldata message) public {
}
function giftmonster(address giftAddress, string calldata message) public onlyOwner {
}
/**
* Set the starting index for the collection
*/
function setStartingIndex() public {
}
/**
* Set the starting index block for the collection, essentially unblocking
* setting starting index
*/
function emergencySetStartingIndexBlock() public onlyOwner {
}
}
| (totalSupply()+1)<=MAX_monster,"Purchase would exceed max supply of monster" | 365,157 | (totalSupply()+1)<=MAX_monster |
"This contract is not approved to spend your token" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
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);
}
pragma solidity ^0.7.0;
/**
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract monster is ERC721, Ownable {
using SafeMath for uint256;
string public LASD_PROVENANCE = "";
uint256 public startingIndexBlock;
uint256 public startingIndex;
uint256 public monsterPrice = 200000000000000000000; //the minimum amount of saletoken required to buy MonstaNFTs
uint256 public MAX_monster;
bool public saleIsActive = false;
bool public whiteListIsActive = false;
IERC20 public saletoken;
bytes32 treeRoot;
address walletToRecieveToken=0x000000000000000000000000000000000000dEaD;
uint256 public REVEAL_TIMESTAMP;
event minted(address indexed to, uint256 indexed tokenId, string message);
constructor(string memory name, string memory symbol, uint256 maxNftSupply, uint256 saleStart) ERC721(name, symbol) {
}
function withdrawToken() public onlyOwner {
}
function setPurchaseToken(IERC20 token) public onlyOwner {
}
function setNFTprice(uint newPrice) public onlyOwner {
}
function setWalletToRecieveToken(address deadwallet) public onlyOwner {
}
/**
* Set monster aside
*/
function reservemonster(uint256 _count) public onlyOwner {
}
function setRevealTimestamp(uint256 revealTimeStamp) public onlyOwner {
}
/*
* Set provenance once it's calculated
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
// Merkle Verification
function setRoot(bytes32 newRoot) public onlyOwner {
}
function verify(
bytes32 root,
bytes32 leaf,
bytes32[] memory proof
)
public
pure
returns (bool)
{
}
function claim(bytes32 leaf,bytes32[] memory proof) public view returns (bool){
}
/**
* Mints monster
*/
function mintmonster( string calldata message) public {
require(saleIsActive, "Sale must be active to mint monster");
require((totalSupply()+1) <= MAX_monster, "Purchase would exceed max supply of monster");
require(<FILL_ME>)
saletoken.approve(walletToRecieveToken, monsterPrice);
saletoken.transferFrom(msg.sender, walletToRecieveToken, monsterPrice);
uint mintIndex = totalSupply();
if (totalSupply() < MAX_monster) {
super._safeMint(msg.sender, mintIndex+1);
super._setTokenURI(mintIndex+1,message);
emit minted(msg.sender, mintIndex+1, message);
}
// If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after
// the end of pre-sale, set the starting index block
if (startingIndexBlock == 0 && (totalSupply() == MAX_monster || block.timestamp >= REVEAL_TIMESTAMP)) {
startingIndexBlock = block.number;
}
}
function whiteListMintMonster( bytes32 leaf, bytes32[] memory proof, string calldata message) public {
}
function giftmonster(address giftAddress, string calldata message) public onlyOwner {
}
/**
* Set the starting index for the collection
*/
function setStartingIndex() public {
}
/**
* Set the starting index block for the collection, essentially unblocking
* setting starting index
*/
function emergencySetStartingIndexBlock() public onlyOwner {
}
}
| saletoken.allowance(msg.sender,address(this))>=monsterPrice,"This contract is not approved to spend your token" | 365,157 | saletoken.allowance(msg.sender,address(this))>=monsterPrice |
"Presale must be active to mint monster" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
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);
}
pragma solidity ^0.7.0;
/**
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract monster is ERC721, Ownable {
using SafeMath for uint256;
string public LASD_PROVENANCE = "";
uint256 public startingIndexBlock;
uint256 public startingIndex;
uint256 public monsterPrice = 200000000000000000000; //the minimum amount of saletoken required to buy MonstaNFTs
uint256 public MAX_monster;
bool public saleIsActive = false;
bool public whiteListIsActive = false;
IERC20 public saletoken;
bytes32 treeRoot;
address walletToRecieveToken=0x000000000000000000000000000000000000dEaD;
uint256 public REVEAL_TIMESTAMP;
event minted(address indexed to, uint256 indexed tokenId, string message);
constructor(string memory name, string memory symbol, uint256 maxNftSupply, uint256 saleStart) ERC721(name, symbol) {
}
function withdrawToken() public onlyOwner {
}
function setPurchaseToken(IERC20 token) public onlyOwner {
}
function setNFTprice(uint newPrice) public onlyOwner {
}
function setWalletToRecieveToken(address deadwallet) public onlyOwner {
}
/**
* Set monster aside
*/
function reservemonster(uint256 _count) public onlyOwner {
}
function setRevealTimestamp(uint256 revealTimeStamp) public onlyOwner {
}
/*
* Set provenance once it's calculated
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
// Merkle Verification
function setRoot(bytes32 newRoot) public onlyOwner {
}
function verify(
bytes32 root,
bytes32 leaf,
bytes32[] memory proof
)
public
pure
returns (bool)
{
}
function claim(bytes32 leaf,bytes32[] memory proof) public view returns (bool){
}
/**
* Mints monster
*/
function mintmonster( string calldata message) public {
}
function whiteListMintMonster( bytes32 leaf, bytes32[] memory proof, string calldata message) public {
require(whiteListIsActive, "Presale must be active to mint monster");
require(<FILL_ME>)
require((totalSupply()+1) <= MAX_monster, "Purchase would exceed max supply of monster");
require(saletoken.allowance(msg.sender, address(this)) >= monsterPrice, "This contract is not approved to spend your token" );
saletoken.approve(walletToRecieveToken, monsterPrice);
saletoken.transferFrom(msg.sender, walletToRecieveToken, monsterPrice);
uint mintIndex = totalSupply();
if (totalSupply() < MAX_monster) {
super._safeMint(msg.sender, mintIndex+1);
super._setTokenURI(mintIndex+1,message);
emit minted(msg.sender, mintIndex+1, message);
}
// If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after
// the end of pre-sale, set the starting index block
if (startingIndexBlock == 0 && (totalSupply() == MAX_monster || block.timestamp >= REVEAL_TIMESTAMP)) {
startingIndexBlock = block.number;
}
}
function giftmonster(address giftAddress, string calldata message) public onlyOwner {
}
/**
* Set the starting index for the collection
*/
function setStartingIndex() public {
}
/**
* Set the starting index block for the collection, essentially unblocking
* setting starting index
*/
function emergencySetStartingIndexBlock() public onlyOwner {
}
}
| claim(leaf,proof),"Presale must be active to mint monster" | 365,157 | claim(leaf,proof) |
"only owners approved" | pragma solidity ^0.8.10;
import "OwnableUpgradeable.sol";
import "PausableUpgradeable.sol";
import "ReentrancyGuardUpgradeable.sol";
import "IERC721ReceiverUpgradeable.sol";
import "ECDSAUpgradeable.sol";
import "EnumerableSetUpgradeable.sol";
import "Strings.sol";
import "IChubbyKaijuDAOStakingV1.sol";
import "IChubbyKaijuDAOCrunch.sol";
import "IChubbyKaijuDAOGEN1.sol";
/***************************************************************************************************
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------------://:-----------------------------------------------------
------------------------------:/osys+-----smddddo:--------------------------------------------------
-----------------------------ommhysymm+--oMy/:/sNm/-------------------------------------------------
----------------------------oMy/::::/hNy:Nm:::::/mN/------------------------------------------------
----------------------------dM/:::::::oNNMs:::::/+Nm++++/::-----------------------------------------
----------------------------dM/::::::::+NM+::+shdmmmddddmNmdy+:-------------------------------------
----------------------------yM+:::::::::hMoymNdyo+////////+symNho-----------------------------------
----------------------------+My:::::::::dMNho/////////////////+yNNs---------------------------------
-----------------------:+sso+Mm:::::::yNmy+//////////////////////sNNo-------------------------------
----------------------yNdyyhdMMo::::omNs+/////////////////////////+hMh------------------------------
---------------------/Md:::::+Nm::/hMh+/////////////////////////////sNd:----------------------------
---------------------+My::::::yMs/dNs+///////////////////////////////oNd----------------------------
---------------------:Md:::::::dNmNo/////////+++////////////////shmdhosMy---------------------------
----------------------dM+::::::/NMs////////+hmdmdo/////////////yNy-:dNodM/--------------------------
----------------------:Nm/:::::sMy////////+mN:`-Nm+///////////+Mh :MhsMy--------------------------
-----------------------sMm+::::NN+////////sMs sMs///////////oMs -Md+Md--------------------------
----------------------sNdmNo::sMm+////////sMo -Mh///////++oosMm-..sMs/Mm:-------------------------
----------------------mM:/ym+sNmy+////////+Md```+My///+oydmmmmmddmmmNMhshNm+------------------------
----------------------oMy:::hMh+///////////yMddmNN++sdmmdys+///////shhhNmhmM/-----------------------
-----------------------yMh:yMy////////////+mNyo+++smNhoodhh+///////shy/+smMMh-----/+osoo+:----------
------------------------oNmMN//////////////++////hMy+///+Mh////////dM+///+hMy---odMmdhhdmNNdo-------
-------------------------:hMd/////////////////sd+++/////+dy////////os/////+NN-/m++Mh+/oo+/oymNs-----
---------------------------Mm///////////++///+NMy/////////////////////////+NN-+m-hMsoo/ooo++ohMy----
---------------------------yMy//////////////smNdMms+/////////+ossyso+////odMosdddNhoooooooosyyNM:---
----------------------------hMy+///////+s+//yy++NMmNdhyssyhdNNNmmmmNNdhhmmh+yhyMmddhhhhhymNdddmNd+--
------------------------:::--sNms+//////+///++//sMd+oyhhhyssdMmhhhhdMmhMd/odMNMNmdmhhddhMNs+//+oyNh:
----------------------+dddddh+oMNs//////////++///sNd+:::::::/dMdhhdNNooMy/MNyyyhhhhdddmMNmmmmdo//sMh
---------------------oNh+//+hMNdo/////////////////omNy+::::::+MNhmMmo/hM+-hMmddhhds/:/NNo++oos+///dM
--------------------:Nm::::+mNs+///////////////////+sdmdyo+++oMMNmy++yMMs-/MmhhdddmmdhMNhhyso+////hM
----------------::::oMs:::sNd+////////////////////////oshdmmmmdyo++odNhyNd/mmddhyyyyhmMdyyhmms////dM
--------------/hmmmdmMo::hMh+////++osssso++///////////////++++++oydNdo//omN+/+oyhdmNNNMy////+////+NN
-------------/Nm+::/sMh:hMy///+sdmNmdddmNmds+////////////oddddmNmhyo/////+dNo-----/MmodNhs+//////sMs
-------------dM/:::::ssdMs//+yNNho+o++oooshNNy+//////////+ssso++//////////+dM+---+mNo//shmm+////oNm-
-------------Mm:::::::hMy//+dMh/+ooo/oo/+ooohMd+////////+++////////////////+mN/yNNy+//////////+yNm:-
-------------NN::::::sMh///dMyo+oooooooooooooyMd//+shmmmdddmmdho////////////oMMms//////////+dNNh+---
-------------hM+::::+Mm+//+MmooooooooooooosyhhmMmhNhs/::---::/sdNh+////+yo//+MN+////////////dM+-----
-------------/Mh::::dMo///+MNyyyyyyhhhhhddhdmddmMd::-----------:/hNy+//+Mm//yMs////////////oMd------
--------------hM+::oMh////+MNhdhhdddmddmmmNNddddMN:---------------+mmo//dMo/+o+////////////dM+------
------------:ohMm::mM+//+hNMNmmNNmdddhhyhdhhhddhNM/----------------:dNo/sMy///////////////oMd-------
-----------+NmsyMs+Md///hMymMmMNNmooo//hmddddddmMh------------------:mm++Mm///////////////dM/-------
-----------dM/::hhyMs///dMoyMNs+hMNddmNNdddhssshMy-------------------+My/mM+/////////////sMh--------
-----------dM/::::mM+///sMhyMh/oNmo//oMNmmmmmmmmy:--------------------mN/hMs////////////+NN:--------
-----------sMs::::NN////+dMNM+/mMo///+NNy+/oNN/:----------------------sMoyMy///////////+dN+---------
------------mN/::/Mm/////+yMN+oMd///+mNo///+NN------------------------+MsoMh//////////omN+----------
------------/Nd/:/Md/////+hMNddMm+/+dMs///+hMs------------------------/My+Md////////+yNm/-----------
-------------+Md//Mm////+mNsosyyNNhmMMs++odMs-------------------------:Mh+MNhso++oydNdo-------------
--------------+Nm/NN///+mMo/////+ossodNNNmy/--------------------------:Mh/MNsdmmmdyo:---------------
***************************************************************************************************/
contract ChubbyKaijuDAOStakingV1 is IChubbyKaijuDAOStakingV1, OwnableUpgradeable, IERC721ReceiverUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable {
using ECDSAUpgradeable for bytes32;
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet;
using Strings for uint128;
uint32 public totalPowerStaked; // trait 0
uint32 public totalMoneyStaked; // trait 1
uint32 public totalMusicStaked; // trait 2
uint48 public lastClaimTimestamp;
uint48 public constant MINIMUM_TO_EXIT = 1 days;
uint128 public constant MAXIMUM_CRUNCH = 18000000 ether;
uint128 public totalCrunchEarned;
uint128 public constant CRUNCH_EARNING_RATE = 115740; //74074074; // 1 crunch per day;
uint128 public constant TIME_BASE_RATE = 100000000;
struct TimeStake { uint16 tokenId; uint48 time; address owner; uint16 trait; uint16 reward_type;}
event TokenStaked(string kind, uint16 tokenId, address owner);
event TokenUnstaked(string kind, uint16 tokenId, address owner, uint128 earnings);
IChubbyKaijuDAOGEN1 private chubbykaijuGen1;
IChubbyKaijuDAOCrunch private chubbykaijuDAOCrunch;
TimeStake[] public gen1StakeByToken;
mapping(uint16 => uint16) public gen1Hierarchy;
mapping(address => EnumerableSetUpgradeable.UintSet) private _gen1StakedTokens;
address private common_address;
address private uncommon_address;
address private rare_address;
address private epic_address;
address private sos_address;
address private one_address;
struct rewardTypeStaked{
uint32 common_gen1; // reward_type: 0 -> 1*1*(1+Time weight)
uint32 uncommon_gen1; // reward_type: 1 -> 1*1*(1+Time weight)
uint32 rare_gen1; // reward_type: 2 -> 2*1*(1+Time weight)
uint32 epic_gen1; // reward_type: 3 -> -> 3*1*(1+Time weight)
uint32 sos_gen1; // reward_type: 4 -> 5*1*(1+Time weight)
uint32 one_gen1; // reward_type: 5 -> 15*1*(1+Time weight)
}
rewardTypeStaked private rewardtypeStaked;
function initialize() public initializer {
}
function setSigners(address[] calldata signers) public onlyOwner{
}
function stakeTokens(address account, uint16[] calldata tokenIds, bytes[] memory signatures) external whenNotPaused nonReentrant _updateEarnings {
require(<FILL_ME>)
for (uint16 i = 0; i < tokenIds.length; i++) {
require(chubbykaijuGen1.ownerOf(tokenIds[i]) == msg.sender, "only owners approved");
uint16 trait = tokenIds[i]>9913? 2:chubbykaijuGen1.traits(tokenIds[i]); // hard-code music country for the mislead traits variable (from 9914 to 9999)
_stakeGEN1(account, tokenIds[i], trait, signatures[i]);
chubbykaijuGen1.transferFrom(msg.sender, address(this), tokenIds[i]);
}
}
function _stakeGEN1(address account, uint16 tokenId, uint16 trait, bytes memory signature) internal {
}
function claimRewardsAndUnstake(uint16[] calldata tokenIds, bool unstake) external whenNotPaused nonReentrant _updateEarnings {
}
function _claimGEN1(uint16 tokenId, bool unstake, uint48 time) internal returns (uint128 reward) {
}
function _calculateGEN1Rewards(uint16 tokenId) internal view returns (uint128 reward) {
}
function calculateGEN1Rewards(uint16 tokenId) external view returns (uint128) {
}
modifier _updateEarnings() {
}
function GEN1depositsOf(address account) external view returns (uint16[] memory) {
}
function togglePaused() external onlyOwner {
}
function setGEN1Contract(address _address) external onlyOwner {
}
function setCrunchContract(address _address) external onlyOwner {
}
function getEthSignedMessageHash(bytes32 _messageHash) public pure returns (bytes32) {
}
function rarityCheck(uint16 tokenId, bytes memory signature) public view returns (address) {
}
function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) private pure returns (address) {
}
function splitSignature(bytes memory sig) private pure returns (bytes32 r, bytes32 s, uint8 v) {
}
function onERC721Received(address, address from, uint256, bytes calldata) external pure override returns (bytes4) {
}
}
| (account==msg.sender),"only owners approved" | 365,272 | (account==msg.sender) |
"only owners approved" | pragma solidity ^0.8.10;
import "OwnableUpgradeable.sol";
import "PausableUpgradeable.sol";
import "ReentrancyGuardUpgradeable.sol";
import "IERC721ReceiverUpgradeable.sol";
import "ECDSAUpgradeable.sol";
import "EnumerableSetUpgradeable.sol";
import "Strings.sol";
import "IChubbyKaijuDAOStakingV1.sol";
import "IChubbyKaijuDAOCrunch.sol";
import "IChubbyKaijuDAOGEN1.sol";
/***************************************************************************************************
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------------://:-----------------------------------------------------
------------------------------:/osys+-----smddddo:--------------------------------------------------
-----------------------------ommhysymm+--oMy/:/sNm/-------------------------------------------------
----------------------------oMy/::::/hNy:Nm:::::/mN/------------------------------------------------
----------------------------dM/:::::::oNNMs:::::/+Nm++++/::-----------------------------------------
----------------------------dM/::::::::+NM+::+shdmmmddddmNmdy+:-------------------------------------
----------------------------yM+:::::::::hMoymNdyo+////////+symNho-----------------------------------
----------------------------+My:::::::::dMNho/////////////////+yNNs---------------------------------
-----------------------:+sso+Mm:::::::yNmy+//////////////////////sNNo-------------------------------
----------------------yNdyyhdMMo::::omNs+/////////////////////////+hMh------------------------------
---------------------/Md:::::+Nm::/hMh+/////////////////////////////sNd:----------------------------
---------------------+My::::::yMs/dNs+///////////////////////////////oNd----------------------------
---------------------:Md:::::::dNmNo/////////+++////////////////shmdhosMy---------------------------
----------------------dM+::::::/NMs////////+hmdmdo/////////////yNy-:dNodM/--------------------------
----------------------:Nm/:::::sMy////////+mN:`-Nm+///////////+Mh :MhsMy--------------------------
-----------------------sMm+::::NN+////////sMs sMs///////////oMs -Md+Md--------------------------
----------------------sNdmNo::sMm+////////sMo -Mh///////++oosMm-..sMs/Mm:-------------------------
----------------------mM:/ym+sNmy+////////+Md```+My///+oydmmmmmddmmmNMhshNm+------------------------
----------------------oMy:::hMh+///////////yMddmNN++sdmmdys+///////shhhNmhmM/-----------------------
-----------------------yMh:yMy////////////+mNyo+++smNhoodhh+///////shy/+smMMh-----/+osoo+:----------
------------------------oNmMN//////////////++////hMy+///+Mh////////dM+///+hMy---odMmdhhdmNNdo-------
-------------------------:hMd/////////////////sd+++/////+dy////////os/////+NN-/m++Mh+/oo+/oymNs-----
---------------------------Mm///////////++///+NMy/////////////////////////+NN-+m-hMsoo/ooo++ohMy----
---------------------------yMy//////////////smNdMms+/////////+ossyso+////odMosdddNhoooooooosyyNM:---
----------------------------hMy+///////+s+//yy++NMmNdhyssyhdNNNmmmmNNdhhmmh+yhyMmddhhhhhymNdddmNd+--
------------------------:::--sNms+//////+///++//sMd+oyhhhyssdMmhhhhdMmhMd/odMNMNmdmhhddhMNs+//+oyNh:
----------------------+dddddh+oMNs//////////++///sNd+:::::::/dMdhhdNNooMy/MNyyyhhhhdddmMNmmmmdo//sMh
---------------------oNh+//+hMNdo/////////////////omNy+::::::+MNhmMmo/hM+-hMmddhhds/:/NNo++oos+///dM
--------------------:Nm::::+mNs+///////////////////+sdmdyo+++oMMNmy++yMMs-/MmhhdddmmdhMNhhyso+////hM
----------------::::oMs:::sNd+////////////////////////oshdmmmmdyo++odNhyNd/mmddhyyyyhmMdyyhmms////dM
--------------/hmmmdmMo::hMh+////++osssso++///////////////++++++oydNdo//omN+/+oyhdmNNNMy////+////+NN
-------------/Nm+::/sMh:hMy///+sdmNmdddmNmds+////////////oddddmNmhyo/////+dNo-----/MmodNhs+//////sMs
-------------dM/:::::ssdMs//+yNNho+o++oooshNNy+//////////+ssso++//////////+dM+---+mNo//shmm+////oNm-
-------------Mm:::::::hMy//+dMh/+ooo/oo/+ooohMd+////////+++////////////////+mN/yNNy+//////////+yNm:-
-------------NN::::::sMh///dMyo+oooooooooooooyMd//+shmmmdddmmdho////////////oMMms//////////+dNNh+---
-------------hM+::::+Mm+//+MmooooooooooooosyhhmMmhNhs/::---::/sdNh+////+yo//+MN+////////////dM+-----
-------------/Mh::::dMo///+MNyyyyyyhhhhhddhdmddmMd::-----------:/hNy+//+Mm//yMs////////////oMd------
--------------hM+::oMh////+MNhdhhdddmddmmmNNddddMN:---------------+mmo//dMo/+o+////////////dM+------
------------:ohMm::mM+//+hNMNmmNNmdddhhyhdhhhddhNM/----------------:dNo/sMy///////////////oMd-------
-----------+NmsyMs+Md///hMymMmMNNmooo//hmddddddmMh------------------:mm++Mm///////////////dM/-------
-----------dM/::hhyMs///dMoyMNs+hMNddmNNdddhssshMy-------------------+My/mM+/////////////sMh--------
-----------dM/::::mM+///sMhyMh/oNmo//oMNmmmmmmmmy:--------------------mN/hMs////////////+NN:--------
-----------sMs::::NN////+dMNM+/mMo///+NNy+/oNN/:----------------------sMoyMy///////////+dN+---------
------------mN/::/Mm/////+yMN+oMd///+mNo///+NN------------------------+MsoMh//////////omN+----------
------------/Nd/:/Md/////+hMNddMm+/+dMs///+hMs------------------------/My+Md////////+yNm/-----------
-------------+Md//Mm////+mNsosyyNNhmMMs++odMs-------------------------:Mh+MNhso++oydNdo-------------
--------------+Nm/NN///+mMo/////+ossodNNNmy/--------------------------:Mh/MNsdmmmdyo:---------------
***************************************************************************************************/
contract ChubbyKaijuDAOStakingV1 is IChubbyKaijuDAOStakingV1, OwnableUpgradeable, IERC721ReceiverUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable {
using ECDSAUpgradeable for bytes32;
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet;
using Strings for uint128;
uint32 public totalPowerStaked; // trait 0
uint32 public totalMoneyStaked; // trait 1
uint32 public totalMusicStaked; // trait 2
uint48 public lastClaimTimestamp;
uint48 public constant MINIMUM_TO_EXIT = 1 days;
uint128 public constant MAXIMUM_CRUNCH = 18000000 ether;
uint128 public totalCrunchEarned;
uint128 public constant CRUNCH_EARNING_RATE = 115740; //74074074; // 1 crunch per day;
uint128 public constant TIME_BASE_RATE = 100000000;
struct TimeStake { uint16 tokenId; uint48 time; address owner; uint16 trait; uint16 reward_type;}
event TokenStaked(string kind, uint16 tokenId, address owner);
event TokenUnstaked(string kind, uint16 tokenId, address owner, uint128 earnings);
IChubbyKaijuDAOGEN1 private chubbykaijuGen1;
IChubbyKaijuDAOCrunch private chubbykaijuDAOCrunch;
TimeStake[] public gen1StakeByToken;
mapping(uint16 => uint16) public gen1Hierarchy;
mapping(address => EnumerableSetUpgradeable.UintSet) private _gen1StakedTokens;
address private common_address;
address private uncommon_address;
address private rare_address;
address private epic_address;
address private sos_address;
address private one_address;
struct rewardTypeStaked{
uint32 common_gen1; // reward_type: 0 -> 1*1*(1+Time weight)
uint32 uncommon_gen1; // reward_type: 1 -> 1*1*(1+Time weight)
uint32 rare_gen1; // reward_type: 2 -> 2*1*(1+Time weight)
uint32 epic_gen1; // reward_type: 3 -> -> 3*1*(1+Time weight)
uint32 sos_gen1; // reward_type: 4 -> 5*1*(1+Time weight)
uint32 one_gen1; // reward_type: 5 -> 15*1*(1+Time weight)
}
rewardTypeStaked private rewardtypeStaked;
function initialize() public initializer {
}
function setSigners(address[] calldata signers) public onlyOwner{
}
function stakeTokens(address account, uint16[] calldata tokenIds, bytes[] memory signatures) external whenNotPaused nonReentrant _updateEarnings {
require((account == msg.sender), "only owners approved");
for (uint16 i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
uint16 trait = tokenIds[i]>9913? 2:chubbykaijuGen1.traits(tokenIds[i]); // hard-code music country for the mislead traits variable (from 9914 to 9999)
_stakeGEN1(account, tokenIds[i], trait, signatures[i]);
chubbykaijuGen1.transferFrom(msg.sender, address(this), tokenIds[i]);
}
}
function _stakeGEN1(address account, uint16 tokenId, uint16 trait, bytes memory signature) internal {
}
function claimRewardsAndUnstake(uint16[] calldata tokenIds, bool unstake) external whenNotPaused nonReentrant _updateEarnings {
}
function _claimGEN1(uint16 tokenId, bool unstake, uint48 time) internal returns (uint128 reward) {
}
function _calculateGEN1Rewards(uint16 tokenId) internal view returns (uint128 reward) {
}
function calculateGEN1Rewards(uint16 tokenId) external view returns (uint128) {
}
modifier _updateEarnings() {
}
function GEN1depositsOf(address account) external view returns (uint16[] memory) {
}
function togglePaused() external onlyOwner {
}
function setGEN1Contract(address _address) external onlyOwner {
}
function setCrunchContract(address _address) external onlyOwner {
}
function getEthSignedMessageHash(bytes32 _messageHash) public pure returns (bytes32) {
}
function rarityCheck(uint16 tokenId, bytes memory signature) public view returns (address) {
}
function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) private pure returns (address) {
}
function splitSignature(bytes memory sig) private pure returns (bytes32 r, bytes32 s, uint8 v) {
}
function onERC721Received(address, address from, uint256, bytes calldata) external pure override returns (bytes4) {
}
}
| chubbykaijuGen1.ownerOf(tokenIds[i])==msg.sender,"only owners approved" | 365,272 | chubbykaijuGen1.ownerOf(tokenIds[i])==msg.sender |
"need 1 day to unstake" | pragma solidity ^0.8.10;
import "OwnableUpgradeable.sol";
import "PausableUpgradeable.sol";
import "ReentrancyGuardUpgradeable.sol";
import "IERC721ReceiverUpgradeable.sol";
import "ECDSAUpgradeable.sol";
import "EnumerableSetUpgradeable.sol";
import "Strings.sol";
import "IChubbyKaijuDAOStakingV1.sol";
import "IChubbyKaijuDAOCrunch.sol";
import "IChubbyKaijuDAOGEN1.sol";
/***************************************************************************************************
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------------://:-----------------------------------------------------
------------------------------:/osys+-----smddddo:--------------------------------------------------
-----------------------------ommhysymm+--oMy/:/sNm/-------------------------------------------------
----------------------------oMy/::::/hNy:Nm:::::/mN/------------------------------------------------
----------------------------dM/:::::::oNNMs:::::/+Nm++++/::-----------------------------------------
----------------------------dM/::::::::+NM+::+shdmmmddddmNmdy+:-------------------------------------
----------------------------yM+:::::::::hMoymNdyo+////////+symNho-----------------------------------
----------------------------+My:::::::::dMNho/////////////////+yNNs---------------------------------
-----------------------:+sso+Mm:::::::yNmy+//////////////////////sNNo-------------------------------
----------------------yNdyyhdMMo::::omNs+/////////////////////////+hMh------------------------------
---------------------/Md:::::+Nm::/hMh+/////////////////////////////sNd:----------------------------
---------------------+My::::::yMs/dNs+///////////////////////////////oNd----------------------------
---------------------:Md:::::::dNmNo/////////+++////////////////shmdhosMy---------------------------
----------------------dM+::::::/NMs////////+hmdmdo/////////////yNy-:dNodM/--------------------------
----------------------:Nm/:::::sMy////////+mN:`-Nm+///////////+Mh :MhsMy--------------------------
-----------------------sMm+::::NN+////////sMs sMs///////////oMs -Md+Md--------------------------
----------------------sNdmNo::sMm+////////sMo -Mh///////++oosMm-..sMs/Mm:-------------------------
----------------------mM:/ym+sNmy+////////+Md```+My///+oydmmmmmddmmmNMhshNm+------------------------
----------------------oMy:::hMh+///////////yMddmNN++sdmmdys+///////shhhNmhmM/-----------------------
-----------------------yMh:yMy////////////+mNyo+++smNhoodhh+///////shy/+smMMh-----/+osoo+:----------
------------------------oNmMN//////////////++////hMy+///+Mh////////dM+///+hMy---odMmdhhdmNNdo-------
-------------------------:hMd/////////////////sd+++/////+dy////////os/////+NN-/m++Mh+/oo+/oymNs-----
---------------------------Mm///////////++///+NMy/////////////////////////+NN-+m-hMsoo/ooo++ohMy----
---------------------------yMy//////////////smNdMms+/////////+ossyso+////odMosdddNhoooooooosyyNM:---
----------------------------hMy+///////+s+//yy++NMmNdhyssyhdNNNmmmmNNdhhmmh+yhyMmddhhhhhymNdddmNd+--
------------------------:::--sNms+//////+///++//sMd+oyhhhyssdMmhhhhdMmhMd/odMNMNmdmhhddhMNs+//+oyNh:
----------------------+dddddh+oMNs//////////++///sNd+:::::::/dMdhhdNNooMy/MNyyyhhhhdddmMNmmmmdo//sMh
---------------------oNh+//+hMNdo/////////////////omNy+::::::+MNhmMmo/hM+-hMmddhhds/:/NNo++oos+///dM
--------------------:Nm::::+mNs+///////////////////+sdmdyo+++oMMNmy++yMMs-/MmhhdddmmdhMNhhyso+////hM
----------------::::oMs:::sNd+////////////////////////oshdmmmmdyo++odNhyNd/mmddhyyyyhmMdyyhmms////dM
--------------/hmmmdmMo::hMh+////++osssso++///////////////++++++oydNdo//omN+/+oyhdmNNNMy////+////+NN
-------------/Nm+::/sMh:hMy///+sdmNmdddmNmds+////////////oddddmNmhyo/////+dNo-----/MmodNhs+//////sMs
-------------dM/:::::ssdMs//+yNNho+o++oooshNNy+//////////+ssso++//////////+dM+---+mNo//shmm+////oNm-
-------------Mm:::::::hMy//+dMh/+ooo/oo/+ooohMd+////////+++////////////////+mN/yNNy+//////////+yNm:-
-------------NN::::::sMh///dMyo+oooooooooooooyMd//+shmmmdddmmdho////////////oMMms//////////+dNNh+---
-------------hM+::::+Mm+//+MmooooooooooooosyhhmMmhNhs/::---::/sdNh+////+yo//+MN+////////////dM+-----
-------------/Mh::::dMo///+MNyyyyyyhhhhhddhdmddmMd::-----------:/hNy+//+Mm//yMs////////////oMd------
--------------hM+::oMh////+MNhdhhdddmddmmmNNddddMN:---------------+mmo//dMo/+o+////////////dM+------
------------:ohMm::mM+//+hNMNmmNNmdddhhyhdhhhddhNM/----------------:dNo/sMy///////////////oMd-------
-----------+NmsyMs+Md///hMymMmMNNmooo//hmddddddmMh------------------:mm++Mm///////////////dM/-------
-----------dM/::hhyMs///dMoyMNs+hMNddmNNdddhssshMy-------------------+My/mM+/////////////sMh--------
-----------dM/::::mM+///sMhyMh/oNmo//oMNmmmmmmmmy:--------------------mN/hMs////////////+NN:--------
-----------sMs::::NN////+dMNM+/mMo///+NNy+/oNN/:----------------------sMoyMy///////////+dN+---------
------------mN/::/Mm/////+yMN+oMd///+mNo///+NN------------------------+MsoMh//////////omN+----------
------------/Nd/:/Md/////+hMNddMm+/+dMs///+hMs------------------------/My+Md////////+yNm/-----------
-------------+Md//Mm////+mNsosyyNNhmMMs++odMs-------------------------:Mh+MNhso++oydNdo-------------
--------------+Nm/NN///+mMo/////+ossodNNNmy/--------------------------:Mh/MNsdmmmdyo:---------------
***************************************************************************************************/
contract ChubbyKaijuDAOStakingV1 is IChubbyKaijuDAOStakingV1, OwnableUpgradeable, IERC721ReceiverUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable {
using ECDSAUpgradeable for bytes32;
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet;
using Strings for uint128;
uint32 public totalPowerStaked; // trait 0
uint32 public totalMoneyStaked; // trait 1
uint32 public totalMusicStaked; // trait 2
uint48 public lastClaimTimestamp;
uint48 public constant MINIMUM_TO_EXIT = 1 days;
uint128 public constant MAXIMUM_CRUNCH = 18000000 ether;
uint128 public totalCrunchEarned;
uint128 public constant CRUNCH_EARNING_RATE = 115740; //74074074; // 1 crunch per day;
uint128 public constant TIME_BASE_RATE = 100000000;
struct TimeStake { uint16 tokenId; uint48 time; address owner; uint16 trait; uint16 reward_type;}
event TokenStaked(string kind, uint16 tokenId, address owner);
event TokenUnstaked(string kind, uint16 tokenId, address owner, uint128 earnings);
IChubbyKaijuDAOGEN1 private chubbykaijuGen1;
IChubbyKaijuDAOCrunch private chubbykaijuDAOCrunch;
TimeStake[] public gen1StakeByToken;
mapping(uint16 => uint16) public gen1Hierarchy;
mapping(address => EnumerableSetUpgradeable.UintSet) private _gen1StakedTokens;
address private common_address;
address private uncommon_address;
address private rare_address;
address private epic_address;
address private sos_address;
address private one_address;
struct rewardTypeStaked{
uint32 common_gen1; // reward_type: 0 -> 1*1*(1+Time weight)
uint32 uncommon_gen1; // reward_type: 1 -> 1*1*(1+Time weight)
uint32 rare_gen1; // reward_type: 2 -> 2*1*(1+Time weight)
uint32 epic_gen1; // reward_type: 3 -> -> 3*1*(1+Time weight)
uint32 sos_gen1; // reward_type: 4 -> 5*1*(1+Time weight)
uint32 one_gen1; // reward_type: 5 -> 15*1*(1+Time weight)
}
rewardTypeStaked private rewardtypeStaked;
function initialize() public initializer {
}
function setSigners(address[] calldata signers) public onlyOwner{
}
function stakeTokens(address account, uint16[] calldata tokenIds, bytes[] memory signatures) external whenNotPaused nonReentrant _updateEarnings {
}
function _stakeGEN1(address account, uint16 tokenId, uint16 trait, bytes memory signature) internal {
}
function claimRewardsAndUnstake(uint16[] calldata tokenIds, bool unstake) external whenNotPaused nonReentrant _updateEarnings {
}
function _claimGEN1(uint16 tokenId, bool unstake, uint48 time) internal returns (uint128 reward) {
TimeStake memory stake = gen1StakeByToken[gen1Hierarchy[tokenId]];
uint16 trait = stake.trait;
uint16 reward_type = stake.reward_type;
require(stake.owner == msg.sender, "only owners can unstake");
require(<FILL_ME>)
reward = _calculateGEN1Rewards(tokenId);
if (unstake) {
TimeStake memory lastStake = gen1StakeByToken[gen1StakeByToken.length - 1];
gen1StakeByToken[gen1Hierarchy[tokenId]] = lastStake;
gen1Hierarchy[lastStake.tokenId] = gen1Hierarchy[tokenId];
gen1StakeByToken.pop();
delete gen1Hierarchy[tokenId];
if(trait == 0){
totalPowerStaked -= 1;
}else if(trait == 1){
totalMoneyStaked -= 1;
}else if(trait == 2){
totalMusicStaked -= 1;
}
if(reward_type == 0){
rewardtypeStaked.common_gen1 -=1;
}else if(reward_type == 1){
rewardtypeStaked.uncommon_gen1 -= 1;
}else if(reward_type == 2){
rewardtypeStaked.rare_gen1 -= 1;
}else if(reward_type == 3){
rewardtypeStaked.epic_gen1 -= 1;
}else if(reward_type == 4){
rewardtypeStaked.sos_gen1 -= 1;
}else if(reward_type == 5){
rewardtypeStaked.one_gen1 -= 1;
}
_gen1StakedTokens[stake.owner].remove(tokenId);
chubbykaijuGen1.transferFrom(address(this), msg.sender, tokenId);
emit TokenUnstaked("CHUBBYKAIJUGEN1", tokenId, stake.owner, reward);
}
else {
gen1StakeByToken[gen1Hierarchy[tokenId]] = TimeStake({
owner: msg.sender,
tokenId: tokenId,
time: time,
trait: trait,
reward_type: reward_type
});
}
}
function _calculateGEN1Rewards(uint16 tokenId) internal view returns (uint128 reward) {
}
function calculateGEN1Rewards(uint16 tokenId) external view returns (uint128) {
}
modifier _updateEarnings() {
}
function GEN1depositsOf(address account) external view returns (uint16[] memory) {
}
function togglePaused() external onlyOwner {
}
function setGEN1Contract(address _address) external onlyOwner {
}
function setCrunchContract(address _address) external onlyOwner {
}
function getEthSignedMessageHash(bytes32 _messageHash) public pure returns (bytes32) {
}
function rarityCheck(uint16 tokenId, bytes memory signature) public view returns (address) {
}
function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) private pure returns (address) {
}
function splitSignature(bytes memory sig) private pure returns (bytes32 r, bytes32 s, uint8 v) {
}
function onERC721Received(address, address from, uint256, bytes calldata) external pure override returns (bytes4) {
}
}
| !(unstake&&block.timestamp-stake.time<MINIMUM_TO_EXIT),"need 1 day to unstake" | 365,272 | !(unstake&&block.timestamp-stake.time<MINIMUM_TO_EXIT) |
"Cannot withdraw before unlocking period pass if competition still active" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./EquinoxINJ.sol";
import "./peggy/IPeggy.sol";
contract DepositManager is ReentrancyGuard, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
IERC20 public equinoxINJ;
IERC20 public realINJ;
IPeggy public peggy;
uint256 public constant lockingPeriod = 21 days;
mapping(address => uint256) public depositBalance;
mapping(address => uint256) public depositUnlockTimestamp;
bool public competitionEnded;
event Withdrawal(address indexed staker, uint256 withdrawalAmount, uint256 withdrawalTimestamp);
event Deposit(
address indexed staker,
address indexed destination,
uint256 depositAmount,
uint256 depositUnlockTimestamp,
uint256 depositTimestamp
);
modifier onlyValidWithdrawal(uint256 withdrawalAmount) {
require(withdrawalAmount > 0, "Cannot withdraw amount of 0");
require(<FILL_ME>)
_;
}
constructor(
IPeggy peggy_,
IERC20 realINJ_,
IERC20 equinoxINJ_
) public {
}
function deposit(uint256 amount) external nonReentrant {
}
function depositFor(uint256 amount, address destination) public nonReentrant {
}
function withdraw(uint256 withdrawalAmount) external nonReentrant onlyValidWithdrawal(withdrawalAmount) {
}
function withdrawAll() external nonReentrant onlyValidWithdrawal(depositBalance[msg.sender]) {
}
function endCompetition() external onlyOwner {
}
function updatePeggy(IPeggy peggy_) external onlyOwner {
}
function _depositFor(uint256 amount, address destination) internal {
}
}
| depositUnlockTimestamp[msg.sender]<=block.timestamp||competitionEnded,"Cannot withdraw before unlocking period pass if competition still active" | 365,285 | depositUnlockTimestamp[msg.sender]<=block.timestamp||competitionEnded |
"Cannot deposit on inactive competition" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./EquinoxINJ.sol";
import "./peggy/IPeggy.sol";
contract DepositManager is ReentrancyGuard, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
IERC20 public equinoxINJ;
IERC20 public realINJ;
IPeggy public peggy;
uint256 public constant lockingPeriod = 21 days;
mapping(address => uint256) public depositBalance;
mapping(address => uint256) public depositUnlockTimestamp;
bool public competitionEnded;
event Withdrawal(address indexed staker, uint256 withdrawalAmount, uint256 withdrawalTimestamp);
event Deposit(
address indexed staker,
address indexed destination,
uint256 depositAmount,
uint256 depositUnlockTimestamp,
uint256 depositTimestamp
);
modifier onlyValidWithdrawal(uint256 withdrawalAmount) {
}
constructor(
IPeggy peggy_,
IERC20 realINJ_,
IERC20 equinoxINJ_
) public {
}
function deposit(uint256 amount) external nonReentrant {
}
function depositFor(uint256 amount, address destination) public nonReentrant {
}
function withdraw(uint256 withdrawalAmount) external nonReentrant onlyValidWithdrawal(withdrawalAmount) {
}
function withdrawAll() external nonReentrant onlyValidWithdrawal(depositBalance[msg.sender]) {
}
function endCompetition() external onlyOwner {
}
function updatePeggy(IPeggy peggy_) external onlyOwner {
}
function _depositFor(uint256 amount, address destination) internal {
require(amount > 0, "Cannot deposit amount of 0");
require(<FILL_ME>)
realINJ.safeTransferFrom(msg.sender, address(this), amount);
peggy.sendToCosmos(address(equinoxINJ), destination, amount);
depositBalance[msg.sender] = depositBalance[msg.sender].add(amount);
depositUnlockTimestamp[msg.sender] = block.timestamp.add(lockingPeriod);
emit Deposit(msg.sender, destination, amount, depositUnlockTimestamp[msg.sender], block.timestamp);
}
}
| !competitionEnded,"Cannot deposit on inactive competition" | 365,285 | !competitionEnded |
"Purchase would exceed max supply of Bananas" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
// Following the recent worldwide pandemic, emerging reports suggest that several banana species have begun exhibiting strange characteristics. Our research team located across the globe has commenced efforts to study and document these unusual phenomena.
// Concerned about parties trying to suppress our research, the team has opted to store our findings on the blockchain to prevent interference. Although this is a costly endeavour, our mission has never been clearer.
// The fate of the world's bananas depends on it.
// from our website (https://boringbananas.co)
// BoringBananasCo is a community-centered enterprise focussed on preserving our research about the emerging reports that several banana species have begun exhibiting strange characteristics following the recent worldwide pandemic.
// Our research team located across the globe has commenced efforts to study and document these unusual phenomena.
// Concerned about parties trying to suppress our research, the team has opted to store our findings on the blockchain to prevent interference.
// Although this is a costly endeavour, our mission has never been clearer.
// The fate of the world's bananas depends on it.
// BANANA RESEARCH TEAM:
// VEE - @thedigitalvee
// MJDATA - @ChampagneMan
// MADBOOGIE - @MadBoogieArt
// JUI - @mz09art
// BERK - @berkozdemir
pragma solidity ^0.7.0;
pragma abicoder v2;
contract BoringBananasCo is ERC721, Ownable {
using SafeMath for uint256;
string public BANANA_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN BANANAS ARE ALL SOLD OUT
string public LICENSE_TEXT = ""; // IT IS WHAT IT SAYS
bool licenseLocked = false; // TEAM CAN'T EDIT THE LICENSE AFTER THIS GETS TRUE
uint256 public constant bananaPrice = 25000000000000000; // 0.025 ETH
uint public constant maxBananaPurchase = 20;
uint256 public constant MAX_BANANAS = 8888;
bool public saleIsActive = false;
mapping(uint => string) public bananaNames;
// Reserve 125 Bananas for team - Giveaways/Prizes etc
uint public bananaReserve = 125;
event bananaNameChange(address _by, uint _tokenId, string _name);
event licenseisLocked(string _licenseText);
constructor() ERC721("Boring Bananas Co.", "BBC") { }
function withdraw() public onlyOwner {
}
function reserveBananas(address _to, uint256 _reserveAmount) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory ) {
}
// Returns the license for tokens
function tokenLicense(uint _id) public view returns(string memory) {
}
// Locks the license to prevent further changes
function lockLicense() public onlyOwner {
}
// Change the license
function changeLicense(string memory _license) public onlyOwner {
}
function mintBoringBanana(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint Banana");
require(numberOfTokens > 0 && numberOfTokens <= maxBananaPurchase, "Can only mint 20 tokens at a time");
require(<FILL_ME>)
require(msg.value >= bananaPrice.mul(numberOfTokens), "Ether value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_BANANAS) {
_safeMint(msg.sender, mintIndex);
}
}
}
function changeBananaName(uint _tokenId, string memory _name) public {
}
function viewBananaName(uint _tokenId) public view returns( string memory ){
}
// GET ALL BANANAS OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH
function bananaNamesOfOwner(address _owner) external view returns(string[] memory ) {
}
}
| totalSupply().add(numberOfTokens)<=MAX_BANANAS,"Purchase would exceed max supply of Bananas" | 365,313 | totalSupply().add(numberOfTokens)<=MAX_BANANAS |
"New name is same as the current one" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
// Following the recent worldwide pandemic, emerging reports suggest that several banana species have begun exhibiting strange characteristics. Our research team located across the globe has commenced efforts to study and document these unusual phenomena.
// Concerned about parties trying to suppress our research, the team has opted to store our findings on the blockchain to prevent interference. Although this is a costly endeavour, our mission has never been clearer.
// The fate of the world's bananas depends on it.
// from our website (https://boringbananas.co)
// BoringBananasCo is a community-centered enterprise focussed on preserving our research about the emerging reports that several banana species have begun exhibiting strange characteristics following the recent worldwide pandemic.
// Our research team located across the globe has commenced efforts to study and document these unusual phenomena.
// Concerned about parties trying to suppress our research, the team has opted to store our findings on the blockchain to prevent interference.
// Although this is a costly endeavour, our mission has never been clearer.
// The fate of the world's bananas depends on it.
// BANANA RESEARCH TEAM:
// VEE - @thedigitalvee
// MJDATA - @ChampagneMan
// MADBOOGIE - @MadBoogieArt
// JUI - @mz09art
// BERK - @berkozdemir
pragma solidity ^0.7.0;
pragma abicoder v2;
contract BoringBananasCo is ERC721, Ownable {
using SafeMath for uint256;
string public BANANA_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN BANANAS ARE ALL SOLD OUT
string public LICENSE_TEXT = ""; // IT IS WHAT IT SAYS
bool licenseLocked = false; // TEAM CAN'T EDIT THE LICENSE AFTER THIS GETS TRUE
uint256 public constant bananaPrice = 25000000000000000; // 0.025 ETH
uint public constant maxBananaPurchase = 20;
uint256 public constant MAX_BANANAS = 8888;
bool public saleIsActive = false;
mapping(uint => string) public bananaNames;
// Reserve 125 Bananas for team - Giveaways/Prizes etc
uint public bananaReserve = 125;
event bananaNameChange(address _by, uint _tokenId, string _name);
event licenseisLocked(string _licenseText);
constructor() ERC721("Boring Bananas Co.", "BBC") { }
function withdraw() public onlyOwner {
}
function reserveBananas(address _to, uint256 _reserveAmount) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory ) {
}
// Returns the license for tokens
function tokenLicense(uint _id) public view returns(string memory) {
}
// Locks the license to prevent further changes
function lockLicense() public onlyOwner {
}
// Change the license
function changeLicense(string memory _license) public onlyOwner {
}
function mintBoringBanana(uint numberOfTokens) public payable {
}
function changeBananaName(uint _tokenId, string memory _name) public {
require(ownerOf(_tokenId) == msg.sender, "Hey, your wallet doesn't own this banana!");
require(<FILL_ME>)
bananaNames[_tokenId] = _name;
emit bananaNameChange(msg.sender, _tokenId, _name);
}
function viewBananaName(uint _tokenId) public view returns( string memory ){
}
// GET ALL BANANAS OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH
function bananaNamesOfOwner(address _owner) external view returns(string[] memory ) {
}
}
| sha256(bytes(_name))!=sha256(bytes(bananaNames[_tokenId])),"New name is same as the current one" | 365,313 | sha256(bytes(_name))!=sha256(bytes(bananaNames[_tokenId])) |
"Invalid token." | pragma solidity 0.7.6;
pragma abicoder v2;
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 Returns the remainder of dividing two unsigned integers, throws on overflow.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
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;
}
interface ERC721TokenReceiver {
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
}
interface ChromaInterface {
function toHex(uint256 _id) external view returns (string memory);
}
contract ChromaticCanvas is IERC721 {
using SafeMath for uint256;
bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
mapping(bytes4 => bool) internal supportedInterfaces;
mapping(uint256 => address) public idToOwner;
mapping(uint256 => address) internal idToApproval;
mapping(address => mapping(address => bool)) internal ownerToOperators;
mapping(address => uint256[]) public ownerToIds;
mapping(uint256 => uint256) public idToOwnerIndex;
string internal nftName = "Chromatic Canvas";
string internal nftSymbol = unicode"□";
uint256 public numTokens = 0;
address public chroma;
bool private reentrancyLock = false;
/* Prevent a contract function from being reentrant-called. */
modifier reentrancyGuard() {
}
modifier canTransfer(uint256 _tokenId) {
}
modifier canOperate(uint256 _tokenId) {
}
modifier validNFToken(uint256 _tokenId) {
require(<FILL_ME>)
_;
}
constructor(address payable _adminAddress, address _chroma) {
}
function _addNFToken(address _to, uint256 _tokenId) internal {
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
}
function _getOwnerNFTCount(address _owner) internal view returns (uint256) {
}
function _safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) private canTransfer(_tokenId) validNFToken(_tokenId) {
}
function _clearApproval(uint256 _tokenId) private {
}
//////////////////////////
//// Enumerable ////
//////////////////////////
function totalSupply() public view returns (uint256) {
}
function tokenOfOwnerByIndex(address _owner, uint256 _index)
external
view
returns (uint256)
{
}
//////////////////////////
//// Administration ////
//////////////////////////
address payable public adminAddress;
uint256 public maxHeight = 64;
uint256 public maxWidth = 64;
uint256 public canvasCreationPrice = 0;
modifier onlyAdmin() {
}
function setAdmin(address payable _newAdmin) external onlyAdmin {
}
function setMaxDimensions(uint256 _maxHeight, uint256 _maxWidth)
external
onlyAdmin
{
}
function setCanvasCreationPrice(uint256 _price) external onlyAdmin {
}
//////////////////////////
//// ERC 721 and 165 ////
//////////////////////////
function isContract(address _addr)
internal
view
returns (bool addressCheck)
{
}
function supportsInterface(bytes4 _interfaceID)
external
view
override
returns (bool)
{
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes calldata _data
) external override {
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) external override {
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) external override canTransfer(_tokenId) validNFToken(_tokenId) {
}
function approve(address _approved, uint256 _tokenId)
external
override
canOperate(_tokenId)
validNFToken(_tokenId)
{
}
function setApprovalForAll(address _operator, bool _approved)
external
override
{
}
function balanceOf(address _owner)
external
view
override
returns (uint256)
{
}
function ownerOf(uint256 _tokenId)
external
view
override
returns (address _owner)
{
}
function getApproved(uint256 _tokenId)
external
view
override
validNFToken(_tokenId)
returns (address)
{
}
function isApprovedForAll(address _owner, address _operator)
external
view
override
returns (bool)
{
}
function _transfer(address _to, uint256 _tokenId) internal {
}
//////////////////////////
//// Canvas ////
//////////////////////////
event CanvasCreated(
uint256 indexed canvasId,
uint256 baseChromaId,
uint256 height,
uint256 width,
string name,
string author
);
event BaseChromaChanged(uint256 indexed canvasId, uint256 baseChromaId);
event ChromaAddedToCanvas(uint256 indexed canvasId, uint256 chromaId);
event ChromaRemovedFromCanvas(uint256 indexed canvasId, uint256 chromaId);
event LocationAddedToChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key,
uint256 y,
uint256 x
);
event LocationRemovedFromChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key
);
event CanvasLocked(uint256 indexed canvasId, address owner);
event CanvasUnlocked(uint256 indexed canvasId, address owner);
event CanvasDestroyed(uint256 indexed canvasId, address destroyer);
event CanvasCreationPriceChanged(uint256 newPrice);
event NameChanged(uint256 indexed canvasId, string name);
event AuthorChanged(uint256 indexed canvasId, string author);
uint256 public tokenIndex = 0;
mapping(uint256 => string) public idToName;
mapping(uint256 => string) public idToAuthor;
mapping(uint256 => uint128[2]) public idToDimensions;
mapping(uint256 => uint256[]) public canvasToChroma;
mapping(uint256 => uint256) public chromaToCanvasIndex;
mapping(uint256 => uint256) public chromaToCanvas;
mapping(uint256 => address) public lockedBy;
mapping(uint256 => uint256) public baseChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChromaIndex;
mapping(uint256 => uint256[]) public chromaToLocations;
modifier notLocked(uint256 _canvasId) {
}
modifier onlyCanvasOwner(uint256 _canvasId) {
}
function lockUntilTransfer(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
{
}
function _unlockCanvas(uint256 _canvasId) internal {
}
function changeName(uint256 _canvasId, string calldata _name)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeAuthor(uint256 _canvasId, string calldata _author)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function createCanvas(
uint256 _baseChromaId,
uint128 _height,
uint128 _width,
string calldata _name,
string calldata _author
) external payable reentrancyGuard {
}
function destroyCanvas(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeBaseChroma(uint256 _baseChromaId, uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function addChromaToCanvas(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function addChromaLocations(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function removeChromaFromCanvas(uint256 _canvasId, uint256 _chromaId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function _removeChromaFromCanvas(uint256 _chromaId) internal {
}
function _addChromaToLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint128[][] calldata _locations
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function idToHeight(uint _id) public view returns(uint128) {
}
function idToWidth(uint _id) public view returns(uint128) {
}
function getOwnedTokenIds(address owner)
public
view
returns (uint256[] memory)
{
}
function getChromaCount(uint256 _canvasId) public view returns (uint) {
}
function getChromaInCanvas(uint256 _canvasId)
public
view
returns (uint256[] memory)
{
}
function getChromaInCanvasInHex(uint256 _canvasId)
public
view
returns (string[] memory)
{
}
function getBaseChromaHex(uint256 _canvasId)
public
view
returns (string memory)
{
}
function getData(uint256 _canvasId) public view returns (string[][] memory) {
}
//////////////////////////
//// Metadata ////
//////////////////////////
/**
* @dev Returns a descriptive name for a collection of NFTokens.
* @return _name Representing name.
*/
function name() external view returns (string memory _name) {
}
/**
* @dev Returns an abbreviated name for NFTokens.
* @return _symbol Representing symbol.
*/
function symbol() external view returns (string memory _symbol) {
}
}
| idToOwner[_tokenId]!=address(0),"Invalid token." | 365,365 | idToOwner[_tokenId]!=address(0) |
"must be unlocked" | pragma solidity 0.7.6;
pragma abicoder v2;
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 Returns the remainder of dividing two unsigned integers, throws on overflow.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
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;
}
interface ERC721TokenReceiver {
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
}
interface ChromaInterface {
function toHex(uint256 _id) external view returns (string memory);
}
contract ChromaticCanvas is IERC721 {
using SafeMath for uint256;
bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
mapping(bytes4 => bool) internal supportedInterfaces;
mapping(uint256 => address) public idToOwner;
mapping(uint256 => address) internal idToApproval;
mapping(address => mapping(address => bool)) internal ownerToOperators;
mapping(address => uint256[]) public ownerToIds;
mapping(uint256 => uint256) public idToOwnerIndex;
string internal nftName = "Chromatic Canvas";
string internal nftSymbol = unicode"□";
uint256 public numTokens = 0;
address public chroma;
bool private reentrancyLock = false;
/* Prevent a contract function from being reentrant-called. */
modifier reentrancyGuard() {
}
modifier canTransfer(uint256 _tokenId) {
}
modifier canOperate(uint256 _tokenId) {
}
modifier validNFToken(uint256 _tokenId) {
}
constructor(address payable _adminAddress, address _chroma) {
}
function _addNFToken(address _to, uint256 _tokenId) internal {
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
}
function _getOwnerNFTCount(address _owner) internal view returns (uint256) {
}
function _safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) private canTransfer(_tokenId) validNFToken(_tokenId) {
}
function _clearApproval(uint256 _tokenId) private {
}
//////////////////////////
//// Enumerable ////
//////////////////////////
function totalSupply() public view returns (uint256) {
}
function tokenOfOwnerByIndex(address _owner, uint256 _index)
external
view
returns (uint256)
{
}
//////////////////////////
//// Administration ////
//////////////////////////
address payable public adminAddress;
uint256 public maxHeight = 64;
uint256 public maxWidth = 64;
uint256 public canvasCreationPrice = 0;
modifier onlyAdmin() {
}
function setAdmin(address payable _newAdmin) external onlyAdmin {
}
function setMaxDimensions(uint256 _maxHeight, uint256 _maxWidth)
external
onlyAdmin
{
}
function setCanvasCreationPrice(uint256 _price) external onlyAdmin {
}
//////////////////////////
//// ERC 721 and 165 ////
//////////////////////////
function isContract(address _addr)
internal
view
returns (bool addressCheck)
{
}
function supportsInterface(bytes4 _interfaceID)
external
view
override
returns (bool)
{
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes calldata _data
) external override {
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) external override {
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) external override canTransfer(_tokenId) validNFToken(_tokenId) {
}
function approve(address _approved, uint256 _tokenId)
external
override
canOperate(_tokenId)
validNFToken(_tokenId)
{
}
function setApprovalForAll(address _operator, bool _approved)
external
override
{
}
function balanceOf(address _owner)
external
view
override
returns (uint256)
{
}
function ownerOf(uint256 _tokenId)
external
view
override
returns (address _owner)
{
}
function getApproved(uint256 _tokenId)
external
view
override
validNFToken(_tokenId)
returns (address)
{
}
function isApprovedForAll(address _owner, address _operator)
external
view
override
returns (bool)
{
}
function _transfer(address _to, uint256 _tokenId) internal {
}
//////////////////////////
//// Canvas ////
//////////////////////////
event CanvasCreated(
uint256 indexed canvasId,
uint256 baseChromaId,
uint256 height,
uint256 width,
string name,
string author
);
event BaseChromaChanged(uint256 indexed canvasId, uint256 baseChromaId);
event ChromaAddedToCanvas(uint256 indexed canvasId, uint256 chromaId);
event ChromaRemovedFromCanvas(uint256 indexed canvasId, uint256 chromaId);
event LocationAddedToChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key,
uint256 y,
uint256 x
);
event LocationRemovedFromChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key
);
event CanvasLocked(uint256 indexed canvasId, address owner);
event CanvasUnlocked(uint256 indexed canvasId, address owner);
event CanvasDestroyed(uint256 indexed canvasId, address destroyer);
event CanvasCreationPriceChanged(uint256 newPrice);
event NameChanged(uint256 indexed canvasId, string name);
event AuthorChanged(uint256 indexed canvasId, string author);
uint256 public tokenIndex = 0;
mapping(uint256 => string) public idToName;
mapping(uint256 => string) public idToAuthor;
mapping(uint256 => uint128[2]) public idToDimensions;
mapping(uint256 => uint256[]) public canvasToChroma;
mapping(uint256 => uint256) public chromaToCanvasIndex;
mapping(uint256 => uint256) public chromaToCanvas;
mapping(uint256 => address) public lockedBy;
mapping(uint256 => uint256) public baseChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChromaIndex;
mapping(uint256 => uint256[]) public chromaToLocations;
modifier notLocked(uint256 _canvasId) {
require(<FILL_ME>)
_;
}
modifier onlyCanvasOwner(uint256 _canvasId) {
}
function lockUntilTransfer(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
{
}
function _unlockCanvas(uint256 _canvasId) internal {
}
function changeName(uint256 _canvasId, string calldata _name)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeAuthor(uint256 _canvasId, string calldata _author)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function createCanvas(
uint256 _baseChromaId,
uint128 _height,
uint128 _width,
string calldata _name,
string calldata _author
) external payable reentrancyGuard {
}
function destroyCanvas(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeBaseChroma(uint256 _baseChromaId, uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function addChromaToCanvas(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function addChromaLocations(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function removeChromaFromCanvas(uint256 _canvasId, uint256 _chromaId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function _removeChromaFromCanvas(uint256 _chromaId) internal {
}
function _addChromaToLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint128[][] calldata _locations
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function idToHeight(uint _id) public view returns(uint128) {
}
function idToWidth(uint _id) public view returns(uint128) {
}
function getOwnedTokenIds(address owner)
public
view
returns (uint256[] memory)
{
}
function getChromaCount(uint256 _canvasId) public view returns (uint) {
}
function getChromaInCanvas(uint256 _canvasId)
public
view
returns (uint256[] memory)
{
}
function getChromaInCanvasInHex(uint256 _canvasId)
public
view
returns (string[] memory)
{
}
function getBaseChromaHex(uint256 _canvasId)
public
view
returns (string memory)
{
}
function getData(uint256 _canvasId) public view returns (string[][] memory) {
}
//////////////////////////
//// Metadata ////
//////////////////////////
/**
* @dev Returns a descriptive name for a collection of NFTokens.
* @return _name Representing name.
*/
function name() external view returns (string memory _name) {
}
/**
* @dev Returns an abbreviated name for NFTokens.
* @return _symbol Representing symbol.
*/
function symbol() external view returns (string memory _symbol) {
}
}
| lockedBy[_canvasId]==address(0),"must be unlocked" | 365,365 | lockedBy[_canvasId]==address(0) |
"must be owner" | pragma solidity 0.7.6;
pragma abicoder v2;
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 Returns the remainder of dividing two unsigned integers, throws on overflow.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
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;
}
interface ERC721TokenReceiver {
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
}
interface ChromaInterface {
function toHex(uint256 _id) external view returns (string memory);
}
contract ChromaticCanvas is IERC721 {
using SafeMath for uint256;
bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
mapping(bytes4 => bool) internal supportedInterfaces;
mapping(uint256 => address) public idToOwner;
mapping(uint256 => address) internal idToApproval;
mapping(address => mapping(address => bool)) internal ownerToOperators;
mapping(address => uint256[]) public ownerToIds;
mapping(uint256 => uint256) public idToOwnerIndex;
string internal nftName = "Chromatic Canvas";
string internal nftSymbol = unicode"□";
uint256 public numTokens = 0;
address public chroma;
bool private reentrancyLock = false;
/* Prevent a contract function from being reentrant-called. */
modifier reentrancyGuard() {
}
modifier canTransfer(uint256 _tokenId) {
}
modifier canOperate(uint256 _tokenId) {
}
modifier validNFToken(uint256 _tokenId) {
}
constructor(address payable _adminAddress, address _chroma) {
}
function _addNFToken(address _to, uint256 _tokenId) internal {
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
}
function _getOwnerNFTCount(address _owner) internal view returns (uint256) {
}
function _safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) private canTransfer(_tokenId) validNFToken(_tokenId) {
}
function _clearApproval(uint256 _tokenId) private {
}
//////////////////////////
//// Enumerable ////
//////////////////////////
function totalSupply() public view returns (uint256) {
}
function tokenOfOwnerByIndex(address _owner, uint256 _index)
external
view
returns (uint256)
{
}
//////////////////////////
//// Administration ////
//////////////////////////
address payable public adminAddress;
uint256 public maxHeight = 64;
uint256 public maxWidth = 64;
uint256 public canvasCreationPrice = 0;
modifier onlyAdmin() {
}
function setAdmin(address payable _newAdmin) external onlyAdmin {
}
function setMaxDimensions(uint256 _maxHeight, uint256 _maxWidth)
external
onlyAdmin
{
}
function setCanvasCreationPrice(uint256 _price) external onlyAdmin {
}
//////////////////////////
//// ERC 721 and 165 ////
//////////////////////////
function isContract(address _addr)
internal
view
returns (bool addressCheck)
{
}
function supportsInterface(bytes4 _interfaceID)
external
view
override
returns (bool)
{
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes calldata _data
) external override {
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) external override {
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) external override canTransfer(_tokenId) validNFToken(_tokenId) {
}
function approve(address _approved, uint256 _tokenId)
external
override
canOperate(_tokenId)
validNFToken(_tokenId)
{
}
function setApprovalForAll(address _operator, bool _approved)
external
override
{
}
function balanceOf(address _owner)
external
view
override
returns (uint256)
{
}
function ownerOf(uint256 _tokenId)
external
view
override
returns (address _owner)
{
}
function getApproved(uint256 _tokenId)
external
view
override
validNFToken(_tokenId)
returns (address)
{
}
function isApprovedForAll(address _owner, address _operator)
external
view
override
returns (bool)
{
}
function _transfer(address _to, uint256 _tokenId) internal {
}
//////////////////////////
//// Canvas ////
//////////////////////////
event CanvasCreated(
uint256 indexed canvasId,
uint256 baseChromaId,
uint256 height,
uint256 width,
string name,
string author
);
event BaseChromaChanged(uint256 indexed canvasId, uint256 baseChromaId);
event ChromaAddedToCanvas(uint256 indexed canvasId, uint256 chromaId);
event ChromaRemovedFromCanvas(uint256 indexed canvasId, uint256 chromaId);
event LocationAddedToChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key,
uint256 y,
uint256 x
);
event LocationRemovedFromChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key
);
event CanvasLocked(uint256 indexed canvasId, address owner);
event CanvasUnlocked(uint256 indexed canvasId, address owner);
event CanvasDestroyed(uint256 indexed canvasId, address destroyer);
event CanvasCreationPriceChanged(uint256 newPrice);
event NameChanged(uint256 indexed canvasId, string name);
event AuthorChanged(uint256 indexed canvasId, string author);
uint256 public tokenIndex = 0;
mapping(uint256 => string) public idToName;
mapping(uint256 => string) public idToAuthor;
mapping(uint256 => uint128[2]) public idToDimensions;
mapping(uint256 => uint256[]) public canvasToChroma;
mapping(uint256 => uint256) public chromaToCanvasIndex;
mapping(uint256 => uint256) public chromaToCanvas;
mapping(uint256 => address) public lockedBy;
mapping(uint256 => uint256) public baseChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChromaIndex;
mapping(uint256 => uint256[]) public chromaToLocations;
modifier notLocked(uint256 _canvasId) {
}
modifier onlyCanvasOwner(uint256 _canvasId) {
require(<FILL_ME>)
_;
}
function lockUntilTransfer(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
{
}
function _unlockCanvas(uint256 _canvasId) internal {
}
function changeName(uint256 _canvasId, string calldata _name)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeAuthor(uint256 _canvasId, string calldata _author)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function createCanvas(
uint256 _baseChromaId,
uint128 _height,
uint128 _width,
string calldata _name,
string calldata _author
) external payable reentrancyGuard {
}
function destroyCanvas(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeBaseChroma(uint256 _baseChromaId, uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function addChromaToCanvas(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function addChromaLocations(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function removeChromaFromCanvas(uint256 _canvasId, uint256 _chromaId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function _removeChromaFromCanvas(uint256 _chromaId) internal {
}
function _addChromaToLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint128[][] calldata _locations
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function idToHeight(uint _id) public view returns(uint128) {
}
function idToWidth(uint _id) public view returns(uint128) {
}
function getOwnedTokenIds(address owner)
public
view
returns (uint256[] memory)
{
}
function getChromaCount(uint256 _canvasId) public view returns (uint) {
}
function getChromaInCanvas(uint256 _canvasId)
public
view
returns (uint256[] memory)
{
}
function getChromaInCanvasInHex(uint256 _canvasId)
public
view
returns (string[] memory)
{
}
function getBaseChromaHex(uint256 _canvasId)
public
view
returns (string memory)
{
}
function getData(uint256 _canvasId) public view returns (string[][] memory) {
}
//////////////////////////
//// Metadata ////
//////////////////////////
/**
* @dev Returns a descriptive name for a collection of NFTokens.
* @return _name Representing name.
*/
function name() external view returns (string memory _name) {
}
/**
* @dev Returns an abbreviated name for NFTokens.
* @return _symbol Representing symbol.
*/
function symbol() external view returns (string memory _symbol) {
}
}
| idToOwner[_canvasId]==msg.sender,"must be owner" | 365,365 | idToOwner[_canvasId]==msg.sender |
"must be locked" | pragma solidity 0.7.6;
pragma abicoder v2;
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 Returns the remainder of dividing two unsigned integers, throws on overflow.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
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;
}
interface ERC721TokenReceiver {
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
}
interface ChromaInterface {
function toHex(uint256 _id) external view returns (string memory);
}
contract ChromaticCanvas is IERC721 {
using SafeMath for uint256;
bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
mapping(bytes4 => bool) internal supportedInterfaces;
mapping(uint256 => address) public idToOwner;
mapping(uint256 => address) internal idToApproval;
mapping(address => mapping(address => bool)) internal ownerToOperators;
mapping(address => uint256[]) public ownerToIds;
mapping(uint256 => uint256) public idToOwnerIndex;
string internal nftName = "Chromatic Canvas";
string internal nftSymbol = unicode"□";
uint256 public numTokens = 0;
address public chroma;
bool private reentrancyLock = false;
/* Prevent a contract function from being reentrant-called. */
modifier reentrancyGuard() {
}
modifier canTransfer(uint256 _tokenId) {
}
modifier canOperate(uint256 _tokenId) {
}
modifier validNFToken(uint256 _tokenId) {
}
constructor(address payable _adminAddress, address _chroma) {
}
function _addNFToken(address _to, uint256 _tokenId) internal {
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
}
function _getOwnerNFTCount(address _owner) internal view returns (uint256) {
}
function _safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) private canTransfer(_tokenId) validNFToken(_tokenId) {
}
function _clearApproval(uint256 _tokenId) private {
}
//////////////////////////
//// Enumerable ////
//////////////////////////
function totalSupply() public view returns (uint256) {
}
function tokenOfOwnerByIndex(address _owner, uint256 _index)
external
view
returns (uint256)
{
}
//////////////////////////
//// Administration ////
//////////////////////////
address payable public adminAddress;
uint256 public maxHeight = 64;
uint256 public maxWidth = 64;
uint256 public canvasCreationPrice = 0;
modifier onlyAdmin() {
}
function setAdmin(address payable _newAdmin) external onlyAdmin {
}
function setMaxDimensions(uint256 _maxHeight, uint256 _maxWidth)
external
onlyAdmin
{
}
function setCanvasCreationPrice(uint256 _price) external onlyAdmin {
}
//////////////////////////
//// ERC 721 and 165 ////
//////////////////////////
function isContract(address _addr)
internal
view
returns (bool addressCheck)
{
}
function supportsInterface(bytes4 _interfaceID)
external
view
override
returns (bool)
{
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes calldata _data
) external override {
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) external override {
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) external override canTransfer(_tokenId) validNFToken(_tokenId) {
}
function approve(address _approved, uint256 _tokenId)
external
override
canOperate(_tokenId)
validNFToken(_tokenId)
{
}
function setApprovalForAll(address _operator, bool _approved)
external
override
{
}
function balanceOf(address _owner)
external
view
override
returns (uint256)
{
}
function ownerOf(uint256 _tokenId)
external
view
override
returns (address _owner)
{
}
function getApproved(uint256 _tokenId)
external
view
override
validNFToken(_tokenId)
returns (address)
{
}
function isApprovedForAll(address _owner, address _operator)
external
view
override
returns (bool)
{
}
function _transfer(address _to, uint256 _tokenId) internal {
}
//////////////////////////
//// Canvas ////
//////////////////////////
event CanvasCreated(
uint256 indexed canvasId,
uint256 baseChromaId,
uint256 height,
uint256 width,
string name,
string author
);
event BaseChromaChanged(uint256 indexed canvasId, uint256 baseChromaId);
event ChromaAddedToCanvas(uint256 indexed canvasId, uint256 chromaId);
event ChromaRemovedFromCanvas(uint256 indexed canvasId, uint256 chromaId);
event LocationAddedToChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key,
uint256 y,
uint256 x
);
event LocationRemovedFromChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key
);
event CanvasLocked(uint256 indexed canvasId, address owner);
event CanvasUnlocked(uint256 indexed canvasId, address owner);
event CanvasDestroyed(uint256 indexed canvasId, address destroyer);
event CanvasCreationPriceChanged(uint256 newPrice);
event NameChanged(uint256 indexed canvasId, string name);
event AuthorChanged(uint256 indexed canvasId, string author);
uint256 public tokenIndex = 0;
mapping(uint256 => string) public idToName;
mapping(uint256 => string) public idToAuthor;
mapping(uint256 => uint128[2]) public idToDimensions;
mapping(uint256 => uint256[]) public canvasToChroma;
mapping(uint256 => uint256) public chromaToCanvasIndex;
mapping(uint256 => uint256) public chromaToCanvas;
mapping(uint256 => address) public lockedBy;
mapping(uint256 => uint256) public baseChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChromaIndex;
mapping(uint256 => uint256[]) public chromaToLocations;
modifier notLocked(uint256 _canvasId) {
}
modifier onlyCanvasOwner(uint256 _canvasId) {
}
function lockUntilTransfer(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
{
}
function _unlockCanvas(uint256 _canvasId) internal {
require(<FILL_ME>)
require(lockedBy[_canvasId] != idToOwner[_canvasId], "must be transferred");
lockedBy[_canvasId] = address(0);
emit CanvasUnlocked(_canvasId, msg.sender);
}
function changeName(uint256 _canvasId, string calldata _name)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeAuthor(uint256 _canvasId, string calldata _author)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function createCanvas(
uint256 _baseChromaId,
uint128 _height,
uint128 _width,
string calldata _name,
string calldata _author
) external payable reentrancyGuard {
}
function destroyCanvas(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeBaseChroma(uint256 _baseChromaId, uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function addChromaToCanvas(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function addChromaLocations(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function removeChromaFromCanvas(uint256 _canvasId, uint256 _chromaId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function _removeChromaFromCanvas(uint256 _chromaId) internal {
}
function _addChromaToLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint128[][] calldata _locations
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function idToHeight(uint _id) public view returns(uint128) {
}
function idToWidth(uint _id) public view returns(uint128) {
}
function getOwnedTokenIds(address owner)
public
view
returns (uint256[] memory)
{
}
function getChromaCount(uint256 _canvasId) public view returns (uint) {
}
function getChromaInCanvas(uint256 _canvasId)
public
view
returns (uint256[] memory)
{
}
function getChromaInCanvasInHex(uint256 _canvasId)
public
view
returns (string[] memory)
{
}
function getBaseChromaHex(uint256 _canvasId)
public
view
returns (string memory)
{
}
function getData(uint256 _canvasId) public view returns (string[][] memory) {
}
//////////////////////////
//// Metadata ////
//////////////////////////
/**
* @dev Returns a descriptive name for a collection of NFTokens.
* @return _name Representing name.
*/
function name() external view returns (string memory _name) {
}
/**
* @dev Returns an abbreviated name for NFTokens.
* @return _symbol Representing symbol.
*/
function symbol() external view returns (string memory _symbol) {
}
}
| lockedBy[_canvasId]!=address(0),"must be locked" | 365,365 | lockedBy[_canvasId]!=address(0) |
"must be transferred" | pragma solidity 0.7.6;
pragma abicoder v2;
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 Returns the remainder of dividing two unsigned integers, throws on overflow.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
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;
}
interface ERC721TokenReceiver {
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
}
interface ChromaInterface {
function toHex(uint256 _id) external view returns (string memory);
}
contract ChromaticCanvas is IERC721 {
using SafeMath for uint256;
bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
mapping(bytes4 => bool) internal supportedInterfaces;
mapping(uint256 => address) public idToOwner;
mapping(uint256 => address) internal idToApproval;
mapping(address => mapping(address => bool)) internal ownerToOperators;
mapping(address => uint256[]) public ownerToIds;
mapping(uint256 => uint256) public idToOwnerIndex;
string internal nftName = "Chromatic Canvas";
string internal nftSymbol = unicode"□";
uint256 public numTokens = 0;
address public chroma;
bool private reentrancyLock = false;
/* Prevent a contract function from being reentrant-called. */
modifier reentrancyGuard() {
}
modifier canTransfer(uint256 _tokenId) {
}
modifier canOperate(uint256 _tokenId) {
}
modifier validNFToken(uint256 _tokenId) {
}
constructor(address payable _adminAddress, address _chroma) {
}
function _addNFToken(address _to, uint256 _tokenId) internal {
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
}
function _getOwnerNFTCount(address _owner) internal view returns (uint256) {
}
function _safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) private canTransfer(_tokenId) validNFToken(_tokenId) {
}
function _clearApproval(uint256 _tokenId) private {
}
//////////////////////////
//// Enumerable ////
//////////////////////////
function totalSupply() public view returns (uint256) {
}
function tokenOfOwnerByIndex(address _owner, uint256 _index)
external
view
returns (uint256)
{
}
//////////////////////////
//// Administration ////
//////////////////////////
address payable public adminAddress;
uint256 public maxHeight = 64;
uint256 public maxWidth = 64;
uint256 public canvasCreationPrice = 0;
modifier onlyAdmin() {
}
function setAdmin(address payable _newAdmin) external onlyAdmin {
}
function setMaxDimensions(uint256 _maxHeight, uint256 _maxWidth)
external
onlyAdmin
{
}
function setCanvasCreationPrice(uint256 _price) external onlyAdmin {
}
//////////////////////////
//// ERC 721 and 165 ////
//////////////////////////
function isContract(address _addr)
internal
view
returns (bool addressCheck)
{
}
function supportsInterface(bytes4 _interfaceID)
external
view
override
returns (bool)
{
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes calldata _data
) external override {
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) external override {
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) external override canTransfer(_tokenId) validNFToken(_tokenId) {
}
function approve(address _approved, uint256 _tokenId)
external
override
canOperate(_tokenId)
validNFToken(_tokenId)
{
}
function setApprovalForAll(address _operator, bool _approved)
external
override
{
}
function balanceOf(address _owner)
external
view
override
returns (uint256)
{
}
function ownerOf(uint256 _tokenId)
external
view
override
returns (address _owner)
{
}
function getApproved(uint256 _tokenId)
external
view
override
validNFToken(_tokenId)
returns (address)
{
}
function isApprovedForAll(address _owner, address _operator)
external
view
override
returns (bool)
{
}
function _transfer(address _to, uint256 _tokenId) internal {
}
//////////////////////////
//// Canvas ////
//////////////////////////
event CanvasCreated(
uint256 indexed canvasId,
uint256 baseChromaId,
uint256 height,
uint256 width,
string name,
string author
);
event BaseChromaChanged(uint256 indexed canvasId, uint256 baseChromaId);
event ChromaAddedToCanvas(uint256 indexed canvasId, uint256 chromaId);
event ChromaRemovedFromCanvas(uint256 indexed canvasId, uint256 chromaId);
event LocationAddedToChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key,
uint256 y,
uint256 x
);
event LocationRemovedFromChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key
);
event CanvasLocked(uint256 indexed canvasId, address owner);
event CanvasUnlocked(uint256 indexed canvasId, address owner);
event CanvasDestroyed(uint256 indexed canvasId, address destroyer);
event CanvasCreationPriceChanged(uint256 newPrice);
event NameChanged(uint256 indexed canvasId, string name);
event AuthorChanged(uint256 indexed canvasId, string author);
uint256 public tokenIndex = 0;
mapping(uint256 => string) public idToName;
mapping(uint256 => string) public idToAuthor;
mapping(uint256 => uint128[2]) public idToDimensions;
mapping(uint256 => uint256[]) public canvasToChroma;
mapping(uint256 => uint256) public chromaToCanvasIndex;
mapping(uint256 => uint256) public chromaToCanvas;
mapping(uint256 => address) public lockedBy;
mapping(uint256 => uint256) public baseChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChromaIndex;
mapping(uint256 => uint256[]) public chromaToLocations;
modifier notLocked(uint256 _canvasId) {
}
modifier onlyCanvasOwner(uint256 _canvasId) {
}
function lockUntilTransfer(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
{
}
function _unlockCanvas(uint256 _canvasId) internal {
require(lockedBy[_canvasId] != address(0), "must be locked");
require(<FILL_ME>)
lockedBy[_canvasId] = address(0);
emit CanvasUnlocked(_canvasId, msg.sender);
}
function changeName(uint256 _canvasId, string calldata _name)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeAuthor(uint256 _canvasId, string calldata _author)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function createCanvas(
uint256 _baseChromaId,
uint128 _height,
uint128 _width,
string calldata _name,
string calldata _author
) external payable reentrancyGuard {
}
function destroyCanvas(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeBaseChroma(uint256 _baseChromaId, uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function addChromaToCanvas(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function addChromaLocations(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function removeChromaFromCanvas(uint256 _canvasId, uint256 _chromaId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function _removeChromaFromCanvas(uint256 _chromaId) internal {
}
function _addChromaToLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint128[][] calldata _locations
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function idToHeight(uint _id) public view returns(uint128) {
}
function idToWidth(uint _id) public view returns(uint128) {
}
function getOwnedTokenIds(address owner)
public
view
returns (uint256[] memory)
{
}
function getChromaCount(uint256 _canvasId) public view returns (uint) {
}
function getChromaInCanvas(uint256 _canvasId)
public
view
returns (uint256[] memory)
{
}
function getChromaInCanvasInHex(uint256 _canvasId)
public
view
returns (string[] memory)
{
}
function getBaseChromaHex(uint256 _canvasId)
public
view
returns (string memory)
{
}
function getData(uint256 _canvasId) public view returns (string[][] memory) {
}
//////////////////////////
//// Metadata ////
//////////////////////////
/**
* @dev Returns a descriptive name for a collection of NFTokens.
* @return _name Representing name.
*/
function name() external view returns (string memory _name) {
}
/**
* @dev Returns an abbreviated name for NFTokens.
* @return _symbol Representing symbol.
*/
function symbol() external view returns (string memory _symbol) {
}
}
| lockedBy[_canvasId]!=idToOwner[_canvasId],"must be transferred" | 365,365 | lockedBy[_canvasId]!=idToOwner[_canvasId] |
"chroma not in canvas" | pragma solidity 0.7.6;
pragma abicoder v2;
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 Returns the remainder of dividing two unsigned integers, throws on overflow.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
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;
}
interface ERC721TokenReceiver {
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
}
interface ChromaInterface {
function toHex(uint256 _id) external view returns (string memory);
}
contract ChromaticCanvas is IERC721 {
using SafeMath for uint256;
bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
mapping(bytes4 => bool) internal supportedInterfaces;
mapping(uint256 => address) public idToOwner;
mapping(uint256 => address) internal idToApproval;
mapping(address => mapping(address => bool)) internal ownerToOperators;
mapping(address => uint256[]) public ownerToIds;
mapping(uint256 => uint256) public idToOwnerIndex;
string internal nftName = "Chromatic Canvas";
string internal nftSymbol = unicode"□";
uint256 public numTokens = 0;
address public chroma;
bool private reentrancyLock = false;
/* Prevent a contract function from being reentrant-called. */
modifier reentrancyGuard() {
}
modifier canTransfer(uint256 _tokenId) {
}
modifier canOperate(uint256 _tokenId) {
}
modifier validNFToken(uint256 _tokenId) {
}
constructor(address payable _adminAddress, address _chroma) {
}
function _addNFToken(address _to, uint256 _tokenId) internal {
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
}
function _getOwnerNFTCount(address _owner) internal view returns (uint256) {
}
function _safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) private canTransfer(_tokenId) validNFToken(_tokenId) {
}
function _clearApproval(uint256 _tokenId) private {
}
//////////////////////////
//// Enumerable ////
//////////////////////////
function totalSupply() public view returns (uint256) {
}
function tokenOfOwnerByIndex(address _owner, uint256 _index)
external
view
returns (uint256)
{
}
//////////////////////////
//// Administration ////
//////////////////////////
address payable public adminAddress;
uint256 public maxHeight = 64;
uint256 public maxWidth = 64;
uint256 public canvasCreationPrice = 0;
modifier onlyAdmin() {
}
function setAdmin(address payable _newAdmin) external onlyAdmin {
}
function setMaxDimensions(uint256 _maxHeight, uint256 _maxWidth)
external
onlyAdmin
{
}
function setCanvasCreationPrice(uint256 _price) external onlyAdmin {
}
//////////////////////////
//// ERC 721 and 165 ////
//////////////////////////
function isContract(address _addr)
internal
view
returns (bool addressCheck)
{
}
function supportsInterface(bytes4 _interfaceID)
external
view
override
returns (bool)
{
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes calldata _data
) external override {
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) external override {
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) external override canTransfer(_tokenId) validNFToken(_tokenId) {
}
function approve(address _approved, uint256 _tokenId)
external
override
canOperate(_tokenId)
validNFToken(_tokenId)
{
}
function setApprovalForAll(address _operator, bool _approved)
external
override
{
}
function balanceOf(address _owner)
external
view
override
returns (uint256)
{
}
function ownerOf(uint256 _tokenId)
external
view
override
returns (address _owner)
{
}
function getApproved(uint256 _tokenId)
external
view
override
validNFToken(_tokenId)
returns (address)
{
}
function isApprovedForAll(address _owner, address _operator)
external
view
override
returns (bool)
{
}
function _transfer(address _to, uint256 _tokenId) internal {
}
//////////////////////////
//// Canvas ////
//////////////////////////
event CanvasCreated(
uint256 indexed canvasId,
uint256 baseChromaId,
uint256 height,
uint256 width,
string name,
string author
);
event BaseChromaChanged(uint256 indexed canvasId, uint256 baseChromaId);
event ChromaAddedToCanvas(uint256 indexed canvasId, uint256 chromaId);
event ChromaRemovedFromCanvas(uint256 indexed canvasId, uint256 chromaId);
event LocationAddedToChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key,
uint256 y,
uint256 x
);
event LocationRemovedFromChroma(
uint256 indexed canvasId,
uint256 chromaId,
uint256 key
);
event CanvasLocked(uint256 indexed canvasId, address owner);
event CanvasUnlocked(uint256 indexed canvasId, address owner);
event CanvasDestroyed(uint256 indexed canvasId, address destroyer);
event CanvasCreationPriceChanged(uint256 newPrice);
event NameChanged(uint256 indexed canvasId, string name);
event AuthorChanged(uint256 indexed canvasId, string author);
uint256 public tokenIndex = 0;
mapping(uint256 => string) public idToName;
mapping(uint256 => string) public idToAuthor;
mapping(uint256 => uint128[2]) public idToDimensions;
mapping(uint256 => uint256[]) public canvasToChroma;
mapping(uint256 => uint256) public chromaToCanvasIndex;
mapping(uint256 => uint256) public chromaToCanvas;
mapping(uint256 => address) public lockedBy;
mapping(uint256 => uint256) public baseChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChroma;
mapping(uint256 => mapping(uint256 => uint256)) public locationToChromaIndex;
mapping(uint256 => uint256[]) public chromaToLocations;
modifier notLocked(uint256 _canvasId) {
}
modifier onlyCanvasOwner(uint256 _canvasId) {
}
function lockUntilTransfer(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
{
}
function _unlockCanvas(uint256 _canvasId) internal {
}
function changeName(uint256 _canvasId, string calldata _name)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeAuthor(uint256 _canvasId, string calldata _author)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function createCanvas(
uint256 _baseChromaId,
uint128 _height,
uint128 _width,
string calldata _name,
string calldata _author
) external payable reentrancyGuard {
}
function destroyCanvas(uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function changeBaseChroma(uint256 _baseChromaId, uint256 _canvasId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function addChromaToCanvas(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
}
function addChromaLocations(
uint256 _canvasId,
uint256 _chromaId,
uint128[][] calldata _locations
) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) {
require(<FILL_ME>)
if (_chromaId == baseChroma[_canvasId]) {
_removeChromaFromLocation(_canvasId, _locations);
return;
}
uint128[2] storage dimensions = idToDimensions[_canvasId];
uint128 height = dimensions[0];
uint128 width = dimensions[1];
for (uint256 i = 0; i < _locations.length; i++) {
uint256 y = _locations[i][0];
uint256 x = _locations[i][1];
require(y < height && x < width, "out of bounds");
uint256 key = (y << 128) + x;
_addChromaToLocation(_canvasId, _chromaId, key);
emit LocationAddedToChroma(_canvasId, _chromaId, key, y, x);
}
}
function removeChromaFromCanvas(uint256 _canvasId, uint256 _chromaId)
external
onlyCanvasOwner(_canvasId)
notLocked(_canvasId)
{
}
function _removeChromaFromCanvas(uint256 _chromaId) internal {
}
function _addChromaToLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint128[][] calldata _locations
) internal {
}
function _removeChromaFromLocation(
uint256 _canvasId,
uint256 _chromaId,
uint256 key
) internal {
}
function idToHeight(uint _id) public view returns(uint128) {
}
function idToWidth(uint _id) public view returns(uint128) {
}
function getOwnedTokenIds(address owner)
public
view
returns (uint256[] memory)
{
}
function getChromaCount(uint256 _canvasId) public view returns (uint) {
}
function getChromaInCanvas(uint256 _canvasId)
public
view
returns (uint256[] memory)
{
}
function getChromaInCanvasInHex(uint256 _canvasId)
public
view
returns (string[] memory)
{
}
function getBaseChromaHex(uint256 _canvasId)
public
view
returns (string memory)
{
}
function getData(uint256 _canvasId) public view returns (string[][] memory) {
}
//////////////////////////
//// Metadata ////
//////////////////////////
/**
* @dev Returns a descriptive name for a collection of NFTokens.
* @return _name Representing name.
*/
function name() external view returns (string memory _name) {
}
/**
* @dev Returns an abbreviated name for NFTokens.
* @return _symbol Representing symbol.
*/
function symbol() external view returns (string memory _symbol) {
}
}
| chromaToCanvas[_chromaId]==_canvasId||_chromaId==baseChroma[_canvasId],"chroma not in canvas" | 365,365 | chromaToCanvas[_chromaId]==_canvasId||_chromaId==baseChroma[_canvasId] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.