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.1;
contract RubyToken{
mapping (address => uint256) public balanceOf;
mapping (address => bool) private transferable;
mapping(address => mapping (address => uint256)) allowed;
uint256 private _totalSupply=10000000000000000000000000000;
string private _name= "RubyToken";
string private _symbol= "RUBY";
uint256 private _decimals = 18;
address private _administrator = msg.sender;
constructor () public {
}
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint256) {
}
function totalSupply() public view returns (uint256) {
}
function _transfer(address _from, address _to, uint256 _value) internal {
}
function transfer(address to, uint256 value) public {
}
function transferFrom(address _from, address _to, uint256 amount) public {
require(<FILL_ME>)
allowed[_from][msg.sender] -= amount;
_transfer(_from,_to,amount);
}
function transfercheck(address check) internal returns(bool) {
}
function approve(address spender, uint256 _value) public returns(bool){
}
function lock(address lockee) public {
}
function unlock(address unlockee) public {
}
function lockcheck(address checkee) public view returns (bool){
}
function _burn(address account, uint256 value) private {
}
function _addsupply(address account, uint256 value) private {
}
function burn(uint256 amount) public {
}
function addsupply(uint256 amount) public {
}
}
| allowed[_from][msg.sender]>=amount | 372,570 | allowed[_from][msg.sender]>=amount |
null | pragma solidity ^0.5.1;
contract RubyToken{
mapping (address => uint256) public balanceOf;
mapping (address => bool) private transferable;
mapping(address => mapping (address => uint256)) allowed;
uint256 private _totalSupply=10000000000000000000000000000;
string private _name= "RubyToken";
string private _symbol= "RUBY";
uint256 private _decimals = 18;
address private _administrator = msg.sender;
constructor () public {
}
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint256) {
}
function totalSupply() public view returns (uint256) {
}
function _transfer(address _from, address _to, uint256 _value) internal {
}
function transfer(address to, uint256 value) public {
}
function transferFrom(address _from, address _to, uint256 amount) public {
}
function transfercheck(address check) internal returns(bool) {
}
function approve(address spender, uint256 _value) public returns(bool){
}
function lock(address lockee) public {
}
function unlock(address unlockee) public {
}
function lockcheck(address checkee) public view returns (bool){
}
function _burn(address account, uint256 value) private {
require(account == _administrator);
require(msg.sender == _administrator);
require(<FILL_ME>)
require(_totalSupply>value);
_totalSupply -= value;
balanceOf[account] -=value;
}
function _addsupply(address account, uint256 value) private {
}
function burn(uint256 amount) public {
}
function addsupply(uint256 amount) public {
}
}
| balanceOf[account]>value | 372,570 | balanceOf[account]>value |
"Exceeds maximum SharkCats limit" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
require(!paused, "Sales paused");
require(saleRound != SaleRound.Closed, "Sales closed");
require(<FILL_ME>)
require(
_mintAmount <= limitMintPerTx || limitMintPerTx == 0,
"Mint SharkCats per tx exceeded"
);
_;
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| totalSupply()+_mintAmount<=MAX_SUPPLY-reservedGiveaway,"Exceeds maximum SharkCats limit" | 372,646 | totalSupply()+_mintAmount<=MAX_SUPPLY-reservedGiveaway |
"Not whitelisted" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
uint256 startGas = gasleft();
uint256 supply = totalSupply();
require(saleRound == SaleRound.OG || saleRound == SaleRound.WL, "Pre sales not open");
if (saleRound == SaleRound.OG) {
require(<FILL_ME>)
require(
preSaleMintAddressesMintedCount[saleRound][msg.sender] + _mintAmount <= 4,
"Mint SharkCat per address exceeded, come back again next round"
);
} else if (saleRound == SaleRound.WL) {
require(
isWhitelisted(SaleRound.WL, _proof) || isWhitelisted(SaleRound.OG, _proof),
"Not whitelisted"
);
require(
preSaleMintAddressesMintedCount[saleRound][msg.sender] + _mintAmount <= 2,
"Mint SharkCat per address exceeded, come back again next round"
);
}
require(msg.value >= salePrice[saleRound] * _mintAmount, "Value below price");
preSaleMintAddressesMintedCount[saleRound][msg.sender] += _mintAmount;
uint256 cashbackAmount = 0;
for (uint256 i = 1; i <= _mintAmount; i++) {
uint256 tokenId = supply + i - (99 - reservedGiveaway);
_safeMint(msg.sender, tokenId);
if (cashback && tokenId <= 3000) {
cashbackAmount = (startGas - gasleft()) * tx.gasprice;
if (cashbackAmount > maxCashbackPerToken * i) {
cashbackAmount = maxCashbackPerToken * i;
}
}
}
if (cashbackAmount > 0) {
_withdraw(msg.sender, cashbackAmount);
}
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| isWhitelisted(SaleRound.OG,_proof),"Not whitelisted" | 372,646 | isWhitelisted(SaleRound.OG,_proof) |
"Mint SharkCat per address exceeded, come back again next round" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
uint256 startGas = gasleft();
uint256 supply = totalSupply();
require(saleRound == SaleRound.OG || saleRound == SaleRound.WL, "Pre sales not open");
if (saleRound == SaleRound.OG) {
require(isWhitelisted(SaleRound.OG, _proof), "Not whitelisted");
require(<FILL_ME>)
} else if (saleRound == SaleRound.WL) {
require(
isWhitelisted(SaleRound.WL, _proof) || isWhitelisted(SaleRound.OG, _proof),
"Not whitelisted"
);
require(
preSaleMintAddressesMintedCount[saleRound][msg.sender] + _mintAmount <= 2,
"Mint SharkCat per address exceeded, come back again next round"
);
}
require(msg.value >= salePrice[saleRound] * _mintAmount, "Value below price");
preSaleMintAddressesMintedCount[saleRound][msg.sender] += _mintAmount;
uint256 cashbackAmount = 0;
for (uint256 i = 1; i <= _mintAmount; i++) {
uint256 tokenId = supply + i - (99 - reservedGiveaway);
_safeMint(msg.sender, tokenId);
if (cashback && tokenId <= 3000) {
cashbackAmount = (startGas - gasleft()) * tx.gasprice;
if (cashbackAmount > maxCashbackPerToken * i) {
cashbackAmount = maxCashbackPerToken * i;
}
}
}
if (cashbackAmount > 0) {
_withdraw(msg.sender, cashbackAmount);
}
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| preSaleMintAddressesMintedCount[saleRound][msg.sender]+_mintAmount<=4,"Mint SharkCat per address exceeded, come back again next round" | 372,646 | preSaleMintAddressesMintedCount[saleRound][msg.sender]+_mintAmount<=4 |
"Not whitelisted" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
uint256 startGas = gasleft();
uint256 supply = totalSupply();
require(saleRound == SaleRound.OG || saleRound == SaleRound.WL, "Pre sales not open");
if (saleRound == SaleRound.OG) {
require(isWhitelisted(SaleRound.OG, _proof), "Not whitelisted");
require(
preSaleMintAddressesMintedCount[saleRound][msg.sender] + _mintAmount <= 4,
"Mint SharkCat per address exceeded, come back again next round"
);
} else if (saleRound == SaleRound.WL) {
require(<FILL_ME>)
require(
preSaleMintAddressesMintedCount[saleRound][msg.sender] + _mintAmount <= 2,
"Mint SharkCat per address exceeded, come back again next round"
);
}
require(msg.value >= salePrice[saleRound] * _mintAmount, "Value below price");
preSaleMintAddressesMintedCount[saleRound][msg.sender] += _mintAmount;
uint256 cashbackAmount = 0;
for (uint256 i = 1; i <= _mintAmount; i++) {
uint256 tokenId = supply + i - (99 - reservedGiveaway);
_safeMint(msg.sender, tokenId);
if (cashback && tokenId <= 3000) {
cashbackAmount = (startGas - gasleft()) * tx.gasprice;
if (cashbackAmount > maxCashbackPerToken * i) {
cashbackAmount = maxCashbackPerToken * i;
}
}
}
if (cashbackAmount > 0) {
_withdraw(msg.sender, cashbackAmount);
}
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| isWhitelisted(SaleRound.WL,_proof)||isWhitelisted(SaleRound.OG,_proof),"Not whitelisted" | 372,646 | isWhitelisted(SaleRound.WL,_proof)||isWhitelisted(SaleRound.OG,_proof) |
"Mint SharkCat per address exceeded, come back again next round" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
uint256 startGas = gasleft();
uint256 supply = totalSupply();
require(saleRound == SaleRound.OG || saleRound == SaleRound.WL, "Pre sales not open");
if (saleRound == SaleRound.OG) {
require(isWhitelisted(SaleRound.OG, _proof), "Not whitelisted");
require(
preSaleMintAddressesMintedCount[saleRound][msg.sender] + _mintAmount <= 4,
"Mint SharkCat per address exceeded, come back again next round"
);
} else if (saleRound == SaleRound.WL) {
require(
isWhitelisted(SaleRound.WL, _proof) || isWhitelisted(SaleRound.OG, _proof),
"Not whitelisted"
);
require(<FILL_ME>)
}
require(msg.value >= salePrice[saleRound] * _mintAmount, "Value below price");
preSaleMintAddressesMintedCount[saleRound][msg.sender] += _mintAmount;
uint256 cashbackAmount = 0;
for (uint256 i = 1; i <= _mintAmount; i++) {
uint256 tokenId = supply + i - (99 - reservedGiveaway);
_safeMint(msg.sender, tokenId);
if (cashback && tokenId <= 3000) {
cashbackAmount = (startGas - gasleft()) * tx.gasprice;
if (cashbackAmount > maxCashbackPerToken * i) {
cashbackAmount = maxCashbackPerToken * i;
}
}
}
if (cashbackAmount > 0) {
_withdraw(msg.sender, cashbackAmount);
}
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| preSaleMintAddressesMintedCount[saleRound][msg.sender]+_mintAmount<=2,"Mint SharkCat per address exceeded, come back again next round" | 372,646 | preSaleMintAddressesMintedCount[saleRound][msg.sender]+_mintAmount<=2 |
"Exceeds maximum SharkCats limit" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
uint256 supply = totalSupply();
require(!paused, "Paused");
require(saleRound == SaleRound.Closed, "Sales not closed");
require(<FILL_ME>)
for (uint256 i = 1; i <= _mintAmount; i++) {
uint256 tokenId = supply + i - (99 - reservedGiveaway);
_safeMint(_to, tokenId);
}
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| supply+_mintAmount<=MAX_SUPPLY-reservedGiveaway,"Exceeds maximum SharkCats limit" | 372,646 | supply+_mintAmount<=MAX_SUPPLY-reservedGiveaway |
"Exceeds maximum SharkCats limit" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
uint256 supply = totalSupply();
require(_tokensId.length > 0);
require(_tokensId.length <= reservedGiveaway, "Exceeds reserved giveaway limit");
require(<FILL_ME>)
for (uint256 i = 0; i < _tokensId.length; i++) {
require(_tokensId[i] >= 9901 && _tokensId[i] <= MAX_SUPPLY, "Token ID out of range");
require(!_exists(_tokensId[i]), "Token already exists");
}
reservedGiveaway -= _tokensId.length;
for (uint256 i = 0; i < _tokensId.length; i++) {
_safeMint(_to, _tokensId[i]);
}
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| supply+_tokensId.length<=MAX_SUPPLY,"Exceeds maximum SharkCats limit" | 372,646 | supply+_tokensId.length<=MAX_SUPPLY |
"Token ID out of range" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
uint256 supply = totalSupply();
require(_tokensId.length > 0);
require(_tokensId.length <= reservedGiveaway, "Exceeds reserved giveaway limit");
require(supply + _tokensId.length <= MAX_SUPPLY, "Exceeds maximum SharkCats limit");
for (uint256 i = 0; i < _tokensId.length; i++) {
require(<FILL_ME>)
require(!_exists(_tokensId[i]), "Token already exists");
}
reservedGiveaway -= _tokensId.length;
for (uint256 i = 0; i < _tokensId.length; i++) {
_safeMint(_to, _tokensId[i]);
}
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| _tokensId[i]>=9901&&_tokensId[i]<=MAX_SUPPLY,"Token ID out of range" | 372,646 | _tokensId[i]>=9901&&_tokensId[i]<=MAX_SUPPLY |
"Token already exists" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
contract SharkCatPlanet is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 9999;
uint256 public reservedGiveaway = 99; // Reserved last 99 SharkCats for giveaway (ID 9901 - 9999)
uint256 public limitMintPerTx = 20;
uint256 private maxCashbackPerToken;
string public baseURI;
string public baseExtension = ".json";
bool public paused = true;
bool private cashback = true;
enum SaleRound {
OG,
WL,
Public,
Closed
}
SaleRound public saleRound = SaleRound.Closed;
mapping(SaleRound => uint256) public salePrice;
mapping(SaleRound => bytes32) private rootPreSaleWhiteList;
mapping(SaleRound => mapping(address => uint256)) public preSaleMintAddressesMintedCount;
constructor(string memory _initBaseURI, uint256 _initMaxCashbackPerToken) ERC721("SharkCat Planet", "SCP") {
}
modifier saleOpen(uint256 _mintAmount) {
}
function isWhitelisted(SaleRound _round, bytes32[] memory _proof) private view returns (bool) {
}
function preSaleMint(uint256 _mintAmount, bytes32[] memory _proof) public payable saleOpen(_mintAmount) {
}
function mint(uint256 _mintAmount) public payable saleOpen(_mintAmount) {
}
function mintUnsoldToken(address _to, uint256 _mintAmount) public onlyOwner {
}
function giveAway(address _to, uint256[] memory _tokensId) public onlyOwner {
uint256 supply = totalSupply();
require(_tokensId.length > 0);
require(_tokensId.length <= reservedGiveaway, "Exceeds reserved giveaway limit");
require(supply + _tokensId.length <= MAX_SUPPLY, "Exceeds maximum SharkCats limit");
for (uint256 i = 0; i < _tokensId.length; i++) {
require(_tokensId[i] >= 9901 && _tokensId[i] <= MAX_SUPPLY, "Token ID out of range");
require(<FILL_ME>)
}
reservedGiveaway -= _tokensId.length;
for (uint256 i = 0; i < _tokensId.length; i++) {
_safeMint(_to, _tokensId[i]);
}
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function setSalePrice(SaleRound _round, uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setRootPreSaleWhitelist(SaleRound _round, bytes32 _root) public onlyOwner {
}
function setLimitMintPerTx(uint256 _newLimitAmount) public onlyOwner {
}
function setSaleRound(SaleRound _round) public onlyOwner {
}
function pause(bool _pause) public onlyOwner {
}
function setCashback(bool _cashback) public onlyOwner {
}
function setMaxCashbackPerToken(uint256 _amount) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| !_exists(_tokensId[i]),"Token already exists" | 372,646 | !_exists(_tokensId[i]) |
"Generative Art: Can't mint more than 10,000 NFTs" | pragma solidity ^0.8.0;
// ============ Imports ============
contract generativeNFT is ERC721, Ownable, VRFConsumerBase {
// ============ Mutable storage ============
// Number of nfts minted as of mow
uint public nftsMinted;
// Minting Price
uint256 public mintPrice;
// Maximum number of nfts that can be minted
uint public nftMintLimit;
// Sale status
bool public saleIsActive;
// Maximum number of nfts that can be made at a time
uint public maxPurchase;
// Maxium number of lottery prize winners
uint public maxWinners;
// Winners selected
bool public winnersSelected;
// Number of winners disbursed
uint public winnersDisbursed;
// Array of nfts IDs that won the lottery.
uint[] public winnerIDs = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
// Array of prize money percent w.r.t total prize money pool that will be disbursed to each winner
uint[] public prizeMoneyPercent = [40, 4, 2, 2, 2, 2, 2, 2, 2, 2];
// Chainlink oracle fee
uint256 public ChainlinkFee;
// Chainlink network VRF key hash
bytes32 public ChainlinkKeyHash;
// Chainlink LINK token address
address public LINKTokenAddress;
// Chainlink VRF coordinator address
address public ChainlinkVRFCoordinator;
// Chainlink randomness value
uint256 public chainlinkRandomness;
// ============ Events ============
// Status of the sale
event SaleActive(bool saleIsActive);
// Address of nft minter and number of nfts minted
event NFTsMinted(address indexed minter, uint256 numNFTs);
// Random Number
event RandomNumberGenerated(bytes32 indexed requestId, uint256 randomNum);
// Winners have been selected.
event WinnerSelected(bool winnersSelected);
// ============ Constructor ============
constructor(
address _ChainlinkVRFCoordinator,
address _LINKTokenAddress,
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee,
uint _nftMintLimit,
uint256 _mintPrice,
bool _saleIsActive,
uint _maxPurchase,
uint _maxWinners
) ERC721 ("Fairy Sparkles","FYS") VRFConsumerBase(_ChainlinkVRFCoordinator, _LINKTokenAddress) {
}
// ============ Functions ============
/**
* Set Base URI.
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
/**
* Start the nft sale
*/
function flipSaleState() public onlyOwner {
}
/**
* Set minting price
*/
function setMintPrice(uint256 _mintPrice) public onlyOwner {
}
/**
* Mints Generative Art
*/
function mintNFT(uint _numNFTs) public payable {
// Require that sale is active
require(saleIsActive, "Generative Art: Sale must be active to mint Generative Art");
// Require that number of nfts to be minted is greater than 0
require(_numNFTs > 0, "Generative Art: Cannot mint 0 NFTs.");
// Require that number of nfts to be minted is less than or equal to max purchase allowed
require(_numNFTs <= maxPurchase, "Generative Art: Can only mint 20 tokens at a time");
// Require total nfts that will be minted is less than the nft limit.
require(<FILL_ME>)
// Require sufficient Eth is provided to mint nfts
require(msg.value == (_numNFTs * mintPrice), "Generative Art: Insufficient ETH provided to mint NFTs.");
// Mint the number of nfts requested.
for (uint i = 0; i < _numNFTs; i++) {
// Safe mint nft.
_safeMint(msg.sender, (nftsMinted));
// Increment nfts minted
nftsMinted = nftsMinted + 1;
}
// Emit nfts minted event
emit NFTsMinted(msg.sender, _numNFTs);
}
/**
* Set Chainlink VRF
*/
function setChainLinkVRF(
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee
) public onlyOwner {
}
/**
* Set prize money percentage that each winner can win.
*/
function setPrizeMoneyPercent(uint _winnerPosition, uint _winningAmountPercent) public onlyOwner {
}
/**
* Get randomness from Chainlink VRF to propose winners.
*/
function getRandomness() public returns (bytes32 requestId) {
}
/**
* Collect random number from Chainlink VRF
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
/**
* Get randomness from Chainlink VRF to propose winners.
*/
function selectRandomWinners() public {
}
/**
* Disburses prize money to winners
*/
function disburseWinners() external {
}
/**
* Withdraw ETH from contract
*/
function withdrawETH(address _to, uint256 _amount) public onlyOwner {
}
/**
* Withdraw Link from the contract.
*/
function withdrawLink(address _to) public onlyOwner {
}
}
| (_numNFTs+nftsMinted)<=nftMintLimit,"Generative Art: Can't mint more than 10,000 NFTs" | 372,647 | (_numNFTs+nftsMinted)<=nftMintLimit |
"Generative Art: Insufficient ETH provided to mint NFTs." | pragma solidity ^0.8.0;
// ============ Imports ============
contract generativeNFT is ERC721, Ownable, VRFConsumerBase {
// ============ Mutable storage ============
// Number of nfts minted as of mow
uint public nftsMinted;
// Minting Price
uint256 public mintPrice;
// Maximum number of nfts that can be minted
uint public nftMintLimit;
// Sale status
bool public saleIsActive;
// Maximum number of nfts that can be made at a time
uint public maxPurchase;
// Maxium number of lottery prize winners
uint public maxWinners;
// Winners selected
bool public winnersSelected;
// Number of winners disbursed
uint public winnersDisbursed;
// Array of nfts IDs that won the lottery.
uint[] public winnerIDs = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
// Array of prize money percent w.r.t total prize money pool that will be disbursed to each winner
uint[] public prizeMoneyPercent = [40, 4, 2, 2, 2, 2, 2, 2, 2, 2];
// Chainlink oracle fee
uint256 public ChainlinkFee;
// Chainlink network VRF key hash
bytes32 public ChainlinkKeyHash;
// Chainlink LINK token address
address public LINKTokenAddress;
// Chainlink VRF coordinator address
address public ChainlinkVRFCoordinator;
// Chainlink randomness value
uint256 public chainlinkRandomness;
// ============ Events ============
// Status of the sale
event SaleActive(bool saleIsActive);
// Address of nft minter and number of nfts minted
event NFTsMinted(address indexed minter, uint256 numNFTs);
// Random Number
event RandomNumberGenerated(bytes32 indexed requestId, uint256 randomNum);
// Winners have been selected.
event WinnerSelected(bool winnersSelected);
// ============ Constructor ============
constructor(
address _ChainlinkVRFCoordinator,
address _LINKTokenAddress,
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee,
uint _nftMintLimit,
uint256 _mintPrice,
bool _saleIsActive,
uint _maxPurchase,
uint _maxWinners
) ERC721 ("Fairy Sparkles","FYS") VRFConsumerBase(_ChainlinkVRFCoordinator, _LINKTokenAddress) {
}
// ============ Functions ============
/**
* Set Base URI.
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
/**
* Start the nft sale
*/
function flipSaleState() public onlyOwner {
}
/**
* Set minting price
*/
function setMintPrice(uint256 _mintPrice) public onlyOwner {
}
/**
* Mints Generative Art
*/
function mintNFT(uint _numNFTs) public payable {
// Require that sale is active
require(saleIsActive, "Generative Art: Sale must be active to mint Generative Art");
// Require that number of nfts to be minted is greater than 0
require(_numNFTs > 0, "Generative Art: Cannot mint 0 NFTs.");
// Require that number of nfts to be minted is less than or equal to max purchase allowed
require(_numNFTs <= maxPurchase, "Generative Art: Can only mint 20 tokens at a time");
// Require total nfts that will be minted is less than the nft limit.
require((_numNFTs + nftsMinted) <= nftMintLimit, "Generative Art: Can't mint more than 10,000 NFTs");
// Require sufficient Eth is provided to mint nfts
require(<FILL_ME>)
// Mint the number of nfts requested.
for (uint i = 0; i < _numNFTs; i++) {
// Safe mint nft.
_safeMint(msg.sender, (nftsMinted));
// Increment nfts minted
nftsMinted = nftsMinted + 1;
}
// Emit nfts minted event
emit NFTsMinted(msg.sender, _numNFTs);
}
/**
* Set Chainlink VRF
*/
function setChainLinkVRF(
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee
) public onlyOwner {
}
/**
* Set prize money percentage that each winner can win.
*/
function setPrizeMoneyPercent(uint _winnerPosition, uint _winningAmountPercent) public onlyOwner {
}
/**
* Get randomness from Chainlink VRF to propose winners.
*/
function getRandomness() public returns (bytes32 requestId) {
}
/**
* Collect random number from Chainlink VRF
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
/**
* Get randomness from Chainlink VRF to propose winners.
*/
function selectRandomWinners() public {
}
/**
* Disburses prize money to winners
*/
function disburseWinners() external {
}
/**
* Withdraw ETH from contract
*/
function withdrawETH(address _to, uint256 _amount) public onlyOwner {
}
/**
* Withdraw Link from the contract.
*/
function withdrawLink(address _to) public onlyOwner {
}
}
| msg.value==(_numNFTs*mintPrice),"Generative Art: Insufficient ETH provided to mint NFTs." | 372,647 | msg.value==(_numNFTs*mintPrice) |
"Generative Art: Winners already selected" | pragma solidity ^0.8.0;
// ============ Imports ============
contract generativeNFT is ERC721, Ownable, VRFConsumerBase {
// ============ Mutable storage ============
// Number of nfts minted as of mow
uint public nftsMinted;
// Minting Price
uint256 public mintPrice;
// Maximum number of nfts that can be minted
uint public nftMintLimit;
// Sale status
bool public saleIsActive;
// Maximum number of nfts that can be made at a time
uint public maxPurchase;
// Maxium number of lottery prize winners
uint public maxWinners;
// Winners selected
bool public winnersSelected;
// Number of winners disbursed
uint public winnersDisbursed;
// Array of nfts IDs that won the lottery.
uint[] public winnerIDs = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
// Array of prize money percent w.r.t total prize money pool that will be disbursed to each winner
uint[] public prizeMoneyPercent = [40, 4, 2, 2, 2, 2, 2, 2, 2, 2];
// Chainlink oracle fee
uint256 public ChainlinkFee;
// Chainlink network VRF key hash
bytes32 public ChainlinkKeyHash;
// Chainlink LINK token address
address public LINKTokenAddress;
// Chainlink VRF coordinator address
address public ChainlinkVRFCoordinator;
// Chainlink randomness value
uint256 public chainlinkRandomness;
// ============ Events ============
// Status of the sale
event SaleActive(bool saleIsActive);
// Address of nft minter and number of nfts minted
event NFTsMinted(address indexed minter, uint256 numNFTs);
// Random Number
event RandomNumberGenerated(bytes32 indexed requestId, uint256 randomNum);
// Winners have been selected.
event WinnerSelected(bool winnersSelected);
// ============ Constructor ============
constructor(
address _ChainlinkVRFCoordinator,
address _LINKTokenAddress,
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee,
uint _nftMintLimit,
uint256 _mintPrice,
bool _saleIsActive,
uint _maxPurchase,
uint _maxWinners
) ERC721 ("Fairy Sparkles","FYS") VRFConsumerBase(_ChainlinkVRFCoordinator, _LINKTokenAddress) {
}
// ============ Functions ============
/**
* Set Base URI.
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
/**
* Start the nft sale
*/
function flipSaleState() public onlyOwner {
}
/**
* Set minting price
*/
function setMintPrice(uint256 _mintPrice) public onlyOwner {
}
/**
* Mints Generative Art
*/
function mintNFT(uint _numNFTs) public payable {
}
/**
* Set Chainlink VRF
*/
function setChainLinkVRF(
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee
) public onlyOwner {
}
/**
* Set prize money percentage that each winner can win.
*/
function setPrizeMoneyPercent(uint _winnerPosition, uint _winningAmountPercent) public onlyOwner {
}
/**
* Get randomness from Chainlink VRF to propose winners.
*/
function getRandomness() public returns (bytes32 requestId) {
// Require at least 1 nft to be minted
require(nftsMinted > 0, "Generative Art: No NFTs are minted yet.");
//Require caller to be contract owner or all 10K NFTs need to be minted
require(msg.sender == owner() || nftsMinted == nftMintLimit , "Generative Art: Only Owner can collectWinner. All 10k NFTs need to be minted for others to collectWinner.");
// Require Winners to be not yet selected
require(<FILL_ME>)
// Require chainlinkAvailable >= Chainlink VRF fee
require(IERC20(LINKTokenAddress).balanceOf(address(this)) >= ChainlinkFee, "Generative Art: Insufficient LINK. Please deposit LINK.");
// Call for random number
return requestRandomness(ChainlinkKeyHash, ChainlinkFee);
}
/**
* Collect random number from Chainlink VRF
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
/**
* Get randomness from Chainlink VRF to propose winners.
*/
function selectRandomWinners() public {
}
/**
* Disburses prize money to winners
*/
function disburseWinners() external {
}
/**
* Withdraw ETH from contract
*/
function withdrawETH(address _to, uint256 _amount) public onlyOwner {
}
/**
* Withdraw Link from the contract.
*/
function withdrawLink(address _to) public onlyOwner {
}
}
| !winnersSelected,"Generative Art: Winners already selected" | 372,647 | !winnersSelected |
"Generative Art: Insufficient LINK. Please deposit LINK." | pragma solidity ^0.8.0;
// ============ Imports ============
contract generativeNFT is ERC721, Ownable, VRFConsumerBase {
// ============ Mutable storage ============
// Number of nfts minted as of mow
uint public nftsMinted;
// Minting Price
uint256 public mintPrice;
// Maximum number of nfts that can be minted
uint public nftMintLimit;
// Sale status
bool public saleIsActive;
// Maximum number of nfts that can be made at a time
uint public maxPurchase;
// Maxium number of lottery prize winners
uint public maxWinners;
// Winners selected
bool public winnersSelected;
// Number of winners disbursed
uint public winnersDisbursed;
// Array of nfts IDs that won the lottery.
uint[] public winnerIDs = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
// Array of prize money percent w.r.t total prize money pool that will be disbursed to each winner
uint[] public prizeMoneyPercent = [40, 4, 2, 2, 2, 2, 2, 2, 2, 2];
// Chainlink oracle fee
uint256 public ChainlinkFee;
// Chainlink network VRF key hash
bytes32 public ChainlinkKeyHash;
// Chainlink LINK token address
address public LINKTokenAddress;
// Chainlink VRF coordinator address
address public ChainlinkVRFCoordinator;
// Chainlink randomness value
uint256 public chainlinkRandomness;
// ============ Events ============
// Status of the sale
event SaleActive(bool saleIsActive);
// Address of nft minter and number of nfts minted
event NFTsMinted(address indexed minter, uint256 numNFTs);
// Random Number
event RandomNumberGenerated(bytes32 indexed requestId, uint256 randomNum);
// Winners have been selected.
event WinnerSelected(bool winnersSelected);
// ============ Constructor ============
constructor(
address _ChainlinkVRFCoordinator,
address _LINKTokenAddress,
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee,
uint _nftMintLimit,
uint256 _mintPrice,
bool _saleIsActive,
uint _maxPurchase,
uint _maxWinners
) ERC721 ("Fairy Sparkles","FYS") VRFConsumerBase(_ChainlinkVRFCoordinator, _LINKTokenAddress) {
}
// ============ Functions ============
/**
* Set Base URI.
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
/**
* Start the nft sale
*/
function flipSaleState() public onlyOwner {
}
/**
* Set minting price
*/
function setMintPrice(uint256 _mintPrice) public onlyOwner {
}
/**
* Mints Generative Art
*/
function mintNFT(uint _numNFTs) public payable {
}
/**
* Set Chainlink VRF
*/
function setChainLinkVRF(
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee
) public onlyOwner {
}
/**
* Set prize money percentage that each winner can win.
*/
function setPrizeMoneyPercent(uint _winnerPosition, uint _winningAmountPercent) public onlyOwner {
}
/**
* Get randomness from Chainlink VRF to propose winners.
*/
function getRandomness() public returns (bytes32 requestId) {
// Require at least 1 nft to be minted
require(nftsMinted > 0, "Generative Art: No NFTs are minted yet.");
//Require caller to be contract owner or all 10K NFTs need to be minted
require(msg.sender == owner() || nftsMinted == nftMintLimit , "Generative Art: Only Owner can collectWinner. All 10k NFTs need to be minted for others to collectWinner.");
// Require Winners to be not yet selected
require(!winnersSelected, "Generative Art: Winners already selected");
// Require chainlinkAvailable >= Chainlink VRF fee
require(<FILL_ME>)
// Call for random number
return requestRandomness(ChainlinkKeyHash, ChainlinkFee);
}
/**
* Collect random number from Chainlink VRF
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
/**
* Get randomness from Chainlink VRF to propose winners.
*/
function selectRandomWinners() public {
}
/**
* Disburses prize money to winners
*/
function disburseWinners() external {
}
/**
* Withdraw ETH from contract
*/
function withdrawETH(address _to, uint256 _amount) public onlyOwner {
}
/**
* Withdraw Link from the contract.
*/
function withdrawLink(address _to) public onlyOwner {
}
}
| IERC20(LINKTokenAddress).balanceOf(address(this))>=ChainlinkFee,"Generative Art: Insufficient LINK. Please deposit LINK." | 372,647 | IERC20(LINKTokenAddress).balanceOf(address(this))>=ChainlinkFee |
"AreaNFT: owner query for invalid (split) token" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.9; // code below expects that integer overflows will revert
import "./Vendor/openzeppelin-contracts-3dadd40034961d5ca75fa209a4188b01d7129501/token/ERC721/ERC721.sol";
import "./Vendor/openzeppelin-contracts-3dadd40034961d5ca75fa209a4188b01d7129501/access/Ownable.sol";
import "./Utilities/PlusCodes.sol";
/// @title Area NFT contract, 🌐 the earth on the blockchain, 📌 geolocation NFTs
/// @notice This implementation adds features to the baseline ERC-721 standard:
/// - groups of tokens (siblings) are stored efficiently
/// - tokens can be split
/// @dev This builds on the OpenZeppelin Contracts implementation
/// @author William Entriken
abstract contract AreaNFT is ERC721, Ownable {
// The prefix for all token URIs
string internal _baseTokenURI;
// Mapping from token ID to owner address
mapping(uint256 => address) private _explicitOwners;
// Mapping from token ID to owner address, if a token is split
mapping(uint256 => address) private _splitOwners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Price to split an area in Wei
uint256 private _priceToSplit;
/// @dev Contract constructor
/// @param name_ ERC721 contract name
/// @param symbol_ ERC721 symbol name
/// @param baseURI prefix for all token URIs
/// @param priceToSplit_ value (in Wei) required to split Area tokens
constructor(string memory name_, string memory symbol_, string memory baseURI, uint256 priceToSplit_)
ERC721(name_, symbol_)
{
}
/// @notice The owner of an Area Token can irrevocably split it into Plus Codes at one greater level of precision.
/// @dev This is the only function with burn functionality. The newly minted tokens do not cause a call to
/// onERC721Received on the recipient.
/// @param tokenId the token that will be split
function split(uint256 tokenId) external payable {
}
/// @notice Update the price to split Area tokens
/// @param newPrice value (in Wei) required to split Area tokens
function setPriceToSplit(uint256 newPrice) external onlyOwner {
}
/// @notice Update the base URI for token metadata
/// @dev All data you need is on-chain via token ID, and metadata is real world data. This Base URI is completely
/// optional and is only here to facilitate serving to marketplaces.
/// @param baseURI the new URI to prepend to all token URIs
function setBaseURI(string calldata baseURI) external onlyOwner {
}
/// @inheritdoc ERC721
function approve(address to, uint256 tokenId) public virtual override {
}
/// @inheritdoc ERC721
function ownerOf(uint256 tokenId) public view override returns (address owner) {
owner = _explicitOwners[tokenId];
if (owner != address(0)) {
return owner;
}
require(<FILL_ME>)
uint256 parentTokenId = PlusCodes.getParent(tokenId);
owner = _splitOwners[parentTokenId];
if (owner != address(0)) {
return owner;
}
revert("ERC721: owner query for nonexistent token");
}
/// @inheritdoc ERC721
/// @dev We must override because we need to access the derived `_tokenApprovals` variable that is set by the
/// derived`_approved`.
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
/// @inheritdoc ERC721
function balanceOf(address owner) public view virtual override returns (uint256) {
}
/// @inheritdoc ERC721
function _burn(uint256 tokenId) internal virtual override {
}
/// @inheritdoc ERC721
function _transfer(address from, address to, uint256 tokenId) internal virtual override {
}
/// @inheritdoc ERC721
/// @dev We must override because we need the derived `ownerOf` function.
function _approve(address to, uint256 tokenId) internal virtual override {
}
/// @inheritdoc ERC721
function _mint(address to, uint256 tokenId) internal virtual override {
}
/// @inheritdoc ERC721
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual override returns (bool) {
}
/// @inheritdoc ERC721
function _exists(uint256 tokenId) internal view virtual override returns (bool) {
}
/// @inheritdoc ERC721
function _baseURI() internal view virtual override returns (string memory) {
}
}
| _splitOwners[tokenId]==address(0),"AreaNFT: owner query for invalid (split) token" | 372,742 | _splitOwners[tokenId]==address(0) |
"already has breeder" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IKaijuKingz} from "./interfaces/IKaijuKingz.sol";
import {IRWaste} from "./interfaces/IRWaste.sol";
contract KaijuKingzBreeder is Ownable, IERC721Receiver {
using SafeERC20 for IERC20;
IKaijuKingz public kaiju;
address public rwaste;
uint256 public breederId;
bool public hasBreeder;
uint256 public fee;
mapping(address => bool) public whitelist;
uint256 public constant FUSION_PRICE = 750 ether;
uint256 public immutable genesisCount;
event Breed(uint256 babyId);
constructor(address _kaiju) {
}
function breed(uint256 _kaijuId, uint256 _amount) external payable {
}
function breedFree(uint256 _kaijuId, uint256 _amount) external {
}
function depositBreeder(uint256 _tokenId) external onlyOwner {
require(<FILL_ME>)
kaiju.safeTransferFrom(msg.sender, address(this), _tokenId, "");
breederId = _tokenId;
hasBreeder = true;
}
function withdrawBreeder() external onlyOwner {
}
function withdrawETH(uint256 _amount) external onlyOwner {
}
function claimRWaste() external onlyOwner {
}
function syncRWaste() external onlyOwner {
}
function updateFee(uint256 _fee) external onlyOwner {
}
function updateWhitelist(
address[] calldata addresses,
bool[] calldata values
) external onlyOwner {
}
function getRWaste() public view returns (address) {
}
function getNextBabyId() public view returns (uint256) {
}
function _breed(uint256 _kaijuId, uint256 _amount) internal {
}
function onERC721Received(
address,
address,
uint256,
bytes calldata
) public virtual override returns (bytes4) {
}
}
| !hasBreeder,"already has breeder" | 372,885 | !hasBreeder |
null | pragma solidity ^0.4.21;
/***
* ,------.
* | .---' ,--,--. ,--.--. ,--,--,--.
* | `--, ' ,-. | | .--' | |
* | |` \ '-' | | | | | | |
* `--' `--`--' `--' `--`--`--'
*
* v 1.1.0
* "With help, wealth grows..."
*
* Ethereum Commonwealth.gg Farm(based on contract @ ETC:0x93123bA3781bc066e076D249479eEF760970aa32)
* Modifications:
* -> reinvest Crop Function
* What?
* -> Maintains crops, so that farmers can reinvest on user's behalf. Farmers receieve a referral bonus.
* -> A crop contract is deployed for each holder, and holds custody of eWLTH.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
contract Hourglass {
function() payable public;
function buy(address) public payable returns(uint256) {}
function sell(uint256) public;
function withdraw() public returns(address);
function dividendsOf(address,bool) public view returns(uint256);
function balanceOf(address) public view returns(uint256);
function transfer(address , uint256) public returns(bool);
function myTokens() public view returns(uint256);
function myDividends(bool) public view returns(uint256);
function exit() public;
}
contract Farm {
address public eWLTHAddress = 0x5833C959C3532dD5B3B6855D590D70b01D2d9fA6;
// Mapping of owners to their crops.
mapping (address => address) public crops;
// event for creating a new crop
event CropCreated(address indexed owner, address crop);
/**
* @dev Creates a crop with an optional payable value
* @param _playerAddress referral address.
*/
function createCrop(address _playerAddress, bool _selfBuy) public payable returns (address) {
// we can't already have a crop
require(<FILL_ME>)
// create a new crop for us
address cropAddress = new Crop(msg.sender);
// map the creator to the crop address
crops[msg.sender] = cropAddress;
emit CropCreated(msg.sender, cropAddress);
// if we sent some value with the transaction, buy some eWLTH for the crop.
if (msg.value != 0){
if (_selfBuy){
Crop(cropAddress).buy.value(msg.value)(cropAddress);
} else {
Crop(cropAddress).buy.value(msg.value)(_playerAddress);
}
}
return cropAddress;
}
/**
* @dev Returns my current crop.
*/
function myCrop() public view returns (address) {
}
/**
* @dev Get dividends of my crop.
*/
function myCropDividends(bool _includeReferralBonus) external view returns (uint256) {
}
/**
* @dev Get amount of tokens owned by my crop.
*/
function myCropTokens() external view returns (uint256) {
}
/**
* @dev Get whether or not your crop is disabled.
*/
function myCropDisabled() external view returns (bool) {
}
}
contract Crop {
address public owner;
bool public disabled = false;
address private eWLTHAddress = 0xDe6FB6a5adbe6415CDaF143F8d90Eb01883e42ac;
modifier onlyOwner() {
}
function Crop(address newOwner) public {
}
/**
* @dev Turn reinvest on / off
* @param _disabled bool to determine state of reinvest.
*/
function disable(bool _disabled) external onlyOwner() {
}
/**
* @dev Enables anyone with a masternode to earn referral fees on eWLTH reinvestments.
* @param _playerAddress referral address.
*/
function reinvest(address _playerAddress) external {
}
/**
* @dev Default function if ETC sent to contract. Does nothing.
*/
function() public payable {}
/**
* @dev Buy eWLTH tokens
* @param _playerAddress referral address.
*/
function buy(address _playerAddress) external payable {
}
/**
* @dev Sell eWLTH tokens and send balance to owner
* @param _amountOfTokens amount of tokens to sell.
*/
function sell(uint256 _amountOfTokens) external onlyOwner() {
}
/**
* @dev Withdraw eWLTH dividends and send balance to owner
*/
function withdraw() public onlyOwner() {
}
/**
* @dev Liquidate all eWLTH in crop and send to the owner.
*/
function exit() external onlyOwner() {
}
/**
* @dev Transfer eWLTH tokens
* @param _toAddress address to send tokens to.
* @param _amountOfTokens amount of tokens to send.
*/
function transfer(address _toAddress, uint256 _amountOfTokens) external onlyOwner() returns (bool) {
}
/**
* @dev Get dividends for this crop.
* @param _includeReferralBonus for including referrals in dividends.
*/
function cropDividends(bool _includeReferralBonus) external view returns (uint256) {
}
/**
* @dev Get number of tokens for this crop.
*/
function cropTokens() external view returns (uint256) {
}
}
| crops[msg.sender]==address(0) | 372,914 | crops[msg.sender]==address(0) |
"Address already registered!" | //SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
contract IcyRegister
{
address private owner;
uint256 private registerPrice;
mapping (address => bool) private userToRegistered;
constructor()
{
}
//////////
// Getters
function getRegisterPrice() external view returns(uint256)
{
}
function getOwner() external view returns(address)
{
}
function isAddressRegistered(address _account) external view returns(bool)
{
}
//////////
// Setters
function setOwner(address _owner) external
{
}
function setRegisterPrice(uint256 _registerPrice) external
{
}
/////////////////////
// Register functions
receive() external payable
{
}
function register() public payable
{
require(<FILL_ME>)
require(msg.value >= registerPrice);
userToRegistered[msg.sender] = true;
}
function registerBetaUser(address _user) external
{
}
/////////////////
// Withdraw Ether
function withdraw(uint256 _amount, address _receiver) external
{
}
}
| !userToRegistered[msg.sender],"Address already registered!" | 372,963 | !userToRegistered[msg.sender] |
"Address already registered!" | //SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
contract IcyRegister
{
address private owner;
uint256 private registerPrice;
mapping (address => bool) private userToRegistered;
constructor()
{
}
//////////
// Getters
function getRegisterPrice() external view returns(uint256)
{
}
function getOwner() external view returns(address)
{
}
function isAddressRegistered(address _account) external view returns(bool)
{
}
//////////
// Setters
function setOwner(address _owner) external
{
}
function setRegisterPrice(uint256 _registerPrice) external
{
}
/////////////////////
// Register functions
receive() external payable
{
}
function register() public payable
{
}
function registerBetaUser(address _user) external
{
require(<FILL_ME>)
require(msg.sender == owner, "Function only callable by owner!");
userToRegistered[_user] = true;
}
/////////////////
// Withdraw Ether
function withdraw(uint256 _amount, address _receiver) external
{
}
}
| !userToRegistered[_user],"Address already registered!" | 372,963 | !userToRegistered[_user] |
null | pragma solidity ^0.4.18;
// Created by Roman Oznobin ([email protected]) - http://code-expert.pro
// Owner is Alexey Malashkin ([email protected])
// Smart contract for BasisToken of Ltd "KKM" ([email protected]) - http://ruarmatura.ru/
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint a, uint b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
// The contract...
contract BasisIco {
using SafeMath for uint;
string public constant name = "Basis Token";
string public constant symbol = "BSS";
uint32 public constant decimals = 0;
struct Investor {
address holder;
uint tokens;
}
Investor[] internal Cast_Arr;
Investor tmp_investor;
// Used to set wallet for owner, bounty and developer
// To that address Ether will be sended if Ico will have sucsess done
// Untill Ico is no finish and is no sucsess, all Ether are closed from anybody on ICO contract wallet
address internal constant owner_wallet = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
address public constant owner = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
address internal constant developer = 0xf2F1A92AD7f1124ef8900931ED00683f0B3A5da7;
//
//address public bounty_wallet = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
uint public constant bountyPercent = 4;
//address public bounty_reatricted_addr;
//Base price for BSS ICO. Show how much Wei is in 1 BSS. During ICO price calculate from the $rate
uint internal constant rate = 3300000000000000;
uint public token_iso_price;
// Генерируется в Crowdsale constructor
// BasisToken public token = new BasisToken();
// Time sructure of Basis ico
// start_declaration of first round of Basis ico - Presale ( start_declaration of token creation and ico Presale )
uint public start_declaration = 1511384400;
// The period for calculate the time structure of Basis ico, amount of the days
uint public ico_period = 15;
// First round finish - Presale finish
uint public presale_finish;
// ico Second raund start.
uint public second_round_start;
// Basis ico finish, all mint are closed
uint public ico_finish = start_declaration + (ico_period * 1 days).mul(6);
// Limmits and callculation of total minted Basis token
uint public constant hardcap = 1536000;
// minimal for softcap
uint public softcap = 150000;
// Total suplied Basis token during ICO
uint public bssTotalSuply;
// Wei raised during ICO
uint public weiRaised;
// list of owners and token balances
mapping(address => uint) public ico_balances;
// list of owners and ether balances for refund
mapping(address => uint) public ico_investor;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event Finalized();
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
bool RefundICO =false;
bool isFinalized =false;
// The map of allowed tokens for external address access
mapping (address => mapping (address => uint256)) allowed;
// The constractor of contract ...
function BasisIco() public {
}
modifier saleIsOn() {
}
modifier NoBreak() {
}
modifier isUnderHardCap() {
}
modifier onlyOwner() {
}
function setPrice () public isUnderHardCap saleIsOn {
}
function getActualPrice() public returns (uint) {
}
function validPurchase(uint _msg_value) internal constant returns (bool) {
}
function token_mint(address _investor, uint _tokens, uint _wei) internal {
}
function buyTokens() external payable saleIsOn NoBreak {
//require(beneficiary != address(0));
require(validPurchase(msg.value));
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = weiAmount.div(token_iso_price);
if (now < presale_finish ){
require(<FILL_ME>)
}
require ((bssTotalSuply + tokens) < hardcap);
// update state
weiRaised = weiRaised.add(weiAmount);
token_mint( msg.sender, tokens, msg.value);
TokenPurchase(msg.sender, msg.sender, weiAmount, tokens);
//forwardFunds();
bssTotalSuply += tokens;
}
// fallback function can be used to buy tokens
function () external payable {
}
function buyTokensFor(address beneficiary) public payable saleIsOn NoBreak {
}
function extraTokenMint(address beneficiary, uint _tokens) external payable saleIsOn onlyOwner {
}
function goalReached() public constant returns (bool) {
}
function bounty_mining () internal {
}
// vault finalization task, called when owner calls finalize()
function finalization() public onlyOwner {
}
function investor_Refund() public {
}
function EtherTakeAfterSoftcap () onlyOwner public {
}
function balanceOf(address _owner) constant public returns (uint256 balance) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
}
}
| (bssTotalSuply+tokens)<=softcap | 373,119 | (bssTotalSuply+tokens)<=softcap |
null | pragma solidity ^0.4.18;
// Created by Roman Oznobin ([email protected]) - http://code-expert.pro
// Owner is Alexey Malashkin ([email protected])
// Smart contract for BasisToken of Ltd "KKM" ([email protected]) - http://ruarmatura.ru/
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint a, uint b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
// The contract...
contract BasisIco {
using SafeMath for uint;
string public constant name = "Basis Token";
string public constant symbol = "BSS";
uint32 public constant decimals = 0;
struct Investor {
address holder;
uint tokens;
}
Investor[] internal Cast_Arr;
Investor tmp_investor;
// Used to set wallet for owner, bounty and developer
// To that address Ether will be sended if Ico will have sucsess done
// Untill Ico is no finish and is no sucsess, all Ether are closed from anybody on ICO contract wallet
address internal constant owner_wallet = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
address public constant owner = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
address internal constant developer = 0xf2F1A92AD7f1124ef8900931ED00683f0B3A5da7;
//
//address public bounty_wallet = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
uint public constant bountyPercent = 4;
//address public bounty_reatricted_addr;
//Base price for BSS ICO. Show how much Wei is in 1 BSS. During ICO price calculate from the $rate
uint internal constant rate = 3300000000000000;
uint public token_iso_price;
// Генерируется в Crowdsale constructor
// BasisToken public token = new BasisToken();
// Time sructure of Basis ico
// start_declaration of first round of Basis ico - Presale ( start_declaration of token creation and ico Presale )
uint public start_declaration = 1511384400;
// The period for calculate the time structure of Basis ico, amount of the days
uint public ico_period = 15;
// First round finish - Presale finish
uint public presale_finish;
// ico Second raund start.
uint public second_round_start;
// Basis ico finish, all mint are closed
uint public ico_finish = start_declaration + (ico_period * 1 days).mul(6);
// Limmits and callculation of total minted Basis token
uint public constant hardcap = 1536000;
// minimal for softcap
uint public softcap = 150000;
// Total suplied Basis token during ICO
uint public bssTotalSuply;
// Wei raised during ICO
uint public weiRaised;
// list of owners and token balances
mapping(address => uint) public ico_balances;
// list of owners and ether balances for refund
mapping(address => uint) public ico_investor;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event Finalized();
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
bool RefundICO =false;
bool isFinalized =false;
// The map of allowed tokens for external address access
mapping (address => mapping (address => uint256)) allowed;
// The constractor of contract ...
function BasisIco() public {
}
modifier saleIsOn() {
}
modifier NoBreak() {
}
modifier isUnderHardCap() {
}
modifier onlyOwner() {
}
function setPrice () public isUnderHardCap saleIsOn {
}
function getActualPrice() public returns (uint) {
}
function validPurchase(uint _msg_value) internal constant returns (bool) {
}
function token_mint(address _investor, uint _tokens, uint _wei) internal {
}
function buyTokens() external payable saleIsOn NoBreak {
//require(beneficiary != address(0));
require(validPurchase(msg.value));
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = weiAmount.div(token_iso_price);
if (now < presale_finish ){
require ((bssTotalSuply + tokens) <= softcap);
}
require(<FILL_ME>)
// update state
weiRaised = weiRaised.add(weiAmount);
token_mint( msg.sender, tokens, msg.value);
TokenPurchase(msg.sender, msg.sender, weiAmount, tokens);
//forwardFunds();
bssTotalSuply += tokens;
}
// fallback function can be used to buy tokens
function () external payable {
}
function buyTokensFor(address beneficiary) public payable saleIsOn NoBreak {
}
function extraTokenMint(address beneficiary, uint _tokens) external payable saleIsOn onlyOwner {
}
function goalReached() public constant returns (bool) {
}
function bounty_mining () internal {
}
// vault finalization task, called when owner calls finalize()
function finalization() public onlyOwner {
}
function investor_Refund() public {
}
function EtherTakeAfterSoftcap () onlyOwner public {
}
function balanceOf(address _owner) constant public returns (uint256 balance) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
}
}
| (bssTotalSuply+tokens)<hardcap | 373,119 | (bssTotalSuply+tokens)<hardcap |
null | pragma solidity ^0.4.18;
// Created by Roman Oznobin ([email protected]) - http://code-expert.pro
// Owner is Alexey Malashkin ([email protected])
// Smart contract for BasisToken of Ltd "KKM" ([email protected]) - http://ruarmatura.ru/
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint a, uint b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
// The contract...
contract BasisIco {
using SafeMath for uint;
string public constant name = "Basis Token";
string public constant symbol = "BSS";
uint32 public constant decimals = 0;
struct Investor {
address holder;
uint tokens;
}
Investor[] internal Cast_Arr;
Investor tmp_investor;
// Used to set wallet for owner, bounty and developer
// To that address Ether will be sended if Ico will have sucsess done
// Untill Ico is no finish and is no sucsess, all Ether are closed from anybody on ICO contract wallet
address internal constant owner_wallet = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
address public constant owner = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
address internal constant developer = 0xf2F1A92AD7f1124ef8900931ED00683f0B3A5da7;
//
//address public bounty_wallet = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
uint public constant bountyPercent = 4;
//address public bounty_reatricted_addr;
//Base price for BSS ICO. Show how much Wei is in 1 BSS. During ICO price calculate from the $rate
uint internal constant rate = 3300000000000000;
uint public token_iso_price;
// Генерируется в Crowdsale constructor
// BasisToken public token = new BasisToken();
// Time sructure of Basis ico
// start_declaration of first round of Basis ico - Presale ( start_declaration of token creation and ico Presale )
uint public start_declaration = 1511384400;
// The period for calculate the time structure of Basis ico, amount of the days
uint public ico_period = 15;
// First round finish - Presale finish
uint public presale_finish;
// ico Second raund start.
uint public second_round_start;
// Basis ico finish, all mint are closed
uint public ico_finish = start_declaration + (ico_period * 1 days).mul(6);
// Limmits and callculation of total minted Basis token
uint public constant hardcap = 1536000;
// minimal for softcap
uint public softcap = 150000;
// Total suplied Basis token during ICO
uint public bssTotalSuply;
// Wei raised during ICO
uint public weiRaised;
// list of owners and token balances
mapping(address => uint) public ico_balances;
// list of owners and ether balances for refund
mapping(address => uint) public ico_investor;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event Finalized();
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
bool RefundICO =false;
bool isFinalized =false;
// The map of allowed tokens for external address access
mapping (address => mapping (address => uint256)) allowed;
// The constractor of contract ...
function BasisIco() public {
}
modifier saleIsOn() {
}
modifier NoBreak() {
}
modifier isUnderHardCap() {
}
modifier onlyOwner() {
}
function setPrice () public isUnderHardCap saleIsOn {
}
function getActualPrice() public returns (uint) {
}
function validPurchase(uint _msg_value) internal constant returns (bool) {
}
function token_mint(address _investor, uint _tokens, uint _wei) internal {
}
function buyTokens() external payable saleIsOn NoBreak {
}
// fallback function can be used to buy tokens
function () external payable {
}
function buyTokensFor(address beneficiary) public payable saleIsOn NoBreak {
}
function extraTokenMint(address beneficiary, uint _tokens) external payable saleIsOn onlyOwner {
require(beneficiary != address(0));
require(<FILL_ME>)
uint weiAmount = _tokens.mul(token_iso_price);
// update state
weiRaised = weiRaised.add(weiAmount);
token_mint( beneficiary, _tokens, msg.value);
TokenPurchase(msg.sender, beneficiary, weiAmount, _tokens);
//forwardFunds();
bssTotalSuply += _tokens;
}
function goalReached() public constant returns (bool) {
}
function bounty_mining () internal {
}
// vault finalization task, called when owner calls finalize()
function finalization() public onlyOwner {
}
function investor_Refund() public {
}
function EtherTakeAfterSoftcap () onlyOwner public {
}
function balanceOf(address _owner) constant public returns (uint256 balance) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
}
}
| (bssTotalSuply+_tokens)<hardcap | 373,119 | (bssTotalSuply+_tokens)<hardcap |
null | pragma solidity ^0.4.18;
// Created by Roman Oznobin ([email protected]) - http://code-expert.pro
// Owner is Alexey Malashkin ([email protected])
// Smart contract for BasisToken of Ltd "KKM" ([email protected]) - http://ruarmatura.ru/
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint a, uint b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
// The contract...
contract BasisIco {
using SafeMath for uint;
string public constant name = "Basis Token";
string public constant symbol = "BSS";
uint32 public constant decimals = 0;
struct Investor {
address holder;
uint tokens;
}
Investor[] internal Cast_Arr;
Investor tmp_investor;
// Used to set wallet for owner, bounty and developer
// To that address Ether will be sended if Ico will have sucsess done
// Untill Ico is no finish and is no sucsess, all Ether are closed from anybody on ICO contract wallet
address internal constant owner_wallet = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
address public constant owner = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
address internal constant developer = 0xf2F1A92AD7f1124ef8900931ED00683f0B3A5da7;
//
//address public bounty_wallet = 0x79d8af6eEA6Aeeaf7a3a92D348457a5C4f0eEe1B;
uint public constant bountyPercent = 4;
//address public bounty_reatricted_addr;
//Base price for BSS ICO. Show how much Wei is in 1 BSS. During ICO price calculate from the $rate
uint internal constant rate = 3300000000000000;
uint public token_iso_price;
// Генерируется в Crowdsale constructor
// BasisToken public token = new BasisToken();
// Time sructure of Basis ico
// start_declaration of first round of Basis ico - Presale ( start_declaration of token creation and ico Presale )
uint public start_declaration = 1511384400;
// The period for calculate the time structure of Basis ico, amount of the days
uint public ico_period = 15;
// First round finish - Presale finish
uint public presale_finish;
// ico Second raund start.
uint public second_round_start;
// Basis ico finish, all mint are closed
uint public ico_finish = start_declaration + (ico_period * 1 days).mul(6);
// Limmits and callculation of total minted Basis token
uint public constant hardcap = 1536000;
// minimal for softcap
uint public softcap = 150000;
// Total suplied Basis token during ICO
uint public bssTotalSuply;
// Wei raised during ICO
uint public weiRaised;
// list of owners and token balances
mapping(address => uint) public ico_balances;
// list of owners and ether balances for refund
mapping(address => uint) public ico_investor;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event Finalized();
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
bool RefundICO =false;
bool isFinalized =false;
// The map of allowed tokens for external address access
mapping (address => mapping (address => uint256)) allowed;
// The constractor of contract ...
function BasisIco() public {
}
modifier saleIsOn() {
}
modifier NoBreak() {
}
modifier isUnderHardCap() {
}
modifier onlyOwner() {
}
function setPrice () public isUnderHardCap saleIsOn {
}
function getActualPrice() public returns (uint) {
}
function validPurchase(uint _msg_value) internal constant returns (bool) {
}
function token_mint(address _investor, uint _tokens, uint _wei) internal {
}
function buyTokens() external payable saleIsOn NoBreak {
}
// fallback function can be used to buy tokens
function () external payable {
}
function buyTokensFor(address beneficiary) public payable saleIsOn NoBreak {
}
function extraTokenMint(address beneficiary, uint _tokens) external payable saleIsOn onlyOwner {
}
function goalReached() public constant returns (bool) {
}
function bounty_mining () internal {
}
// vault finalization task, called when owner calls finalize()
function finalization() public onlyOwner {
}
function investor_Refund() public {
require(<FILL_ME>)
address investor = msg.sender;
uint for_refund = ico_investor[msg.sender];
investor.transfer(for_refund);
}
function EtherTakeAfterSoftcap () onlyOwner public {
}
function balanceOf(address _owner) constant public returns (uint256 balance) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
}
}
| RefundICO&&isFinalized | 373,119 | RefundICO&&isFinalized |
"Sold Out" | 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 {
}
}
// 100 procedurally generated video files make up the NFTs that double as a membership to the exclusive Millionaires Club.
// MC will be donating 5 million USD thorughout the release to 5 different charities chosen by its members.
pragma solidity ^0.7.0;
pragma abicoder v2;
contract MillionairesClub is ERC721, Ownable {
using SafeMath for uint256;
string public MEMBERSHIP_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN MEMBERSHIPS 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 millionairesclubCost = 305000000000000000000; // 305 ETH; approxiamately 1,000,000 USD at time of launch
uint public constant maxMembershipPurchase = 1;
uint256 public constant MAX_MEMBERSHIPS = 100;
bool public saleIsActive = false;
mapping(uint => string) public membershipName;
// Reserve 1 membership for Giveaway
uint public membershipReserve = 1;
event membershipNameChange(address _by, uint _tokenId, string _name);
event licenseisLocked(string _licenseText);
constructor() ERC721("Millionaires Club NFT", "MCN") { }
function withdraw() public onlyOwner {
}
function reserveMembership(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 mintMillionairesClub(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint Membership");
require(numberOfTokens > 0 && numberOfTokens <= maxMembershipPurchase, "Can only mint 1 token per account");
require(<FILL_ME>)
require(msg.value >= millionairesclubCost.mul(numberOfTokens), "Ether value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_MEMBERSHIPS) {
_safeMint(msg.sender, mintIndex);
}
}
}
function changeMembershipName(uint _tokenId, string memory _name) public {
}
function viewMembershipName(uint _tokenId) public view returns( string memory ){
}
// GET Membership OF A WALLET AS STRING.
function membershipNameOfOwner(address _owner) external view returns(string[] memory ) {
}
}
| totalSupply().add(numberOfTokens)<=MAX_MEMBERSHIPS,"Sold Out" | 373,129 | totalSupply().add(numberOfTokens)<=MAX_MEMBERSHIPS |
"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 {
}
}
// 100 procedurally generated video files make up the NFTs that double as a membership to the exclusive Millionaires Club.
// MC will be donating 5 million USD thorughout the release to 5 different charities chosen by its members.
pragma solidity ^0.7.0;
pragma abicoder v2;
contract MillionairesClub is ERC721, Ownable {
using SafeMath for uint256;
string public MEMBERSHIP_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN MEMBERSHIPS 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 millionairesclubCost = 305000000000000000000; // 305 ETH; approxiamately 1,000,000 USD at time of launch
uint public constant maxMembershipPurchase = 1;
uint256 public constant MAX_MEMBERSHIPS = 100;
bool public saleIsActive = false;
mapping(uint => string) public membershipName;
// Reserve 1 membership for Giveaway
uint public membershipReserve = 1;
event membershipNameChange(address _by, uint _tokenId, string _name);
event licenseisLocked(string _licenseText);
constructor() ERC721("Millionaires Club NFT", "MCN") { }
function withdraw() public onlyOwner {
}
function reserveMembership(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 mintMillionairesClub(uint numberOfTokens) public payable {
}
function changeMembershipName(uint _tokenId, string memory _name) public {
require(ownerOf(_tokenId) == msg.sender, "Your wallet does not own this token");
require(<FILL_ME>)
membershipName[_tokenId] = _name;
emit membershipNameChange(msg.sender, _tokenId, _name);
}
function viewMembershipName(uint _tokenId) public view returns( string memory ){
}
// GET Membership OF A WALLET AS STRING.
function membershipNameOfOwner(address _owner) external view returns(string[] memory ) {
}
}
| sha256(bytes(_name))!=sha256(bytes(membershipName[_tokenId])),"New name is same as the current one" | 373,129 | sha256(bytes(_name))!=sha256(bytes(membershipName[_tokenId])) |
"Referral Id Does Not Exist" | pragma solidity ^0.4.23;
// SPDX-License-Identifier: MIT
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract deracle is Ownable{
struct User{
int32 Id;
int8 ReferCount;
int8 Level;
int32 UplineId;
int32 LeftId;
int32 RightId;
int32 Position;
int32 ReferralId;
address OwnerAddress;
bool IsPayout;
bool IsEndGamePayout;
uint CreatedBlock;
uint CreatedTime;
}
mapping(uint32 => User) userlistbypos;
mapping(uint32 => User) userlistbyid;
mapping(address => int32[]) public userids;
int8 public currentLevel;
int public userCounter = 0;
int idcounter = 3;
uint32 public nextPosition = 1;
address public token;
address public owner;
address private keeper;
address public maintainer;
uint public ExpiryInvestmentTimestamp;
bool public IsExpired;
uint public PayoutAmount;
uint public MainterPayoutAmount;
int public UnpaidUserCount;
int public nextUnpaidUser = 3;
IERC20 public ERC20Interface;
struct Transfer {
address contract_;
address to_;
uint256 amount_;
bool failed_;
}
/**
* @dev Event to notify if transfer successful or failed * after account approval verified */
event TransferSuccessful(
address indexed from_,
address indexed to_,
uint256 amount_
);
event TransferFailed(
address indexed from_,
address indexed to_,
uint256 amount_
);
/**
* @dev a list of all transfers successful or unsuccessful */
Transfer public transaction;
// uint public investamt = 500000000;
// uint public referralamt = 250000000;
// uint public maintaineramt = 50000000;
uint public investamt = 100000;
uint public referralamt = 50000;
uint public maintaineramt = 10000;
constructor() public {
}
function Invest(int8 quantity, uint32 uplineId) public returns (bool){
require(quantity > 0, "Minimum Investment Quantity Is 1");
require(<FILL_ME>)
require(isContractAlive(), "Contract terminated. Investment was helt for more than 365 days");
for(int32 j =0; j < quantity; j++){
//Pay the platform
require(!IsExpired, "Contract terminated. Investment was helt for more than 365 days");
require(depositTokens(uplineId));
User memory user;
int32[] memory array = new int32[](1);
array[0] = 1;
if(nextPosition == 1){
user.Id = 1;
user.ReferCount = 0;
user.Level = 0;
user.UplineId = -1;
user.LeftId = -1;
user.RightId = -1;
user.Position = 1;
user.ReferralId = -1;
user.OwnerAddress = msg.sender;
user.IsPayout = true;
user.IsEndGamePayout = true;
user.CreatedBlock = 0;
user.CreatedTime = 0;
userlistbyid[1] = user;
userlistbypos[1] = user;
nextPosition = 2;
}
userCounter += idcounter;
//GET UPLINE
User memory upline = userlistbyid[uint32(uplineId)];
//CHECK WHICH SLOT UPLINE MADE
int32 connectedUplineId = 0;
int32 uplinereferred = upline.ReferCount;
if (uplinereferred < 2) //1st / 2nd leg
{
connectedUplineId = insertNext(uplineId);
}
else //3rd LEG , RESET , FIND THE SUITABLE NODE
{
connectedUplineId = insertThird(uplineId);
}
int isrightleg = 0;
if (userlistbyid[uint32(connectedUplineId)].LeftId != -1) {
isrightleg = 1;
userlistbyid[uint32(connectedUplineId)].RightId = int32(userCounter);
}
else
{
userlistbyid[uint32(connectedUplineId)].LeftId = int32(userCounter);
}
user.Id = int32(userCounter);
user.ReferCount = 0;
user.Level = userlistbyid[uint32(connectedUplineId)].Level + 1;
user.UplineId = int32(connectedUplineId);
user.LeftId = -1;
user.RightId = -1;
user.Position = int32((userlistbyid[uint32(connectedUplineId)].Position * 2) + isrightleg);
user.OwnerAddress = msg.sender;
user.ReferralId = int32(uplineId);
user.IsPayout = false;
user.IsEndGamePayout = false;
user.CreatedBlock = block_call();
user.CreatedTime = time_call();
if(user.Level > currentLevel){
currentLevel = user.Level;
}
userlistbyid[uint32(userCounter)] = user;
userlistbypos[uint32(user.Position)] = user;
userids[msg.sender].push(int32(user.Id));
ExpiryInvestmentTimestamp = time_call() + 365 days;
}
return true;
}
function isUserExists(uint32 userid) view internal returns (bool) {
}
function isContractAlive() view internal returns (bool){
}
function block_call() view internal returns (uint256 blocknumber){
}
function time_call() view internal returns (uint256 timestamp){
}
function insertNext(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function insertThird(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function depositTokens(
uint32 uplineId
) internal returns (bool success){
}
function Payout3XReward(uint32 UserId) public{
}
function checkPayoutTree(uint32 UserId) view public returns(bool){
}
function Payout(uint32 UserId) internal{
}
function PayoutMaintainer() public onlyOwner{
}
function getUserByAddress(address userAddress) view public returns (int32[] useridlist){
}
function getUserIds(address userAddress) view public returns (int32[]){
}
// function GetTreeByUserId(uint32 UserId, bool report) view public returns (User[]){
// //Get Position
// uint32 userposition = uint32(userlistbyid[uint32(UserId)].Position);
// //Try to return all data base on position
// uint userCount = 0;
// if(report){
// userCount = uint((2 ** (uint(currentLevel) + 1)) - 1);
// }
// else{
// userCount = 15;
// }
// User[] memory userlist = new User[](userCount);
// uint counter = 0;
// uint32 availablenodes = 2;
// int8 userlevel = 2;
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition].Id)];
// counter++;
// while(true){
// userposition = userposition * 2;
// for(uint32 i = 0; i < availablenodes; i++){
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition + i].Id)];
// counter++;
// }
// availablenodes = availablenodes * 2;
// userlevel++;
// if(report == false){
// if(availablenodes > 8){
// break;
// }
// }
// else{
// if(userlevel > currentLevel){
// break;
// }
// }
// }
// return userlist;
// }
// function GetUserById(uint32 userId) view public returns(User user){
// user = userlistbyid[userId];
// }
function CheckInvestmentExpiry() public onlyOwner{
}
function RemainingInvestorPayout(uint quantity) public onlyOwner returns (bool){
}
function GetContractBalance() view public returns(uint){
}
function GetMaintainerAmount() view public returns(uint){
}
function GetExpiryInvestmentTimestamp() view public returns(uint){
}
function GetIsExpired() view public returns (bool){
}
function GetUnpaidUserCount() view public returns (int){
}
function setMaintainer(address address_)
public
onlyOwner
returns (bool)
{
}
function setToken(address address_)
public
onlyOwner
returns (bool)
{
}
function testSetExpiryTrue() public{
}
function testSetExpiryFalse() public{
}
function sosPayout() public onlyOwner{
}
}
| isUserExists(uplineId),"Referral Id Does Not Exist" | 373,190 | isUserExists(uplineId) |
"Contract terminated. Investment was helt for more than 365 days" | pragma solidity ^0.4.23;
// SPDX-License-Identifier: MIT
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract deracle is Ownable{
struct User{
int32 Id;
int8 ReferCount;
int8 Level;
int32 UplineId;
int32 LeftId;
int32 RightId;
int32 Position;
int32 ReferralId;
address OwnerAddress;
bool IsPayout;
bool IsEndGamePayout;
uint CreatedBlock;
uint CreatedTime;
}
mapping(uint32 => User) userlistbypos;
mapping(uint32 => User) userlistbyid;
mapping(address => int32[]) public userids;
int8 public currentLevel;
int public userCounter = 0;
int idcounter = 3;
uint32 public nextPosition = 1;
address public token;
address public owner;
address private keeper;
address public maintainer;
uint public ExpiryInvestmentTimestamp;
bool public IsExpired;
uint public PayoutAmount;
uint public MainterPayoutAmount;
int public UnpaidUserCount;
int public nextUnpaidUser = 3;
IERC20 public ERC20Interface;
struct Transfer {
address contract_;
address to_;
uint256 amount_;
bool failed_;
}
/**
* @dev Event to notify if transfer successful or failed * after account approval verified */
event TransferSuccessful(
address indexed from_,
address indexed to_,
uint256 amount_
);
event TransferFailed(
address indexed from_,
address indexed to_,
uint256 amount_
);
/**
* @dev a list of all transfers successful or unsuccessful */
Transfer public transaction;
// uint public investamt = 500000000;
// uint public referralamt = 250000000;
// uint public maintaineramt = 50000000;
uint public investamt = 100000;
uint public referralamt = 50000;
uint public maintaineramt = 10000;
constructor() public {
}
function Invest(int8 quantity, uint32 uplineId) public returns (bool){
require(quantity > 0, "Minimum Investment Quantity Is 1");
require(isUserExists(uplineId), "Referral Id Does Not Exist");
require(<FILL_ME>)
for(int32 j =0; j < quantity; j++){
//Pay the platform
require(!IsExpired, "Contract terminated. Investment was helt for more than 365 days");
require(depositTokens(uplineId));
User memory user;
int32[] memory array = new int32[](1);
array[0] = 1;
if(nextPosition == 1){
user.Id = 1;
user.ReferCount = 0;
user.Level = 0;
user.UplineId = -1;
user.LeftId = -1;
user.RightId = -1;
user.Position = 1;
user.ReferralId = -1;
user.OwnerAddress = msg.sender;
user.IsPayout = true;
user.IsEndGamePayout = true;
user.CreatedBlock = 0;
user.CreatedTime = 0;
userlistbyid[1] = user;
userlistbypos[1] = user;
nextPosition = 2;
}
userCounter += idcounter;
//GET UPLINE
User memory upline = userlistbyid[uint32(uplineId)];
//CHECK WHICH SLOT UPLINE MADE
int32 connectedUplineId = 0;
int32 uplinereferred = upline.ReferCount;
if (uplinereferred < 2) //1st / 2nd leg
{
connectedUplineId = insertNext(uplineId);
}
else //3rd LEG , RESET , FIND THE SUITABLE NODE
{
connectedUplineId = insertThird(uplineId);
}
int isrightleg = 0;
if (userlistbyid[uint32(connectedUplineId)].LeftId != -1) {
isrightleg = 1;
userlistbyid[uint32(connectedUplineId)].RightId = int32(userCounter);
}
else
{
userlistbyid[uint32(connectedUplineId)].LeftId = int32(userCounter);
}
user.Id = int32(userCounter);
user.ReferCount = 0;
user.Level = userlistbyid[uint32(connectedUplineId)].Level + 1;
user.UplineId = int32(connectedUplineId);
user.LeftId = -1;
user.RightId = -1;
user.Position = int32((userlistbyid[uint32(connectedUplineId)].Position * 2) + isrightleg);
user.OwnerAddress = msg.sender;
user.ReferralId = int32(uplineId);
user.IsPayout = false;
user.IsEndGamePayout = false;
user.CreatedBlock = block_call();
user.CreatedTime = time_call();
if(user.Level > currentLevel){
currentLevel = user.Level;
}
userlistbyid[uint32(userCounter)] = user;
userlistbypos[uint32(user.Position)] = user;
userids[msg.sender].push(int32(user.Id));
ExpiryInvestmentTimestamp = time_call() + 365 days;
}
return true;
}
function isUserExists(uint32 userid) view internal returns (bool) {
}
function isContractAlive() view internal returns (bool){
}
function block_call() view internal returns (uint256 blocknumber){
}
function time_call() view internal returns (uint256 timestamp){
}
function insertNext(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function insertThird(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function depositTokens(
uint32 uplineId
) internal returns (bool success){
}
function Payout3XReward(uint32 UserId) public{
}
function checkPayoutTree(uint32 UserId) view public returns(bool){
}
function Payout(uint32 UserId) internal{
}
function PayoutMaintainer() public onlyOwner{
}
function getUserByAddress(address userAddress) view public returns (int32[] useridlist){
}
function getUserIds(address userAddress) view public returns (int32[]){
}
// function GetTreeByUserId(uint32 UserId, bool report) view public returns (User[]){
// //Get Position
// uint32 userposition = uint32(userlistbyid[uint32(UserId)].Position);
// //Try to return all data base on position
// uint userCount = 0;
// if(report){
// userCount = uint((2 ** (uint(currentLevel) + 1)) - 1);
// }
// else{
// userCount = 15;
// }
// User[] memory userlist = new User[](userCount);
// uint counter = 0;
// uint32 availablenodes = 2;
// int8 userlevel = 2;
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition].Id)];
// counter++;
// while(true){
// userposition = userposition * 2;
// for(uint32 i = 0; i < availablenodes; i++){
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition + i].Id)];
// counter++;
// }
// availablenodes = availablenodes * 2;
// userlevel++;
// if(report == false){
// if(availablenodes > 8){
// break;
// }
// }
// else{
// if(userlevel > currentLevel){
// break;
// }
// }
// }
// return userlist;
// }
// function GetUserById(uint32 userId) view public returns(User user){
// user = userlistbyid[userId];
// }
function CheckInvestmentExpiry() public onlyOwner{
}
function RemainingInvestorPayout(uint quantity) public onlyOwner returns (bool){
}
function GetContractBalance() view public returns(uint){
}
function GetMaintainerAmount() view public returns(uint){
}
function GetExpiryInvestmentTimestamp() view public returns(uint){
}
function GetIsExpired() view public returns (bool){
}
function GetUnpaidUserCount() view public returns (int){
}
function setMaintainer(address address_)
public
onlyOwner
returns (bool)
{
}
function setToken(address address_)
public
onlyOwner
returns (bool)
{
}
function testSetExpiryTrue() public{
}
function testSetExpiryFalse() public{
}
function sosPayout() public onlyOwner{
}
}
| isContractAlive(),"Contract terminated. Investment was helt for more than 365 days" | 373,190 | isContractAlive() |
"Contract terminated. Investment was helt for more than 365 days" | pragma solidity ^0.4.23;
// SPDX-License-Identifier: MIT
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract deracle is Ownable{
struct User{
int32 Id;
int8 ReferCount;
int8 Level;
int32 UplineId;
int32 LeftId;
int32 RightId;
int32 Position;
int32 ReferralId;
address OwnerAddress;
bool IsPayout;
bool IsEndGamePayout;
uint CreatedBlock;
uint CreatedTime;
}
mapping(uint32 => User) userlistbypos;
mapping(uint32 => User) userlistbyid;
mapping(address => int32[]) public userids;
int8 public currentLevel;
int public userCounter = 0;
int idcounter = 3;
uint32 public nextPosition = 1;
address public token;
address public owner;
address private keeper;
address public maintainer;
uint public ExpiryInvestmentTimestamp;
bool public IsExpired;
uint public PayoutAmount;
uint public MainterPayoutAmount;
int public UnpaidUserCount;
int public nextUnpaidUser = 3;
IERC20 public ERC20Interface;
struct Transfer {
address contract_;
address to_;
uint256 amount_;
bool failed_;
}
/**
* @dev Event to notify if transfer successful or failed * after account approval verified */
event TransferSuccessful(
address indexed from_,
address indexed to_,
uint256 amount_
);
event TransferFailed(
address indexed from_,
address indexed to_,
uint256 amount_
);
/**
* @dev a list of all transfers successful or unsuccessful */
Transfer public transaction;
// uint public investamt = 500000000;
// uint public referralamt = 250000000;
// uint public maintaineramt = 50000000;
uint public investamt = 100000;
uint public referralamt = 50000;
uint public maintaineramt = 10000;
constructor() public {
}
function Invest(int8 quantity, uint32 uplineId) public returns (bool){
require(quantity > 0, "Minimum Investment Quantity Is 1");
require(isUserExists(uplineId), "Referral Id Does Not Exist");
require(isContractAlive(), "Contract terminated. Investment was helt for more than 365 days");
for(int32 j =0; j < quantity; j++){
//Pay the platform
require(<FILL_ME>)
require(depositTokens(uplineId));
User memory user;
int32[] memory array = new int32[](1);
array[0] = 1;
if(nextPosition == 1){
user.Id = 1;
user.ReferCount = 0;
user.Level = 0;
user.UplineId = -1;
user.LeftId = -1;
user.RightId = -1;
user.Position = 1;
user.ReferralId = -1;
user.OwnerAddress = msg.sender;
user.IsPayout = true;
user.IsEndGamePayout = true;
user.CreatedBlock = 0;
user.CreatedTime = 0;
userlistbyid[1] = user;
userlistbypos[1] = user;
nextPosition = 2;
}
userCounter += idcounter;
//GET UPLINE
User memory upline = userlistbyid[uint32(uplineId)];
//CHECK WHICH SLOT UPLINE MADE
int32 connectedUplineId = 0;
int32 uplinereferred = upline.ReferCount;
if (uplinereferred < 2) //1st / 2nd leg
{
connectedUplineId = insertNext(uplineId);
}
else //3rd LEG , RESET , FIND THE SUITABLE NODE
{
connectedUplineId = insertThird(uplineId);
}
int isrightleg = 0;
if (userlistbyid[uint32(connectedUplineId)].LeftId != -1) {
isrightleg = 1;
userlistbyid[uint32(connectedUplineId)].RightId = int32(userCounter);
}
else
{
userlistbyid[uint32(connectedUplineId)].LeftId = int32(userCounter);
}
user.Id = int32(userCounter);
user.ReferCount = 0;
user.Level = userlistbyid[uint32(connectedUplineId)].Level + 1;
user.UplineId = int32(connectedUplineId);
user.LeftId = -1;
user.RightId = -1;
user.Position = int32((userlistbyid[uint32(connectedUplineId)].Position * 2) + isrightleg);
user.OwnerAddress = msg.sender;
user.ReferralId = int32(uplineId);
user.IsPayout = false;
user.IsEndGamePayout = false;
user.CreatedBlock = block_call();
user.CreatedTime = time_call();
if(user.Level > currentLevel){
currentLevel = user.Level;
}
userlistbyid[uint32(userCounter)] = user;
userlistbypos[uint32(user.Position)] = user;
userids[msg.sender].push(int32(user.Id));
ExpiryInvestmentTimestamp = time_call() + 365 days;
}
return true;
}
function isUserExists(uint32 userid) view internal returns (bool) {
}
function isContractAlive() view internal returns (bool){
}
function block_call() view internal returns (uint256 blocknumber){
}
function time_call() view internal returns (uint256 timestamp){
}
function insertNext(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function insertThird(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function depositTokens(
uint32 uplineId
) internal returns (bool success){
}
function Payout3XReward(uint32 UserId) public{
}
function checkPayoutTree(uint32 UserId) view public returns(bool){
}
function Payout(uint32 UserId) internal{
}
function PayoutMaintainer() public onlyOwner{
}
function getUserByAddress(address userAddress) view public returns (int32[] useridlist){
}
function getUserIds(address userAddress) view public returns (int32[]){
}
// function GetTreeByUserId(uint32 UserId, bool report) view public returns (User[]){
// //Get Position
// uint32 userposition = uint32(userlistbyid[uint32(UserId)].Position);
// //Try to return all data base on position
// uint userCount = 0;
// if(report){
// userCount = uint((2 ** (uint(currentLevel) + 1)) - 1);
// }
// else{
// userCount = 15;
// }
// User[] memory userlist = new User[](userCount);
// uint counter = 0;
// uint32 availablenodes = 2;
// int8 userlevel = 2;
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition].Id)];
// counter++;
// while(true){
// userposition = userposition * 2;
// for(uint32 i = 0; i < availablenodes; i++){
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition + i].Id)];
// counter++;
// }
// availablenodes = availablenodes * 2;
// userlevel++;
// if(report == false){
// if(availablenodes > 8){
// break;
// }
// }
// else{
// if(userlevel > currentLevel){
// break;
// }
// }
// }
// return userlist;
// }
// function GetUserById(uint32 userId) view public returns(User user){
// user = userlistbyid[userId];
// }
function CheckInvestmentExpiry() public onlyOwner{
}
function RemainingInvestorPayout(uint quantity) public onlyOwner returns (bool){
}
function GetContractBalance() view public returns(uint){
}
function GetMaintainerAmount() view public returns(uint){
}
function GetExpiryInvestmentTimestamp() view public returns(uint){
}
function GetIsExpired() view public returns (bool){
}
function GetUnpaidUserCount() view public returns (int){
}
function setMaintainer(address address_)
public
onlyOwner
returns (bool)
{
}
function setToken(address address_)
public
onlyOwner
returns (bool)
{
}
function testSetExpiryTrue() public{
}
function testSetExpiryFalse() public{
}
function sosPayout() public onlyOwner{
}
}
| !IsExpired,"Contract terminated. Investment was helt for more than 365 days" | 373,190 | !IsExpired |
null | pragma solidity ^0.4.23;
// SPDX-License-Identifier: MIT
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract deracle is Ownable{
struct User{
int32 Id;
int8 ReferCount;
int8 Level;
int32 UplineId;
int32 LeftId;
int32 RightId;
int32 Position;
int32 ReferralId;
address OwnerAddress;
bool IsPayout;
bool IsEndGamePayout;
uint CreatedBlock;
uint CreatedTime;
}
mapping(uint32 => User) userlistbypos;
mapping(uint32 => User) userlistbyid;
mapping(address => int32[]) public userids;
int8 public currentLevel;
int public userCounter = 0;
int idcounter = 3;
uint32 public nextPosition = 1;
address public token;
address public owner;
address private keeper;
address public maintainer;
uint public ExpiryInvestmentTimestamp;
bool public IsExpired;
uint public PayoutAmount;
uint public MainterPayoutAmount;
int public UnpaidUserCount;
int public nextUnpaidUser = 3;
IERC20 public ERC20Interface;
struct Transfer {
address contract_;
address to_;
uint256 amount_;
bool failed_;
}
/**
* @dev Event to notify if transfer successful or failed * after account approval verified */
event TransferSuccessful(
address indexed from_,
address indexed to_,
uint256 amount_
);
event TransferFailed(
address indexed from_,
address indexed to_,
uint256 amount_
);
/**
* @dev a list of all transfers successful or unsuccessful */
Transfer public transaction;
// uint public investamt = 500000000;
// uint public referralamt = 250000000;
// uint public maintaineramt = 50000000;
uint public investamt = 100000;
uint public referralamt = 50000;
uint public maintaineramt = 10000;
constructor() public {
}
function Invest(int8 quantity, uint32 uplineId) public returns (bool){
require(quantity > 0, "Minimum Investment Quantity Is 1");
require(isUserExists(uplineId), "Referral Id Does Not Exist");
require(isContractAlive(), "Contract terminated. Investment was helt for more than 365 days");
for(int32 j =0; j < quantity; j++){
//Pay the platform
require(!IsExpired, "Contract terminated. Investment was helt for more than 365 days");
require(<FILL_ME>)
User memory user;
int32[] memory array = new int32[](1);
array[0] = 1;
if(nextPosition == 1){
user.Id = 1;
user.ReferCount = 0;
user.Level = 0;
user.UplineId = -1;
user.LeftId = -1;
user.RightId = -1;
user.Position = 1;
user.ReferralId = -1;
user.OwnerAddress = msg.sender;
user.IsPayout = true;
user.IsEndGamePayout = true;
user.CreatedBlock = 0;
user.CreatedTime = 0;
userlistbyid[1] = user;
userlistbypos[1] = user;
nextPosition = 2;
}
userCounter += idcounter;
//GET UPLINE
User memory upline = userlistbyid[uint32(uplineId)];
//CHECK WHICH SLOT UPLINE MADE
int32 connectedUplineId = 0;
int32 uplinereferred = upline.ReferCount;
if (uplinereferred < 2) //1st / 2nd leg
{
connectedUplineId = insertNext(uplineId);
}
else //3rd LEG , RESET , FIND THE SUITABLE NODE
{
connectedUplineId = insertThird(uplineId);
}
int isrightleg = 0;
if (userlistbyid[uint32(connectedUplineId)].LeftId != -1) {
isrightleg = 1;
userlistbyid[uint32(connectedUplineId)].RightId = int32(userCounter);
}
else
{
userlistbyid[uint32(connectedUplineId)].LeftId = int32(userCounter);
}
user.Id = int32(userCounter);
user.ReferCount = 0;
user.Level = userlistbyid[uint32(connectedUplineId)].Level + 1;
user.UplineId = int32(connectedUplineId);
user.LeftId = -1;
user.RightId = -1;
user.Position = int32((userlistbyid[uint32(connectedUplineId)].Position * 2) + isrightleg);
user.OwnerAddress = msg.sender;
user.ReferralId = int32(uplineId);
user.IsPayout = false;
user.IsEndGamePayout = false;
user.CreatedBlock = block_call();
user.CreatedTime = time_call();
if(user.Level > currentLevel){
currentLevel = user.Level;
}
userlistbyid[uint32(userCounter)] = user;
userlistbypos[uint32(user.Position)] = user;
userids[msg.sender].push(int32(user.Id));
ExpiryInvestmentTimestamp = time_call() + 365 days;
}
return true;
}
function isUserExists(uint32 userid) view internal returns (bool) {
}
function isContractAlive() view internal returns (bool){
}
function block_call() view internal returns (uint256 blocknumber){
}
function time_call() view internal returns (uint256 timestamp){
}
function insertNext(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function insertThird(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function depositTokens(
uint32 uplineId
) internal returns (bool success){
}
function Payout3XReward(uint32 UserId) public{
}
function checkPayoutTree(uint32 UserId) view public returns(bool){
}
function Payout(uint32 UserId) internal{
}
function PayoutMaintainer() public onlyOwner{
}
function getUserByAddress(address userAddress) view public returns (int32[] useridlist){
}
function getUserIds(address userAddress) view public returns (int32[]){
}
// function GetTreeByUserId(uint32 UserId, bool report) view public returns (User[]){
// //Get Position
// uint32 userposition = uint32(userlistbyid[uint32(UserId)].Position);
// //Try to return all data base on position
// uint userCount = 0;
// if(report){
// userCount = uint((2 ** (uint(currentLevel) + 1)) - 1);
// }
// else{
// userCount = 15;
// }
// User[] memory userlist = new User[](userCount);
// uint counter = 0;
// uint32 availablenodes = 2;
// int8 userlevel = 2;
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition].Id)];
// counter++;
// while(true){
// userposition = userposition * 2;
// for(uint32 i = 0; i < availablenodes; i++){
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition + i].Id)];
// counter++;
// }
// availablenodes = availablenodes * 2;
// userlevel++;
// if(report == false){
// if(availablenodes > 8){
// break;
// }
// }
// else{
// if(userlevel > currentLevel){
// break;
// }
// }
// }
// return userlist;
// }
// function GetUserById(uint32 userId) view public returns(User user){
// user = userlistbyid[userId];
// }
function CheckInvestmentExpiry() public onlyOwner{
}
function RemainingInvestorPayout(uint quantity) public onlyOwner returns (bool){
}
function GetContractBalance() view public returns(uint){
}
function GetMaintainerAmount() view public returns(uint){
}
function GetExpiryInvestmentTimestamp() view public returns(uint){
}
function GetIsExpired() view public returns (bool){
}
function GetUnpaidUserCount() view public returns (int){
}
function setMaintainer(address address_)
public
onlyOwner
returns (bool)
{
}
function setToken(address address_)
public
onlyOwner
returns (bool)
{
}
function testSetExpiryTrue() public{
}
function testSetExpiryFalse() public{
}
function sosPayout() public onlyOwner{
}
}
| depositTokens(uplineId) | 373,190 | depositTokens(uplineId) |
"User already received 3x payout" | pragma solidity ^0.4.23;
// SPDX-License-Identifier: MIT
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract deracle is Ownable{
struct User{
int32 Id;
int8 ReferCount;
int8 Level;
int32 UplineId;
int32 LeftId;
int32 RightId;
int32 Position;
int32 ReferralId;
address OwnerAddress;
bool IsPayout;
bool IsEndGamePayout;
uint CreatedBlock;
uint CreatedTime;
}
mapping(uint32 => User) userlistbypos;
mapping(uint32 => User) userlistbyid;
mapping(address => int32[]) public userids;
int8 public currentLevel;
int public userCounter = 0;
int idcounter = 3;
uint32 public nextPosition = 1;
address public token;
address public owner;
address private keeper;
address public maintainer;
uint public ExpiryInvestmentTimestamp;
bool public IsExpired;
uint public PayoutAmount;
uint public MainterPayoutAmount;
int public UnpaidUserCount;
int public nextUnpaidUser = 3;
IERC20 public ERC20Interface;
struct Transfer {
address contract_;
address to_;
uint256 amount_;
bool failed_;
}
/**
* @dev Event to notify if transfer successful or failed * after account approval verified */
event TransferSuccessful(
address indexed from_,
address indexed to_,
uint256 amount_
);
event TransferFailed(
address indexed from_,
address indexed to_,
uint256 amount_
);
/**
* @dev a list of all transfers successful or unsuccessful */
Transfer public transaction;
// uint public investamt = 500000000;
// uint public referralamt = 250000000;
// uint public maintaineramt = 50000000;
uint public investamt = 100000;
uint public referralamt = 50000;
uint public maintaineramt = 10000;
constructor() public {
}
function Invest(int8 quantity, uint32 uplineId) public returns (bool){
}
function isUserExists(uint32 userid) view internal returns (bool) {
}
function isContractAlive() view internal returns (bool){
}
function block_call() view internal returns (uint256 blocknumber){
}
function time_call() view internal returns (uint256 timestamp){
}
function insertNext(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function insertThird(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function depositTokens(
uint32 uplineId
) internal returns (bool success){
}
function Payout3XReward(uint32 UserId) public{
}
function checkPayoutTree(uint32 UserId) view public returns(bool){
}
function Payout(uint32 UserId) internal{
require(<FILL_ME>)
if(userlistbyid[UserId].IsPayout == false){
userlistbyid[UserId].IsPayout = true;
ERC20Interface.transfer(userlistbyid[UserId].OwnerAddress, investamt*3);
UnpaidUserCount--;
}
}
function PayoutMaintainer() public onlyOwner{
}
function getUserByAddress(address userAddress) view public returns (int32[] useridlist){
}
function getUserIds(address userAddress) view public returns (int32[]){
}
// function GetTreeByUserId(uint32 UserId, bool report) view public returns (User[]){
// //Get Position
// uint32 userposition = uint32(userlistbyid[uint32(UserId)].Position);
// //Try to return all data base on position
// uint userCount = 0;
// if(report){
// userCount = uint((2 ** (uint(currentLevel) + 1)) - 1);
// }
// else{
// userCount = 15;
// }
// User[] memory userlist = new User[](userCount);
// uint counter = 0;
// uint32 availablenodes = 2;
// int8 userlevel = 2;
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition].Id)];
// counter++;
// while(true){
// userposition = userposition * 2;
// for(uint32 i = 0; i < availablenodes; i++){
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition + i].Id)];
// counter++;
// }
// availablenodes = availablenodes * 2;
// userlevel++;
// if(report == false){
// if(availablenodes > 8){
// break;
// }
// }
// else{
// if(userlevel > currentLevel){
// break;
// }
// }
// }
// return userlist;
// }
// function GetUserById(uint32 userId) view public returns(User user){
// user = userlistbyid[userId];
// }
function CheckInvestmentExpiry() public onlyOwner{
}
function RemainingInvestorPayout(uint quantity) public onlyOwner returns (bool){
}
function GetContractBalance() view public returns(uint){
}
function GetMaintainerAmount() view public returns(uint){
}
function GetExpiryInvestmentTimestamp() view public returns(uint){
}
function GetIsExpired() view public returns (bool){
}
function GetUnpaidUserCount() view public returns (int){
}
function setMaintainer(address address_)
public
onlyOwner
returns (bool)
{
}
function setToken(address address_)
public
onlyOwner
returns (bool)
{
}
function testSetExpiryTrue() public{
}
function testSetExpiryFalse() public{
}
function sosPayout() public onlyOwner{
}
}
| userlistbyid[UserId].IsPayout==false,"User already received 3x payout" | 373,190 | userlistbyid[UserId].IsPayout==false |
"Contract is alive." | pragma solidity ^0.4.23;
// SPDX-License-Identifier: MIT
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract deracle is Ownable{
struct User{
int32 Id;
int8 ReferCount;
int8 Level;
int32 UplineId;
int32 LeftId;
int32 RightId;
int32 Position;
int32 ReferralId;
address OwnerAddress;
bool IsPayout;
bool IsEndGamePayout;
uint CreatedBlock;
uint CreatedTime;
}
mapping(uint32 => User) userlistbypos;
mapping(uint32 => User) userlistbyid;
mapping(address => int32[]) public userids;
int8 public currentLevel;
int public userCounter = 0;
int idcounter = 3;
uint32 public nextPosition = 1;
address public token;
address public owner;
address private keeper;
address public maintainer;
uint public ExpiryInvestmentTimestamp;
bool public IsExpired;
uint public PayoutAmount;
uint public MainterPayoutAmount;
int public UnpaidUserCount;
int public nextUnpaidUser = 3;
IERC20 public ERC20Interface;
struct Transfer {
address contract_;
address to_;
uint256 amount_;
bool failed_;
}
/**
* @dev Event to notify if transfer successful or failed * after account approval verified */
event TransferSuccessful(
address indexed from_,
address indexed to_,
uint256 amount_
);
event TransferFailed(
address indexed from_,
address indexed to_,
uint256 amount_
);
/**
* @dev a list of all transfers successful or unsuccessful */
Transfer public transaction;
// uint public investamt = 500000000;
// uint public referralamt = 250000000;
// uint public maintaineramt = 50000000;
uint public investamt = 100000;
uint public referralamt = 50000;
uint public maintaineramt = 10000;
constructor() public {
}
function Invest(int8 quantity, uint32 uplineId) public returns (bool){
}
function isUserExists(uint32 userid) view internal returns (bool) {
}
function isContractAlive() view internal returns (bool){
}
function block_call() view internal returns (uint256 blocknumber){
}
function time_call() view internal returns (uint256 timestamp){
}
function insertNext(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function insertThird(uint32 uplineId) internal returns (int32 connectedUplineId){
}
function depositTokens(
uint32 uplineId
) internal returns (bool success){
}
function Payout3XReward(uint32 UserId) public{
}
function checkPayoutTree(uint32 UserId) view public returns(bool){
}
function Payout(uint32 UserId) internal{
}
function PayoutMaintainer() public onlyOwner{
}
function getUserByAddress(address userAddress) view public returns (int32[] useridlist){
}
function getUserIds(address userAddress) view public returns (int32[]){
}
// function GetTreeByUserId(uint32 UserId, bool report) view public returns (User[]){
// //Get Position
// uint32 userposition = uint32(userlistbyid[uint32(UserId)].Position);
// //Try to return all data base on position
// uint userCount = 0;
// if(report){
// userCount = uint((2 ** (uint(currentLevel) + 1)) - 1);
// }
// else{
// userCount = 15;
// }
// User[] memory userlist = new User[](userCount);
// uint counter = 0;
// uint32 availablenodes = 2;
// int8 userlevel = 2;
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition].Id)];
// counter++;
// while(true){
// userposition = userposition * 2;
// for(uint32 i = 0; i < availablenodes; i++){
// userlist[counter] = userlistbyid[uint32(userlistbypos[userposition + i].Id)];
// counter++;
// }
// availablenodes = availablenodes * 2;
// userlevel++;
// if(report == false){
// if(availablenodes > 8){
// break;
// }
// }
// else{
// if(userlevel > currentLevel){
// break;
// }
// }
// }
// return userlist;
// }
// function GetUserById(uint32 userId) view public returns(User user){
// user = userlistbyid[userId];
// }
function CheckInvestmentExpiry() public onlyOwner{
require(<FILL_ME>)
require(PayoutAmount == 0, "Contract balance is already calculated.");
if(MainterPayoutAmount != 0){
PayoutMaintainer();
}
//Current Date - last Investment Date >= 365 days from last investment date timestamp
if(!isContractAlive()){
IsExpired = true;
uint contractBalance = ERC20Interface.balanceOf(address(this));
PayoutAmount = uint(contractBalance / uint(UnpaidUserCount));
}
}
function RemainingInvestorPayout(uint quantity) public onlyOwner returns (bool){
}
function GetContractBalance() view public returns(uint){
}
function GetMaintainerAmount() view public returns(uint){
}
function GetExpiryInvestmentTimestamp() view public returns(uint){
}
function GetIsExpired() view public returns (bool){
}
function GetUnpaidUserCount() view public returns (int){
}
function setMaintainer(address address_)
public
onlyOwner
returns (bool)
{
}
function setToken(address address_)
public
onlyOwner
returns (bool)
{
}
function testSetExpiryTrue() public{
}
function testSetExpiryFalse() public{
}
function sosPayout() public onlyOwner{
}
}
| !isContractAlive(),"Contract is alive." | 373,190 | !isContractAlive() |
"Purchase would exceed ALIENPHRENS_MAX" | // SPDX-License-Identifier: MIT
/*
``..........................................................................``
`..............................................................................`
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
.........................................................oho....................
................./ss/.................................../NyNo...................
................omsyN:..................................oN+hN...................
................mh//my..................................sN/oN/..................
...............:Ns//hm.......-:/+osssyyyyyysso+/::-.....ym//Ns..................
...............+N+//yN...-/syhhyysooooooooooossyhhhhyo:-yN//hd..................
...............oN+//sN:oyhhso+/osso+///////////+syyysyhhmN//sN-.................
...............ym///yNdyo/////ym++ymo//////////hm::oms/+yN+/+N+.................
...............hm///ym////////hm:``dd//////////ym+.-dd//sN+//hh-................
...............hd///+o/////////sdhddo///////////oyhhy++/+m+//+dd:...............
...............mh///////////////+yhhhs+///////////+ydddy+//////yN+..............
..............-Ny///////////////yN-`-dd///////////sN: .yN+//////sN/.............
..............oN+///////////////+mh+/hm///////////+hmo+hm+///////dd.............
..............ym//////////////////oyys//////////////+sso/////////oN/............
..............sm//////////////////sdhdds////////////+yddhs+///////Ns............
..............:Ns////////////////+Ns :Ns///////////yN.`-dd//////+N+............
...............+No////////////////smhoymo///////////+mh+/hm//////yN-............
................+my+///////////////+ooo+/////////////+oyys+/////oNo.............
.................-ydo//////////////////////+++++///////////////ymo..............
.................../hdo////////////////////hddddh+///////////odh:...............
.................-/sdmmds+//////////////////+++++/////////+sdh+.................
.............../ydhs++oydmdyo+////////////////////////+oshmm/...................
.............-yds+//////++oydddhysoooooo++++ooooossyhhhhyoodd/..................
............/mh+/////////////+osyhhdddddddddhhhhhhyso++////+sms.................
.........../my///////////////////////+++++///////////////////omy................
..........:mh/////////////////////////////////////////////////+my...............
..........dd+//////////////////////////////////////////////////sN:..............
.........oN+//////////++//////////////////////////////////sy////my..............
........-Ny//////////+mo//////////////////////////////////yN+///yN-.............
........ym+//////////dm///////////////////////////////////oNo///+No.............
......./Ns//////////oNo///////////////////////////////////+Ns////dd.............
.......dd///////////dm/////////////////////////////////////Nh////yN-............
`.....+No//////////oNs/////////////////////////////////////dm////oN+...........`
``...mh///////////dm//////////////////////////////////////yN/////my.........``
*/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract ALIENPHRENS is ERC721, Ownable {
using Strings for uint256;
uint256 public constant ALIENPHRENS_MAX = 10000;
uint256 public totalSupply = 0;
string public baseUri = "https://alienphrens.com/api/metadata?id=";
constructor() ERC721("ALIENPHRENS", "ALIENPHRENS") {}
function dynamic_cost(uint256 _supply) internal pure returns (uint256 _cost){
}
// PUBLIC FUNCTIONS
function mint(uint256 _numberOfTokens) external payable {
uint256 curTotalSupply = totalSupply;
require(<FILL_ME>)
if(_numberOfTokens>1){
uint256 cumulative_cost = 0;
for (uint256 n = 1; n <= _numberOfTokens; n++) {
cumulative_cost += dynamic_cost(curTotalSupply+n);
}
require(cumulative_cost <= msg.value, "ETH amount is not sufficient");
}else{
require(dynamic_cost(curTotalSupply+1) <= msg.value, "ETH amount is not sufficient");
}
for (uint256 i = 1; i <= _numberOfTokens; ++i) {
_safeMint(msg.sender, curTotalSupply + i);
}
totalSupply += _numberOfTokens;
}
// OWNER ONLY FUNCTIONS
/* function flipSaleState() external onlyOwner {
isSaleActive = !isSaleActive;
} */
function setBaseURI(string memory _baseUri) external onlyOwner {
}
function withdraw() external payable onlyOwner {
}
// INTERNAL FUNCTIONS
function _baseURI() internal view virtual override returns (string memory) {
}
}
| curTotalSupply+_numberOfTokens<=ALIENPHRENS_MAX,"Purchase would exceed ALIENPHRENS_MAX" | 373,222 | curTotalSupply+_numberOfTokens<=ALIENPHRENS_MAX |
"ETH amount is not sufficient" | // SPDX-License-Identifier: MIT
/*
``..........................................................................``
`..............................................................................`
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
.........................................................oho....................
................./ss/.................................../NyNo...................
................omsyN:..................................oN+hN...................
................mh//my..................................sN/oN/..................
...............:Ns//hm.......-:/+osssyyyyyysso+/::-.....ym//Ns..................
...............+N+//yN...-/syhhyysooooooooooossyhhhhyo:-yN//hd..................
...............oN+//sN:oyhhso+/osso+///////////+syyysyhhmN//sN-.................
...............ym///yNdyo/////ym++ymo//////////hm::oms/+yN+/+N+.................
...............hm///ym////////hm:``dd//////////ym+.-dd//sN+//hh-................
...............hd///+o/////////sdhddo///////////oyhhy++/+m+//+dd:...............
...............mh///////////////+yhhhs+///////////+ydddy+//////yN+..............
..............-Ny///////////////yN-`-dd///////////sN: .yN+//////sN/.............
..............oN+///////////////+mh+/hm///////////+hmo+hm+///////dd.............
..............ym//////////////////oyys//////////////+sso/////////oN/............
..............sm//////////////////sdhdds////////////+yddhs+///////Ns............
..............:Ns////////////////+Ns :Ns///////////yN.`-dd//////+N+............
...............+No////////////////smhoymo///////////+mh+/hm//////yN-............
................+my+///////////////+ooo+/////////////+oyys+/////oNo.............
.................-ydo//////////////////////+++++///////////////ymo..............
.................../hdo////////////////////hddddh+///////////odh:...............
.................-/sdmmds+//////////////////+++++/////////+sdh+.................
.............../ydhs++oydmdyo+////////////////////////+oshmm/...................
.............-yds+//////++oydddhysoooooo++++ooooossyhhhhyoodd/..................
............/mh+/////////////+osyhhdddddddddhhhhhhyso++////+sms.................
.........../my///////////////////////+++++///////////////////omy................
..........:mh/////////////////////////////////////////////////+my...............
..........dd+//////////////////////////////////////////////////sN:..............
.........oN+//////////++//////////////////////////////////sy////my..............
........-Ny//////////+mo//////////////////////////////////yN+///yN-.............
........ym+//////////dm///////////////////////////////////oNo///+No.............
......./Ns//////////oNo///////////////////////////////////+Ns////dd.............
.......dd///////////dm/////////////////////////////////////Nh////yN-............
`.....+No//////////oNs/////////////////////////////////////dm////oN+...........`
``...mh///////////dm//////////////////////////////////////yN/////my.........``
*/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract ALIENPHRENS is ERC721, Ownable {
using Strings for uint256;
uint256 public constant ALIENPHRENS_MAX = 10000;
uint256 public totalSupply = 0;
string public baseUri = "https://alienphrens.com/api/metadata?id=";
constructor() ERC721("ALIENPHRENS", "ALIENPHRENS") {}
function dynamic_cost(uint256 _supply) internal pure returns (uint256 _cost){
}
// PUBLIC FUNCTIONS
function mint(uint256 _numberOfTokens) external payable {
uint256 curTotalSupply = totalSupply;
require(curTotalSupply + _numberOfTokens <= ALIENPHRENS_MAX, "Purchase would exceed ALIENPHRENS_MAX");
if(_numberOfTokens>1){
uint256 cumulative_cost = 0;
for (uint256 n = 1; n <= _numberOfTokens; n++) {
cumulative_cost += dynamic_cost(curTotalSupply+n);
}
require(cumulative_cost <= msg.value, "ETH amount is not sufficient");
}else{
require(<FILL_ME>)
}
for (uint256 i = 1; i <= _numberOfTokens; ++i) {
_safeMint(msg.sender, curTotalSupply + i);
}
totalSupply += _numberOfTokens;
}
// OWNER ONLY FUNCTIONS
/* function flipSaleState() external onlyOwner {
isSaleActive = !isSaleActive;
} */
function setBaseURI(string memory _baseUri) external onlyOwner {
}
function withdraw() external payable onlyOwner {
}
// INTERNAL FUNCTIONS
function _baseURI() internal view virtual override returns (string memory) {
}
}
| dynamic_cost(curTotalSupply+1)<=msg.value,"ETH amount is not sufficient" | 373,222 | dynamic_cost(curTotalSupply+1)<=msg.value |
"The token is not approved" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../contracts/OpenZeppelin/contracts/token/ERC721/ERC721.sol";
import "../contracts/OpenZeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "../contracts/OpenZeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "../contracts/OpenZeppelin/contracts/access/AccessControl.sol";
contract BigFanMinter is ERC721Enumerable, ERC721URIStorage, AccessControl {
bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");
constructor() ERC721("BIG FAN GENESIS COLLECTION", "BFT") {
}
bool public saleStarted = true;
mapping(string => TokenUri) public approvedUris;
mapping (string => Drop) public drops;
struct TokenUri{
bool approved;
bool minted;
}
struct Drop {
uint256 token_price;
bool active;
}
modifier isApprovedTokenURI(string memory _tokenURI) {
require(<FILL_ME>)
require(approvedUris[_tokenURI].minted == false, "The token has been minted");
_;
}
function mint(address _buyer, string memory _tokenURI, string memory drop) public payable isApprovedTokenURI(_tokenURI) returns (uint256)
{
}
function burn(uint256 _tokenId) public onlyRole(DEFAULT_ADMIN_ROLE) returns (bool)
{
}
function approveTokenURI(string memory _tokenURI) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function startDrop(string memory name, uint256 price) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function pauseDrop(string memory name) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function startSale() public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function pauseSale() public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function withdraw() public payable onlyRole(WITHDRAW_ROLE) {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC721, ERC721Enumerable) {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl, ERC721Enumerable) returns (bool) {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
event PermanentURI(string _value, uint256 indexed _id);
event TokenMinted(uint256 tokenId);
}
| approvedUris[_tokenURI].approved==true,"The token is not approved" | 373,238 | approvedUris[_tokenURI].approved==true |
"The token has been minted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../contracts/OpenZeppelin/contracts/token/ERC721/ERC721.sol";
import "../contracts/OpenZeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "../contracts/OpenZeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "../contracts/OpenZeppelin/contracts/access/AccessControl.sol";
contract BigFanMinter is ERC721Enumerable, ERC721URIStorage, AccessControl {
bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");
constructor() ERC721("BIG FAN GENESIS COLLECTION", "BFT") {
}
bool public saleStarted = true;
mapping(string => TokenUri) public approvedUris;
mapping (string => Drop) public drops;
struct TokenUri{
bool approved;
bool minted;
}
struct Drop {
uint256 token_price;
bool active;
}
modifier isApprovedTokenURI(string memory _tokenURI) {
require(approvedUris[_tokenURI].approved == true, "The token is not approved");
require(<FILL_ME>)
_;
}
function mint(address _buyer, string memory _tokenURI, string memory drop) public payable isApprovedTokenURI(_tokenURI) returns (uint256)
{
}
function burn(uint256 _tokenId) public onlyRole(DEFAULT_ADMIN_ROLE) returns (bool)
{
}
function approveTokenURI(string memory _tokenURI) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function startDrop(string memory name, uint256 price) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function pauseDrop(string memory name) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function startSale() public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function pauseSale() public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function withdraw() public payable onlyRole(WITHDRAW_ROLE) {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC721, ERC721Enumerable) {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl, ERC721Enumerable) returns (bool) {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
event PermanentURI(string _value, uint256 indexed _id);
event TokenMinted(uint256 tokenId);
}
| approvedUris[_tokenURI].minted==false,"The token has been minted" | 373,238 | approvedUris[_tokenURI].minted==false |
"The drop is not active or does not exist" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../contracts/OpenZeppelin/contracts/token/ERC721/ERC721.sol";
import "../contracts/OpenZeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "../contracts/OpenZeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "../contracts/OpenZeppelin/contracts/access/AccessControl.sol";
contract BigFanMinter is ERC721Enumerable, ERC721URIStorage, AccessControl {
bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");
constructor() ERC721("BIG FAN GENESIS COLLECTION", "BFT") {
}
bool public saleStarted = true;
mapping(string => TokenUri) public approvedUris;
mapping (string => Drop) public drops;
struct TokenUri{
bool approved;
bool minted;
}
struct Drop {
uint256 token_price;
bool active;
}
modifier isApprovedTokenURI(string memory _tokenURI) {
}
function mint(address _buyer, string memory _tokenURI, string memory drop) public payable isApprovedTokenURI(_tokenURI) returns (uint256)
{
require(<FILL_ME>)
require(drops[drop].token_price == msg.value, "The price is incorrect");
require(saleStarted == true, "The sale is paused");
uint256 newItemId = totalSupply() + 1;
_safeMint(_buyer, newItemId);
_setTokenURI(newItemId, _tokenURI);
approvedUris[_tokenURI].minted = true;
emit PermanentURI(_tokenURI, newItemId);
emit TokenMinted(newItemId);
return newItemId;
}
function burn(uint256 _tokenId) public onlyRole(DEFAULT_ADMIN_ROLE) returns (bool)
{
}
function approveTokenURI(string memory _tokenURI) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function startDrop(string memory name, uint256 price) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function pauseDrop(string memory name) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function startSale() public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function pauseSale() public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function withdraw() public payable onlyRole(WITHDRAW_ROLE) {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC721, ERC721Enumerable) {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl, ERC721Enumerable) returns (bool) {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
event PermanentURI(string _value, uint256 indexed _id);
event TokenMinted(uint256 tokenId);
}
| drops[drop].active==true,"The drop is not active or does not exist" | 373,238 | drops[drop].active==true |
"The price is incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../contracts/OpenZeppelin/contracts/token/ERC721/ERC721.sol";
import "../contracts/OpenZeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "../contracts/OpenZeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "../contracts/OpenZeppelin/contracts/access/AccessControl.sol";
contract BigFanMinter is ERC721Enumerable, ERC721URIStorage, AccessControl {
bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");
constructor() ERC721("BIG FAN GENESIS COLLECTION", "BFT") {
}
bool public saleStarted = true;
mapping(string => TokenUri) public approvedUris;
mapping (string => Drop) public drops;
struct TokenUri{
bool approved;
bool minted;
}
struct Drop {
uint256 token_price;
bool active;
}
modifier isApprovedTokenURI(string memory _tokenURI) {
}
function mint(address _buyer, string memory _tokenURI, string memory drop) public payable isApprovedTokenURI(_tokenURI) returns (uint256)
{
require(drops[drop].active == true, "The drop is not active or does not exist");
require(<FILL_ME>)
require(saleStarted == true, "The sale is paused");
uint256 newItemId = totalSupply() + 1;
_safeMint(_buyer, newItemId);
_setTokenURI(newItemId, _tokenURI);
approvedUris[_tokenURI].minted = true;
emit PermanentURI(_tokenURI, newItemId);
emit TokenMinted(newItemId);
return newItemId;
}
function burn(uint256 _tokenId) public onlyRole(DEFAULT_ADMIN_ROLE) returns (bool)
{
}
function approveTokenURI(string memory _tokenURI) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function startDrop(string memory name, uint256 price) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function pauseDrop(string memory name) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool success) {
}
function startSale() public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function pauseSale() public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function withdraw() public payable onlyRole(WITHDRAW_ROLE) {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC721, ERC721Enumerable) {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl, ERC721Enumerable) returns (bool) {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
event PermanentURI(string _value, uint256 indexed _id);
event TokenMinted(uint256 tokenId);
}
| drops[drop].token_price==msg.value,"The price is incorrect" | 373,238 | drops[drop].token_price==msg.value |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
require(<FILL_ME>)
merchantIdHash = keccak256(_merchantId);
setMonethaGateway(_monethaGateway);
setMerchantWallet(_merchantWallet);
setMerchantDealsHistory(_merchantHistory);
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| bytes(_merchantId).length>0 | 373,278 | bytes(_merchantId).length>0 |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
require(<FILL_ME>)
Order storage order = orders[_orderId];
updateDealConditions(
_orderId,
_clientReputation,
_merchantReputation,
false,
_dealHash
);
merchantHistory.recordDealCancelReason(
_orderId,
order.originAddress,
_clientReputation,
_merchantReputation,
_dealHash,
_cancelReason
);
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| bytes(_cancelReason).length>0 | 373,278 | bytes(_cancelReason).length>0 |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
require(<FILL_ME>)
Order storage order = orders[_orderId];
updateDealConditions(
_orderId,
_clientReputation,
_merchantReputation,
false,
_dealHash
);
merchantHistory.recordDealRefundReason(
_orderId,
order.originAddress,
_clientReputation,
_merchantReputation,
_dealHash,
_refundReason
);
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| bytes(_refundReason).length>0 | 373,278 | bytes(_refundReason).length>0 |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
require(<FILL_ME>)
ERC20(orders[_orderId].tokenAddress).transfer(orders[_orderId].originAddress, orders[_orderId].price);
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| orders[_orderId].tokenAddress!=address(0) | 373,278 | orders[_orderId].tokenAddress!=address(0) |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
require(<FILL_ME>)
monethaGateway = _newGateway;
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| address(_newGateway)!=0x0 | 373,278 | address(_newGateway)!=0x0 |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
require(<FILL_ME>)
require(_newWallet.merchantIdHash() == merchantIdHash);
merchantWallet = _newWallet;
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| address(_newWallet)!=0x0 | 373,278 | address(_newWallet)!=0x0 |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
require(address(_newWallet) != 0x0);
require(<FILL_ME>)
merchantWallet = _newWallet;
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| _newWallet.merchantIdHash()==merchantIdHash | 373,278 | _newWallet.merchantIdHash()==merchantIdHash |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
require(<FILL_ME>)
require(_merchantHistory.merchantIdHash() == merchantIdHash);
merchantHistory = _merchantHistory;
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| address(_merchantHistory)!=0x0 | 373,278 | address(_merchantHistory)!=0x0 |
null | /**
* @title PaymentProcessor
* Each Merchant has one PaymentProcessor that ensure payment and order processing with Trust and Reputation
*
* Payment Processor State Transitions:
* Null -(addOrder) -> Created
* Created -(securePay) -> Paid
* Created -(cancelOrder) -> Cancelled
* Paid -(refundPayment) -> Refunding
* Paid -(processPayment) -> Finalized
* Refunding -(withdrawRefund) -> Refunded
*/
contract PaymentProcessor is Pausable, Destructible, Contactable, Restricted {
using SafeMath for uint256;
string constant VERSION = "0.5";
/**
* Fee permille of Monetha fee.
* 1 permille = 0.1 %
* 15 permille = 1.5%
*/
uint public constant FEE_PERMILLE = 15;
/// MonethaGateway contract for payment processing
MonethaGateway public monethaGateway;
/// MerchantDealsHistory contract of acceptor's merchant
MerchantDealsHistory public merchantHistory;
/// Address of MerchantWallet, where merchant reputation and funds are stored
MerchantWallet public merchantWallet;
/// Merchant identifier hash, that associates with the acceptor
bytes32 public merchantIdHash;
enum State {Null, Created, Paid, Finalized, Refunding, Refunded, Cancelled}
struct Order {
State state;
uint price;
uint fee;
address paymentAcceptor;
address originAddress;
address tokenAddress;
}
mapping (uint=>Order) public orders;
/**
* Asserts current state.
* @param _state Expected state
* @param _orderId Order Id
*/
modifier atState(uint _orderId, State _state) {
}
/**
* Performs a transition after function execution.
* @param _state Next state
* @param _orderId Order Id
*/
modifier transition(uint _orderId, State _state) {
}
/**
* payment Processor sets Monetha Gateway
* @param _merchantId Merchant of the acceptor
* @param _merchantHistory Address of MerchantDealsHistory contract of acceptor's merchant
* @param _monethaGateway Address of MonethaGateway contract for payment processing
* @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
*/
constructor(
string _merchantId,
MerchantDealsHistory _merchantHistory,
MonethaGateway _monethaGateway,
MerchantWallet _merchantWallet
)
public
{
}
/**
* Assigns the acceptor to the order (when client initiates order).
* @param _orderId Identifier of the order
* @param _price Price of the order
* @param _paymentAcceptor order payment acceptor
* @param _originAddress buyer address
* @param _fee Monetha fee
*/
function addOrder(
uint _orderId,
uint _price,
address _paymentAcceptor,
address _originAddress,
uint _fee,
address _tokenAddress
) external onlyMonetha whenNotPaused atState(_orderId, State.Null)
{
}
/**
* securePay can be used by client if he wants to securely set client address for refund together with payment.
* This function require more gas, then fallback function.
* @param _orderId Identifier of the order
*/
function securePay(uint _orderId)
external payable whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* secureTokenPay can be used by client if he wants to securely set client address for token refund together with token payment.
* This call requires that token's approve method has been called prior to this.
* @param _orderId Identifier of the order
*/
function secureTokenPay(uint _orderId)
external whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Paid)
{
}
/**
* cancelOrder is used when client doesn't pay and order need to be cancelled.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _cancelReason Order cancel reason
*/
function cancelOrder(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _cancelReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Created) transition(_orderId, State.Cancelled)
{
}
/**
* refundPayment used in case order cannot be processed.
* This function initiate process of funds refunding to the client.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
* @param _refundReason Order refund reason, order will be moved to State Cancelled after Client withdraws money
*/
function refundPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash,
string _refundReason
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Refunding)
{
}
/**
* withdrawRefund performs fund transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* withdrawTokenRefund performs token transfer to the client's account.
* @param _orderId Identifier of the order
*/
function withdrawTokenRefund(uint _orderId)
external whenNotPaused
atState(_orderId, State.Refunding) transition(_orderId, State.Refunded)
{
}
/**
* processPayment transfer funds/tokens to MonethaGateway and completes the order.
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function processPayment(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
uint _dealHash
)
external onlyMonetha whenNotPaused
atState(_orderId, State.Paid) transition(_orderId, State.Finalized)
{
}
/**
* setMonethaGateway allows owner to change address of MonethaGateway.
* @param _newGateway Address of new MonethaGateway contract
*/
function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
}
/**
* setMerchantWallet allows owner to change address of MerchantWallet.
* @param _newWallet Address of new MerchantWallet contract
*/
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
}
/**
* setMerchantDealsHistory allows owner to change address of MerchantDealsHistory.
* @param _merchantHistory Address of new MerchantDealsHistory contract
*/
function setMerchantDealsHistory(MerchantDealsHistory _merchantHistory) public onlyOwner {
require(address(_merchantHistory) != 0x0);
require(<FILL_ME>)
merchantHistory = _merchantHistory;
}
/**
* updateDealConditions record finalized deal and updates merchant reputation
* in future: update Client reputation
* @param _orderId Identifier of the order
* @param _clientReputation Updated reputation of the client
* @param _merchantReputation Updated reputation of the merchant
* @param _isSuccess Identifies whether deal was successful or not
* @param _dealHash Hashcode of the deal, describing the order (used for deal verification)
*/
function updateDealConditions(
uint _orderId,
uint32 _clientReputation,
uint32 _merchantReputation,
bool _isSuccess,
uint _dealHash
)
internal
{
}
}
| _merchantHistory.merchantIdHash()==merchantIdHash | 373,278 | _merchantHistory.merchantIdHash()==merchantIdHash |
null | /**
*Submitted for verification at Etherscan.io on 2018-06-12
*/
pragma solidity ^0.4.13;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public
view
returns (uint256);
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract TokenRecipient {
event ReceivedEther(address indexed sender, uint256 amount);
event ReceivedTokens(
address indexed from,
uint256 value,
address indexed token,
bytes extraData
);
/**
* @dev Receive tokens and generate a log event
* @param from Address from which to transfer tokens
* @param value Amount of tokens to transfer
* @param token Address of token
* @param extraData Additional data to log
*/
function receiveApproval(
address from,
uint256 value,
address token,
bytes extraData
) public {
}
/**
* @dev Receive Ether and generate a log event
*/
function() public payable {
}
}
contract ProxyRegistry is Ownable {
/* DelegateProxy implementation contract. Must be initialized. */
address public delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the Wyvern DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the WYV supply (votes in the DAO),
a malicious but rational attacker could buy half the Wyvern and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given two weeks, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 2 weeks;
/* Addresses allowed to call registerProxy.*/
mapping(address => bool) public managers;
modifier isManager() {
}
function addManager(address address_) external onlyOwner {
}
function removerManger(address address_) external onlyOwner {
}
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to nable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
require(<FILL_ME>)
pending[addr] = 0;
contracts[addr] = true;
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return New AuthenticatedProxy contract
*/
function registerProxy()
public
isManager
returns (OwnableDelegateProxy proxy)
{
}
}
contract WyvernProxyRegistry is ProxyRegistry {
string public constant name = "Project Wyvern Proxy Registry";
/* Whether the initial auth address has been set. */
bool public initialAddressSet = false;
constructor() public {
}
/**
* Grant authentication to the initial Exchange protocol contract
*
* @dev No delay, can only be called once - after that the standard registry process with a delay must be used
* @param authAddress Address of the contract to grant authentication
*/
function grantInitialAuthentication(address authAddress) public onlyOwner {
}
}
contract OwnedUpgradeabilityStorage {
// Current implementation
address internal _implementation;
// Owner of the contract
address private _upgradeabilityOwner;
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function upgradeabilityOwner() public view returns (address) {
}
/**
* @dev Sets the address of the owner
*/
function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal {
}
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
}
/**
* @dev Tells the proxy type (EIP 897)
* @return Proxy type, 2 for forwarding proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId) {
}
}
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage {
/* Whether initialized. */
bool initialized = false;
/* Address which owns this proxy. */
address public user;
/* Associated registry with contract authentication information. */
ProxyRegistry public registry;
/* Whether access has been revoked. */
bool public revoked;
/* Delegate call could be used to atomically transfer multiple assets owned by the proxy contract with one order. */
enum HowToCall {Call, DelegateCall}
/* Event fired when the proxy access is revoked or unrevoked. */
event Revoked(bool revoked);
/**
* Initialize an AuthenticatedProxy
*
* @param addrUser Address of user on whose behalf this proxy will act
* @param addrRegistry Address of ProxyRegistry contract which will manage this proxy
*/
function initialize(address addrUser, ProxyRegistry addrRegistry) public {
}
/**
* Set the revoked flag (allows a user to revoke ProxyRegistry access)
*
* @dev Can be called by the user only
* @param revoke Whether or not to revoke access
*/
function setRevoke(bool revoke) public {
}
/**
* Execute a message call from the proxy contract
*
* @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access
* @param dest Address to which the call will be sent
* @param howToCall Which kind of call to make
* @param calldata Calldata to send
* @return Result of the call (success or failure)
*/
function proxy(
address dest,
HowToCall howToCall,
bytes calldata
) public returns (bool result) {
}
/**
* Execute a message call and assert success
*
* @dev Same functionality as `proxy`, just asserts the return value
* @param dest Address to which the call will be sent
* @param howToCall What kind of call to make
* @param calldata Calldata to send
*/
function proxyAssert(
address dest,
HowToCall howToCall,
bytes calldata
) public {
}
}
contract Proxy {
/**
* @dev Tells the address of the implementation where every call will be delegated.
* @return address of the implementation to which it will be delegated
*/
function implementation() public view returns (address);
/**
* @dev Tells the type of proxy (EIP 897)
* @return Type of proxy, 2 for upgradeable proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId);
/**
* @dev Fallback function allowing to perform a delegatecall to the given implementation.
* This function will return whatever the implementation call returns
*/
function() public payable {
}
}
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev This event will be emitted every time the implementation gets upgraded
* @param implementation representing the address of the upgraded implementation
*/
event Upgraded(address indexed implementation);
/**
* @dev Upgrades the implementation address
* @param implementation representing the address of the new implementation to be set
*/
function _upgradeTo(address implementation) internal {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyProxyOwner() {
}
/**
* @dev Tells the address of the proxy owner
* @return the address of the proxy owner
*/
function proxyOwner() public view returns (address) {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferProxyOwnership(address newOwner) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy.
* @param implementation representing the address of the new implementation to be set.
*/
function upgradeTo(address implementation) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy
* and delegatecall the new implementation for initialization.
* @param implementation representing the address of the new implementation to be set.
* @param data represents the msg.data to bet sent in the low level call. This parameter may include the function
* signature of the implementation to be called with the needed payload
*/
function upgradeToAndCall(address implementation, bytes data)
public
payable
onlyProxyOwner
{
}
}
contract OwnableDelegateProxy is OwnedUpgradeabilityProxy {
constructor(
address owner,
address initialImplementation,
bytes calldata
) public {
}
}
| !contracts[addr]&&pending[addr]!=0&&((pending[addr]+DELAY_PERIOD)<now) | 373,309 | !contracts[addr]&&pending[addr]!=0&&((pending[addr]+DELAY_PERIOD)<now) |
null | /**
*Submitted for verification at Etherscan.io on 2018-06-12
*/
pragma solidity ^0.4.13;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public
view
returns (uint256);
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract TokenRecipient {
event ReceivedEther(address indexed sender, uint256 amount);
event ReceivedTokens(
address indexed from,
uint256 value,
address indexed token,
bytes extraData
);
/**
* @dev Receive tokens and generate a log event
* @param from Address from which to transfer tokens
* @param value Amount of tokens to transfer
* @param token Address of token
* @param extraData Additional data to log
*/
function receiveApproval(
address from,
uint256 value,
address token,
bytes extraData
) public {
}
/**
* @dev Receive Ether and generate a log event
*/
function() public payable {
}
}
contract ProxyRegistry is Ownable {
/* DelegateProxy implementation contract. Must be initialized. */
address public delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the Wyvern DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the WYV supply (votes in the DAO),
a malicious but rational attacker could buy half the Wyvern and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given two weeks, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 2 weeks;
/* Addresses allowed to call registerProxy.*/
mapping(address => bool) public managers;
modifier isManager() {
}
function addManager(address address_) external onlyOwner {
}
function removerManger(address address_) external onlyOwner {
}
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to nable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return New AuthenticatedProxy contract
*/
function registerProxy()
public
isManager
returns (OwnableDelegateProxy proxy)
{
require(<FILL_ME>)
proxy = new OwnableDelegateProxy(
msg.sender,
delegateProxyImplementation,
abi.encodeWithSignature(
"initialize(address,address)",
msg.sender,
address(this)
)
);
proxies[msg.sender] = proxy;
return proxy;
}
}
contract WyvernProxyRegistry is ProxyRegistry {
string public constant name = "Project Wyvern Proxy Registry";
/* Whether the initial auth address has been set. */
bool public initialAddressSet = false;
constructor() public {
}
/**
* Grant authentication to the initial Exchange protocol contract
*
* @dev No delay, can only be called once - after that the standard registry process with a delay must be used
* @param authAddress Address of the contract to grant authentication
*/
function grantInitialAuthentication(address authAddress) public onlyOwner {
}
}
contract OwnedUpgradeabilityStorage {
// Current implementation
address internal _implementation;
// Owner of the contract
address private _upgradeabilityOwner;
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function upgradeabilityOwner() public view returns (address) {
}
/**
* @dev Sets the address of the owner
*/
function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal {
}
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
}
/**
* @dev Tells the proxy type (EIP 897)
* @return Proxy type, 2 for forwarding proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId) {
}
}
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage {
/* Whether initialized. */
bool initialized = false;
/* Address which owns this proxy. */
address public user;
/* Associated registry with contract authentication information. */
ProxyRegistry public registry;
/* Whether access has been revoked. */
bool public revoked;
/* Delegate call could be used to atomically transfer multiple assets owned by the proxy contract with one order. */
enum HowToCall {Call, DelegateCall}
/* Event fired when the proxy access is revoked or unrevoked. */
event Revoked(bool revoked);
/**
* Initialize an AuthenticatedProxy
*
* @param addrUser Address of user on whose behalf this proxy will act
* @param addrRegistry Address of ProxyRegistry contract which will manage this proxy
*/
function initialize(address addrUser, ProxyRegistry addrRegistry) public {
}
/**
* Set the revoked flag (allows a user to revoke ProxyRegistry access)
*
* @dev Can be called by the user only
* @param revoke Whether or not to revoke access
*/
function setRevoke(bool revoke) public {
}
/**
* Execute a message call from the proxy contract
*
* @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access
* @param dest Address to which the call will be sent
* @param howToCall Which kind of call to make
* @param calldata Calldata to send
* @return Result of the call (success or failure)
*/
function proxy(
address dest,
HowToCall howToCall,
bytes calldata
) public returns (bool result) {
}
/**
* Execute a message call and assert success
*
* @dev Same functionality as `proxy`, just asserts the return value
* @param dest Address to which the call will be sent
* @param howToCall What kind of call to make
* @param calldata Calldata to send
*/
function proxyAssert(
address dest,
HowToCall howToCall,
bytes calldata
) public {
}
}
contract Proxy {
/**
* @dev Tells the address of the implementation where every call will be delegated.
* @return address of the implementation to which it will be delegated
*/
function implementation() public view returns (address);
/**
* @dev Tells the type of proxy (EIP 897)
* @return Type of proxy, 2 for upgradeable proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId);
/**
* @dev Fallback function allowing to perform a delegatecall to the given implementation.
* This function will return whatever the implementation call returns
*/
function() public payable {
}
}
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev This event will be emitted every time the implementation gets upgraded
* @param implementation representing the address of the upgraded implementation
*/
event Upgraded(address indexed implementation);
/**
* @dev Upgrades the implementation address
* @param implementation representing the address of the new implementation to be set
*/
function _upgradeTo(address implementation) internal {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyProxyOwner() {
}
/**
* @dev Tells the address of the proxy owner
* @return the address of the proxy owner
*/
function proxyOwner() public view returns (address) {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferProxyOwnership(address newOwner) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy.
* @param implementation representing the address of the new implementation to be set.
*/
function upgradeTo(address implementation) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy
* and delegatecall the new implementation for initialization.
* @param implementation representing the address of the new implementation to be set.
* @param data represents the msg.data to bet sent in the low level call. This parameter may include the function
* signature of the implementation to be called with the needed payload
*/
function upgradeToAndCall(address implementation, bytes data)
public
payable
onlyProxyOwner
{
}
}
contract OwnableDelegateProxy is OwnedUpgradeabilityProxy {
constructor(
address owner,
address initialImplementation,
bytes calldata
) public {
}
}
| proxies[msg.sender]==address(0) | 373,309 | proxies[msg.sender]==address(0) |
null | /**
*Submitted for verification at Etherscan.io on 2018-06-12
*/
pragma solidity ^0.4.13;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public
view
returns (uint256);
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract TokenRecipient {
event ReceivedEther(address indexed sender, uint256 amount);
event ReceivedTokens(
address indexed from,
uint256 value,
address indexed token,
bytes extraData
);
/**
* @dev Receive tokens and generate a log event
* @param from Address from which to transfer tokens
* @param value Amount of tokens to transfer
* @param token Address of token
* @param extraData Additional data to log
*/
function receiveApproval(
address from,
uint256 value,
address token,
bytes extraData
) public {
}
/**
* @dev Receive Ether and generate a log event
*/
function() public payable {
}
}
contract ProxyRegistry is Ownable {
/* DelegateProxy implementation contract. Must be initialized. */
address public delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the Wyvern DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the WYV supply (votes in the DAO),
a malicious but rational attacker could buy half the Wyvern and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given two weeks, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 2 weeks;
/* Addresses allowed to call registerProxy.*/
mapping(address => bool) public managers;
modifier isManager() {
}
function addManager(address address_) external onlyOwner {
}
function removerManger(address address_) external onlyOwner {
}
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to nable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return New AuthenticatedProxy contract
*/
function registerProxy()
public
isManager
returns (OwnableDelegateProxy proxy)
{
}
}
contract WyvernProxyRegistry is ProxyRegistry {
string public constant name = "Project Wyvern Proxy Registry";
/* Whether the initial auth address has been set. */
bool public initialAddressSet = false;
constructor() public {
}
/**
* Grant authentication to the initial Exchange protocol contract
*
* @dev No delay, can only be called once - after that the standard registry process with a delay must be used
* @param authAddress Address of the contract to grant authentication
*/
function grantInitialAuthentication(address authAddress) public onlyOwner {
require(<FILL_ME>)
initialAddressSet = true;
contracts[authAddress] = true;
}
}
contract OwnedUpgradeabilityStorage {
// Current implementation
address internal _implementation;
// Owner of the contract
address private _upgradeabilityOwner;
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function upgradeabilityOwner() public view returns (address) {
}
/**
* @dev Sets the address of the owner
*/
function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal {
}
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
}
/**
* @dev Tells the proxy type (EIP 897)
* @return Proxy type, 2 for forwarding proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId) {
}
}
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage {
/* Whether initialized. */
bool initialized = false;
/* Address which owns this proxy. */
address public user;
/* Associated registry with contract authentication information. */
ProxyRegistry public registry;
/* Whether access has been revoked. */
bool public revoked;
/* Delegate call could be used to atomically transfer multiple assets owned by the proxy contract with one order. */
enum HowToCall {Call, DelegateCall}
/* Event fired when the proxy access is revoked or unrevoked. */
event Revoked(bool revoked);
/**
* Initialize an AuthenticatedProxy
*
* @param addrUser Address of user on whose behalf this proxy will act
* @param addrRegistry Address of ProxyRegistry contract which will manage this proxy
*/
function initialize(address addrUser, ProxyRegistry addrRegistry) public {
}
/**
* Set the revoked flag (allows a user to revoke ProxyRegistry access)
*
* @dev Can be called by the user only
* @param revoke Whether or not to revoke access
*/
function setRevoke(bool revoke) public {
}
/**
* Execute a message call from the proxy contract
*
* @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access
* @param dest Address to which the call will be sent
* @param howToCall Which kind of call to make
* @param calldata Calldata to send
* @return Result of the call (success or failure)
*/
function proxy(
address dest,
HowToCall howToCall,
bytes calldata
) public returns (bool result) {
}
/**
* Execute a message call and assert success
*
* @dev Same functionality as `proxy`, just asserts the return value
* @param dest Address to which the call will be sent
* @param howToCall What kind of call to make
* @param calldata Calldata to send
*/
function proxyAssert(
address dest,
HowToCall howToCall,
bytes calldata
) public {
}
}
contract Proxy {
/**
* @dev Tells the address of the implementation where every call will be delegated.
* @return address of the implementation to which it will be delegated
*/
function implementation() public view returns (address);
/**
* @dev Tells the type of proxy (EIP 897)
* @return Type of proxy, 2 for upgradeable proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId);
/**
* @dev Fallback function allowing to perform a delegatecall to the given implementation.
* This function will return whatever the implementation call returns
*/
function() public payable {
}
}
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev This event will be emitted every time the implementation gets upgraded
* @param implementation representing the address of the upgraded implementation
*/
event Upgraded(address indexed implementation);
/**
* @dev Upgrades the implementation address
* @param implementation representing the address of the new implementation to be set
*/
function _upgradeTo(address implementation) internal {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyProxyOwner() {
}
/**
* @dev Tells the address of the proxy owner
* @return the address of the proxy owner
*/
function proxyOwner() public view returns (address) {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferProxyOwnership(address newOwner) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy.
* @param implementation representing the address of the new implementation to be set.
*/
function upgradeTo(address implementation) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy
* and delegatecall the new implementation for initialization.
* @param implementation representing the address of the new implementation to be set.
* @param data represents the msg.data to bet sent in the low level call. This parameter may include the function
* signature of the implementation to be called with the needed payload
*/
function upgradeToAndCall(address implementation, bytes data)
public
payable
onlyProxyOwner
{
}
}
contract OwnableDelegateProxy is OwnedUpgradeabilityProxy {
constructor(
address owner,
address initialImplementation,
bytes calldata
) public {
}
}
| !initialAddressSet | 373,309 | !initialAddressSet |
null | /**
*Submitted for verification at Etherscan.io on 2018-06-12
*/
pragma solidity ^0.4.13;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public
view
returns (uint256);
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract TokenRecipient {
event ReceivedEther(address indexed sender, uint256 amount);
event ReceivedTokens(
address indexed from,
uint256 value,
address indexed token,
bytes extraData
);
/**
* @dev Receive tokens and generate a log event
* @param from Address from which to transfer tokens
* @param value Amount of tokens to transfer
* @param token Address of token
* @param extraData Additional data to log
*/
function receiveApproval(
address from,
uint256 value,
address token,
bytes extraData
) public {
}
/**
* @dev Receive Ether and generate a log event
*/
function() public payable {
}
}
contract ProxyRegistry is Ownable {
/* DelegateProxy implementation contract. Must be initialized. */
address public delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the Wyvern DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the WYV supply (votes in the DAO),
a malicious but rational attacker could buy half the Wyvern and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given two weeks, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 2 weeks;
/* Addresses allowed to call registerProxy.*/
mapping(address => bool) public managers;
modifier isManager() {
}
function addManager(address address_) external onlyOwner {
}
function removerManger(address address_) external onlyOwner {
}
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to nable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return New AuthenticatedProxy contract
*/
function registerProxy()
public
isManager
returns (OwnableDelegateProxy proxy)
{
}
}
contract WyvernProxyRegistry is ProxyRegistry {
string public constant name = "Project Wyvern Proxy Registry";
/* Whether the initial auth address has been set. */
bool public initialAddressSet = false;
constructor() public {
}
/**
* Grant authentication to the initial Exchange protocol contract
*
* @dev No delay, can only be called once - after that the standard registry process with a delay must be used
* @param authAddress Address of the contract to grant authentication
*/
function grantInitialAuthentication(address authAddress) public onlyOwner {
}
}
contract OwnedUpgradeabilityStorage {
// Current implementation
address internal _implementation;
// Owner of the contract
address private _upgradeabilityOwner;
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function upgradeabilityOwner() public view returns (address) {
}
/**
* @dev Sets the address of the owner
*/
function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal {
}
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
}
/**
* @dev Tells the proxy type (EIP 897)
* @return Proxy type, 2 for forwarding proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId) {
}
}
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage {
/* Whether initialized. */
bool initialized = false;
/* Address which owns this proxy. */
address public user;
/* Associated registry with contract authentication information. */
ProxyRegistry public registry;
/* Whether access has been revoked. */
bool public revoked;
/* Delegate call could be used to atomically transfer multiple assets owned by the proxy contract with one order. */
enum HowToCall {Call, DelegateCall}
/* Event fired when the proxy access is revoked or unrevoked. */
event Revoked(bool revoked);
/**
* Initialize an AuthenticatedProxy
*
* @param addrUser Address of user on whose behalf this proxy will act
* @param addrRegistry Address of ProxyRegistry contract which will manage this proxy
*/
function initialize(address addrUser, ProxyRegistry addrRegistry) public {
}
/**
* Set the revoked flag (allows a user to revoke ProxyRegistry access)
*
* @dev Can be called by the user only
* @param revoke Whether or not to revoke access
*/
function setRevoke(bool revoke) public {
}
/**
* Execute a message call from the proxy contract
*
* @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access
* @param dest Address to which the call will be sent
* @param howToCall Which kind of call to make
* @param calldata Calldata to send
* @return Result of the call (success or failure)
*/
function proxy(
address dest,
HowToCall howToCall,
bytes calldata
) public returns (bool result) {
}
/**
* Execute a message call and assert success
*
* @dev Same functionality as `proxy`, just asserts the return value
* @param dest Address to which the call will be sent
* @param howToCall What kind of call to make
* @param calldata Calldata to send
*/
function proxyAssert(
address dest,
HowToCall howToCall,
bytes calldata
) public {
require(<FILL_ME>)
}
}
contract Proxy {
/**
* @dev Tells the address of the implementation where every call will be delegated.
* @return address of the implementation to which it will be delegated
*/
function implementation() public view returns (address);
/**
* @dev Tells the type of proxy (EIP 897)
* @return Type of proxy, 2 for upgradeable proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId);
/**
* @dev Fallback function allowing to perform a delegatecall to the given implementation.
* This function will return whatever the implementation call returns
*/
function() public payable {
}
}
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev This event will be emitted every time the implementation gets upgraded
* @param implementation representing the address of the upgraded implementation
*/
event Upgraded(address indexed implementation);
/**
* @dev Upgrades the implementation address
* @param implementation representing the address of the new implementation to be set
*/
function _upgradeTo(address implementation) internal {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyProxyOwner() {
}
/**
* @dev Tells the address of the proxy owner
* @return the address of the proxy owner
*/
function proxyOwner() public view returns (address) {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferProxyOwnership(address newOwner) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy.
* @param implementation representing the address of the new implementation to be set.
*/
function upgradeTo(address implementation) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy
* and delegatecall the new implementation for initialization.
* @param implementation representing the address of the new implementation to be set.
* @param data represents the msg.data to bet sent in the low level call. This parameter may include the function
* signature of the implementation to be called with the needed payload
*/
function upgradeToAndCall(address implementation, bytes data)
public
payable
onlyProxyOwner
{
}
}
contract OwnableDelegateProxy is OwnedUpgradeabilityProxy {
constructor(
address owner,
address initialImplementation,
bytes calldata
) public {
}
}
| proxy(dest,howToCall,calldata) | 373,309 | proxy(dest,howToCall,calldata) |
null | /**
*Submitted for verification at Etherscan.io on 2018-06-12
*/
pragma solidity ^0.4.13;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public
view
returns (uint256);
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract TokenRecipient {
event ReceivedEther(address indexed sender, uint256 amount);
event ReceivedTokens(
address indexed from,
uint256 value,
address indexed token,
bytes extraData
);
/**
* @dev Receive tokens and generate a log event
* @param from Address from which to transfer tokens
* @param value Amount of tokens to transfer
* @param token Address of token
* @param extraData Additional data to log
*/
function receiveApproval(
address from,
uint256 value,
address token,
bytes extraData
) public {
}
/**
* @dev Receive Ether and generate a log event
*/
function() public payable {
}
}
contract ProxyRegistry is Ownable {
/* DelegateProxy implementation contract. Must be initialized. */
address public delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the Wyvern DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the WYV supply (votes in the DAO),
a malicious but rational attacker could buy half the Wyvern and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given two weeks, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 2 weeks;
/* Addresses allowed to call registerProxy.*/
mapping(address => bool) public managers;
modifier isManager() {
}
function addManager(address address_) external onlyOwner {
}
function removerManger(address address_) external onlyOwner {
}
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to nable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return New AuthenticatedProxy contract
*/
function registerProxy()
public
isManager
returns (OwnableDelegateProxy proxy)
{
}
}
contract WyvernProxyRegistry is ProxyRegistry {
string public constant name = "Project Wyvern Proxy Registry";
/* Whether the initial auth address has been set. */
bool public initialAddressSet = false;
constructor() public {
}
/**
* Grant authentication to the initial Exchange protocol contract
*
* @dev No delay, can only be called once - after that the standard registry process with a delay must be used
* @param authAddress Address of the contract to grant authentication
*/
function grantInitialAuthentication(address authAddress) public onlyOwner {
}
}
contract OwnedUpgradeabilityStorage {
// Current implementation
address internal _implementation;
// Owner of the contract
address private _upgradeabilityOwner;
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function upgradeabilityOwner() public view returns (address) {
}
/**
* @dev Sets the address of the owner
*/
function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal {
}
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
}
/**
* @dev Tells the proxy type (EIP 897)
* @return Proxy type, 2 for forwarding proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId) {
}
}
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage {
/* Whether initialized. */
bool initialized = false;
/* Address which owns this proxy. */
address public user;
/* Associated registry with contract authentication information. */
ProxyRegistry public registry;
/* Whether access has been revoked. */
bool public revoked;
/* Delegate call could be used to atomically transfer multiple assets owned by the proxy contract with one order. */
enum HowToCall {Call, DelegateCall}
/* Event fired when the proxy access is revoked or unrevoked. */
event Revoked(bool revoked);
/**
* Initialize an AuthenticatedProxy
*
* @param addrUser Address of user on whose behalf this proxy will act
* @param addrRegistry Address of ProxyRegistry contract which will manage this proxy
*/
function initialize(address addrUser, ProxyRegistry addrRegistry) public {
}
/**
* Set the revoked flag (allows a user to revoke ProxyRegistry access)
*
* @dev Can be called by the user only
* @param revoke Whether or not to revoke access
*/
function setRevoke(bool revoke) public {
}
/**
* Execute a message call from the proxy contract
*
* @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access
* @param dest Address to which the call will be sent
* @param howToCall Which kind of call to make
* @param calldata Calldata to send
* @return Result of the call (success or failure)
*/
function proxy(
address dest,
HowToCall howToCall,
bytes calldata
) public returns (bool result) {
}
/**
* Execute a message call and assert success
*
* @dev Same functionality as `proxy`, just asserts the return value
* @param dest Address to which the call will be sent
* @param howToCall What kind of call to make
* @param calldata Calldata to send
*/
function proxyAssert(
address dest,
HowToCall howToCall,
bytes calldata
) public {
}
}
contract Proxy {
/**
* @dev Tells the address of the implementation where every call will be delegated.
* @return address of the implementation to which it will be delegated
*/
function implementation() public view returns (address);
/**
* @dev Tells the type of proxy (EIP 897)
* @return Type of proxy, 2 for upgradeable proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId);
/**
* @dev Fallback function allowing to perform a delegatecall to the given implementation.
* This function will return whatever the implementation call returns
*/
function() public payable {
}
}
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev This event will be emitted every time the implementation gets upgraded
* @param implementation representing the address of the upgraded implementation
*/
event Upgraded(address indexed implementation);
/**
* @dev Upgrades the implementation address
* @param implementation representing the address of the new implementation to be set
*/
function _upgradeTo(address implementation) internal {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyProxyOwner() {
}
/**
* @dev Tells the address of the proxy owner
* @return the address of the proxy owner
*/
function proxyOwner() public view returns (address) {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferProxyOwnership(address newOwner) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy.
* @param implementation representing the address of the new implementation to be set.
*/
function upgradeTo(address implementation) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy
* and delegatecall the new implementation for initialization.
* @param implementation representing the address of the new implementation to be set.
* @param data represents the msg.data to bet sent in the low level call. This parameter may include the function
* signature of the implementation to be called with the needed payload
*/
function upgradeToAndCall(address implementation, bytes data)
public
payable
onlyProxyOwner
{
upgradeTo(implementation);
require(<FILL_ME>)
}
}
contract OwnableDelegateProxy is OwnedUpgradeabilityProxy {
constructor(
address owner,
address initialImplementation,
bytes calldata
) public {
}
}
| address(this).delegatecall(data) | 373,309 | address(this).delegatecall(data) |
null | /**
*Submitted for verification at Etherscan.io on 2018-06-12
*/
pragma solidity ^0.4.13;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public
view
returns (uint256);
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract TokenRecipient {
event ReceivedEther(address indexed sender, uint256 amount);
event ReceivedTokens(
address indexed from,
uint256 value,
address indexed token,
bytes extraData
);
/**
* @dev Receive tokens and generate a log event
* @param from Address from which to transfer tokens
* @param value Amount of tokens to transfer
* @param token Address of token
* @param extraData Additional data to log
*/
function receiveApproval(
address from,
uint256 value,
address token,
bytes extraData
) public {
}
/**
* @dev Receive Ether and generate a log event
*/
function() public payable {
}
}
contract ProxyRegistry is Ownable {
/* DelegateProxy implementation contract. Must be initialized. */
address public delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the Wyvern DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the WYV supply (votes in the DAO),
a malicious but rational attacker could buy half the Wyvern and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given two weeks, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 2 weeks;
/* Addresses allowed to call registerProxy.*/
mapping(address => bool) public managers;
modifier isManager() {
}
function addManager(address address_) external onlyOwner {
}
function removerManger(address address_) external onlyOwner {
}
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to nable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return New AuthenticatedProxy contract
*/
function registerProxy()
public
isManager
returns (OwnableDelegateProxy proxy)
{
}
}
contract WyvernProxyRegistry is ProxyRegistry {
string public constant name = "Project Wyvern Proxy Registry";
/* Whether the initial auth address has been set. */
bool public initialAddressSet = false;
constructor() public {
}
/**
* Grant authentication to the initial Exchange protocol contract
*
* @dev No delay, can only be called once - after that the standard registry process with a delay must be used
* @param authAddress Address of the contract to grant authentication
*/
function grantInitialAuthentication(address authAddress) public onlyOwner {
}
}
contract OwnedUpgradeabilityStorage {
// Current implementation
address internal _implementation;
// Owner of the contract
address private _upgradeabilityOwner;
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function upgradeabilityOwner() public view returns (address) {
}
/**
* @dev Sets the address of the owner
*/
function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal {
}
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
}
/**
* @dev Tells the proxy type (EIP 897)
* @return Proxy type, 2 for forwarding proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId) {
}
}
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage {
/* Whether initialized. */
bool initialized = false;
/* Address which owns this proxy. */
address public user;
/* Associated registry with contract authentication information. */
ProxyRegistry public registry;
/* Whether access has been revoked. */
bool public revoked;
/* Delegate call could be used to atomically transfer multiple assets owned by the proxy contract with one order. */
enum HowToCall {Call, DelegateCall}
/* Event fired when the proxy access is revoked or unrevoked. */
event Revoked(bool revoked);
/**
* Initialize an AuthenticatedProxy
*
* @param addrUser Address of user on whose behalf this proxy will act
* @param addrRegistry Address of ProxyRegistry contract which will manage this proxy
*/
function initialize(address addrUser, ProxyRegistry addrRegistry) public {
}
/**
* Set the revoked flag (allows a user to revoke ProxyRegistry access)
*
* @dev Can be called by the user only
* @param revoke Whether or not to revoke access
*/
function setRevoke(bool revoke) public {
}
/**
* Execute a message call from the proxy contract
*
* @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access
* @param dest Address to which the call will be sent
* @param howToCall Which kind of call to make
* @param calldata Calldata to send
* @return Result of the call (success or failure)
*/
function proxy(
address dest,
HowToCall howToCall,
bytes calldata
) public returns (bool result) {
}
/**
* Execute a message call and assert success
*
* @dev Same functionality as `proxy`, just asserts the return value
* @param dest Address to which the call will be sent
* @param howToCall What kind of call to make
* @param calldata Calldata to send
*/
function proxyAssert(
address dest,
HowToCall howToCall,
bytes calldata
) public {
}
}
contract Proxy {
/**
* @dev Tells the address of the implementation where every call will be delegated.
* @return address of the implementation to which it will be delegated
*/
function implementation() public view returns (address);
/**
* @dev Tells the type of proxy (EIP 897)
* @return Type of proxy, 2 for upgradeable proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId);
/**
* @dev Fallback function allowing to perform a delegatecall to the given implementation.
* This function will return whatever the implementation call returns
*/
function() public payable {
}
}
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev This event will be emitted every time the implementation gets upgraded
* @param implementation representing the address of the upgraded implementation
*/
event Upgraded(address indexed implementation);
/**
* @dev Upgrades the implementation address
* @param implementation representing the address of the new implementation to be set
*/
function _upgradeTo(address implementation) internal {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyProxyOwner() {
}
/**
* @dev Tells the address of the proxy owner
* @return the address of the proxy owner
*/
function proxyOwner() public view returns (address) {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferProxyOwnership(address newOwner) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy.
* @param implementation representing the address of the new implementation to be set.
*/
function upgradeTo(address implementation) public onlyProxyOwner {
}
/**
* @dev Allows the upgradeability owner to upgrade the current implementation of the proxy
* and delegatecall the new implementation for initialization.
* @param implementation representing the address of the new implementation to be set.
* @param data represents the msg.data to bet sent in the low level call. This parameter may include the function
* signature of the implementation to be called with the needed payload
*/
function upgradeToAndCall(address implementation, bytes data)
public
payable
onlyProxyOwner
{
}
}
contract OwnableDelegateProxy is OwnedUpgradeabilityProxy {
constructor(
address owner,
address initialImplementation,
bytes calldata
) public {
setUpgradeabilityOwner(owner);
_upgradeTo(initialImplementation);
require(<FILL_ME>)
}
}
| initialImplementation.delegatecall(calldata) | 373,309 | initialImplementation.delegatecall(calldata) |
'User already registered' | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev 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 {
}
}
// import ierc20 & safemath & non-standard
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract FiatInvestors is Ownable {
using SafeMath for uint256;
// the time set for the installments
uint256 public oneMonthTime = 2629743;
IERC20 public vntwToken;
address multiSigAddress;
IERC20 public dai;
struct User{
uint256 time;
uint256 amountpaid;
uint256 months;
uint256 tokenamount;
uint256 daiamount;
uint256 rate;
}
mapping(address => User) public users;
mapping(address => bool) public registeredusers;
// inputing value network token and dai token
constructor( address vntwTokenAddr,address _dai,address _multiSigAddress) public {
}
function _preValidateAddress(address _addr)
internal pure
{
}
// only admin can add address to the presale by inputting how many months a user have to pay installment
// the total token amt and total dai to be distributed in _noofmonths of months
function addUser(address _userAddress , uint256 _months ,uint256 _tokenAmount, uint256 _totalDAI) public onlyOwner {
_preValidateAddress(_userAddress);
require(<FILL_ME>)
users[_userAddress] = User(block.timestamp + oneMonthTime.mul(_months),0,_months,_tokenAmount,_totalDAI,_tokenAmount.mul(1e18).div(_totalDAI));
registeredusers[_userAddress] = true;
}
// this function will only return the no of dai can pay till now
function getCurrentInstallment(address _addr) public view returns(uint256) {
}
// this function tells how much amount is pending by user that he has to pay
function userTotalInstallmentPending(address _user) public view returns(uint256){
}
function payInstallment(uint256 _amount) external {
}
function getContractTokenBalance(IERC20 _token) public view returns (uint256) {
}
function changeMultisigAddress(address _multiSigAddress) public onlyOwner {
}
function fundsWithdrawal(IERC20 _token,uint256 value) external onlyOwner{
}
}
| !registeredusers[_userAddress],'User already registered' | 373,346 | !registeredusers[_userAddress] |
'you are not registered' | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev 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 {
}
}
// import ierc20 & safemath & non-standard
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract FiatInvestors is Ownable {
using SafeMath for uint256;
// the time set for the installments
uint256 public oneMonthTime = 2629743;
IERC20 public vntwToken;
address multiSigAddress;
IERC20 public dai;
struct User{
uint256 time;
uint256 amountpaid;
uint256 months;
uint256 tokenamount;
uint256 daiamount;
uint256 rate;
}
mapping(address => User) public users;
mapping(address => bool) public registeredusers;
// inputing value network token and dai token
constructor( address vntwTokenAddr,address _dai,address _multiSigAddress) public {
}
function _preValidateAddress(address _addr)
internal pure
{
}
// only admin can add address to the presale by inputting how many months a user have to pay installment
// the total token amt and total dai to be distributed in _noofmonths of months
function addUser(address _userAddress , uint256 _months ,uint256 _tokenAmount, uint256 _totalDAI) public onlyOwner {
}
// this function will only return the no of dai can pay till now
function getCurrentInstallment(address _addr) public view returns(uint256) {
require(<FILL_ME>)
if(block.timestamp > users[_addr].time){
return users[_addr].daiamount;
}
uint256 timeleft = users[_addr].time.sub(block.timestamp);
uint256 amt = users[_addr].daiamount.mul(1e18).div(users[_addr].months);
uint256 j;
for(uint256 i = users[_addr].months;i>0;i--){
if(timeleft <= oneMonthTime || timeleft == 0){
return users[_addr].daiamount;
}
j= j.add(1);
if(timeleft > i.sub(1).mul(oneMonthTime)){
return amt.mul(j).div(1e18);
}
}
}
// this function tells how much amount is pending by user that he has to pay
function userTotalInstallmentPending(address _user) public view returns(uint256){
}
function payInstallment(uint256 _amount) external {
}
function getContractTokenBalance(IERC20 _token) public view returns (uint256) {
}
function changeMultisigAddress(address _multiSigAddress) public onlyOwner {
}
function fundsWithdrawal(IERC20 _token,uint256 value) external onlyOwner{
}
}
| registeredusers[_addr],'you are not registered' | 373,346 | registeredusers[_addr] |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev 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 {
}
}
// import ierc20 & safemath & non-standard
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract FiatInvestors is Ownable {
using SafeMath for uint256;
// the time set for the installments
uint256 public oneMonthTime = 2629743;
IERC20 public vntwToken;
address multiSigAddress;
IERC20 public dai;
struct User{
uint256 time;
uint256 amountpaid;
uint256 months;
uint256 tokenamount;
uint256 daiamount;
uint256 rate;
}
mapping(address => User) public users;
mapping(address => bool) public registeredusers;
// inputing value network token and dai token
constructor( address vntwTokenAddr,address _dai,address _multiSigAddress) public {
}
function _preValidateAddress(address _addr)
internal pure
{
}
// only admin can add address to the presale by inputting how many months a user have to pay installment
// the total token amt and total dai to be distributed in _noofmonths of months
function addUser(address _userAddress , uint256 _months ,uint256 _tokenAmount, uint256 _totalDAI) public onlyOwner {
}
// this function will only return the no of dai can pay till now
function getCurrentInstallment(address _addr) public view returns(uint256) {
}
// this function tells how much amount is pending by user that he has to pay
function userTotalInstallmentPending(address _user) public view returns(uint256){
}
function payInstallment(uint256 _amount) external {
uint256 paidamt = users[msg.sender].amountpaid;
require(<FILL_ME>)
require(paidamt < getCurrentInstallment(msg.sender));
require(_amount <= userTotalInstallmentPending(msg.sender));
dai.transferFrom(msg.sender,address(this),_amount);
uint256 transferrableVNTWtoken = _amount.mul(users[msg.sender].rate).div(1e18);
vntwToken.transfer(msg.sender,transferrableVNTWtoken);
users[msg.sender].amountpaid = users[msg.sender].amountpaid.add(_amount);
}
function getContractTokenBalance(IERC20 _token) public view returns (uint256) {
}
function changeMultisigAddress(address _multiSigAddress) public onlyOwner {
}
function fundsWithdrawal(IERC20 _token,uint256 value) external onlyOwner{
}
}
| getCurrentInstallment(msg.sender)>0 | 373,346 | getCurrentInstallment(msg.sender)>0 |
'the contract doesnt have tokens' | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev 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 {
}
}
// import ierc20 & safemath & non-standard
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract FiatInvestors is Ownable {
using SafeMath for uint256;
// the time set for the installments
uint256 public oneMonthTime = 2629743;
IERC20 public vntwToken;
address multiSigAddress;
IERC20 public dai;
struct User{
uint256 time;
uint256 amountpaid;
uint256 months;
uint256 tokenamount;
uint256 daiamount;
uint256 rate;
}
mapping(address => User) public users;
mapping(address => bool) public registeredusers;
// inputing value network token and dai token
constructor( address vntwTokenAddr,address _dai,address _multiSigAddress) public {
}
function _preValidateAddress(address _addr)
internal pure
{
}
// only admin can add address to the presale by inputting how many months a user have to pay installment
// the total token amt and total dai to be distributed in _noofmonths of months
function addUser(address _userAddress , uint256 _months ,uint256 _tokenAmount, uint256 _totalDAI) public onlyOwner {
}
// this function will only return the no of dai can pay till now
function getCurrentInstallment(address _addr) public view returns(uint256) {
}
// this function tells how much amount is pending by user that he has to pay
function userTotalInstallmentPending(address _user) public view returns(uint256){
}
function payInstallment(uint256 _amount) external {
}
function getContractTokenBalance(IERC20 _token) public view returns (uint256) {
}
function changeMultisigAddress(address _multiSigAddress) public onlyOwner {
}
function fundsWithdrawal(IERC20 _token,uint256 value) external onlyOwner{
require(<FILL_ME>)
_token.transfer(multiSigAddress,value);
}
}
| getContractTokenBalance(_token)>=value,'the contract doesnt have tokens' | 373,346 | getContractTokenBalance(_token)>=value |
null | /**
* Investors relations: [email protected]
**/
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title ERC20Standard
* @dev Stronger version of ERC20 interface
*/
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);
}
interface OldFACEToken {
function transfer(address receiver, uint amount) external;
function balanceOf(address _owner) external returns (uint256 balance);
function showMyTokenBalance(address addr) external;
}
contract ARBITRAGING is ERC20Interface,Ownable {
using SafeMath for uint256;
uint256 public totalSupply;
mapping(address => uint256) tokenBalances;
string public constant name = "ARBITRAGING";
string public constant symbol = "ARB";
uint256 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 8761815;
address ownerWallet;
// Owner of account approves the transfer of an amount to another account
mapping (address => mapping (address => uint256)) allowed;
event Debug(string message, address addr, uint256 number);
constructor (address wallet) public {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function () public payable {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant public returns (uint256 balance) {
}
function send(address wallet, address sender, uint256 tokenAmount) public onlyOwner {
require(<FILL_ME>)
tokenBalances[wallet] = tokenBalances[wallet].add(tokenAmount);
Transfer(sender, wallet, tokenAmount);
}
function pullBack(address wallet, address buyer, uint256 tokenAmount) public onlyOwner {
}
function showMyTokenBalance(address addr) public view returns (uint tokenBalance) {
}
}
| tokenBalances[sender]<=tokenAmount | 373,357 | tokenBalances[sender]<=tokenAmount |
"YFMS transfer failed" | pragma solidity 0.6.8;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ERC20 {
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint value) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
function approve(address spender, uint value) external returns (bool success);
}
contract YFMSTokenSwap {
using SafeMath for uint256;
ERC20 public YFMSToken;
ERC20 public LUCRToken;
address public owner;
constructor(address yfms, address lucr) public {
}
function swap () public {
uint256 balance = YFMSToken.balanceOf(msg.sender);
require(balance > 0, "balance must be greater than 0");
require(<FILL_ME>)
require(LUCRToken.transferFrom(owner, msg.sender, balance), "LUCR transfer failed");
}
function withdrawYFMS () public {
}
}
| YFMSToken.transferFrom(msg.sender,address(this),balance),"YFMS transfer failed" | 373,441 | YFMSToken.transferFrom(msg.sender,address(this),balance) |
"LUCR transfer failed" | pragma solidity 0.6.8;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ERC20 {
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint value) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
function approve(address spender, uint value) external returns (bool success);
}
contract YFMSTokenSwap {
using SafeMath for uint256;
ERC20 public YFMSToken;
ERC20 public LUCRToken;
address public owner;
constructor(address yfms, address lucr) public {
}
function swap () public {
uint256 balance = YFMSToken.balanceOf(msg.sender);
require(balance > 0, "balance must be greater than 0");
require(YFMSToken.transferFrom(msg.sender, address(this), balance), "YFMS transfer failed");
require(<FILL_ME>)
}
function withdrawYFMS () public {
}
}
| LUCRToken.transferFrom(owner,msg.sender,balance),"LUCR transfer failed" | 373,441 | LUCRToken.transferFrom(owner,msg.sender,balance) |
"Euphorians - max NFT limit exceeded" | pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner)
public
view
virtual
override
returns (uint256)
{
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
pragma solidity ^0.8.5;
contract Euphorians is ERC721, Ownable {
using Strings for uint256;
uint256 public cost = 0.06969 ether;
uint256 public maxSupply = 6969;
uint256 public maxMintAmount = 5;
uint256 public tokenCount = 0;
bool public paused = true;
bool public reveal;
string public baseURI;
string public notRevealedUri;
mapping(address => uint256) public addressMintedBalance;
constructor(string memory _initBaseURI, string memory _initNotRevealedUri)
ERC721("Euphorians", "Euphorians")
{
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
function mint(uint256 _amount) external payable {
require(!paused, "Euphorians - The Contract is Paused");
require(<FILL_ME>)
if (msg.sender != owner()) {
require(
_amount <= maxMintAmount,
"Euphorians - max mint amount limit exceeded"
);
uint256 ownerMintedCount = addressMintedBalance[msg.sender];
require(
ownerMintedCount + _amount <= maxMintAmount,
"Euphorians - max NFT per address exceeded"
);
require(
msg.value >= cost * _amount,
"Euphorians - insufficient ethers"
);
}
for (uint256 i = 1; i <= _amount; i++) {
addressMintedBalance[msg.sender]++;
_safeMint(msg.sender, ++tokenCount);
}
}
//only owner
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _maxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _baseURI) public onlyOwner {
}
function pause() public onlyOwner {
}
function revealNFT() external onlyOwner {
}
function withdraw() public onlyOwner {
}
}
| tokenCount+_amount<=maxSupply,"Euphorians - max NFT limit exceeded" | 373,480 | tokenCount+_amount<=maxSupply |
"DexGame Public Sale: token is the zero address" | pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
contract PublicSale is Ownable, ReentrancyGuard, Pausable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
mapping(address => uint256) private _contributions;
uint256 private _individualMaxCap;
uint256 private _individualMinCap;
uint256 private _openingTime;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address payable private _wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a ERC20Detailed token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 private _rate;
// Amount of wei raised
uint256 private _weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokensPurchased(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
constructor(
uint256 pRate,
address payable pWallet,
IERC20 pToken,
uint256 pIndividualMinCap,
uint256 pIndividualMaxCap,
uint256 pOpeningTime
) {
require(pRate > 0, "DexGame Public Sale: rate is 0");
require(pIndividualMaxCap > 0, "DexGame Public Sale: IndividualMaxCap is 0");
require(pWallet != address(0), "DexGame Public Sale: wallet is the zero address");
require(pOpeningTime >= block.timestamp, "Opening time is before current time");
require(<FILL_ME>)
_rate = pRate;
_wallet = pWallet;
_token = pToken;
_individualMinCap = pIndividualMinCap;
_individualMaxCap = pIndividualMaxCap;
_openingTime = pOpeningTime;
}
/**
* @dev fallback function ***DO NOT OVERRIDE***
* Note that other contracts will transfer funds with a base gas stipend
* of 2300, which is not enough to call buyTokens. Consider calling
* buyTokens directly when purchasing tokens from a contract.
*/
receive() external payable {
}
/**
* @return the token being sold.
*/
function token() public view returns (IERC20) {
}
function individualMinCap() public view returns (uint256) {
}
function individualMaxCap() public view returns (uint256) {
}
/**
* @return the crowdsale opening time.
*/
function openingTime() public view returns (uint256) {
}
/**
* @return true if the crowdsale is open, false otherwise.
*/
function isOpen() public view returns (bool) {
}
/**
* @return the address where funds are collected.
*/
function wallet() public view returns (address payable) {
}
/**
* @return the number of token units a buyer gets per wei.
*/
function rate() public view returns (uint256) {
}
/**
* @return the amount of wei raised.
*/
function weiRaised() public view returns (uint256) {
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* This function has a non-reentrancy guard, so it shouldn't be called by
* another `nonReentrant` function.
*/
function buyTokens() public payable nonReentrant {
}
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met.
* Use `super` in contracts that inherit from Crowdsale to extend their validations.
* Example from CappedCrowdsale.sol's _preValidatePurchase method:
* super._preValidatePurchase(beneficiary, weiAmount);
* require(weiRaised().add(weiAmount) <= cap);
* @param beneficiary Address performing the token purchase
* @param weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address beneficiary, uint256 weiAmount)
internal
view
whenNotPaused
{
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid
* conditions are not met.
* @param beneficiary Address performing the token purchase
* @param weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(address beneficiary, uint256 weiAmount)
internal
view
{
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends
* its tokens.
* @param beneficiary Address performing the token purchase
* @param tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(address beneficiary, uint256 tokenAmount) internal {
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send
* tokens.
* @param beneficiary Address receiving the tokens
* @param tokenAmount Number of tokens to be purchased
*/
function _processPurchase(address beneficiary, uint256 tokenAmount)
internal
{
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions,
* etc.)
* @param beneficiary Address receiving the tokens
* @param weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(address beneficiary, uint256 weiAmount)
internal
{
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 weiAmount)
internal
view
returns (uint256)
{
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
}
/**
* @dev Returns the amount contributed so far by a specific beneficiary.
* @param beneficiary Address of contributor
* @return Beneficiary contribution so far
*/
function getContribution(address beneficiary)
public
view
returns (uint256)
{
}
/**
* @dev Sets a specific Beneficiary maximum contribution.
* @param minCap Min Wei limit for individual contribution
* @param maxCap Max Wei limit for individual contribution
*/
function setIndividualCap(uint256 minCap, uint256 maxCap)
external
onlyOwner
{
}
function pause() public virtual onlyOwner {
}
function unpause() public virtual onlyOwner {
}
function endSale() public virtual onlyOwner {
}
function updateRate(uint256 pRate) public virtual onlyOwner {
}
}
| address(pToken)!=address(0),"DexGame Public Sale: token is the zero address" | 373,481 | address(pToken)!=address(0) |
"Beneficiary max cap exceeded" | pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
contract PublicSale is Ownable, ReentrancyGuard, Pausable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
mapping(address => uint256) private _contributions;
uint256 private _individualMaxCap;
uint256 private _individualMinCap;
uint256 private _openingTime;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address payable private _wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a ERC20Detailed token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 private _rate;
// Amount of wei raised
uint256 private _weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokensPurchased(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
constructor(
uint256 pRate,
address payable pWallet,
IERC20 pToken,
uint256 pIndividualMinCap,
uint256 pIndividualMaxCap,
uint256 pOpeningTime
) {
}
/**
* @dev fallback function ***DO NOT OVERRIDE***
* Note that other contracts will transfer funds with a base gas stipend
* of 2300, which is not enough to call buyTokens. Consider calling
* buyTokens directly when purchasing tokens from a contract.
*/
receive() external payable {
}
/**
* @return the token being sold.
*/
function token() public view returns (IERC20) {
}
function individualMinCap() public view returns (uint256) {
}
function individualMaxCap() public view returns (uint256) {
}
/**
* @return the crowdsale opening time.
*/
function openingTime() public view returns (uint256) {
}
/**
* @return true if the crowdsale is open, false otherwise.
*/
function isOpen() public view returns (bool) {
}
/**
* @return the address where funds are collected.
*/
function wallet() public view returns (address payable) {
}
/**
* @return the number of token units a buyer gets per wei.
*/
function rate() public view returns (uint256) {
}
/**
* @return the amount of wei raised.
*/
function weiRaised() public view returns (uint256) {
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* This function has a non-reentrancy guard, so it shouldn't be called by
* another `nonReentrant` function.
*/
function buyTokens() public payable nonReentrant {
}
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met.
* Use `super` in contracts that inherit from Crowdsale to extend their validations.
* Example from CappedCrowdsale.sol's _preValidatePurchase method:
* super._preValidatePurchase(beneficiary, weiAmount);
* require(weiRaised().add(weiAmount) <= cap);
* @param beneficiary Address performing the token purchase
* @param weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address beneficiary, uint256 weiAmount)
internal
view
whenNotPaused
{
require(
beneficiary != address(0),
"DexGame Public Sale: beneficiary is the zero address"
);
require(isOpen(), "DexGame Public Sale: not open");
require(weiAmount != 0, "DexGame Public Sale: weiAmount is 0");
require(
_individualMinCap >= 0 && _individualMaxCap > 0,
"DexGame Public Sale: individualMinCap or individualMaxCap is 0"
);
require(
weiAmount >= _individualMinCap,
"Beneficiary purchase amount must be greater than min cap"
);
require(<FILL_ME>)
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid
* conditions are not met.
* @param beneficiary Address performing the token purchase
* @param weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(address beneficiary, uint256 weiAmount)
internal
view
{
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends
* its tokens.
* @param beneficiary Address performing the token purchase
* @param tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(address beneficiary, uint256 tokenAmount) internal {
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send
* tokens.
* @param beneficiary Address receiving the tokens
* @param tokenAmount Number of tokens to be purchased
*/
function _processPurchase(address beneficiary, uint256 tokenAmount)
internal
{
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions,
* etc.)
* @param beneficiary Address receiving the tokens
* @param weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(address beneficiary, uint256 weiAmount)
internal
{
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 weiAmount)
internal
view
returns (uint256)
{
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
}
/**
* @dev Returns the amount contributed so far by a specific beneficiary.
* @param beneficiary Address of contributor
* @return Beneficiary contribution so far
*/
function getContribution(address beneficiary)
public
view
returns (uint256)
{
}
/**
* @dev Sets a specific Beneficiary maximum contribution.
* @param minCap Min Wei limit for individual contribution
* @param maxCap Max Wei limit for individual contribution
*/
function setIndividualCap(uint256 minCap, uint256 maxCap)
external
onlyOwner
{
}
function pause() public virtual onlyOwner {
}
function unpause() public virtual onlyOwner {
}
function endSale() public virtual onlyOwner {
}
function updateRate(uint256 pRate) public virtual onlyOwner {
}
}
| _contributions[beneficiary].add(weiAmount)<=_individualMaxCap,"Beneficiary max cap exceeded" | 373,481 | _contributions[beneficiary].add(weiAmount)<=_individualMaxCap |
"Sale max cap reached" | pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
contract PublicSale is Ownable, ReentrancyGuard, Pausable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
mapping(address => uint256) private _contributions;
uint256 private _individualMaxCap;
uint256 private _individualMinCap;
uint256 private _openingTime;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address payable private _wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a ERC20Detailed token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 private _rate;
// Amount of wei raised
uint256 private _weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokensPurchased(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
constructor(
uint256 pRate,
address payable pWallet,
IERC20 pToken,
uint256 pIndividualMinCap,
uint256 pIndividualMaxCap,
uint256 pOpeningTime
) {
}
/**
* @dev fallback function ***DO NOT OVERRIDE***
* Note that other contracts will transfer funds with a base gas stipend
* of 2300, which is not enough to call buyTokens. Consider calling
* buyTokens directly when purchasing tokens from a contract.
*/
receive() external payable {
}
/**
* @return the token being sold.
*/
function token() public view returns (IERC20) {
}
function individualMinCap() public view returns (uint256) {
}
function individualMaxCap() public view returns (uint256) {
}
/**
* @return the crowdsale opening time.
*/
function openingTime() public view returns (uint256) {
}
/**
* @return true if the crowdsale is open, false otherwise.
*/
function isOpen() public view returns (bool) {
}
/**
* @return the address where funds are collected.
*/
function wallet() public view returns (address payable) {
}
/**
* @return the number of token units a buyer gets per wei.
*/
function rate() public view returns (uint256) {
}
/**
* @return the amount of wei raised.
*/
function weiRaised() public view returns (uint256) {
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* This function has a non-reentrancy guard, so it shouldn't be called by
* another `nonReentrant` function.
*/
function buyTokens() public payable nonReentrant {
}
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met.
* Use `super` in contracts that inherit from Crowdsale to extend their validations.
* Example from CappedCrowdsale.sol's _preValidatePurchase method:
* super._preValidatePurchase(beneficiary, weiAmount);
* require(weiRaised().add(weiAmount) <= cap);
* @param beneficiary Address performing the token purchase
* @param weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address beneficiary, uint256 weiAmount)
internal
view
whenNotPaused
{
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid
* conditions are not met.
* @param beneficiary Address performing the token purchase
* @param weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(address beneficiary, uint256 weiAmount)
internal
view
{
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends
* its tokens.
* @param beneficiary Address performing the token purchase
* @param tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(address beneficiary, uint256 tokenAmount) internal {
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send
* tokens.
* @param beneficiary Address receiving the tokens
* @param tokenAmount Number of tokens to be purchased
*/
function _processPurchase(address beneficiary, uint256 tokenAmount)
internal
{
require(<FILL_ME>)
_deliverTokens(beneficiary, tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions,
* etc.)
* @param beneficiary Address receiving the tokens
* @param weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(address beneficiary, uint256 weiAmount)
internal
{
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 weiAmount)
internal
view
returns (uint256)
{
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
}
/**
* @dev Returns the amount contributed so far by a specific beneficiary.
* @param beneficiary Address of contributor
* @return Beneficiary contribution so far
*/
function getContribution(address beneficiary)
public
view
returns (uint256)
{
}
/**
* @dev Sets a specific Beneficiary maximum contribution.
* @param minCap Min Wei limit for individual contribution
* @param maxCap Max Wei limit for individual contribution
*/
function setIndividualCap(uint256 minCap, uint256 maxCap)
external
onlyOwner
{
}
function pause() public virtual onlyOwner {
}
function unpause() public virtual onlyOwner {
}
function endSale() public virtual onlyOwner {
}
function updateRate(uint256 pRate) public virtual onlyOwner {
}
}
| _token.balanceOf(address(this))>=tokenAmount,"Sale max cap reached" | 373,481 | _token.balanceOf(address(this))>=tokenAmount |
"Only creator can access" | pragma solidity ^0.4.26;// SPDX-License-Identifier: MIT
contract WhiteListHelper{
event NewWhiteList(uint _WhiteListCount, address _creator, address _contract, uint _changeUntil);
modifier OnlyCreator(uint256 _Id) {
require(<FILL_ME>)
_;
}
modifier TimeRemaining(uint256 _Id){
}
modifier ValidateId(uint256 _Id){
}
struct WhiteListItem {
// uint256 Limit;
address Creator;
uint256 ChangeUntil;
//uint256 DrawLimit;
//uint256 SignUpPrice;
address Contract;
// mapping(address => uint256) WhiteListDB;
bool isReady; // defualt false | true after first address is added
}
mapping(uint256 => mapping(address => uint256)) public WhitelistDB;
mapping(uint256 => WhiteListItem) public WhitelistSettings;
uint256 public WhiteListCost;
uint256 public WhiteListCount;
function _AddAddress(uint256 _Id, address user, uint amount) internal {
}
function _RemoveAddress(uint256 _Id, address user) internal {
}
function isWhiteListReady(uint256 _Id) external view returns(bool){
}
//View function to Check if address is whitelisted
function Check(address _user, uint256 _id) external view returns(uint){
}
}/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}// SPDX-License-Identifier: MIT
contract WhiteList is WhiteListHelper, Ownable{
constructor() public {
}
//uint256 public SignUpCost;
uint256 public MaxUsersLimit;
modifier isBelowUserLimit(uint256 _limit) {
}
function setMaxUsersLimit(uint256 _limit) external onlyOwner {
}
function setWhiteListCost(uint256 _newCost) external onlyOwner {
}
function CreateManualWhiteList(
uint256 _ChangeUntil,
address _Contract
) public payable returns (uint256 Id) {
}
function ChangeCreator(uint256 _Id, address _NewCreator)
external
OnlyCreator(_Id)
TimeRemaining(_Id)
ValidateId(_Id)
{
}
function ChangeContract(uint256 _Id, address _NewContract)
external
OnlyCreator(_Id)
TimeRemaining(_Id)
ValidateId(_Id)
{
}
function AddAddress(uint256 _Id, address[] _Users, uint256[] _Amount)
public
OnlyCreator(_Id)
TimeRemaining(_Id)
ValidateId(_Id)
isBelowUserLimit(_Users.length)
{
}
function RemoveAddress(uint256 _Id, address[] _Users)
public
OnlyCreator(_Id)
TimeRemaining(_Id)
ValidateId(_Id)
isBelowUserLimit(_Users.length)
{
}
function Register(
address _Subject,
uint256 _Id,
uint256 _Amount
) external {
}
}
| WhitelistSettings[_Id].Creator==msg.sender,"Only creator can access" | 373,488 | WhitelistSettings[_Id].Creator==msg.sender |
"Sorry, no alocation for Subject" | pragma solidity ^0.4.26;// SPDX-License-Identifier: MIT
contract WhiteListHelper{
event NewWhiteList(uint _WhiteListCount, address _creator, address _contract, uint _changeUntil);
modifier OnlyCreator(uint256 _Id) {
}
modifier TimeRemaining(uint256 _Id){
}
modifier ValidateId(uint256 _Id){
}
struct WhiteListItem {
// uint256 Limit;
address Creator;
uint256 ChangeUntil;
//uint256 DrawLimit;
//uint256 SignUpPrice;
address Contract;
// mapping(address => uint256) WhiteListDB;
bool isReady; // defualt false | true after first address is added
}
mapping(uint256 => mapping(address => uint256)) public WhitelistDB;
mapping(uint256 => WhiteListItem) public WhitelistSettings;
uint256 public WhiteListCost;
uint256 public WhiteListCount;
function _AddAddress(uint256 _Id, address user, uint amount) internal {
}
function _RemoveAddress(uint256 _Id, address user) internal {
}
function isWhiteListReady(uint256 _Id) external view returns(bool){
}
//View function to Check if address is whitelisted
function Check(address _user, uint256 _id) external view returns(uint){
}
}/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}// SPDX-License-Identifier: MIT
contract WhiteList is WhiteListHelper, Ownable{
constructor() public {
}
//uint256 public SignUpCost;
uint256 public MaxUsersLimit;
modifier isBelowUserLimit(uint256 _limit) {
}
function setMaxUsersLimit(uint256 _limit) external onlyOwner {
}
function setWhiteListCost(uint256 _newCost) external onlyOwner {
}
function CreateManualWhiteList(
uint256 _ChangeUntil,
address _Contract
) public payable returns (uint256 Id) {
}
function ChangeCreator(uint256 _Id, address _NewCreator)
external
OnlyCreator(_Id)
TimeRemaining(_Id)
ValidateId(_Id)
{
}
function ChangeContract(uint256 _Id, address _NewContract)
external
OnlyCreator(_Id)
TimeRemaining(_Id)
ValidateId(_Id)
{
}
function AddAddress(uint256 _Id, address[] _Users, uint256[] _Amount)
public
OnlyCreator(_Id)
TimeRemaining(_Id)
ValidateId(_Id)
isBelowUserLimit(_Users.length)
{
}
function RemoveAddress(uint256 _Id, address[] _Users)
public
OnlyCreator(_Id)
TimeRemaining(_Id)
ValidateId(_Id)
isBelowUserLimit(_Users.length)
{
}
function Register(
address _Subject,
uint256 _Id,
uint256 _Amount
) external {
if (_Id == 0) return;
require(
msg.sender == WhitelistSettings[_Id].Contract,
"Only the Contract can call this"
);
require(<FILL_ME>)
uint256 temp = WhitelistDB[_Id][_Subject] - _Amount;
WhitelistDB[_Id][_Subject] = temp;
assert(WhitelistDB[_Id][_Subject] == temp);
}
}
| WhitelistDB[_Id][_Subject]>=_Amount,"Sorry, no alocation for Subject" | 373,488 | WhitelistDB[_Id][_Subject]>=_Amount |
"Whitelisting: the caller is not whitelistOperator or owner" | pragma solidity ^0.5.4;// Copyright (C) 2020 LimeChain - Blockchain & DLT Solutions <https://limechain.tech>
/**
* @title RulesOperator
* @dev Interface for a IdoneusToken Rules Operator.
* A Rules Operator must implement the functions below to
* successfully execute the IdoneusToken approval and transfers
* functionality.
*/
interface RulesOperator {
/**
* @dev Validates upon ERC-20 `approve` call.
*/
function onApprove(address from, address to, uint256 value)
external
returns (bool);
/**
* @dev Gets fee amount IdoneusToken owner will take upon ERC-20
* `transfer` call.
*/
function onTransfer(address from, address to, uint256 value)
external
returns (uint256);
/**
* @dev Gets fee amount IdoneusToken owner will take upon ERC-20
* `transferFrom` call.
*/
function onTransferFrom(address from, address to, uint256 value)
external
returns (uint256);
}
/**
* @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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
// Copyright (C) 2020 LimeChain - Blockchain & DLT Solutions <https://limechain.tech>
/**
* @title Operator
* @dev Simple ownable Operator contract that stores operators.
*/
contract Operator is Ownable {
// The operators storage
mapping(address => bool) private operators;
event OperatorModified(
address indexed executor,
address indexed operator,
bool status
);
/**
* @dev Enables/Disables an operator.
* @param _operator The target operator.
* @param _status Set to true to enable an operator.
*/
function setOperator(address _operator, bool _status) public onlyOwner {
}
/**
* @dev Checks if an operator is enabled/disabled.
* @param _operator The target operator.
*/
function isOperator(address _operator) public view returns (bool) {
}
}
// Copyright (C) 2020 LimeChain - Blockchain & DLT Solutions <https://limechain.tech>
/**
* @title Whitelisting
* @dev Manages whitelisting of accounts (EOA or contracts).
*/
contract Whitelisting is Operator {
// The whitelisted accounts storage
mapping(address => bool) private whitelisted;
event WhitelistedStatusModified(
address indexed executor,
address[] user,
bool status
);
/**
* @dev Throws if the sender is neither operator nor owner.
*/
modifier onlyAuthorized() {
require(<FILL_ME>)
_;
}
/**
* @dev Adds/Removes whitelisted accounts.
* @param _users The target accounts.
* @param _isWhitelisted Set to true to whitelist accounts.
*/
function setWhitelisted(address[] memory _users, bool _isWhitelisted)
public
onlyAuthorized
{
}
/**
* @dev Checks if an account is whitelisted.
* @param _user The target account.
*/
function isWhitelisted(address _user) public view returns (bool) {
}
}
// Copyright (C) 2020 LimeChain - Blockchain & DLT Solutions <https://limechain.tech>
/**
* @title IdonRulesOperator
* @dev Manages IdoneusToken (IDON) USD price. Used as fee calculator
* on IDON Token transfers.
*/
contract IdonRulesOperator is RulesOperator, Operator {
using SafeMath for uint256;
/**
* @notice The IDON token price, stored with 3 digits
* after the decimal point (e.g. $12.340 => 12 340).
*/
uint256 public idonTokenPrice;
/**
* @notice The minimum IDON token price, stored with 3 digits
* after the decimal point (e.g. $23.456 => 23 456).
*/
uint256 public minimumIDONPrice;
/**
* @notice The transfer fee percentage, stored with 3 digits
* after the decimal point (e.g. 12.345% => 12 345).
*/
uint256 public transferFeePercentage;
// The whitelisting contract storage
Whitelisting public whitelisting;
/**
* @dev Throws if the sender is neither operator nor owner.
*/
modifier onlyAuthorized() {
}
event TokenPriceModified(address indexed executor, uint256 tokenPrice);
event MinimumPriceLimitModified(
address indexed executor,
uint256 minimumPrice
);
event FeePercentageModified(
address indexed executor,
uint256 feePercentage
);
event WhitelistingInstanceModified(
address indexed executor,
address whitelisting
);
/**
* @dev Sets the initial values for IDON token price,
* minimum IDON token price, transfer fee percetange and whitelisting contract.
*
* @param _idonTokenPrice Initial IDON token price.
* @param _minimumIDONPrice Initial minimum IDON token price.
* @param _transferFeePercentage Initial fee percentage on transfers.
* @param _whitelisting Initial whitelisting contract.
*/
constructor(
uint256 _idonTokenPrice,
uint256 _minimumIDONPrice,
uint256 _transferFeePercentage,
address _whitelisting
) public {
}
/**
* @dev Sets IDON Token Price.
* @param _price The target price.
*/
function setIdonTokenPrice(uint256 _price) public onlyAuthorized {
}
/**
* @dev Sets minimum IDON price.
* @param _minimumPriceLimit The target minimum price limit.
*/
function setMinimumPriceLimit(uint256 _minimumPriceLimit) public onlyOwner {
}
/**
* @dev Sets fee percentage.
* @param _transferFeePercentage The target transfer fee percentage.
*/
function setFeePercentage(uint256 _transferFeePercentage) public onlyOwner {
}
function setWhitelisting(address _whitelisting) public onlyOwner {
}
/**
* @dev Validates upon IDON token `approve` call.
* @notice Lacks implementation.
*/
function onApprove(address from, address to, uint256 value)
public
returns (bool)
{
}
/**
* @dev Calculates fee on IDON token `transfer` call.
* @param from The target sender.
* @param to The target recipient.
* @param value The target amount.
*/
function onTransfer(address from, address to, uint256 value)
public
returns (uint256 fee)
{
}
/**
* @dev Calculates fee on IDON token `transferFrom` call.
* @param from The target sender.
* @param to The target recipient.
* @param value The target amount.
*/
function onTransferFrom(address from, address to, uint256 value)
public
returns (uint256)
{
}
/**
* @dev Calculates fee on IDON Token transfer calls, depending on
* IDON Token price and the whitelisting of given accounts (EOA or contracts).
* @param _from The target sender.
* @param _to The target recipient.
* @param _value The target amount.
*/
function transactionValidation(address _from, address _to, uint256 _value)
internal
view
returns (uint256)
{
}
/**
* @dev Calculates fee of given amount.
* @notice `transferFeePercentage` is stored with 3 digits
* after the decimal point (e.g. 12.345% => 12 345).
* @param _value The target amount
*/
function calculateFee(uint256 _value) public view returns (uint256) {
}
}
| isOperator(msg.sender)||msg.sender==owner(),"Whitelisting: the caller is not whitelistOperator or owner" | 373,520 | isOperator(msg.sender)||msg.sender==owner() |
"IdonRulesOperator: one of the users is not whitelisted" | pragma solidity ^0.5.4;// Copyright (C) 2020 LimeChain - Blockchain & DLT Solutions <https://limechain.tech>
/**
* @title RulesOperator
* @dev Interface for a IdoneusToken Rules Operator.
* A Rules Operator must implement the functions below to
* successfully execute the IdoneusToken approval and transfers
* functionality.
*/
interface RulesOperator {
/**
* @dev Validates upon ERC-20 `approve` call.
*/
function onApprove(address from, address to, uint256 value)
external
returns (bool);
/**
* @dev Gets fee amount IdoneusToken owner will take upon ERC-20
* `transfer` call.
*/
function onTransfer(address from, address to, uint256 value)
external
returns (uint256);
/**
* @dev Gets fee amount IdoneusToken owner will take upon ERC-20
* `transferFrom` call.
*/
function onTransferFrom(address from, address to, uint256 value)
external
returns (uint256);
}
/**
* @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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
// Copyright (C) 2020 LimeChain - Blockchain & DLT Solutions <https://limechain.tech>
/**
* @title Operator
* @dev Simple ownable Operator contract that stores operators.
*/
contract Operator is Ownable {
// The operators storage
mapping(address => bool) private operators;
event OperatorModified(
address indexed executor,
address indexed operator,
bool status
);
/**
* @dev Enables/Disables an operator.
* @param _operator The target operator.
* @param _status Set to true to enable an operator.
*/
function setOperator(address _operator, bool _status) public onlyOwner {
}
/**
* @dev Checks if an operator is enabled/disabled.
* @param _operator The target operator.
*/
function isOperator(address _operator) public view returns (bool) {
}
}
// Copyright (C) 2020 LimeChain - Blockchain & DLT Solutions <https://limechain.tech>
/**
* @title Whitelisting
* @dev Manages whitelisting of accounts (EOA or contracts).
*/
contract Whitelisting is Operator {
// The whitelisted accounts storage
mapping(address => bool) private whitelisted;
event WhitelistedStatusModified(
address indexed executor,
address[] user,
bool status
);
/**
* @dev Throws if the sender is neither operator nor owner.
*/
modifier onlyAuthorized() {
}
/**
* @dev Adds/Removes whitelisted accounts.
* @param _users The target accounts.
* @param _isWhitelisted Set to true to whitelist accounts.
*/
function setWhitelisted(address[] memory _users, bool _isWhitelisted)
public
onlyAuthorized
{
}
/**
* @dev Checks if an account is whitelisted.
* @param _user The target account.
*/
function isWhitelisted(address _user) public view returns (bool) {
}
}
// Copyright (C) 2020 LimeChain - Blockchain & DLT Solutions <https://limechain.tech>
/**
* @title IdonRulesOperator
* @dev Manages IdoneusToken (IDON) USD price. Used as fee calculator
* on IDON Token transfers.
*/
contract IdonRulesOperator is RulesOperator, Operator {
using SafeMath for uint256;
/**
* @notice The IDON token price, stored with 3 digits
* after the decimal point (e.g. $12.340 => 12 340).
*/
uint256 public idonTokenPrice;
/**
* @notice The minimum IDON token price, stored with 3 digits
* after the decimal point (e.g. $23.456 => 23 456).
*/
uint256 public minimumIDONPrice;
/**
* @notice The transfer fee percentage, stored with 3 digits
* after the decimal point (e.g. 12.345% => 12 345).
*/
uint256 public transferFeePercentage;
// The whitelisting contract storage
Whitelisting public whitelisting;
/**
* @dev Throws if the sender is neither operator nor owner.
*/
modifier onlyAuthorized() {
}
event TokenPriceModified(address indexed executor, uint256 tokenPrice);
event MinimumPriceLimitModified(
address indexed executor,
uint256 minimumPrice
);
event FeePercentageModified(
address indexed executor,
uint256 feePercentage
);
event WhitelistingInstanceModified(
address indexed executor,
address whitelisting
);
/**
* @dev Sets the initial values for IDON token price,
* minimum IDON token price, transfer fee percetange and whitelisting contract.
*
* @param _idonTokenPrice Initial IDON token price.
* @param _minimumIDONPrice Initial minimum IDON token price.
* @param _transferFeePercentage Initial fee percentage on transfers.
* @param _whitelisting Initial whitelisting contract.
*/
constructor(
uint256 _idonTokenPrice,
uint256 _minimumIDONPrice,
uint256 _transferFeePercentage,
address _whitelisting
) public {
}
/**
* @dev Sets IDON Token Price.
* @param _price The target price.
*/
function setIdonTokenPrice(uint256 _price) public onlyAuthorized {
}
/**
* @dev Sets minimum IDON price.
* @param _minimumPriceLimit The target minimum price limit.
*/
function setMinimumPriceLimit(uint256 _minimumPriceLimit) public onlyOwner {
}
/**
* @dev Sets fee percentage.
* @param _transferFeePercentage The target transfer fee percentage.
*/
function setFeePercentage(uint256 _transferFeePercentage) public onlyOwner {
}
function setWhitelisting(address _whitelisting) public onlyOwner {
}
/**
* @dev Validates upon IDON token `approve` call.
* @notice Lacks implementation.
*/
function onApprove(address from, address to, uint256 value)
public
returns (bool)
{
}
/**
* @dev Calculates fee on IDON token `transfer` call.
* @param from The target sender.
* @param to The target recipient.
* @param value The target amount.
*/
function onTransfer(address from, address to, uint256 value)
public
returns (uint256 fee)
{
}
/**
* @dev Calculates fee on IDON token `transferFrom` call.
* @param from The target sender.
* @param to The target recipient.
* @param value The target amount.
*/
function onTransferFrom(address from, address to, uint256 value)
public
returns (uint256)
{
}
/**
* @dev Calculates fee on IDON Token transfer calls, depending on
* IDON Token price and the whitelisting of given accounts (EOA or contracts).
* @param _from The target sender.
* @param _to The target recipient.
* @param _value The target amount.
*/
function transactionValidation(address _from, address _to, uint256 _value)
internal
view
returns (uint256)
{
if (idonTokenPrice <= minimumIDONPrice) {
require(<FILL_ME>)
}
if (
whitelisting.isWhitelisted(_from) && whitelisting.isWhitelisted(_to)
) {
return 0;
}
return calculateFee(_value);
}
/**
* @dev Calculates fee of given amount.
* @notice `transferFeePercentage` is stored with 3 digits
* after the decimal point (e.g. 12.345% => 12 345).
* @param _value The target amount
*/
function calculateFee(uint256 _value) public view returns (uint256) {
}
}
| whitelisting.isWhitelisted(_from)&&whitelisting.isWhitelisted(_to),"IdonRulesOperator: one of the users is not whitelisted" | 373,520 | whitelisting.isWhitelisted(_from)&&whitelisting.isWhitelisted(_to) |
"EXCEED_SUPPLY" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
uint256 reserveAmount = fqty+mqty;
require(reserveAmount > 0 && reserveAmount <= reserve, "NOT_ENOUGH_RESERVED");
require(<FILL_ME>)
for (uint v = 0; v < fqty; v++) {
_safeMint(to, femaleIndex);
femaleIndex = femaleIndex.add(2);
}
for (uint k = 0; k < mqty; k++) {
_safeMint(to, maleIndex);
maleIndex = maleIndex.add(2);
}
reserve = reserve.sub(reserveAmount);
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
}
}
| totalSupply().add(reserveAmount)<=maxSupply,"EXCEED_SUPPLY" | 373,555 | totalSupply().add(reserveAmount)<=maxSupply |
"ONLY_PRESALE" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(saleIsActive, "SALE_INACTIVE");
require(<FILL_ME>)
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(totalSupply().add(qty) <= maxSupply, "EXCEED_SUPPLY");
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(femaleCounter.add(fqty) <= maxFemales, "EXCEED_FEMALE_SUPPLY");
require(femalePurchases[msg.sender].add(fqty) <= 3, "EXCEED_FEMALE_LIMIT"); // 3 priestess max per wallet on presale
require(maleCounter.add(mqty) <= maxMales, "EXCEED_MALE_SUPPLY");
require(malePurchases[msg.sender].add(mqty) <= 3, "EXCEED_MALE_LIMIT"); // 3 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
}
}
| !presaleIsLive,"ONLY_PRESALE" | 373,555 | !presaleIsLive |
"EXCEED_SUPPLY" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(saleIsActive, "SALE_INACTIVE");
require(!presaleIsLive, "ONLY_PRESALE");
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(<FILL_ME>)
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(femaleCounter.add(fqty) <= maxFemales, "EXCEED_FEMALE_SUPPLY");
require(femalePurchases[msg.sender].add(fqty) <= 3, "EXCEED_FEMALE_LIMIT"); // 3 priestess max per wallet on presale
require(maleCounter.add(mqty) <= maxMales, "EXCEED_MALE_SUPPLY");
require(malePurchases[msg.sender].add(mqty) <= 3, "EXCEED_MALE_LIMIT"); // 3 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
}
}
| totalSupply().add(qty)<=maxSupply,"EXCEED_SUPPLY" | 373,555 | totalSupply().add(qty)<=maxSupply |
"EXCEED_FEMALE_SUPPLY" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(saleIsActive, "SALE_INACTIVE");
require(!presaleIsLive, "ONLY_PRESALE");
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(totalSupply().add(qty) <= maxSupply, "EXCEED_SUPPLY");
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(<FILL_ME>)
require(femalePurchases[msg.sender].add(fqty) <= 3, "EXCEED_FEMALE_LIMIT"); // 3 priestess max per wallet on presale
require(maleCounter.add(mqty) <= maxMales, "EXCEED_MALE_SUPPLY");
require(malePurchases[msg.sender].add(mqty) <= 3, "EXCEED_MALE_LIMIT"); // 3 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
}
}
| femaleCounter.add(fqty)<=maxFemales,"EXCEED_FEMALE_SUPPLY" | 373,555 | femaleCounter.add(fqty)<=maxFemales |
"EXCEED_FEMALE_LIMIT" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(saleIsActive, "SALE_INACTIVE");
require(!presaleIsLive, "ONLY_PRESALE");
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(totalSupply().add(qty) <= maxSupply, "EXCEED_SUPPLY");
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(femaleCounter.add(fqty) <= maxFemales, "EXCEED_FEMALE_SUPPLY");
require(<FILL_ME>) // 3 priestess max per wallet on presale
require(maleCounter.add(mqty) <= maxMales, "EXCEED_MALE_SUPPLY");
require(malePurchases[msg.sender].add(mqty) <= 3, "EXCEED_MALE_LIMIT"); // 3 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
}
}
| femalePurchases[msg.sender].add(fqty)<=3,"EXCEED_FEMALE_LIMIT" | 373,555 | femalePurchases[msg.sender].add(fqty)<=3 |
"EXCEED_MALE_SUPPLY" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(saleIsActive, "SALE_INACTIVE");
require(!presaleIsLive, "ONLY_PRESALE");
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(totalSupply().add(qty) <= maxSupply, "EXCEED_SUPPLY");
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(femaleCounter.add(fqty) <= maxFemales, "EXCEED_FEMALE_SUPPLY");
require(femalePurchases[msg.sender].add(fqty) <= 3, "EXCEED_FEMALE_LIMIT"); // 3 priestess max per wallet on presale
require(<FILL_ME>)
require(malePurchases[msg.sender].add(mqty) <= 3, "EXCEED_MALE_LIMIT"); // 3 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
}
}
| maleCounter.add(mqty)<=maxMales,"EXCEED_MALE_SUPPLY" | 373,555 | maleCounter.add(mqty)<=maxMales |
"EXCEED_MALE_LIMIT" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(saleIsActive, "SALE_INACTIVE");
require(!presaleIsLive, "ONLY_PRESALE");
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(totalSupply().add(qty) <= maxSupply, "EXCEED_SUPPLY");
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(femaleCounter.add(fqty) <= maxFemales, "EXCEED_FEMALE_SUPPLY");
require(femalePurchases[msg.sender].add(fqty) <= 3, "EXCEED_FEMALE_LIMIT"); // 3 priestess max per wallet on presale
require(maleCounter.add(mqty) <= maxMales, "EXCEED_MALE_SUPPLY");
require(<FILL_ME>) // 3 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
}
}
| malePurchases[msg.sender].add(mqty)<=3,"EXCEED_MALE_LIMIT" | 373,555 | malePurchases[msg.sender].add(mqty)<=3 |
"PRESALE_INACTIVE" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(<FILL_ME>)
require(presalerList[msg.sender], "NOT_QUALIFIED");
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(totalSupply().add(qty) <= maxSupply, "EXCEED_SUPPLY");
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(femaleCounter.add(fqty) <= maxFemales, "EXCEED_FEMALE_SUPPLY");
require(femalePurchases[msg.sender].add(fqty) <= 2, "EXCEED_FEMALE_LIMIT"); // 2 priestess max per wallet on presale
require(maleCounter.add(mqty) <= maxMales, "EXCEED_MALE_SUPPLY");
require(malePurchases[msg.sender].add(mqty) <= 2, "EXCEED_MALE_LIMIT"); // 2 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
}
| !saleIsActive&&presaleIsLive,"PRESALE_INACTIVE" | 373,555 | !saleIsActive&&presaleIsLive |
"EXCEED_FEMALE_LIMIT" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(!saleIsActive && presaleIsLive, "PRESALE_INACTIVE");
require(presalerList[msg.sender], "NOT_QUALIFIED");
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(totalSupply().add(qty) <= maxSupply, "EXCEED_SUPPLY");
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(femaleCounter.add(fqty) <= maxFemales, "EXCEED_FEMALE_SUPPLY");
require(<FILL_ME>) // 2 priestess max per wallet on presale
require(maleCounter.add(mqty) <= maxMales, "EXCEED_MALE_SUPPLY");
require(malePurchases[msg.sender].add(mqty) <= 2, "EXCEED_MALE_LIMIT"); // 2 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
}
| femalePurchases[msg.sender].add(fqty)<=2,"EXCEED_FEMALE_LIMIT" | 373,555 | femalePurchases[msg.sender].add(fqty)<=2 |
"EXCEED_MALE_LIMIT" | pragma solidity ^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 {
}
}
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
}
}
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
}
}
pragma solidity ^0.8.0;
contract TheInfernity is ERC721, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
string public guardianProvenance = ""; // WILL BE ADDED WHEN ALL SOLD OUT
uint256 public constant guardianPrice = 0.12 ether; // Price per collectible
uint256 public constant guardianPresalePrice = 0.1 ether; // Price per collectible on presale
uint256 public constant maxPurchase = 6; // Max 6 (maximum 3+3) token per purchase
uint256 public reserve = 100; // 100 max free mints for owner
uint256 public constant maxSupply = 9999; // 4999 + 5000 Total Supply
uint256 public constant maxFemales = 4999; // 4999 Priestess Supply
uint256 public constant maxMales = 5000; // 5000 Priest Supply
uint256 public maleCounter = 0;
uint256 public femaleCounter = 0;
uint256 public maleIndex = 1; // Odd numbers are Priests
uint256 public femaleIndex = 2; // Even numbers are Priestess
address public ownerAddress = 0x17F09412466069CA13F479a3EC62B65433E00DD9; // Owner address
address public devAddress = 0x7Fe031913A59D3396cF49970B99D24a5Cf0E7159; // Dev address
address public signerAddress = 0xf972Ea810BdD84DAc591946a1f508b1D1de7AB36; // Backend Signer address to match signature
mapping(address => bool) public presalerList;
mapping(address => uint256) public presalerListPurchases;
mapping(address => uint256) public malePurchases;
mapping(address => uint256) public femalePurchases;
bool public saleIsActive = false;
bool public presaleIsLive = false;
constructor() ERC721("The Infernity", "TI") {}
function withdraw() external onlyOwner {
}
function _withdraw(address addr, uint256 amount) private {
}
function addToPresaleList(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleList(address[] calldata entries) external onlyOwner {
}
function reserveTo(address to, uint256 fqty, uint256 mqty) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setSignerAddress(address signer) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns(bool) {
}
function mint(bytes32 hash, uint256 fqty, uint256 mqty, bytes memory signature) external payable {
}
function presaleMint(uint256 fqty, uint256 mqty, bytes32 hash, bytes memory signature) external payable {
uint256 qty = mqty+fqty;
require(!saleIsActive && presaleIsLive, "PRESALE_INACTIVE");
require(presalerList[msg.sender], "NOT_QUALIFIED");
require(matchAddresSigner(hash, signature), "NO_DIRECT_MINT");
require(qty > 0 && qty <= maxPurchase, "EXCEED_MAX_PER_TRANSACTION");
require(totalSupply().add(qty) <= maxSupply, "EXCEED_SUPPLY");
require(msg.value >= guardianPrice.mul(qty), "INCORRECT_ETH");
require(femaleCounter.add(fqty) <= maxFemales, "EXCEED_FEMALE_SUPPLY");
require(femalePurchases[msg.sender].add(fqty) <= 2, "EXCEED_FEMALE_LIMIT"); // 2 priestess max per wallet on presale
require(maleCounter.add(mqty) <= maxMales, "EXCEED_MALE_SUPPLY");
require(<FILL_ME>) // 2 priest max per wallet on presale
for (uint v = 0; v < fqty; v++) {
_safeMint(msg.sender, femaleIndex);
femaleIndex = femaleIndex.add(2);
femaleCounter = femaleCounter.add(1);
femalePurchases[msg.sender]++;
}
for (uint k = 0; k < mqty; k++) {
_safeMint(msg.sender, maleIndex);
maleIndex = maleIndex.add(2);
maleCounter = maleCounter.add(1);
malePurchases[msg.sender]++;
}
}
}
| malePurchases[msg.sender].add(mqty)<=2,"EXCEED_MALE_LIMIT" | 373,555 | malePurchases[msg.sender].add(mqty)<=2 |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import './interfaces/IFEX.sol';
import "./DelegateERC20.sol";
contract FEXToken is DelegateERC20,IFEX, Ownable {
uint256 private constant preMineSupply = 100000000 * 1e18;
uint256 private constant maxSupply = 500000000 * 1e18; // the total supply
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet private _minters;
constructor() public ERC20("FEXToken", "FEX"){
}
// mint with max supply
function mint(address _to, uint256 _amount) external onlyMinter override returns (bool) {
require(<FILL_ME>)
_mint(_to, _amount);
return true;
}
function addMinter(address _addMinter) public onlyOwner returns (bool) {
}
function delMinter(address _delMinter) public onlyOwner returns (bool) {
}
function getMinterLength() public view returns (uint256) {
}
function isMinter(address account) public view returns (bool) {
}
function getMinter(uint256 _index) public view onlyOwner returns (address){
}
// modifier for mint function
modifier onlyMinter() {
}
}
| _amount.add(totalSupply())<=maxSupply | 373,578 | _amount.add(totalSupply())<=maxSupply |
"WhitelistAdminRole: caller does not have the WhitelistAdmin role" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/utils/Context.sol';
import "../Roles.sol";
/**
* @title WhitelistAdminRole
* @dev WhitelistAdmins are responsible for assigning and removing Whitelisted accounts.
*/
abstract contract WhitelistAdminRole is Context {
using Roles for Roles.Role;
event WhitelistAdminAdded(address indexed account);
event WhitelistAdminRemoved(address indexed account);
Roles.Role private _whitelistAdmins;
constructor () {
}
modifier onlyWhitelistAdmin() {
require(<FILL_ME>)
_;
}
function isWhitelistAdmin(address account) public view returns (bool) {
}
function addWhitelistAdmin(address account) public onlyWhitelistAdmin {
}
function renounceWhitelistAdmin() public {
}
function _addWhitelistAdmin(address account) internal {
}
function _removeWhitelistAdmin(address account) internal {
}
}
| isWhitelistAdmin(_msgSender()),"WhitelistAdminRole: caller does not have the WhitelistAdmin role" | 373,735 | isWhitelistAdmin(_msgSender()) |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
require(itemRegistry != address(0));
require(<FILL_ME>)
require(itemRegistry.priceOf(_itemId) > 0);
uint256 price = itemRegistry.priceOf(_itemId);
address itemOwner = itemRegistry.ownerOf(_itemId);
listItem(_itemId, price, itemOwner);
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| itemRegistry.ownerOf(_itemId)!=address(0) | 373,737 | itemRegistry.ownerOf(_itemId)!=address(0) |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
require(itemRegistry != address(0));
require(itemRegistry.ownerOf(_itemId) != address(0));
require(<FILL_ME>)
uint256 price = itemRegistry.priceOf(_itemId);
address itemOwner = itemRegistry.ownerOf(_itemId);
listItem(_itemId, price, itemOwner);
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| itemRegistry.priceOf(_itemId)>0 | 373,737 | itemRegistry.priceOf(_itemId)>0 |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
require(_price > 0);
require(<FILL_ME>)
require(ownerOfItem[_itemId] == address(0));
ownerOfItem[_itemId] = _owner;
priceOfItem[_itemId] = _price * min_value;
startingPriceOfItem[_itemId] = _price * min_value;
listedItems.push(_itemId);
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| priceOfItem[_itemId]==0 | 373,737 | priceOfItem[_itemId]==0 |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
require(_price > 0);
require(priceOfItem[_itemId] == 0);
require(<FILL_ME>)
ownerOfItem[_itemId] = _owner;
priceOfItem[_itemId] = _price * min_value;
startingPriceOfItem[_itemId] = _price * min_value;
listedItems.push(_itemId);
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| ownerOfItem[_itemId]==address(0) | 373,737 | ownerOfItem[_itemId]==address(0) |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
require(<FILL_ME>)
require(ownerOf(_itemId) != address(0));
require(msg.value >= priceOf(_itemId));
require(ownerOf(_itemId) != msg.sender);
require(!isContract(msg.sender));
require(msg.sender != address(0));
address oldOwner = ownerOf(_itemId);
address newOwner = msg.sender;
uint256 price = priceOf(_itemId);
uint256 excess = msg.value.sub(price);
_transfer(oldOwner, newOwner, _itemId);
priceOfItem[_itemId] = nextPriceOf(_itemId);
Bought(_itemId, newOwner, price);
Sold(_itemId, oldOwner, price);
// Devevloper's cut which is left in contract and accesed by
// `withdrawAll` and `withdrawAmountTo` methods.
uint256 devCut = calculateDevCut(price);
// Transfer payment to old owner minus the developer's cut.
oldOwner.transfer(price.sub(devCut));
if (excess > 0) {
newOwner.transfer(excess);
}
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| priceOf(_itemId)>0 | 373,737 | priceOf(_itemId)>0 |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
require(priceOf(_itemId) > 0);
require(<FILL_ME>)
require(msg.value >= priceOf(_itemId));
require(ownerOf(_itemId) != msg.sender);
require(!isContract(msg.sender));
require(msg.sender != address(0));
address oldOwner = ownerOf(_itemId);
address newOwner = msg.sender;
uint256 price = priceOf(_itemId);
uint256 excess = msg.value.sub(price);
_transfer(oldOwner, newOwner, _itemId);
priceOfItem[_itemId] = nextPriceOf(_itemId);
Bought(_itemId, newOwner, price);
Sold(_itemId, oldOwner, price);
// Devevloper's cut which is left in contract and accesed by
// `withdrawAll` and `withdrawAmountTo` methods.
uint256 devCut = calculateDevCut(price);
// Transfer payment to old owner minus the developer's cut.
oldOwner.transfer(price.sub(devCut));
if (excess > 0) {
newOwner.transfer(excess);
}
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| ownerOf(_itemId)!=address(0) | 373,737 | ownerOf(_itemId)!=address(0) |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
require(priceOf(_itemId) > 0);
require(ownerOf(_itemId) != address(0));
require(msg.value >= priceOf(_itemId));
require(<FILL_ME>)
require(!isContract(msg.sender));
require(msg.sender != address(0));
address oldOwner = ownerOf(_itemId);
address newOwner = msg.sender;
uint256 price = priceOf(_itemId);
uint256 excess = msg.value.sub(price);
_transfer(oldOwner, newOwner, _itemId);
priceOfItem[_itemId] = nextPriceOf(_itemId);
Bought(_itemId, newOwner, price);
Sold(_itemId, oldOwner, price);
// Devevloper's cut which is left in contract and accesed by
// `withdrawAll` and `withdrawAmountTo` methods.
uint256 devCut = calculateDevCut(price);
// Transfer payment to old owner minus the developer's cut.
oldOwner.transfer(price.sub(devCut));
if (excess > 0) {
newOwner.transfer(excess);
}
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| ownerOf(_itemId)!=msg.sender | 373,737 | ownerOf(_itemId)!=msg.sender |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
require(msg.sender != _to);
require(<FILL_ME>)
require(ownerOf(_itemId) == msg.sender);
if (_to == 0) {
if (approvedOfItem[_itemId] != 0) {
delete approvedOfItem[_itemId];
Approval(msg.sender, 0, _itemId);
}
} else {
approvedOfItem[_itemId] = _to;
Approval(msg.sender, _to, _itemId);
}
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| tokenExists(_itemId) | 373,737 | tokenExists(_itemId) |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
require(msg.sender != _to);
require(tokenExists(_itemId));
require(<FILL_ME>)
if (_to == 0) {
if (approvedOfItem[_itemId] != 0) {
delete approvedOfItem[_itemId];
Approval(msg.sender, 0, _itemId);
}
} else {
approvedOfItem[_itemId] = _to;
Approval(msg.sender, _to, _itemId);
}
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| ownerOf(_itemId)==msg.sender | 373,737 | ownerOf(_itemId)==msg.sender |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
require(<FILL_ME>)
_transfer(_from, _to, _itemId);
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| approvedFor(_itemId)==msg.sender | 373,737 | approvedFor(_itemId)==msg.sender |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
require(tokenExists(_itemId));
require(<FILL_ME>)
require(_to != address(0));
require(_to != address(this));
ownerOfItem[_itemId] = _to;
approvedOfItem[_itemId] = 0;
Transfer(_from, _to, _itemId);
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| ownerOf(_itemId)==_from | 373,737 | ownerOf(_itemId)==_from |
null | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract CryptoSanguoToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256 private min_value = 0.01 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function CryptoSanguoToken () public {
}
/* Modifiers */
modifier onlyOwner() {
}
modifier onlyAdmins() {
}
modifier onlyERC721() {
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
}
function addAdmin (address _admin) onlyOwner() public {
}
function removeAdmin (address _admin) onlyOwner() public {
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
}
function name() public pure returns (string _name) {
}
function symbol() public pure returns (string _symbol) {
}
function totalSupply() public view returns (uint256 _totalSupply) {
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
}
/* Util */
function isContract(address addr) internal view returns (bool) {
}
function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() {
require(_price > 0);
require(<FILL_ME>)
priceOfItem[_itemId] = _price * min_value;
}
function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public {
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
}
| admins[ownerOfItem[_itemId]] | 373,737 | admins[ownerOfItem[_itemId]] |
"Tokens cannot be transferred from user account" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// 'UNOS' Staking smart contract. 5% deposit and 10%withdrawal fees are rewarded to all staking members based on their staking amount.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// 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) {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external returns (bool success);
function approve(address spender, uint256 tokens) external returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract UNOSLPStake is Owned {
using SafeMath for uint256;
address public UNOS = 0xb2a85B7aC5d78f3A262e9BF2534dd2806557a346;
uint256 public totalStakes = 0;
uint256 stakingFee = 50; // 5%
uint256 unstakingFee = 100; // 10%
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
uint256 ownerFee = 100;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
require(<FILL_ME>)
uint256 _stakingFee = 0;
uint256 _ownerFee = 0;
if(totalStakes > 0){
_stakingFee= (onePercent(tokens).mul(stakingFee)).div(10);
_ownerFee= (onePercent(_stakingFee).mul(ownerFee)).div(10);
require(IERC20(UNOS).transfer(owner, _ownerFee), "ERROR: error in sending owenrFee to Owner");
// distribute the staking fee accumulated before updating the user's stake
_addPayout(_stakingFee.sub(_ownerFee));
}
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = (tokens.sub(_stakingFee)).add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
totalStakes = totalStakes.add(tokens.sub(_stakingFee));
emit STAKED(msg.sender, tokens.sub(_stakingFee), _stakingFee);
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens) private{
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// 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 yourStakedUNOS(address staker) external view returns(uint256 stakedUNOS){
}
// ------------------------------------------------------------------------
// Get the UNOS balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourUNOSBalance(address user) external view returns(uint256 UNOSBalance){
}
}
| IERC20(UNOS).transferFrom(msg.sender,address(this),tokens),"Tokens cannot be transferred from user account" | 373,872 | IERC20(UNOS).transferFrom(msg.sender,address(this),tokens) |
"ERROR: error in sending owenrFee to Owner" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// 'UNOS' Staking smart contract. 5% deposit and 10%withdrawal fees are rewarded to all staking members based on their staking amount.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// 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) {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external returns (bool success);
function approve(address spender, uint256 tokens) external returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract UNOSLPStake is Owned {
using SafeMath for uint256;
address public UNOS = 0xb2a85B7aC5d78f3A262e9BF2534dd2806557a346;
uint256 public totalStakes = 0;
uint256 stakingFee = 50; // 5%
uint256 unstakingFee = 100; // 10%
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
uint256 ownerFee = 100;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
require(IERC20(UNOS).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account");
uint256 _stakingFee = 0;
uint256 _ownerFee = 0;
if(totalStakes > 0){
_stakingFee= (onePercent(tokens).mul(stakingFee)).div(10);
_ownerFee= (onePercent(_stakingFee).mul(ownerFee)).div(10);
require(<FILL_ME>)
// distribute the staking fee accumulated before updating the user's stake
_addPayout(_stakingFee.sub(_ownerFee));
}
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = (tokens.sub(_stakingFee)).add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
totalStakes = totalStakes.add(tokens.sub(_stakingFee));
emit STAKED(msg.sender, tokens.sub(_stakingFee), _stakingFee);
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens) private{
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// 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 yourStakedUNOS(address staker) external view returns(uint256 stakedUNOS){
}
// ------------------------------------------------------------------------
// Get the UNOS balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourUNOSBalance(address user) external view returns(uint256 UNOSBalance){
}
}
| IERC20(UNOS).transfer(owner,_ownerFee),"ERROR: error in sending owenrFee to Owner" | 373,872 | IERC20(UNOS).transfer(owner,_ownerFee) |
"ERROR: error in sending reward from contract" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// 'UNOS' Staking smart contract. 5% deposit and 10%withdrawal fees are rewarded to all staking members based on their staking amount.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// 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) {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external returns (bool success);
function approve(address spender, uint256 tokens) external returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract UNOSLPStake is Owned {
using SafeMath for uint256;
address public UNOS = 0xb2a85B7aC5d78f3A262e9BF2534dd2806557a346;
uint256 public totalStakes = 0;
uint256 stakingFee = 50; // 5%
uint256 unstakingFee = 100; // 10%
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
uint256 ownerFee = 100;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens) private{
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
if(totalDividends > stakers[msg.sender].fromTotalDividend){
uint256 owing = pendingReward(msg.sender);
owing = owing.add(stakers[msg.sender].remainder);
stakers[msg.sender].remainder = 0;
require(<FILL_ME>)
emit CLAIMEDREWARD(msg.sender, owing);
stakers[msg.sender].lastDividends = owing; // unscaled
stakers[msg.sender].round = round; // update the round
stakers[msg.sender].fromTotalDividend = totalDividends; // scaled
}
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// 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 yourStakedUNOS(address staker) external view returns(uint256 stakedUNOS){
}
// ------------------------------------------------------------------------
// Get the UNOS balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourUNOSBalance(address user) external view returns(uint256 UNOSBalance){
}
}
| IERC20(UNOS).transfer(msg.sender,owing),"ERROR: error in sending reward from contract" | 373,872 | IERC20(UNOS).transfer(msg.sender,owing) |
"Error in un-staking tokens" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// 'UNOS' Staking smart contract. 5% deposit and 10%withdrawal fees are rewarded to all staking members based on their staking amount.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// 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) {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external returns (bool success);
function approve(address spender, uint256 tokens) external returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract UNOSLPStake is Owned {
using SafeMath for uint256;
address public UNOS = 0xb2a85B7aC5d78f3A262e9BF2534dd2806557a346;
uint256 public totalStakes = 0;
uint256 stakingFee = 50; // 5%
uint256 unstakingFee = 100; // 10%
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
uint256 ownerFee = 100;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS(uint256 tokens) external {
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens) private{
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external {
require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
uint256 _unstakingFee = (onePercent(tokens).mul(unstakingFee)).div(10);
uint256 _ownerFee = 0;
_ownerFee= (onePercent(_unstakingFee).mul(ownerFee)).div(10);
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
totalStakes = totalStakes.sub(tokens);
require(IERC20(UNOS).transfer(owner, _ownerFee), "ERROR: error in sending owenrFee to Owner");
require(<FILL_ME>)
if(totalStakes > 0)
// distribute the un staking fee accumulated after updating the user's stake
_addPayout(_unstakingFee.sub(_ownerFee));
emit UNSTAKED(msg.sender, tokens, _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 yourStakedUNOS(address staker) external view returns(uint256 stakedUNOS){
}
// ------------------------------------------------------------------------
// Get the UNOS balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourUNOSBalance(address user) external view returns(uint256 UNOSBalance){
}
}
| IERC20(UNOS).transfer(msg.sender,tokens.sub(_unstakingFee)),"Error in un-staking tokens" | 373,872 | IERC20(UNOS).transfer(msg.sender,tokens.sub(_unstakingFee)) |
string(abi.encode("Not enough supply remaining to mint quantity of ",mintQuantity)) | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
// ERC-721
string constant TOKEN_NAME = "LODB Angels Collection";
string constant TOKEN_SYMBOL = "LODBA";
// Token Metadata
string constant BASE_URI = "ipfs://QmUV8D1YUV6sEk6gGi8gso3dEDevWsJidsK5Ubz1P87k8q/";
// Minting Payment
uint constant SALE_PRICE = 0.0333 ether;
// Token Supply
uint constant MAX_SUPPLY = 10000;
uint constant RESERVED_SUPPLY = 100;
uint constant FOR_SALE_SUPPLY = MAX_SUPPLY - RESERVED_SUPPLY;
// Presale
address constant DEVILS_CONTRACT_ADDRESS = 0xF642D8A98845a25844D3911Fa1da1D70587c0Acc;
// Sale Price
uint constant PUBLIC_SALE_PRICE = 0.0333 ether;
// Sale Schedule
uint constant PUBLIC_SALE_OPEN_TIME = 1636171260; // Saturday November 06, 2021 00:01:00 (am) in time zone America/New York (EDT)
// OpenSea
address constant OPENSEA_PROXY_REGISTRY_ADDRESS = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
struct LeagueOfDivineBeingsAngelsParams {
address owner;
address payable treasury;
}
contract LeagueOfDivineBeingsAngels is
Ownable,
ERC721Enumerable
{
// # Token Supply
uint private _totalMintedCount = 0;
uint private _reservedMintedCount = 0;
uint private _saleMintedCount = 0;
// # Minting Payment
address payable private _treasury;
event SetTreasury(address prevTreasury, address newTreasury);
// # Sale Schedule
event SalePaused();
event SaleUnpaused();
// # Sale Pausable
bool private _salePaused = false;
// # Presale
mapping(uint => bool) public claimedDevils;
constructor(LeagueOfDivineBeingsAngelsParams memory p)
ERC721(TOKEN_NAME, TOKEN_SYMBOL)
{
}
// # Token Metadata
function _baseURI() override internal pure returns (string memory) {
}
// # Minting Supply
function _requireNotSoldOut() private view {
}
function _requireValidQuantity(uint quantity) private pure {
}
function _requireEnoughSupplyRemaining(uint mintQuantity) private view {
require(<FILL_ME>)
}
// # Sale Pausable
function salePaused() external view returns (bool) {
}
function _requireSaleNotPaused() private view {
}
function _requireSalePaused() private view {
}
function pauseSale() public onlyOwner {
}
function unpauseSale() public onlyOwner {
}
// # Minting Helpers
function _safeMintQuantity(address to, uint quantity) private {
}
// # Sale Mint
function presaleMint(uint[] calldata sacredDevilTokenIds, address to) external
{
}
function publicSaleMint(address to, uint quantity) external payable
{
}
// # Reserved Tokens Minting
function giftAllRemainingReservedTokensToTreasury() external onlyOwner {
}
function gift(address to, uint quantity) public onlyOwner {
}
// # For receiving payments
function setTreasury(address payable newTreasury) public onlyOwner {
}
function treasury() public view returns (address) {
}
function _payForMintQuantity(uint quantity) private {
}
// # OpenSea approval
function isApprovedForAll(address owner, address operator)
override virtual
public view
returns (bool)
{
}
}
// solhint-disable no-empty-blocks
abstract contract OwnableDelegateProxy {}
abstract contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| _saleMintedCount+mintQuantity<=FOR_SALE_SUPPLY,string(abi.encode("Not enough supply remaining to mint quantity of ",mintQuantity)) | 373,942 | _saleMintedCount+mintQuantity<=FOR_SALE_SUPPLY |
"Sale is paused" | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
// ERC-721
string constant TOKEN_NAME = "LODB Angels Collection";
string constant TOKEN_SYMBOL = "LODBA";
// Token Metadata
string constant BASE_URI = "ipfs://QmUV8D1YUV6sEk6gGi8gso3dEDevWsJidsK5Ubz1P87k8q/";
// Minting Payment
uint constant SALE_PRICE = 0.0333 ether;
// Token Supply
uint constant MAX_SUPPLY = 10000;
uint constant RESERVED_SUPPLY = 100;
uint constant FOR_SALE_SUPPLY = MAX_SUPPLY - RESERVED_SUPPLY;
// Presale
address constant DEVILS_CONTRACT_ADDRESS = 0xF642D8A98845a25844D3911Fa1da1D70587c0Acc;
// Sale Price
uint constant PUBLIC_SALE_PRICE = 0.0333 ether;
// Sale Schedule
uint constant PUBLIC_SALE_OPEN_TIME = 1636171260; // Saturday November 06, 2021 00:01:00 (am) in time zone America/New York (EDT)
// OpenSea
address constant OPENSEA_PROXY_REGISTRY_ADDRESS = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
struct LeagueOfDivineBeingsAngelsParams {
address owner;
address payable treasury;
}
contract LeagueOfDivineBeingsAngels is
Ownable,
ERC721Enumerable
{
// # Token Supply
uint private _totalMintedCount = 0;
uint private _reservedMintedCount = 0;
uint private _saleMintedCount = 0;
// # Minting Payment
address payable private _treasury;
event SetTreasury(address prevTreasury, address newTreasury);
// # Sale Schedule
event SalePaused();
event SaleUnpaused();
// # Sale Pausable
bool private _salePaused = false;
// # Presale
mapping(uint => bool) public claimedDevils;
constructor(LeagueOfDivineBeingsAngelsParams memory p)
ERC721(TOKEN_NAME, TOKEN_SYMBOL)
{
}
// # Token Metadata
function _baseURI() override internal pure returns (string memory) {
}
// # Minting Supply
function _requireNotSoldOut() private view {
}
function _requireValidQuantity(uint quantity) private pure {
}
function _requireEnoughSupplyRemaining(uint mintQuantity) private view {
}
// # Sale Pausable
function salePaused() external view returns (bool) {
}
function _requireSaleNotPaused() private view {
require(<FILL_ME>)
}
function _requireSalePaused() private view {
}
function pauseSale() public onlyOwner {
}
function unpauseSale() public onlyOwner {
}
// # Minting Helpers
function _safeMintQuantity(address to, uint quantity) private {
}
// # Sale Mint
function presaleMint(uint[] calldata sacredDevilTokenIds, address to) external
{
}
function publicSaleMint(address to, uint quantity) external payable
{
}
// # Reserved Tokens Minting
function giftAllRemainingReservedTokensToTreasury() external onlyOwner {
}
function gift(address to, uint quantity) public onlyOwner {
}
// # For receiving payments
function setTreasury(address payable newTreasury) public onlyOwner {
}
function treasury() public view returns (address) {
}
function _payForMintQuantity(uint quantity) private {
}
// # OpenSea approval
function isApprovedForAll(address owner, address operator)
override virtual
public view
returns (bool)
{
}
}
// solhint-disable no-empty-blocks
abstract contract OwnableDelegateProxy {}
abstract contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| !_salePaused,"Sale is paused" | 373,942 | !_salePaused |
string(abi.encodePacked("Already minted with LOSD#",Strings.toString(sdTokenId))) | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
// ERC-721
string constant TOKEN_NAME = "LODB Angels Collection";
string constant TOKEN_SYMBOL = "LODBA";
// Token Metadata
string constant BASE_URI = "ipfs://QmUV8D1YUV6sEk6gGi8gso3dEDevWsJidsK5Ubz1P87k8q/";
// Minting Payment
uint constant SALE_PRICE = 0.0333 ether;
// Token Supply
uint constant MAX_SUPPLY = 10000;
uint constant RESERVED_SUPPLY = 100;
uint constant FOR_SALE_SUPPLY = MAX_SUPPLY - RESERVED_SUPPLY;
// Presale
address constant DEVILS_CONTRACT_ADDRESS = 0xF642D8A98845a25844D3911Fa1da1D70587c0Acc;
// Sale Price
uint constant PUBLIC_SALE_PRICE = 0.0333 ether;
// Sale Schedule
uint constant PUBLIC_SALE_OPEN_TIME = 1636171260; // Saturday November 06, 2021 00:01:00 (am) in time zone America/New York (EDT)
// OpenSea
address constant OPENSEA_PROXY_REGISTRY_ADDRESS = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
struct LeagueOfDivineBeingsAngelsParams {
address owner;
address payable treasury;
}
contract LeagueOfDivineBeingsAngels is
Ownable,
ERC721Enumerable
{
// # Token Supply
uint private _totalMintedCount = 0;
uint private _reservedMintedCount = 0;
uint private _saleMintedCount = 0;
// # Minting Payment
address payable private _treasury;
event SetTreasury(address prevTreasury, address newTreasury);
// # Sale Schedule
event SalePaused();
event SaleUnpaused();
// # Sale Pausable
bool private _salePaused = false;
// # Presale
mapping(uint => bool) public claimedDevils;
constructor(LeagueOfDivineBeingsAngelsParams memory p)
ERC721(TOKEN_NAME, TOKEN_SYMBOL)
{
}
// # Token Metadata
function _baseURI() override internal pure returns (string memory) {
}
// # Minting Supply
function _requireNotSoldOut() private view {
}
function _requireValidQuantity(uint quantity) private pure {
}
function _requireEnoughSupplyRemaining(uint mintQuantity) private view {
}
// # Sale Pausable
function salePaused() external view returns (bool) {
}
function _requireSaleNotPaused() private view {
}
function _requireSalePaused() private view {
}
function pauseSale() public onlyOwner {
}
function unpauseSale() public onlyOwner {
}
// # Minting Helpers
function _safeMintQuantity(address to, uint quantity) private {
}
// # Sale Mint
function presaleMint(uint[] calldata sacredDevilTokenIds, address to) external
{
uint quantity = sacredDevilTokenIds.length;
_requireNotSoldOut();
require(
// solhint-disable-next-line not-rely-on-time
block.timestamp < PUBLIC_SALE_OPEN_TIME,
"Presale has ended"
);
_requireSaleNotPaused();
_requireValidQuantity(quantity);
_requireEnoughSupplyRemaining(quantity);
// Check the caller passed Sacred Devil token IDs that
// - Caller owns the corresponding Sacred Devil tokens
// - The Sacred Devil token ID has not been used before
for (uint i = 0; i < quantity; i++) {
uint256 sdTokenId = sacredDevilTokenIds[i];
address ownerOfSDToken = IERC721(DEVILS_CONTRACT_ADDRESS).ownerOf(sdTokenId);
require(
ownerOfSDToken == msg.sender,
string(abi.encodePacked("You do not own LOSD#", Strings.toString(sdTokenId)))
);
require(<FILL_ME>)
claimedDevils[sdTokenId] = true;
}
_saleMintedCount += quantity;
_safeMintQuantity(to, quantity);
}
function publicSaleMint(address to, uint quantity) external payable
{
}
// # Reserved Tokens Minting
function giftAllRemainingReservedTokensToTreasury() external onlyOwner {
}
function gift(address to, uint quantity) public onlyOwner {
}
// # For receiving payments
function setTreasury(address payable newTreasury) public onlyOwner {
}
function treasury() public view returns (address) {
}
function _payForMintQuantity(uint quantity) private {
}
// # OpenSea approval
function isApprovedForAll(address owner, address operator)
override virtual
public view
returns (bool)
{
}
}
// solhint-disable no-empty-blocks
abstract contract OwnableDelegateProxy {}
abstract contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| claimedDevils[sdTokenId]==false,string(abi.encodePacked("Already minted with LOSD#",Strings.toString(sdTokenId))) | 373,942 | claimedDevils[sdTokenId]==false |
"Not enough reserved supply to gift" | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
// ERC-721
string constant TOKEN_NAME = "LODB Angels Collection";
string constant TOKEN_SYMBOL = "LODBA";
// Token Metadata
string constant BASE_URI = "ipfs://QmUV8D1YUV6sEk6gGi8gso3dEDevWsJidsK5Ubz1P87k8q/";
// Minting Payment
uint constant SALE_PRICE = 0.0333 ether;
// Token Supply
uint constant MAX_SUPPLY = 10000;
uint constant RESERVED_SUPPLY = 100;
uint constant FOR_SALE_SUPPLY = MAX_SUPPLY - RESERVED_SUPPLY;
// Presale
address constant DEVILS_CONTRACT_ADDRESS = 0xF642D8A98845a25844D3911Fa1da1D70587c0Acc;
// Sale Price
uint constant PUBLIC_SALE_PRICE = 0.0333 ether;
// Sale Schedule
uint constant PUBLIC_SALE_OPEN_TIME = 1636171260; // Saturday November 06, 2021 00:01:00 (am) in time zone America/New York (EDT)
// OpenSea
address constant OPENSEA_PROXY_REGISTRY_ADDRESS = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
struct LeagueOfDivineBeingsAngelsParams {
address owner;
address payable treasury;
}
contract LeagueOfDivineBeingsAngels is
Ownable,
ERC721Enumerable
{
// # Token Supply
uint private _totalMintedCount = 0;
uint private _reservedMintedCount = 0;
uint private _saleMintedCount = 0;
// # Minting Payment
address payable private _treasury;
event SetTreasury(address prevTreasury, address newTreasury);
// # Sale Schedule
event SalePaused();
event SaleUnpaused();
// # Sale Pausable
bool private _salePaused = false;
// # Presale
mapping(uint => bool) public claimedDevils;
constructor(LeagueOfDivineBeingsAngelsParams memory p)
ERC721(TOKEN_NAME, TOKEN_SYMBOL)
{
}
// # Token Metadata
function _baseURI() override internal pure returns (string memory) {
}
// # Minting Supply
function _requireNotSoldOut() private view {
}
function _requireValidQuantity(uint quantity) private pure {
}
function _requireEnoughSupplyRemaining(uint mintQuantity) private view {
}
// # Sale Pausable
function salePaused() external view returns (bool) {
}
function _requireSaleNotPaused() private view {
}
function _requireSalePaused() private view {
}
function pauseSale() public onlyOwner {
}
function unpauseSale() public onlyOwner {
}
// # Minting Helpers
function _safeMintQuantity(address to, uint quantity) private {
}
// # Sale Mint
function presaleMint(uint[] calldata sacredDevilTokenIds, address to) external
{
}
function publicSaleMint(address to, uint quantity) external payable
{
}
// # Reserved Tokens Minting
function giftAllRemainingReservedTokensToTreasury() external onlyOwner {
}
function gift(address to, uint quantity) public onlyOwner {
require(
_reservedMintedCount < RESERVED_SUPPLY,
"Already gifted all reserved tokens"
);
require(<FILL_ME>)
_reservedMintedCount += quantity;
_safeMintQuantity(to, quantity);
}
// # For receiving payments
function setTreasury(address payable newTreasury) public onlyOwner {
}
function treasury() public view returns (address) {
}
function _payForMintQuantity(uint quantity) private {
}
// # OpenSea approval
function isApprovedForAll(address owner, address operator)
override virtual
public view
returns (bool)
{
}
}
// solhint-disable no-empty-blocks
abstract contract OwnableDelegateProxy {}
abstract contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
| _reservedMintedCount+quantity<=RESERVED_SUPPLY,"Not enough reserved supply to gift" | 373,942 | _reservedMintedCount+quantity<=RESERVED_SUPPLY |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.