comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"RICK-01" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "./ERC721Tradable.sol";
import "./Strings.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
/**
* @title Creature
* Creature - a contract for my non-fungible creatures.
*/
contract Creature is ERC721Tradable {
address payable private _owner;
uint256 private _currentTokenId = 0;
uint256 private _basePrice = 0;
uint256 private constant _protectPrice = 300000000000000000;
uint256 private constant _imagePrice = 100000000000000000;
uint256 private constant _simpleTraitPrice = 14000000000000000;
uint256 private constant _advancedTraitPrice = 35000000000000000;
uint256 private constant _legendaryTraitPrice = 60000000000000000;
struct Rick {
uint256 skin;
uint256 hair;
uint256 shirt;
uint256 pants;
uint256 shoes;
uint256 item;
}
struct RickProtection {
uint256 id;
uint256 value;
}
bytes32 constant RICK_TYPEHASH = keccak256(
"Rick(uint skin, uint hair, uint shirt, uint pants, uint shoes, uint item)"
);
bytes32 constant RICKPROTECTION_TYPEHASH = keccak256(
"RickProtection(uint id, uint value)"
);
mapping (uint => Rick) private _ricks;
mapping (uint => string) private _image;
mapping (uint => string) private _name;
//hash => rickId
mapping (bytes32 => bool) private _rickHash;
mapping (bytes32 => bool) private _rickProtectionHash;
constructor(address _proxyRegistryAddress)
public
ERC721Tradable("CryptoRick", "RICKS", _proxyRegistryAddress)
{
}
function craftRick(Rick memory rick) public returns (uint){
}
function getImage(uint rickId) public view returns (string memory){
}
function totalSupply() public view returns (uint256) {
}
function hash(Rick memory _rick) internal pure returns (bytes32) {
}
function hashProtection(RickProtection memory _rickProt) internal pure returns (bytes32) {
}
function _getNextTokenId() private view returns (uint256) { }
function _incrementTokenId() private { }
function getCurrentTokenId() public view returns (uint256) { }
function getRick(uint rickId) public view returns (Rick memory) {
}
function getName(uint rickId) public view returns (string memory){
}
function setName(
uint rickId,
string memory name
) public payable {
}
function buyRick(
Rick memory _rick,
string memory image,
uint[] memory protectedTraitIds
) public payable {
/*
Validate the Input!
We throw our own RICK-XX error code to handle the frontend output.
*/
//check for remaining ricks
require(_currentTokenId < totalSupply(), "RICK-00");
//is the rick uniq ?
bytes32 rickHash = hash(_rick);
require(<FILL_ME>)
require(msg.value >= getPriceForRick(_rick, bytes(image).length > 0, protectedTraitIds.length), "RICK-02");
bytes32 hashHair = hashProtection(RickProtection(1, _rick.hair));
require(_rickProtectionHash[hashHair] == false, "RICK-03");
bytes32 hashShirt = hashProtection(RickProtection(2, _rick.shirt));
require(_rickProtectionHash[hashShirt] == false, "RICK-04");
bytes32 hashPants = hashProtection(RickProtection(3, _rick.pants));
require(_rickProtectionHash[hashPants] == false, "RICK-05");
bytes32 hashShoes = hashProtection(RickProtection(4, _rick.shoes));
require(_rickProtectionHash[hashShoes] == false, "RICK-06");
bytes32 hashItem = hashProtection(RickProtection(5, _rick.item));
require(_rickProtectionHash[hashItem] == false, "RICK-07");
/*
Mint the new Token
*/
uint nextId = _getNextTokenId();
_safeMint(msg.sender, nextId);
_incrementTokenId();
/*
Save rick
*/
_image[nextId] = image;
_ricks[nextId] = _rick;
_rickHash[rickHash] = true;
/*
Protect the traits
*/
for (uint i = 0; i < protectedTraitIds.length; i++) {
uint val = protectedTraitIds[i];
if (val == 1) _rickProtectionHash[hashHair] = true;
if (val == 2) _rickProtectionHash[hashShirt] = true;
if (val == 3) _rickProtectionHash[hashPants] = true;
if (val == 4) _rickProtectionHash[hashShoes] = true;
if (val == 5) _rickProtectionHash[hashItem] = true;
}
//update basePrice
if (nextId == 50 ) _basePrice = 20000000000000000;
else if (nextId == 250 ) _basePrice = 50000000000000000;
else if (nextId == 500 ) _basePrice = 70000000000000000;
else if (nextId == 1000) _basePrice = 100000000000000000;
}
function getPriceForRick(Rick memory rick, bool withImage, uint protectedTraits) internal view returns(uint){
}
function withdraw(uint256 amount) public {
}
function baseTokenURI() public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
}
| _rickHash[rickHash]==false,"RICK-01" | 299,758 | _rickHash[rickHash]==false |
"RICK-03" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "./ERC721Tradable.sol";
import "./Strings.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
/**
* @title Creature
* Creature - a contract for my non-fungible creatures.
*/
contract Creature is ERC721Tradable {
address payable private _owner;
uint256 private _currentTokenId = 0;
uint256 private _basePrice = 0;
uint256 private constant _protectPrice = 300000000000000000;
uint256 private constant _imagePrice = 100000000000000000;
uint256 private constant _simpleTraitPrice = 14000000000000000;
uint256 private constant _advancedTraitPrice = 35000000000000000;
uint256 private constant _legendaryTraitPrice = 60000000000000000;
struct Rick {
uint256 skin;
uint256 hair;
uint256 shirt;
uint256 pants;
uint256 shoes;
uint256 item;
}
struct RickProtection {
uint256 id;
uint256 value;
}
bytes32 constant RICK_TYPEHASH = keccak256(
"Rick(uint skin, uint hair, uint shirt, uint pants, uint shoes, uint item)"
);
bytes32 constant RICKPROTECTION_TYPEHASH = keccak256(
"RickProtection(uint id, uint value)"
);
mapping (uint => Rick) private _ricks;
mapping (uint => string) private _image;
mapping (uint => string) private _name;
//hash => rickId
mapping (bytes32 => bool) private _rickHash;
mapping (bytes32 => bool) private _rickProtectionHash;
constructor(address _proxyRegistryAddress)
public
ERC721Tradable("CryptoRick", "RICKS", _proxyRegistryAddress)
{
}
function craftRick(Rick memory rick) public returns (uint){
}
function getImage(uint rickId) public view returns (string memory){
}
function totalSupply() public view returns (uint256) {
}
function hash(Rick memory _rick) internal pure returns (bytes32) {
}
function hashProtection(RickProtection memory _rickProt) internal pure returns (bytes32) {
}
function _getNextTokenId() private view returns (uint256) { }
function _incrementTokenId() private { }
function getCurrentTokenId() public view returns (uint256) { }
function getRick(uint rickId) public view returns (Rick memory) {
}
function getName(uint rickId) public view returns (string memory){
}
function setName(
uint rickId,
string memory name
) public payable {
}
function buyRick(
Rick memory _rick,
string memory image,
uint[] memory protectedTraitIds
) public payable {
/*
Validate the Input!
We throw our own RICK-XX error code to handle the frontend output.
*/
//check for remaining ricks
require(_currentTokenId < totalSupply(), "RICK-00");
//is the rick uniq ?
bytes32 rickHash = hash(_rick);
require(_rickHash[rickHash] == false, "RICK-01");
require(msg.value >= getPriceForRick(_rick, bytes(image).length > 0, protectedTraitIds.length), "RICK-02");
bytes32 hashHair = hashProtection(RickProtection(1, _rick.hair));
require(<FILL_ME>)
bytes32 hashShirt = hashProtection(RickProtection(2, _rick.shirt));
require(_rickProtectionHash[hashShirt] == false, "RICK-04");
bytes32 hashPants = hashProtection(RickProtection(3, _rick.pants));
require(_rickProtectionHash[hashPants] == false, "RICK-05");
bytes32 hashShoes = hashProtection(RickProtection(4, _rick.shoes));
require(_rickProtectionHash[hashShoes] == false, "RICK-06");
bytes32 hashItem = hashProtection(RickProtection(5, _rick.item));
require(_rickProtectionHash[hashItem] == false, "RICK-07");
/*
Mint the new Token
*/
uint nextId = _getNextTokenId();
_safeMint(msg.sender, nextId);
_incrementTokenId();
/*
Save rick
*/
_image[nextId] = image;
_ricks[nextId] = _rick;
_rickHash[rickHash] = true;
/*
Protect the traits
*/
for (uint i = 0; i < protectedTraitIds.length; i++) {
uint val = protectedTraitIds[i];
if (val == 1) _rickProtectionHash[hashHair] = true;
if (val == 2) _rickProtectionHash[hashShirt] = true;
if (val == 3) _rickProtectionHash[hashPants] = true;
if (val == 4) _rickProtectionHash[hashShoes] = true;
if (val == 5) _rickProtectionHash[hashItem] = true;
}
//update basePrice
if (nextId == 50 ) _basePrice = 20000000000000000;
else if (nextId == 250 ) _basePrice = 50000000000000000;
else if (nextId == 500 ) _basePrice = 70000000000000000;
else if (nextId == 1000) _basePrice = 100000000000000000;
}
function getPriceForRick(Rick memory rick, bool withImage, uint protectedTraits) internal view returns(uint){
}
function withdraw(uint256 amount) public {
}
function baseTokenURI() public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
}
| _rickProtectionHash[hashHair]==false,"RICK-03" | 299,758 | _rickProtectionHash[hashHair]==false |
"RICK-04" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "./ERC721Tradable.sol";
import "./Strings.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
/**
* @title Creature
* Creature - a contract for my non-fungible creatures.
*/
contract Creature is ERC721Tradable {
address payable private _owner;
uint256 private _currentTokenId = 0;
uint256 private _basePrice = 0;
uint256 private constant _protectPrice = 300000000000000000;
uint256 private constant _imagePrice = 100000000000000000;
uint256 private constant _simpleTraitPrice = 14000000000000000;
uint256 private constant _advancedTraitPrice = 35000000000000000;
uint256 private constant _legendaryTraitPrice = 60000000000000000;
struct Rick {
uint256 skin;
uint256 hair;
uint256 shirt;
uint256 pants;
uint256 shoes;
uint256 item;
}
struct RickProtection {
uint256 id;
uint256 value;
}
bytes32 constant RICK_TYPEHASH = keccak256(
"Rick(uint skin, uint hair, uint shirt, uint pants, uint shoes, uint item)"
);
bytes32 constant RICKPROTECTION_TYPEHASH = keccak256(
"RickProtection(uint id, uint value)"
);
mapping (uint => Rick) private _ricks;
mapping (uint => string) private _image;
mapping (uint => string) private _name;
//hash => rickId
mapping (bytes32 => bool) private _rickHash;
mapping (bytes32 => bool) private _rickProtectionHash;
constructor(address _proxyRegistryAddress)
public
ERC721Tradable("CryptoRick", "RICKS", _proxyRegistryAddress)
{
}
function craftRick(Rick memory rick) public returns (uint){
}
function getImage(uint rickId) public view returns (string memory){
}
function totalSupply() public view returns (uint256) {
}
function hash(Rick memory _rick) internal pure returns (bytes32) {
}
function hashProtection(RickProtection memory _rickProt) internal pure returns (bytes32) {
}
function _getNextTokenId() private view returns (uint256) { }
function _incrementTokenId() private { }
function getCurrentTokenId() public view returns (uint256) { }
function getRick(uint rickId) public view returns (Rick memory) {
}
function getName(uint rickId) public view returns (string memory){
}
function setName(
uint rickId,
string memory name
) public payable {
}
function buyRick(
Rick memory _rick,
string memory image,
uint[] memory protectedTraitIds
) public payable {
/*
Validate the Input!
We throw our own RICK-XX error code to handle the frontend output.
*/
//check for remaining ricks
require(_currentTokenId < totalSupply(), "RICK-00");
//is the rick uniq ?
bytes32 rickHash = hash(_rick);
require(_rickHash[rickHash] == false, "RICK-01");
require(msg.value >= getPriceForRick(_rick, bytes(image).length > 0, protectedTraitIds.length), "RICK-02");
bytes32 hashHair = hashProtection(RickProtection(1, _rick.hair));
require(_rickProtectionHash[hashHair] == false, "RICK-03");
bytes32 hashShirt = hashProtection(RickProtection(2, _rick.shirt));
require(<FILL_ME>)
bytes32 hashPants = hashProtection(RickProtection(3, _rick.pants));
require(_rickProtectionHash[hashPants] == false, "RICK-05");
bytes32 hashShoes = hashProtection(RickProtection(4, _rick.shoes));
require(_rickProtectionHash[hashShoes] == false, "RICK-06");
bytes32 hashItem = hashProtection(RickProtection(5, _rick.item));
require(_rickProtectionHash[hashItem] == false, "RICK-07");
/*
Mint the new Token
*/
uint nextId = _getNextTokenId();
_safeMint(msg.sender, nextId);
_incrementTokenId();
/*
Save rick
*/
_image[nextId] = image;
_ricks[nextId] = _rick;
_rickHash[rickHash] = true;
/*
Protect the traits
*/
for (uint i = 0; i < protectedTraitIds.length; i++) {
uint val = protectedTraitIds[i];
if (val == 1) _rickProtectionHash[hashHair] = true;
if (val == 2) _rickProtectionHash[hashShirt] = true;
if (val == 3) _rickProtectionHash[hashPants] = true;
if (val == 4) _rickProtectionHash[hashShoes] = true;
if (val == 5) _rickProtectionHash[hashItem] = true;
}
//update basePrice
if (nextId == 50 ) _basePrice = 20000000000000000;
else if (nextId == 250 ) _basePrice = 50000000000000000;
else if (nextId == 500 ) _basePrice = 70000000000000000;
else if (nextId == 1000) _basePrice = 100000000000000000;
}
function getPriceForRick(Rick memory rick, bool withImage, uint protectedTraits) internal view returns(uint){
}
function withdraw(uint256 amount) public {
}
function baseTokenURI() public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
}
| _rickProtectionHash[hashShirt]==false,"RICK-04" | 299,758 | _rickProtectionHash[hashShirt]==false |
"RICK-05" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "./ERC721Tradable.sol";
import "./Strings.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
/**
* @title Creature
* Creature - a contract for my non-fungible creatures.
*/
contract Creature is ERC721Tradable {
address payable private _owner;
uint256 private _currentTokenId = 0;
uint256 private _basePrice = 0;
uint256 private constant _protectPrice = 300000000000000000;
uint256 private constant _imagePrice = 100000000000000000;
uint256 private constant _simpleTraitPrice = 14000000000000000;
uint256 private constant _advancedTraitPrice = 35000000000000000;
uint256 private constant _legendaryTraitPrice = 60000000000000000;
struct Rick {
uint256 skin;
uint256 hair;
uint256 shirt;
uint256 pants;
uint256 shoes;
uint256 item;
}
struct RickProtection {
uint256 id;
uint256 value;
}
bytes32 constant RICK_TYPEHASH = keccak256(
"Rick(uint skin, uint hair, uint shirt, uint pants, uint shoes, uint item)"
);
bytes32 constant RICKPROTECTION_TYPEHASH = keccak256(
"RickProtection(uint id, uint value)"
);
mapping (uint => Rick) private _ricks;
mapping (uint => string) private _image;
mapping (uint => string) private _name;
//hash => rickId
mapping (bytes32 => bool) private _rickHash;
mapping (bytes32 => bool) private _rickProtectionHash;
constructor(address _proxyRegistryAddress)
public
ERC721Tradable("CryptoRick", "RICKS", _proxyRegistryAddress)
{
}
function craftRick(Rick memory rick) public returns (uint){
}
function getImage(uint rickId) public view returns (string memory){
}
function totalSupply() public view returns (uint256) {
}
function hash(Rick memory _rick) internal pure returns (bytes32) {
}
function hashProtection(RickProtection memory _rickProt) internal pure returns (bytes32) {
}
function _getNextTokenId() private view returns (uint256) { }
function _incrementTokenId() private { }
function getCurrentTokenId() public view returns (uint256) { }
function getRick(uint rickId) public view returns (Rick memory) {
}
function getName(uint rickId) public view returns (string memory){
}
function setName(
uint rickId,
string memory name
) public payable {
}
function buyRick(
Rick memory _rick,
string memory image,
uint[] memory protectedTraitIds
) public payable {
/*
Validate the Input!
We throw our own RICK-XX error code to handle the frontend output.
*/
//check for remaining ricks
require(_currentTokenId < totalSupply(), "RICK-00");
//is the rick uniq ?
bytes32 rickHash = hash(_rick);
require(_rickHash[rickHash] == false, "RICK-01");
require(msg.value >= getPriceForRick(_rick, bytes(image).length > 0, protectedTraitIds.length), "RICK-02");
bytes32 hashHair = hashProtection(RickProtection(1, _rick.hair));
require(_rickProtectionHash[hashHair] == false, "RICK-03");
bytes32 hashShirt = hashProtection(RickProtection(2, _rick.shirt));
require(_rickProtectionHash[hashShirt] == false, "RICK-04");
bytes32 hashPants = hashProtection(RickProtection(3, _rick.pants));
require(<FILL_ME>)
bytes32 hashShoes = hashProtection(RickProtection(4, _rick.shoes));
require(_rickProtectionHash[hashShoes] == false, "RICK-06");
bytes32 hashItem = hashProtection(RickProtection(5, _rick.item));
require(_rickProtectionHash[hashItem] == false, "RICK-07");
/*
Mint the new Token
*/
uint nextId = _getNextTokenId();
_safeMint(msg.sender, nextId);
_incrementTokenId();
/*
Save rick
*/
_image[nextId] = image;
_ricks[nextId] = _rick;
_rickHash[rickHash] = true;
/*
Protect the traits
*/
for (uint i = 0; i < protectedTraitIds.length; i++) {
uint val = protectedTraitIds[i];
if (val == 1) _rickProtectionHash[hashHair] = true;
if (val == 2) _rickProtectionHash[hashShirt] = true;
if (val == 3) _rickProtectionHash[hashPants] = true;
if (val == 4) _rickProtectionHash[hashShoes] = true;
if (val == 5) _rickProtectionHash[hashItem] = true;
}
//update basePrice
if (nextId == 50 ) _basePrice = 20000000000000000;
else if (nextId == 250 ) _basePrice = 50000000000000000;
else if (nextId == 500 ) _basePrice = 70000000000000000;
else if (nextId == 1000) _basePrice = 100000000000000000;
}
function getPriceForRick(Rick memory rick, bool withImage, uint protectedTraits) internal view returns(uint){
}
function withdraw(uint256 amount) public {
}
function baseTokenURI() public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
}
| _rickProtectionHash[hashPants]==false,"RICK-05" | 299,758 | _rickProtectionHash[hashPants]==false |
"RICK-06" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "./ERC721Tradable.sol";
import "./Strings.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
/**
* @title Creature
* Creature - a contract for my non-fungible creatures.
*/
contract Creature is ERC721Tradable {
address payable private _owner;
uint256 private _currentTokenId = 0;
uint256 private _basePrice = 0;
uint256 private constant _protectPrice = 300000000000000000;
uint256 private constant _imagePrice = 100000000000000000;
uint256 private constant _simpleTraitPrice = 14000000000000000;
uint256 private constant _advancedTraitPrice = 35000000000000000;
uint256 private constant _legendaryTraitPrice = 60000000000000000;
struct Rick {
uint256 skin;
uint256 hair;
uint256 shirt;
uint256 pants;
uint256 shoes;
uint256 item;
}
struct RickProtection {
uint256 id;
uint256 value;
}
bytes32 constant RICK_TYPEHASH = keccak256(
"Rick(uint skin, uint hair, uint shirt, uint pants, uint shoes, uint item)"
);
bytes32 constant RICKPROTECTION_TYPEHASH = keccak256(
"RickProtection(uint id, uint value)"
);
mapping (uint => Rick) private _ricks;
mapping (uint => string) private _image;
mapping (uint => string) private _name;
//hash => rickId
mapping (bytes32 => bool) private _rickHash;
mapping (bytes32 => bool) private _rickProtectionHash;
constructor(address _proxyRegistryAddress)
public
ERC721Tradable("CryptoRick", "RICKS", _proxyRegistryAddress)
{
}
function craftRick(Rick memory rick) public returns (uint){
}
function getImage(uint rickId) public view returns (string memory){
}
function totalSupply() public view returns (uint256) {
}
function hash(Rick memory _rick) internal pure returns (bytes32) {
}
function hashProtection(RickProtection memory _rickProt) internal pure returns (bytes32) {
}
function _getNextTokenId() private view returns (uint256) { }
function _incrementTokenId() private { }
function getCurrentTokenId() public view returns (uint256) { }
function getRick(uint rickId) public view returns (Rick memory) {
}
function getName(uint rickId) public view returns (string memory){
}
function setName(
uint rickId,
string memory name
) public payable {
}
function buyRick(
Rick memory _rick,
string memory image,
uint[] memory protectedTraitIds
) public payable {
/*
Validate the Input!
We throw our own RICK-XX error code to handle the frontend output.
*/
//check for remaining ricks
require(_currentTokenId < totalSupply(), "RICK-00");
//is the rick uniq ?
bytes32 rickHash = hash(_rick);
require(_rickHash[rickHash] == false, "RICK-01");
require(msg.value >= getPriceForRick(_rick, bytes(image).length > 0, protectedTraitIds.length), "RICK-02");
bytes32 hashHair = hashProtection(RickProtection(1, _rick.hair));
require(_rickProtectionHash[hashHair] == false, "RICK-03");
bytes32 hashShirt = hashProtection(RickProtection(2, _rick.shirt));
require(_rickProtectionHash[hashShirt] == false, "RICK-04");
bytes32 hashPants = hashProtection(RickProtection(3, _rick.pants));
require(_rickProtectionHash[hashPants] == false, "RICK-05");
bytes32 hashShoes = hashProtection(RickProtection(4, _rick.shoes));
require(<FILL_ME>)
bytes32 hashItem = hashProtection(RickProtection(5, _rick.item));
require(_rickProtectionHash[hashItem] == false, "RICK-07");
/*
Mint the new Token
*/
uint nextId = _getNextTokenId();
_safeMint(msg.sender, nextId);
_incrementTokenId();
/*
Save rick
*/
_image[nextId] = image;
_ricks[nextId] = _rick;
_rickHash[rickHash] = true;
/*
Protect the traits
*/
for (uint i = 0; i < protectedTraitIds.length; i++) {
uint val = protectedTraitIds[i];
if (val == 1) _rickProtectionHash[hashHair] = true;
if (val == 2) _rickProtectionHash[hashShirt] = true;
if (val == 3) _rickProtectionHash[hashPants] = true;
if (val == 4) _rickProtectionHash[hashShoes] = true;
if (val == 5) _rickProtectionHash[hashItem] = true;
}
//update basePrice
if (nextId == 50 ) _basePrice = 20000000000000000;
else if (nextId == 250 ) _basePrice = 50000000000000000;
else if (nextId == 500 ) _basePrice = 70000000000000000;
else if (nextId == 1000) _basePrice = 100000000000000000;
}
function getPriceForRick(Rick memory rick, bool withImage, uint protectedTraits) internal view returns(uint){
}
function withdraw(uint256 amount) public {
}
function baseTokenURI() public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
}
| _rickProtectionHash[hashShoes]==false,"RICK-06" | 299,758 | _rickProtectionHash[hashShoes]==false |
"RICK-07" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "./ERC721Tradable.sol";
import "./Strings.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
/**
* @title Creature
* Creature - a contract for my non-fungible creatures.
*/
contract Creature is ERC721Tradable {
address payable private _owner;
uint256 private _currentTokenId = 0;
uint256 private _basePrice = 0;
uint256 private constant _protectPrice = 300000000000000000;
uint256 private constant _imagePrice = 100000000000000000;
uint256 private constant _simpleTraitPrice = 14000000000000000;
uint256 private constant _advancedTraitPrice = 35000000000000000;
uint256 private constant _legendaryTraitPrice = 60000000000000000;
struct Rick {
uint256 skin;
uint256 hair;
uint256 shirt;
uint256 pants;
uint256 shoes;
uint256 item;
}
struct RickProtection {
uint256 id;
uint256 value;
}
bytes32 constant RICK_TYPEHASH = keccak256(
"Rick(uint skin, uint hair, uint shirt, uint pants, uint shoes, uint item)"
);
bytes32 constant RICKPROTECTION_TYPEHASH = keccak256(
"RickProtection(uint id, uint value)"
);
mapping (uint => Rick) private _ricks;
mapping (uint => string) private _image;
mapping (uint => string) private _name;
//hash => rickId
mapping (bytes32 => bool) private _rickHash;
mapping (bytes32 => bool) private _rickProtectionHash;
constructor(address _proxyRegistryAddress)
public
ERC721Tradable("CryptoRick", "RICKS", _proxyRegistryAddress)
{
}
function craftRick(Rick memory rick) public returns (uint){
}
function getImage(uint rickId) public view returns (string memory){
}
function totalSupply() public view returns (uint256) {
}
function hash(Rick memory _rick) internal pure returns (bytes32) {
}
function hashProtection(RickProtection memory _rickProt) internal pure returns (bytes32) {
}
function _getNextTokenId() private view returns (uint256) { }
function _incrementTokenId() private { }
function getCurrentTokenId() public view returns (uint256) { }
function getRick(uint rickId) public view returns (Rick memory) {
}
function getName(uint rickId) public view returns (string memory){
}
function setName(
uint rickId,
string memory name
) public payable {
}
function buyRick(
Rick memory _rick,
string memory image,
uint[] memory protectedTraitIds
) public payable {
/*
Validate the Input!
We throw our own RICK-XX error code to handle the frontend output.
*/
//check for remaining ricks
require(_currentTokenId < totalSupply(), "RICK-00");
//is the rick uniq ?
bytes32 rickHash = hash(_rick);
require(_rickHash[rickHash] == false, "RICK-01");
require(msg.value >= getPriceForRick(_rick, bytes(image).length > 0, protectedTraitIds.length), "RICK-02");
bytes32 hashHair = hashProtection(RickProtection(1, _rick.hair));
require(_rickProtectionHash[hashHair] == false, "RICK-03");
bytes32 hashShirt = hashProtection(RickProtection(2, _rick.shirt));
require(_rickProtectionHash[hashShirt] == false, "RICK-04");
bytes32 hashPants = hashProtection(RickProtection(3, _rick.pants));
require(_rickProtectionHash[hashPants] == false, "RICK-05");
bytes32 hashShoes = hashProtection(RickProtection(4, _rick.shoes));
require(_rickProtectionHash[hashShoes] == false, "RICK-06");
bytes32 hashItem = hashProtection(RickProtection(5, _rick.item));
require(<FILL_ME>)
/*
Mint the new Token
*/
uint nextId = _getNextTokenId();
_safeMint(msg.sender, nextId);
_incrementTokenId();
/*
Save rick
*/
_image[nextId] = image;
_ricks[nextId] = _rick;
_rickHash[rickHash] = true;
/*
Protect the traits
*/
for (uint i = 0; i < protectedTraitIds.length; i++) {
uint val = protectedTraitIds[i];
if (val == 1) _rickProtectionHash[hashHair] = true;
if (val == 2) _rickProtectionHash[hashShirt] = true;
if (val == 3) _rickProtectionHash[hashPants] = true;
if (val == 4) _rickProtectionHash[hashShoes] = true;
if (val == 5) _rickProtectionHash[hashItem] = true;
}
//update basePrice
if (nextId == 50 ) _basePrice = 20000000000000000;
else if (nextId == 250 ) _basePrice = 50000000000000000;
else if (nextId == 500 ) _basePrice = 70000000000000000;
else if (nextId == 1000) _basePrice = 100000000000000000;
}
function getPriceForRick(Rick memory rick, bool withImage, uint protectedTraits) internal view returns(uint){
}
function withdraw(uint256 amount) public {
}
function baseTokenURI() public pure returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
}
| _rickProtectionHash[hashItem]==false,"RICK-07" | 299,758 | _rickProtectionHash[hashItem]==false |
null | pragma solidity ^0.4.16;
/**
* New Art Coin
*
* Invest into your future luxurious lifestyle.
*
* This is a luxurious token with the following properties:
* - 300.000.000 coins max supply
* - 150.000.000 coins mined for the company wallet
* - Investors receive bonus coins from the company wallet during bonus phases
*
* Visit https://newartcoin.io for more information and tokenholder benefits.
*
* Copyright New Art Coin Co., Ltd. All rights reserved.
*/
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
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);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @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) {
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev 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) public view returns (uint256 balance) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @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) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @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)
* From MonolithDAO Token.sol
* @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) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
contract NARCoin is StandardToken, Ownable {
string public constant name = "New Art Coin";
string public constant symbol = "NAR";
uint256 public constant decimals = 18;
uint256 public constant UNIT = 10 ** decimals;
address public companyWallet;
address public backendWallet;
uint256 public maxSupply = 300000000 * UNIT;
/**
* 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 TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
modifier onlyBackend() {
}
function NARCoin(address _companyWallet, address _backendWallet) public {
}
/**
* Change the backendWallet that is allowed to issue new tokens (used by server side)
* Or completely disabled backend unrevokable for all eternity by setting it to 0x0
*/
function setBackendWallet(address _backendWallet) public onlyOwner {
}
function() public payable {
}
/***
* This function is used to transfer tokens that have been bought through other means (credit card, bitcoin, etc), and to burn tokens after the sale.
*/
function mint(address receiver, uint256 tokens) public onlyBackend {
require(<FILL_ME>)
balances[receiver] += tokens;
totalSupply_ += tokens;
Transfer(address(0x0), receiver, tokens);
}
function sendBonus(address receiver, uint256 bonus) public onlyBackend {
}
}
| totalSupply_+tokens<=maxSupply | 299,771 | totalSupply_+tokens<=maxSupply |
null | pragma solidity ^0.4.11;
contract Ownable {
address public owner;
function Ownable() public {
}
function transferOwnership(address newOwner) onlyOwner public {
}
modifier onlyOwner() {
}
}
contract DnaMixer {
function mixDna(uint256 dna1, uint256 dna2, uint256 seed) public pure returns (uint256);
}
contract CpData is Ownable {
struct Girl {
uint256 dna;
uint64 creationTime;
uint32 sourceGirl1;
uint32 sourceGirl2;
uint16 gen;
uint8 combinesLeft;
uint64 combineCooledDown;
}
struct Auction {
address seller;
uint128 startingPriceWei;
uint128 endingPriceWei;
uint64 duration;
uint64 creationTime;
bool isCombine;
}
event NewGirl(address owner, uint256 girlId, uint256 sourceGirl1, uint256 sourceGirl2, uint256 dna);
event Transfer(address from, address to, uint256 girlId);
event AuctionCreated(uint256 girlId, uint256 startingPriceWei, uint256 endingPriceWei, uint256 duration, bool isCombine);
event AuctionCompleted(uint256 girlId, uint256 priceWei, address winner);
event AuctionCancelled(uint256 girlId);
uint256 public constant OWNERS_AUCTION_CUT = 350;
uint256 public constant MAX_PROMO_GIRLS = 6000;
uint256 public promoCreatedCount;
uint256 public constant MAX_GEN0_GIRLS = 30000;
uint256 public gen0CreatedCount;
DnaMixer public dnaMixer;
Girl[] girls;
mapping (uint256 => address) public girlIdToOwner;
mapping (uint256 => Auction) public girlIdToAuction;
}
contract CpInternals is CpData {
function _transfer(address _from, address _to, uint256 _girlId) internal {
}
function _createGirl(uint256 _sourceGirlId1, uint256 _sourceGirlId2, uint256 _gen, uint256 _dna, address _owner) internal returns (uint) {
}
function _combineGirls(Girl storage _sourceGirl1, Girl storage _sourceGirl2, uint256 _girl1Id, uint256 _girl2Id, address _owner) internal returns(uint256) {
}
function _getAuctionPrice(Auction storage _auction) internal view returns (uint256) {
}
}
contract CpApis is CpInternals {
function getGirl(uint256 _id) external view returns (uint256 dna, uint256 sourceGirlId1, uint256 sourceGirlId2, uint256 gen, uint256 creationTime, uint8 combinesLeft, uint64 combineCooledDown) {
}
function createPromoGirl(uint256 _dna) external onlyOwner {
}
function createGen0(uint256 _dna) external onlyOwner {
}
function setDnaMixerAddress(address _address) external onlyOwner {
}
function transfer(address _to, uint256 _girlId) external {
require(_to != address(0));
require(_to != address(this));
require(<FILL_ME>)
Auction storage auction = girlIdToAuction[_girlId];
require(auction.creationTime == 0);
_transfer(msg.sender, _to, _girlId);
}
function ownerOf(uint256 _girlId) external view returns (address owner) {
}
function createAuction(uint256 _girlId, uint256 _startingPriceWei, uint256 _endingPriceWei, uint256 _duration, bool _isCombine) external {
}
function bid(uint256 _girlId, uint256 _myGirl) external payable {
}
function combineMyGirls(uint256 _girlId1, uint256 _girlId2) external payable {
}
function cancelAuction(uint256 _girlId) external {
}
function getAuction(uint256 _girlId) external view returns(address seller, uint256 startingPriceWei, uint256 endingPriceWei, uint256 duration, uint256 startedAt, bool isCombine) {
}
function getGirlsAuctionPrice(uint256 _girlId) external view returns (uint256) {
}
function withdrawBalance() external onlyOwner {
}
}
contract CryptoPussyMain is CpApis {
function CryptoPussyMain() public payable {
}
function() external payable {
}
}
| girlIdToOwner[_girlId]==msg.sender | 299,933 | girlIdToOwner[_girlId]==msg.sender |
null | pragma solidity ^0.4.11;
contract Ownable {
address public owner;
function Ownable() public {
}
function transferOwnership(address newOwner) onlyOwner public {
}
modifier onlyOwner() {
}
}
contract DnaMixer {
function mixDna(uint256 dna1, uint256 dna2, uint256 seed) public pure returns (uint256);
}
contract CpData is Ownable {
struct Girl {
uint256 dna;
uint64 creationTime;
uint32 sourceGirl1;
uint32 sourceGirl2;
uint16 gen;
uint8 combinesLeft;
uint64 combineCooledDown;
}
struct Auction {
address seller;
uint128 startingPriceWei;
uint128 endingPriceWei;
uint64 duration;
uint64 creationTime;
bool isCombine;
}
event NewGirl(address owner, uint256 girlId, uint256 sourceGirl1, uint256 sourceGirl2, uint256 dna);
event Transfer(address from, address to, uint256 girlId);
event AuctionCreated(uint256 girlId, uint256 startingPriceWei, uint256 endingPriceWei, uint256 duration, bool isCombine);
event AuctionCompleted(uint256 girlId, uint256 priceWei, address winner);
event AuctionCancelled(uint256 girlId);
uint256 public constant OWNERS_AUCTION_CUT = 350;
uint256 public constant MAX_PROMO_GIRLS = 6000;
uint256 public promoCreatedCount;
uint256 public constant MAX_GEN0_GIRLS = 30000;
uint256 public gen0CreatedCount;
DnaMixer public dnaMixer;
Girl[] girls;
mapping (uint256 => address) public girlIdToOwner;
mapping (uint256 => Auction) public girlIdToAuction;
}
contract CpInternals is CpData {
function _transfer(address _from, address _to, uint256 _girlId) internal {
}
function _createGirl(uint256 _sourceGirlId1, uint256 _sourceGirlId2, uint256 _gen, uint256 _dna, address _owner) internal returns (uint) {
}
function _combineGirls(Girl storage _sourceGirl1, Girl storage _sourceGirl2, uint256 _girl1Id, uint256 _girl2Id, address _owner) internal returns(uint256) {
}
function _getAuctionPrice(Auction storage _auction) internal view returns (uint256) {
}
}
contract CpApis is CpInternals {
function getGirl(uint256 _id) external view returns (uint256 dna, uint256 sourceGirlId1, uint256 sourceGirlId2, uint256 gen, uint256 creationTime, uint8 combinesLeft, uint64 combineCooledDown) {
}
function createPromoGirl(uint256 _dna) external onlyOwner {
}
function createGen0(uint256 _dna) external onlyOwner {
}
function setDnaMixerAddress(address _address) external onlyOwner {
}
function transfer(address _to, uint256 _girlId) external {
}
function ownerOf(uint256 _girlId) external view returns (address owner) {
}
function createAuction(uint256 _girlId, uint256 _startingPriceWei, uint256 _endingPriceWei, uint256 _duration, bool _isCombine) external {
}
function bid(uint256 _girlId, uint256 _myGirl) external payable {
Auction storage auction = girlIdToAuction[_girlId];
require(auction.startingPriceWei > 0);
require(<FILL_ME>)
uint256 price = _getAuctionPrice(auction);
require(msg.value >= price);
bool isCombine = auction.isCombine;
if (isCombine) {
Girl storage sourceGirl1 = girls[_girlId];
Girl storage sourceGirl2 = girls[_myGirl];
require(sourceGirl1.combinesLeft > 0);
require(sourceGirl2.combinesLeft > 0);
require(sourceGirl1.combineCooledDown < now);
require(sourceGirl2.combineCooledDown < now);
}
address seller = auction.seller;
delete girlIdToAuction[_girlId];
if (price > 0) {
uint256 cut = price * (OWNERS_AUCTION_CUT / 10000);
seller.transfer(price - cut);
}
msg.sender.transfer(msg.value - price);
if (isCombine) {
_combineGirls(sourceGirl1, sourceGirl2, _girlId, _myGirl, msg.sender);
} else {
_transfer(seller, msg.sender, _girlId);
}
AuctionCompleted(_girlId, price, msg.sender);
}
function combineMyGirls(uint256 _girlId1, uint256 _girlId2) external payable {
}
function cancelAuction(uint256 _girlId) external {
}
function getAuction(uint256 _girlId) external view returns(address seller, uint256 startingPriceWei, uint256 endingPriceWei, uint256 duration, uint256 startedAt, bool isCombine) {
}
function getGirlsAuctionPrice(uint256 _girlId) external view returns (uint256) {
}
function withdrawBalance() external onlyOwner {
}
}
contract CryptoPussyMain is CpApis {
function CryptoPussyMain() public payable {
}
function() external payable {
}
}
| !auction.isCombine||(auction.isCombine&&_girlId>0) | 299,933 | !auction.isCombine||(auction.isCombine&&_girlId>0) |
null | pragma solidity ^0.4.11;
contract Ownable {
address public owner;
function Ownable() public {
}
function transferOwnership(address newOwner) onlyOwner public {
}
modifier onlyOwner() {
}
}
contract DnaMixer {
function mixDna(uint256 dna1, uint256 dna2, uint256 seed) public pure returns (uint256);
}
contract CpData is Ownable {
struct Girl {
uint256 dna;
uint64 creationTime;
uint32 sourceGirl1;
uint32 sourceGirl2;
uint16 gen;
uint8 combinesLeft;
uint64 combineCooledDown;
}
struct Auction {
address seller;
uint128 startingPriceWei;
uint128 endingPriceWei;
uint64 duration;
uint64 creationTime;
bool isCombine;
}
event NewGirl(address owner, uint256 girlId, uint256 sourceGirl1, uint256 sourceGirl2, uint256 dna);
event Transfer(address from, address to, uint256 girlId);
event AuctionCreated(uint256 girlId, uint256 startingPriceWei, uint256 endingPriceWei, uint256 duration, bool isCombine);
event AuctionCompleted(uint256 girlId, uint256 priceWei, address winner);
event AuctionCancelled(uint256 girlId);
uint256 public constant OWNERS_AUCTION_CUT = 350;
uint256 public constant MAX_PROMO_GIRLS = 6000;
uint256 public promoCreatedCount;
uint256 public constant MAX_GEN0_GIRLS = 30000;
uint256 public gen0CreatedCount;
DnaMixer public dnaMixer;
Girl[] girls;
mapping (uint256 => address) public girlIdToOwner;
mapping (uint256 => Auction) public girlIdToAuction;
}
contract CpInternals is CpData {
function _transfer(address _from, address _to, uint256 _girlId) internal {
}
function _createGirl(uint256 _sourceGirlId1, uint256 _sourceGirlId2, uint256 _gen, uint256 _dna, address _owner) internal returns (uint) {
}
function _combineGirls(Girl storage _sourceGirl1, Girl storage _sourceGirl2, uint256 _girl1Id, uint256 _girl2Id, address _owner) internal returns(uint256) {
}
function _getAuctionPrice(Auction storage _auction) internal view returns (uint256) {
}
}
contract CpApis is CpInternals {
function getGirl(uint256 _id) external view returns (uint256 dna, uint256 sourceGirlId1, uint256 sourceGirlId2, uint256 gen, uint256 creationTime, uint8 combinesLeft, uint64 combineCooledDown) {
}
function createPromoGirl(uint256 _dna) external onlyOwner {
}
function createGen0(uint256 _dna) external onlyOwner {
}
function setDnaMixerAddress(address _address) external onlyOwner {
}
function transfer(address _to, uint256 _girlId) external {
}
function ownerOf(uint256 _girlId) external view returns (address owner) {
}
function createAuction(uint256 _girlId, uint256 _startingPriceWei, uint256 _endingPriceWei, uint256 _duration, bool _isCombine) external {
}
function bid(uint256 _girlId, uint256 _myGirl) external payable {
}
function combineMyGirls(uint256 _girlId1, uint256 _girlId2) external payable {
require(_girlId1 != _girlId2);
require(<FILL_ME>)
require(girlIdToOwner[_girlId2] == msg.sender);
Girl storage sourceGirl1 = girls[_girlId1];
Girl storage sourceGirl2 = girls[_girlId2];
require(sourceGirl1.combinesLeft > 0);
require(sourceGirl2.combinesLeft > 0);
require(sourceGirl1.combineCooledDown < now);
require(sourceGirl2.combineCooledDown < now);
_combineGirls(sourceGirl1, sourceGirl2, _girlId1, _girlId2, msg.sender);
}
function cancelAuction(uint256 _girlId) external {
}
function getAuction(uint256 _girlId) external view returns(address seller, uint256 startingPriceWei, uint256 endingPriceWei, uint256 duration, uint256 startedAt, bool isCombine) {
}
function getGirlsAuctionPrice(uint256 _girlId) external view returns (uint256) {
}
function withdrawBalance() external onlyOwner {
}
}
contract CryptoPussyMain is CpApis {
function CryptoPussyMain() public payable {
}
function() external payable {
}
}
| girlIdToOwner[_girlId1]==msg.sender | 299,933 | girlIdToOwner[_girlId1]==msg.sender |
null | pragma solidity ^0.4.11;
contract Ownable {
address public owner;
function Ownable() public {
}
function transferOwnership(address newOwner) onlyOwner public {
}
modifier onlyOwner() {
}
}
contract DnaMixer {
function mixDna(uint256 dna1, uint256 dna2, uint256 seed) public pure returns (uint256);
}
contract CpData is Ownable {
struct Girl {
uint256 dna;
uint64 creationTime;
uint32 sourceGirl1;
uint32 sourceGirl2;
uint16 gen;
uint8 combinesLeft;
uint64 combineCooledDown;
}
struct Auction {
address seller;
uint128 startingPriceWei;
uint128 endingPriceWei;
uint64 duration;
uint64 creationTime;
bool isCombine;
}
event NewGirl(address owner, uint256 girlId, uint256 sourceGirl1, uint256 sourceGirl2, uint256 dna);
event Transfer(address from, address to, uint256 girlId);
event AuctionCreated(uint256 girlId, uint256 startingPriceWei, uint256 endingPriceWei, uint256 duration, bool isCombine);
event AuctionCompleted(uint256 girlId, uint256 priceWei, address winner);
event AuctionCancelled(uint256 girlId);
uint256 public constant OWNERS_AUCTION_CUT = 350;
uint256 public constant MAX_PROMO_GIRLS = 6000;
uint256 public promoCreatedCount;
uint256 public constant MAX_GEN0_GIRLS = 30000;
uint256 public gen0CreatedCount;
DnaMixer public dnaMixer;
Girl[] girls;
mapping (uint256 => address) public girlIdToOwner;
mapping (uint256 => Auction) public girlIdToAuction;
}
contract CpInternals is CpData {
function _transfer(address _from, address _to, uint256 _girlId) internal {
}
function _createGirl(uint256 _sourceGirlId1, uint256 _sourceGirlId2, uint256 _gen, uint256 _dna, address _owner) internal returns (uint) {
}
function _combineGirls(Girl storage _sourceGirl1, Girl storage _sourceGirl2, uint256 _girl1Id, uint256 _girl2Id, address _owner) internal returns(uint256) {
}
function _getAuctionPrice(Auction storage _auction) internal view returns (uint256) {
}
}
contract CpApis is CpInternals {
function getGirl(uint256 _id) external view returns (uint256 dna, uint256 sourceGirlId1, uint256 sourceGirlId2, uint256 gen, uint256 creationTime, uint8 combinesLeft, uint64 combineCooledDown) {
}
function createPromoGirl(uint256 _dna) external onlyOwner {
}
function createGen0(uint256 _dna) external onlyOwner {
}
function setDnaMixerAddress(address _address) external onlyOwner {
}
function transfer(address _to, uint256 _girlId) external {
}
function ownerOf(uint256 _girlId) external view returns (address owner) {
}
function createAuction(uint256 _girlId, uint256 _startingPriceWei, uint256 _endingPriceWei, uint256 _duration, bool _isCombine) external {
}
function bid(uint256 _girlId, uint256 _myGirl) external payable {
}
function combineMyGirls(uint256 _girlId1, uint256 _girlId2) external payable {
require(_girlId1 != _girlId2);
require(girlIdToOwner[_girlId1] == msg.sender);
require(<FILL_ME>)
Girl storage sourceGirl1 = girls[_girlId1];
Girl storage sourceGirl2 = girls[_girlId2];
require(sourceGirl1.combinesLeft > 0);
require(sourceGirl2.combinesLeft > 0);
require(sourceGirl1.combineCooledDown < now);
require(sourceGirl2.combineCooledDown < now);
_combineGirls(sourceGirl1, sourceGirl2, _girlId1, _girlId2, msg.sender);
}
function cancelAuction(uint256 _girlId) external {
}
function getAuction(uint256 _girlId) external view returns(address seller, uint256 startingPriceWei, uint256 endingPriceWei, uint256 duration, uint256 startedAt, bool isCombine) {
}
function getGirlsAuctionPrice(uint256 _girlId) external view returns (uint256) {
}
function withdrawBalance() external onlyOwner {
}
}
contract CryptoPussyMain is CpApis {
function CryptoPussyMain() public payable {
}
function() external payable {
}
}
| girlIdToOwner[_girlId2]==msg.sender | 299,933 | girlIdToOwner[_girlId2]==msg.sender |
"Mint quantity exceeds allowance for this address" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract CryptoParadoxClub is ERC721, ERC721Enumerable, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
// config
string constant notRevealedURI = "ipfs://QmWj2RcjV9Ve7UVmQb7wGu4tJvxjZVqLuKPo5zGVYX7xjZ/";
uint256 constant maxSupply = 7777;
uint256 constant nftPerAddress = 10;
uint256 public price = 0.05 ether;
Counters.Counter private _tokenIDCounter;
string public baseURI;
string public baseExtension = ".json";
bool public collectionRevealed = false;
mapping(address => uint256) public addressMintedBal;
constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public methods
/**
* Required `proof` a valid merkle proof that msg.sender is whitelisted
* Provide an empty proof for the public sale
*
* Emits a {Transfer} event.
*/
function buy(address _to, uint256 _quantity) public payable {
uint256 userMintLimit = nftPerAddress;
require(_quantity > 0, "Need to mint at least 1 NFT");
require(<FILL_ME>)
require(_tokenIDCounter.current() <= maxSupply, "Sold out");
require(_tokenIDCounter.current() + _quantity <= maxSupply, "Mint quantity exceeds max supply");
require(msg.value >= price * _quantity, "Insufficient funds");
for (uint i = 0; i < _quantity; i++){
_tokenIDCounter.increment();
addressMintedBal[_to]++;
_mint(_to, _tokenIDCounter.current());
}
}
function tokenURI(uint256 _tokenID) public view virtual override returns (string memory) {
}
// Owner methods
function reveal(string memory _newBaseURI) public onlyOwner {
}
function AirDrop(address[] calldata _inf) public onlyOwner{
}
function setPrice(uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
/**
* @inheritdoc ERC721
*/
function supportsInterface(bytes4 interfaceID)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
function _beforeTokenTransfer(address from, address to, uint256 _tokenID)
internal
override(ERC721, ERC721Enumerable)
{
}
}
| addressMintedBal[msg.sender]+_quantity<=userMintLimit,"Mint quantity exceeds allowance for this address" | 299,985 | addressMintedBal[msg.sender]+_quantity<=userMintLimit |
"Sold out" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract CryptoParadoxClub is ERC721, ERC721Enumerable, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
// config
string constant notRevealedURI = "ipfs://QmWj2RcjV9Ve7UVmQb7wGu4tJvxjZVqLuKPo5zGVYX7xjZ/";
uint256 constant maxSupply = 7777;
uint256 constant nftPerAddress = 10;
uint256 public price = 0.05 ether;
Counters.Counter private _tokenIDCounter;
string public baseURI;
string public baseExtension = ".json";
bool public collectionRevealed = false;
mapping(address => uint256) public addressMintedBal;
constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public methods
/**
* Required `proof` a valid merkle proof that msg.sender is whitelisted
* Provide an empty proof for the public sale
*
* Emits a {Transfer} event.
*/
function buy(address _to, uint256 _quantity) public payable {
uint256 userMintLimit = nftPerAddress;
require(_quantity > 0, "Need to mint at least 1 NFT");
require(addressMintedBal[msg.sender] + _quantity <= userMintLimit, "Mint quantity exceeds allowance for this address");
require(<FILL_ME>)
require(_tokenIDCounter.current() + _quantity <= maxSupply, "Mint quantity exceeds max supply");
require(msg.value >= price * _quantity, "Insufficient funds");
for (uint i = 0; i < _quantity; i++){
_tokenIDCounter.increment();
addressMintedBal[_to]++;
_mint(_to, _tokenIDCounter.current());
}
}
function tokenURI(uint256 _tokenID) public view virtual override returns (string memory) {
}
// Owner methods
function reveal(string memory _newBaseURI) public onlyOwner {
}
function AirDrop(address[] calldata _inf) public onlyOwner{
}
function setPrice(uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
/**
* @inheritdoc ERC721
*/
function supportsInterface(bytes4 interfaceID)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
function _beforeTokenTransfer(address from, address to, uint256 _tokenID)
internal
override(ERC721, ERC721Enumerable)
{
}
}
| _tokenIDCounter.current()<=maxSupply,"Sold out" | 299,985 | _tokenIDCounter.current()<=maxSupply |
"Mint quantity exceeds max supply" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract CryptoParadoxClub is ERC721, ERC721Enumerable, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
// config
string constant notRevealedURI = "ipfs://QmWj2RcjV9Ve7UVmQb7wGu4tJvxjZVqLuKPo5zGVYX7xjZ/";
uint256 constant maxSupply = 7777;
uint256 constant nftPerAddress = 10;
uint256 public price = 0.05 ether;
Counters.Counter private _tokenIDCounter;
string public baseURI;
string public baseExtension = ".json";
bool public collectionRevealed = false;
mapping(address => uint256) public addressMintedBal;
constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public methods
/**
* Required `proof` a valid merkle proof that msg.sender is whitelisted
* Provide an empty proof for the public sale
*
* Emits a {Transfer} event.
*/
function buy(address _to, uint256 _quantity) public payable {
uint256 userMintLimit = nftPerAddress;
require(_quantity > 0, "Need to mint at least 1 NFT");
require(addressMintedBal[msg.sender] + _quantity <= userMintLimit, "Mint quantity exceeds allowance for this address");
require(_tokenIDCounter.current() <= maxSupply, "Sold out");
require(<FILL_ME>)
require(msg.value >= price * _quantity, "Insufficient funds");
for (uint i = 0; i < _quantity; i++){
_tokenIDCounter.increment();
addressMintedBal[_to]++;
_mint(_to, _tokenIDCounter.current());
}
}
function tokenURI(uint256 _tokenID) public view virtual override returns (string memory) {
}
// Owner methods
function reveal(string memory _newBaseURI) public onlyOwner {
}
function AirDrop(address[] calldata _inf) public onlyOwner{
}
function setPrice(uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
/**
* @inheritdoc ERC721
*/
function supportsInterface(bytes4 interfaceID)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
function _beforeTokenTransfer(address from, address to, uint256 _tokenID)
internal
override(ERC721, ERC721Enumerable)
{
}
}
| _tokenIDCounter.current()+_quantity<=maxSupply,"Mint quantity exceeds max supply" | 299,985 | _tokenIDCounter.current()+_quantity<=maxSupply |
"Collection was already revealed!" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract CryptoParadoxClub is ERC721, ERC721Enumerable, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
// config
string constant notRevealedURI = "ipfs://QmWj2RcjV9Ve7UVmQb7wGu4tJvxjZVqLuKPo5zGVYX7xjZ/";
uint256 constant maxSupply = 7777;
uint256 constant nftPerAddress = 10;
uint256 public price = 0.05 ether;
Counters.Counter private _tokenIDCounter;
string public baseURI;
string public baseExtension = ".json";
bool public collectionRevealed = false;
mapping(address => uint256) public addressMintedBal;
constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public methods
/**
* Required `proof` a valid merkle proof that msg.sender is whitelisted
* Provide an empty proof for the public sale
*
* Emits a {Transfer} event.
*/
function buy(address _to, uint256 _quantity) public payable {
}
function tokenURI(uint256 _tokenID) public view virtual override returns (string memory) {
}
// Owner methods
function reveal(string memory _newBaseURI) public onlyOwner {
// One way function.
require(<FILL_ME>)
collectionRevealed = true;
baseURI = _newBaseURI;
}
function AirDrop(address[] calldata _inf) public onlyOwner{
}
function setPrice(uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
/**
* @inheritdoc ERC721
*/
function supportsInterface(bytes4 interfaceID)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
function _beforeTokenTransfer(address from, address to, uint256 _tokenID)
internal
override(ERC721, ERC721Enumerable)
{
}
}
| !collectionRevealed,"Collection was already revealed!" | 299,985 | !collectionRevealed |
"Mint quantity exceeds max supply" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract CryptoParadoxClub is ERC721, ERC721Enumerable, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
// config
string constant notRevealedURI = "ipfs://QmWj2RcjV9Ve7UVmQb7wGu4tJvxjZVqLuKPo5zGVYX7xjZ/";
uint256 constant maxSupply = 7777;
uint256 constant nftPerAddress = 10;
uint256 public price = 0.05 ether;
Counters.Counter private _tokenIDCounter;
string public baseURI;
string public baseExtension = ".json";
bool public collectionRevealed = false;
mapping(address => uint256) public addressMintedBal;
constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public methods
/**
* Required `proof` a valid merkle proof that msg.sender is whitelisted
* Provide an empty proof for the public sale
*
* Emits a {Transfer} event.
*/
function buy(address _to, uint256 _quantity) public payable {
}
function tokenURI(uint256 _tokenID) public view virtual override returns (string memory) {
}
// Owner methods
function reveal(string memory _newBaseURI) public onlyOwner {
}
function AirDrop(address[] calldata _inf) public onlyOwner{
require(_inf.length > 0, "Need to mint at least 1 NFT");
require(_tokenIDCounter.current() <= maxSupply, "Sold out");
require(<FILL_ME>)
for (uint i = 0; i < _inf.length; i++){
_tokenIDCounter.increment();
addressMintedBal[_inf[i]]++;
_mint(_inf[i], _tokenIDCounter.current());
}
}
function setPrice(uint256 _newPrice) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
/**
* @inheritdoc ERC721
*/
function supportsInterface(bytes4 interfaceID)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
function _beforeTokenTransfer(address from, address to, uint256 _tokenID)
internal
override(ERC721, ERC721Enumerable)
{
}
}
| _tokenIDCounter.current()+_inf.length<=maxSupply,"Mint quantity exceeds max supply" | 299,985 | _tokenIDCounter.current()+_inf.length<=maxSupply |
"Already staking" | //
// _ _ _ ___ ___
// | | | | | | |__ \ / _ \
// | | ___ | |_| |_ ___ _ __ _ _ ) || | | |
// | | / _ \| __| __/ _ \ '__| | | | / / | | | |
// | |___| (_) | |_| || __/ | | |_| | / /_ | |_| |
// |______\___/ \__|\__\___|_| \__, | |____(_)___/
// __/ |
// |___/
//
pragma solidity ^0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
//Keeps track of 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 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 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 {
}
}
//Interface for ERC20 tokens
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
//Interface for Uni V2 tokens
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
//Interface for the Pepemon factory
//Contains only the mint method
interface IPepemonFactory{
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes memory _data
) external;
}
pragma solidity >=0.6.0 <0.8.0;
/**
* @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) {
}
}
contract LotteryTwo is Ownable{
//Uni V2 Address for ppdex
address public UniV2Address;
//PPDEX address
address public PPDEX;
//pepemonFactory address
address public pepemonFactory;
//how long users have to wait before they can withdraw LP
//5760 blocks = 1 day
//40320 blocks = 1 week
//184320 block = 32 days
uint public blockTime;
//Block when users will be allowed to mint NFTs if they provided liq before this block
uint public stakingDeadline;
//how many PPDEX needed to stake for a normal NFT
uint public minPPDEX = 1000*10**17;
//how many PPDEX needed to stake for a golden NFT
uint public minPPDEXGolden = 1000*10**17;
//nft ids for minting
uint public normalID;
uint public goldenID;
using SafeMath for uint;
//events
event Redeemed(address indexed user, uint id);
event Staked(address indexed user, uint amount);
event Unstaked(address indexed user, uint amount);
/**
* _UniV2Address => Uni V2 token address (should be 0x6B1455E27902CA89eE3ABB0673A8Aa9Ce1609952)
* _PPDEX => PPDEX token address (should be 0xf1f508c7c9f0d1b15a76fba564eef2d956220cf7)
* _pepemonFactory => pepemonFactory address (should be 0xcb6768a968440187157cfe13b67cac82ef6cc5a4)
* _blockTime => Time a user must wait to mint a NFT (should be 208000 for 32 days)
*/
constructor(address _UniV2Address, address _PPDEX, address _pepemonFactory, uint _blockTime) {
}
//mapping that keeps track of last nft claim
mapping (address => uint) depositBlock;
//mapping that keeps track of how many LP tokens user deposited
mapping (address => uint ) LPBalance;
//mapping that keeps track of if a user is staking
mapping (address => bool) isStaking;
//mapping that keeps track of if a user is staking normal nft
mapping (address => bool) isStakingNormalNFT;
//Keeps track of if a user has minted a NFT;
mapping(address => mapping(uint => bool)) hasMinted;
//setter functions
//Sets Uni V2 Pair address
function setUniV2Address (address addr) public onlyOwner{
}
//Sets PPDEX token address
function setPPDEX (address _PPDEX) public onlyOwner{
}
//Sets Pepemon Factory address
function setPepemonFactory (address _pepemonFactory) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint golden nfts
function setminPPDEXGolden (uint _minPPDEXGolden) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint normal nfts
function setminPPDEX (uint _minPPDEX) public onlyOwner{
}
//Updates NFT info - IDs + block
function updateNFT (uint _normalID, uint _goldenID) public onlyOwner{
}
//Sets
//view LP functions
//Returns mininum amount of LP tokens needed to qualify for minting a normal NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokens() public view returns (uint){
}
//Returns min amount of LP tokens needed to qualify for golden NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokensGolden() public view returns (uint){
}
//Converts LP token balances to PPDEX
function LPToPPDEX(uint lp) public view returns (uint){
}
//mapping functions
//Get the block num of the time the user staked
function getStakingStart(address addr) public view returns(uint){
}
//Get the amount of LP tokens the address deposited
function getLPBalance(address addr) public view returns(uint){
}
//Check if an address is staking.
function isUserStaking(address addr) public view returns (bool){
}
//Check if user has minted a NFT
function hasUserMinted(address addr, uint id) public view returns(bool){
}
//Check if an address is staking for a normal or golden NFT
//True = user is staking for a normal NFT
//False = user is staking for a golden NFT (or the user is not staking at all)
function isUserStakingNormalNFT(address addr) public view returns (bool){
}
//staking functions
//Transfers liqudity worth 46.6 PPDEX from the user to stake
function stakeForNormalNFT() public {
//Make sure user is not already staking
require(<FILL_ME>)
//Transfer liquidity worth 46.6 PPDEX to contract
IUniswapV2ERC20 lpToken = IUniswapV2ERC20(UniV2Address);
uint lpAmount = MinLPTokens();
require (lpToken.transferFrom(msg.sender, address(this), lpAmount), "Token Transfer failed");
//Update mappings
LPBalance[msg.sender] = lpAmount;
depositBlock[msg.sender] = block.number;
isStaking[msg.sender] = true;
isStakingNormalNFT[msg.sender]= true;
emit Staked(msg.sender, lpAmount);
}
//Transfers liquidity worth 150 PPDEX for user to get golden NFT
function stakeForGoldenNFT() public {
}
//Allow the user to withdraw
function withdrawLP() public{
}
//Allow the user to mint a NFT
function mintNFT() public {
}
}
| !isStaking[msg.sender],"Already staking" | 300,033 | !isStaking[msg.sender] |
"Token Transfer failed" | //
// _ _ _ ___ ___
// | | | | | | |__ \ / _ \
// | | ___ | |_| |_ ___ _ __ _ _ ) || | | |
// | | / _ \| __| __/ _ \ '__| | | | / / | | | |
// | |___| (_) | |_| || __/ | | |_| | / /_ | |_| |
// |______\___/ \__|\__\___|_| \__, | |____(_)___/
// __/ |
// |___/
//
pragma solidity ^0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
//Keeps track of 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 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 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 {
}
}
//Interface for ERC20 tokens
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
//Interface for Uni V2 tokens
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
//Interface for the Pepemon factory
//Contains only the mint method
interface IPepemonFactory{
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes memory _data
) external;
}
pragma solidity >=0.6.0 <0.8.0;
/**
* @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) {
}
}
contract LotteryTwo is Ownable{
//Uni V2 Address for ppdex
address public UniV2Address;
//PPDEX address
address public PPDEX;
//pepemonFactory address
address public pepemonFactory;
//how long users have to wait before they can withdraw LP
//5760 blocks = 1 day
//40320 blocks = 1 week
//184320 block = 32 days
uint public blockTime;
//Block when users will be allowed to mint NFTs if they provided liq before this block
uint public stakingDeadline;
//how many PPDEX needed to stake for a normal NFT
uint public minPPDEX = 1000*10**17;
//how many PPDEX needed to stake for a golden NFT
uint public minPPDEXGolden = 1000*10**17;
//nft ids for minting
uint public normalID;
uint public goldenID;
using SafeMath for uint;
//events
event Redeemed(address indexed user, uint id);
event Staked(address indexed user, uint amount);
event Unstaked(address indexed user, uint amount);
/**
* _UniV2Address => Uni V2 token address (should be 0x6B1455E27902CA89eE3ABB0673A8Aa9Ce1609952)
* _PPDEX => PPDEX token address (should be 0xf1f508c7c9f0d1b15a76fba564eef2d956220cf7)
* _pepemonFactory => pepemonFactory address (should be 0xcb6768a968440187157cfe13b67cac82ef6cc5a4)
* _blockTime => Time a user must wait to mint a NFT (should be 208000 for 32 days)
*/
constructor(address _UniV2Address, address _PPDEX, address _pepemonFactory, uint _blockTime) {
}
//mapping that keeps track of last nft claim
mapping (address => uint) depositBlock;
//mapping that keeps track of how many LP tokens user deposited
mapping (address => uint ) LPBalance;
//mapping that keeps track of if a user is staking
mapping (address => bool) isStaking;
//mapping that keeps track of if a user is staking normal nft
mapping (address => bool) isStakingNormalNFT;
//Keeps track of if a user has minted a NFT;
mapping(address => mapping(uint => bool)) hasMinted;
//setter functions
//Sets Uni V2 Pair address
function setUniV2Address (address addr) public onlyOwner{
}
//Sets PPDEX token address
function setPPDEX (address _PPDEX) public onlyOwner{
}
//Sets Pepemon Factory address
function setPepemonFactory (address _pepemonFactory) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint golden nfts
function setminPPDEXGolden (uint _minPPDEXGolden) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint normal nfts
function setminPPDEX (uint _minPPDEX) public onlyOwner{
}
//Updates NFT info - IDs + block
function updateNFT (uint _normalID, uint _goldenID) public onlyOwner{
}
//Sets
//view LP functions
//Returns mininum amount of LP tokens needed to qualify for minting a normal NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokens() public view returns (uint){
}
//Returns min amount of LP tokens needed to qualify for golden NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokensGolden() public view returns (uint){
}
//Converts LP token balances to PPDEX
function LPToPPDEX(uint lp) public view returns (uint){
}
//mapping functions
//Get the block num of the time the user staked
function getStakingStart(address addr) public view returns(uint){
}
//Get the amount of LP tokens the address deposited
function getLPBalance(address addr) public view returns(uint){
}
//Check if an address is staking.
function isUserStaking(address addr) public view returns (bool){
}
//Check if user has minted a NFT
function hasUserMinted(address addr, uint id) public view returns(bool){
}
//Check if an address is staking for a normal or golden NFT
//True = user is staking for a normal NFT
//False = user is staking for a golden NFT (or the user is not staking at all)
function isUserStakingNormalNFT(address addr) public view returns (bool){
}
//staking functions
//Transfers liqudity worth 46.6 PPDEX from the user to stake
function stakeForNormalNFT() public {
//Make sure user is not already staking
require (!isStaking[msg.sender], "Already staking");
//Transfer liquidity worth 46.6 PPDEX to contract
IUniswapV2ERC20 lpToken = IUniswapV2ERC20(UniV2Address);
uint lpAmount = MinLPTokens();
require(<FILL_ME>)
//Update mappings
LPBalance[msg.sender] = lpAmount;
depositBlock[msg.sender] = block.number;
isStaking[msg.sender] = true;
isStakingNormalNFT[msg.sender]= true;
emit Staked(msg.sender, lpAmount);
}
//Transfers liquidity worth 150 PPDEX for user to get golden NFT
function stakeForGoldenNFT() public {
}
//Allow the user to withdraw
function withdrawLP() public{
}
//Allow the user to mint a NFT
function mintNFT() public {
}
}
| lpToken.transferFrom(msg.sender,address(this),lpAmount),"Token Transfer failed" | 300,033 | lpToken.transferFrom(msg.sender,address(this),lpAmount) |
"Must wait 32 days to withdraw" | //
// _ _ _ ___ ___
// | | | | | | |__ \ / _ \
// | | ___ | |_| |_ ___ _ __ _ _ ) || | | |
// | | / _ \| __| __/ _ \ '__| | | | / / | | | |
// | |___| (_) | |_| || __/ | | |_| | / /_ | |_| |
// |______\___/ \__|\__\___|_| \__, | |____(_)___/
// __/ |
// |___/
//
pragma solidity ^0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
//Keeps track of 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 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 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 {
}
}
//Interface for ERC20 tokens
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
//Interface for Uni V2 tokens
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
//Interface for the Pepemon factory
//Contains only the mint method
interface IPepemonFactory{
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes memory _data
) external;
}
pragma solidity >=0.6.0 <0.8.0;
/**
* @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) {
}
}
contract LotteryTwo is Ownable{
//Uni V2 Address for ppdex
address public UniV2Address;
//PPDEX address
address public PPDEX;
//pepemonFactory address
address public pepemonFactory;
//how long users have to wait before they can withdraw LP
//5760 blocks = 1 day
//40320 blocks = 1 week
//184320 block = 32 days
uint public blockTime;
//Block when users will be allowed to mint NFTs if they provided liq before this block
uint public stakingDeadline;
//how many PPDEX needed to stake for a normal NFT
uint public minPPDEX = 1000*10**17;
//how many PPDEX needed to stake for a golden NFT
uint public minPPDEXGolden = 1000*10**17;
//nft ids for minting
uint public normalID;
uint public goldenID;
using SafeMath for uint;
//events
event Redeemed(address indexed user, uint id);
event Staked(address indexed user, uint amount);
event Unstaked(address indexed user, uint amount);
/**
* _UniV2Address => Uni V2 token address (should be 0x6B1455E27902CA89eE3ABB0673A8Aa9Ce1609952)
* _PPDEX => PPDEX token address (should be 0xf1f508c7c9f0d1b15a76fba564eef2d956220cf7)
* _pepemonFactory => pepemonFactory address (should be 0xcb6768a968440187157cfe13b67cac82ef6cc5a4)
* _blockTime => Time a user must wait to mint a NFT (should be 208000 for 32 days)
*/
constructor(address _UniV2Address, address _PPDEX, address _pepemonFactory, uint _blockTime) {
}
//mapping that keeps track of last nft claim
mapping (address => uint) depositBlock;
//mapping that keeps track of how many LP tokens user deposited
mapping (address => uint ) LPBalance;
//mapping that keeps track of if a user is staking
mapping (address => bool) isStaking;
//mapping that keeps track of if a user is staking normal nft
mapping (address => bool) isStakingNormalNFT;
//Keeps track of if a user has minted a NFT;
mapping(address => mapping(uint => bool)) hasMinted;
//setter functions
//Sets Uni V2 Pair address
function setUniV2Address (address addr) public onlyOwner{
}
//Sets PPDEX token address
function setPPDEX (address _PPDEX) public onlyOwner{
}
//Sets Pepemon Factory address
function setPepemonFactory (address _pepemonFactory) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint golden nfts
function setminPPDEXGolden (uint _minPPDEXGolden) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint normal nfts
function setminPPDEX (uint _minPPDEX) public onlyOwner{
}
//Updates NFT info - IDs + block
function updateNFT (uint _normalID, uint _goldenID) public onlyOwner{
}
//Sets
//view LP functions
//Returns mininum amount of LP tokens needed to qualify for minting a normal NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokens() public view returns (uint){
}
//Returns min amount of LP tokens needed to qualify for golden NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokensGolden() public view returns (uint){
}
//Converts LP token balances to PPDEX
function LPToPPDEX(uint lp) public view returns (uint){
}
//mapping functions
//Get the block num of the time the user staked
function getStakingStart(address addr) public view returns(uint){
}
//Get the amount of LP tokens the address deposited
function getLPBalance(address addr) public view returns(uint){
}
//Check if an address is staking.
function isUserStaking(address addr) public view returns (bool){
}
//Check if user has minted a NFT
function hasUserMinted(address addr, uint id) public view returns(bool){
}
//Check if an address is staking for a normal or golden NFT
//True = user is staking for a normal NFT
//False = user is staking for a golden NFT (or the user is not staking at all)
function isUserStakingNormalNFT(address addr) public view returns (bool){
}
//staking functions
//Transfers liqudity worth 46.6 PPDEX from the user to stake
function stakeForNormalNFT() public {
}
//Transfers liquidity worth 150 PPDEX for user to get golden NFT
function stakeForGoldenNFT() public {
}
//Allow the user to withdraw
function withdrawLP() public{
IUniswapV2ERC20 lpToken = IUniswapV2ERC20(UniV2Address);
//LP tokens are locked for 32 days
require(<FILL_ME>)
//Update mappings
uint lpAmount = LPBalance[msg.sender];
LPBalance[msg.sender] = 0;
depositBlock[msg.sender] = 0;
isStaking[msg.sender] = false;
isStakingNormalNFT[msg.sender]= false;
//Send user his LP token balance
require (lpToken.transfer(msg.sender, lpAmount));
emit Unstaked(msg.sender, lpAmount);
}
//Allow the user to mint a NFT
function mintNFT() public {
}
}
| depositBlock[msg.sender]+blockTime<block.number,"Must wait 32 days to withdraw" | 300,033 | depositBlock[msg.sender]+blockTime<block.number |
null | //
// _ _ _ ___ ___
// | | | | | | |__ \ / _ \
// | | ___ | |_| |_ ___ _ __ _ _ ) || | | |
// | | / _ \| __| __/ _ \ '__| | | | / / | | | |
// | |___| (_) | |_| || __/ | | |_| | / /_ | |_| |
// |______\___/ \__|\__\___|_| \__, | |____(_)___/
// __/ |
// |___/
//
pragma solidity ^0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
//Keeps track of 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 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 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 {
}
}
//Interface for ERC20 tokens
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
//Interface for Uni V2 tokens
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
//Interface for the Pepemon factory
//Contains only the mint method
interface IPepemonFactory{
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes memory _data
) external;
}
pragma solidity >=0.6.0 <0.8.0;
/**
* @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) {
}
}
contract LotteryTwo is Ownable{
//Uni V2 Address for ppdex
address public UniV2Address;
//PPDEX address
address public PPDEX;
//pepemonFactory address
address public pepemonFactory;
//how long users have to wait before they can withdraw LP
//5760 blocks = 1 day
//40320 blocks = 1 week
//184320 block = 32 days
uint public blockTime;
//Block when users will be allowed to mint NFTs if they provided liq before this block
uint public stakingDeadline;
//how many PPDEX needed to stake for a normal NFT
uint public minPPDEX = 1000*10**17;
//how many PPDEX needed to stake for a golden NFT
uint public minPPDEXGolden = 1000*10**17;
//nft ids for minting
uint public normalID;
uint public goldenID;
using SafeMath for uint;
//events
event Redeemed(address indexed user, uint id);
event Staked(address indexed user, uint amount);
event Unstaked(address indexed user, uint amount);
/**
* _UniV2Address => Uni V2 token address (should be 0x6B1455E27902CA89eE3ABB0673A8Aa9Ce1609952)
* _PPDEX => PPDEX token address (should be 0xf1f508c7c9f0d1b15a76fba564eef2d956220cf7)
* _pepemonFactory => pepemonFactory address (should be 0xcb6768a968440187157cfe13b67cac82ef6cc5a4)
* _blockTime => Time a user must wait to mint a NFT (should be 208000 for 32 days)
*/
constructor(address _UniV2Address, address _PPDEX, address _pepemonFactory, uint _blockTime) {
}
//mapping that keeps track of last nft claim
mapping (address => uint) depositBlock;
//mapping that keeps track of how many LP tokens user deposited
mapping (address => uint ) LPBalance;
//mapping that keeps track of if a user is staking
mapping (address => bool) isStaking;
//mapping that keeps track of if a user is staking normal nft
mapping (address => bool) isStakingNormalNFT;
//Keeps track of if a user has minted a NFT;
mapping(address => mapping(uint => bool)) hasMinted;
//setter functions
//Sets Uni V2 Pair address
function setUniV2Address (address addr) public onlyOwner{
}
//Sets PPDEX token address
function setPPDEX (address _PPDEX) public onlyOwner{
}
//Sets Pepemon Factory address
function setPepemonFactory (address _pepemonFactory) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint golden nfts
function setminPPDEXGolden (uint _minPPDEXGolden) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint normal nfts
function setminPPDEX (uint _minPPDEX) public onlyOwner{
}
//Updates NFT info - IDs + block
function updateNFT (uint _normalID, uint _goldenID) public onlyOwner{
}
//Sets
//view LP functions
//Returns mininum amount of LP tokens needed to qualify for minting a normal NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokens() public view returns (uint){
}
//Returns min amount of LP tokens needed to qualify for golden NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokensGolden() public view returns (uint){
}
//Converts LP token balances to PPDEX
function LPToPPDEX(uint lp) public view returns (uint){
}
//mapping functions
//Get the block num of the time the user staked
function getStakingStart(address addr) public view returns(uint){
}
//Get the amount of LP tokens the address deposited
function getLPBalance(address addr) public view returns(uint){
}
//Check if an address is staking.
function isUserStaking(address addr) public view returns (bool){
}
//Check if user has minted a NFT
function hasUserMinted(address addr, uint id) public view returns(bool){
}
//Check if an address is staking for a normal or golden NFT
//True = user is staking for a normal NFT
//False = user is staking for a golden NFT (or the user is not staking at all)
function isUserStakingNormalNFT(address addr) public view returns (bool){
}
//staking functions
//Transfers liqudity worth 46.6 PPDEX from the user to stake
function stakeForNormalNFT() public {
}
//Transfers liquidity worth 150 PPDEX for user to get golden NFT
function stakeForGoldenNFT() public {
}
//Allow the user to withdraw
function withdrawLP() public{
IUniswapV2ERC20 lpToken = IUniswapV2ERC20(UniV2Address);
//LP tokens are locked for 32 days
require (depositBlock[msg.sender]+blockTime < block.number, "Must wait 32 days to withdraw");
//Update mappings
uint lpAmount = LPBalance[msg.sender];
LPBalance[msg.sender] = 0;
depositBlock[msg.sender] = 0;
isStaking[msg.sender] = false;
isStakingNormalNFT[msg.sender]= false;
//Send user his LP token balance
require(<FILL_ME>)
emit Unstaked(msg.sender, lpAmount);
}
//Allow the user to mint a NFT
function mintNFT() public {
}
}
| lpToken.transfer(msg.sender,lpAmount) | 300,033 | lpToken.transfer(msg.sender,lpAmount) |
"User isn't staking" | //
// _ _ _ ___ ___
// | | | | | | |__ \ / _ \
// | | ___ | |_| |_ ___ _ __ _ _ ) || | | |
// | | / _ \| __| __/ _ \ '__| | | | / / | | | |
// | |___| (_) | |_| || __/ | | |_| | / /_ | |_| |
// |______\___/ \__|\__\___|_| \__, | |____(_)___/
// __/ |
// |___/
//
pragma solidity ^0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
//Keeps track of 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 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 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 {
}
}
//Interface for ERC20 tokens
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
//Interface for Uni V2 tokens
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
//Interface for the Pepemon factory
//Contains only the mint method
interface IPepemonFactory{
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes memory _data
) external;
}
pragma solidity >=0.6.0 <0.8.0;
/**
* @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) {
}
}
contract LotteryTwo is Ownable{
//Uni V2 Address for ppdex
address public UniV2Address;
//PPDEX address
address public PPDEX;
//pepemonFactory address
address public pepemonFactory;
//how long users have to wait before they can withdraw LP
//5760 blocks = 1 day
//40320 blocks = 1 week
//184320 block = 32 days
uint public blockTime;
//Block when users will be allowed to mint NFTs if they provided liq before this block
uint public stakingDeadline;
//how many PPDEX needed to stake for a normal NFT
uint public minPPDEX = 1000*10**17;
//how many PPDEX needed to stake for a golden NFT
uint public minPPDEXGolden = 1000*10**17;
//nft ids for minting
uint public normalID;
uint public goldenID;
using SafeMath for uint;
//events
event Redeemed(address indexed user, uint id);
event Staked(address indexed user, uint amount);
event Unstaked(address indexed user, uint amount);
/**
* _UniV2Address => Uni V2 token address (should be 0x6B1455E27902CA89eE3ABB0673A8Aa9Ce1609952)
* _PPDEX => PPDEX token address (should be 0xf1f508c7c9f0d1b15a76fba564eef2d956220cf7)
* _pepemonFactory => pepemonFactory address (should be 0xcb6768a968440187157cfe13b67cac82ef6cc5a4)
* _blockTime => Time a user must wait to mint a NFT (should be 208000 for 32 days)
*/
constructor(address _UniV2Address, address _PPDEX, address _pepemonFactory, uint _blockTime) {
}
//mapping that keeps track of last nft claim
mapping (address => uint) depositBlock;
//mapping that keeps track of how many LP tokens user deposited
mapping (address => uint ) LPBalance;
//mapping that keeps track of if a user is staking
mapping (address => bool) isStaking;
//mapping that keeps track of if a user is staking normal nft
mapping (address => bool) isStakingNormalNFT;
//Keeps track of if a user has minted a NFT;
mapping(address => mapping(uint => bool)) hasMinted;
//setter functions
//Sets Uni V2 Pair address
function setUniV2Address (address addr) public onlyOwner{
}
//Sets PPDEX token address
function setPPDEX (address _PPDEX) public onlyOwner{
}
//Sets Pepemon Factory address
function setPepemonFactory (address _pepemonFactory) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint golden nfts
function setminPPDEXGolden (uint _minPPDEXGolden) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint normal nfts
function setminPPDEX (uint _minPPDEX) public onlyOwner{
}
//Updates NFT info - IDs + block
function updateNFT (uint _normalID, uint _goldenID) public onlyOwner{
}
//Sets
//view LP functions
//Returns mininum amount of LP tokens needed to qualify for minting a normal NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokens() public view returns (uint){
}
//Returns min amount of LP tokens needed to qualify for golden NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokensGolden() public view returns (uint){
}
//Converts LP token balances to PPDEX
function LPToPPDEX(uint lp) public view returns (uint){
}
//mapping functions
//Get the block num of the time the user staked
function getStakingStart(address addr) public view returns(uint){
}
//Get the amount of LP tokens the address deposited
function getLPBalance(address addr) public view returns(uint){
}
//Check if an address is staking.
function isUserStaking(address addr) public view returns (bool){
}
//Check if user has minted a NFT
function hasUserMinted(address addr, uint id) public view returns(bool){
}
//Check if an address is staking for a normal or golden NFT
//True = user is staking for a normal NFT
//False = user is staking for a golden NFT (or the user is not staking at all)
function isUserStakingNormalNFT(address addr) public view returns (bool){
}
//staking functions
//Transfers liqudity worth 46.6 PPDEX from the user to stake
function stakeForNormalNFT() public {
}
//Transfers liquidity worth 150 PPDEX for user to get golden NFT
function stakeForGoldenNFT() public {
}
//Allow the user to withdraw
function withdrawLP() public{
}
//Allow the user to mint a NFT
function mintNFT() public {
//Make sure user is staking
require(<FILL_ME>)
//Make sure enough time has passed
require (block.number > stakingDeadline, "Please wait longer");
//Make sure user deposited before deadline
require (depositBlock[msg.sender] < stakingDeadline, "You did not stake before the deadline");
//Make sure user did not already mint a nft
require ((hasMinted[msg.sender][normalID] == false)&& (hasMinted[msg.sender][goldenID])== false, "You have already minted a NFT");
IPepemonFactory factory = IPepemonFactory(pepemonFactory);
//Send user 1 normal nft or 1 golden nft, depending on how much he staked
if (isStakingNormalNFT[msg.sender]){
factory.mint(msg.sender, normalID, 1, "");
hasMinted[msg.sender][normalID] = true;
emit Redeemed(msg.sender, normalID);
}
else{
factory.mint(msg.sender, goldenID, 1, "");
hasMinted[msg.sender][goldenID] = true;
emit Redeemed(msg.sender, goldenID);
}
}
}
| isStaking[msg.sender],"User isn't staking" | 300,033 | isStaking[msg.sender] |
"You did not stake before the deadline" | //
// _ _ _ ___ ___
// | | | | | | |__ \ / _ \
// | | ___ | |_| |_ ___ _ __ _ _ ) || | | |
// | | / _ \| __| __/ _ \ '__| | | | / / | | | |
// | |___| (_) | |_| || __/ | | |_| | / /_ | |_| |
// |______\___/ \__|\__\___|_| \__, | |____(_)___/
// __/ |
// |___/
//
pragma solidity ^0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
//Keeps track of 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 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 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 {
}
}
//Interface for ERC20 tokens
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
//Interface for Uni V2 tokens
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
//Interface for the Pepemon factory
//Contains only the mint method
interface IPepemonFactory{
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes memory _data
) external;
}
pragma solidity >=0.6.0 <0.8.0;
/**
* @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) {
}
}
contract LotteryTwo is Ownable{
//Uni V2 Address for ppdex
address public UniV2Address;
//PPDEX address
address public PPDEX;
//pepemonFactory address
address public pepemonFactory;
//how long users have to wait before they can withdraw LP
//5760 blocks = 1 day
//40320 blocks = 1 week
//184320 block = 32 days
uint public blockTime;
//Block when users will be allowed to mint NFTs if they provided liq before this block
uint public stakingDeadline;
//how many PPDEX needed to stake for a normal NFT
uint public minPPDEX = 1000*10**17;
//how many PPDEX needed to stake for a golden NFT
uint public minPPDEXGolden = 1000*10**17;
//nft ids for minting
uint public normalID;
uint public goldenID;
using SafeMath for uint;
//events
event Redeemed(address indexed user, uint id);
event Staked(address indexed user, uint amount);
event Unstaked(address indexed user, uint amount);
/**
* _UniV2Address => Uni V2 token address (should be 0x6B1455E27902CA89eE3ABB0673A8Aa9Ce1609952)
* _PPDEX => PPDEX token address (should be 0xf1f508c7c9f0d1b15a76fba564eef2d956220cf7)
* _pepemonFactory => pepemonFactory address (should be 0xcb6768a968440187157cfe13b67cac82ef6cc5a4)
* _blockTime => Time a user must wait to mint a NFT (should be 208000 for 32 days)
*/
constructor(address _UniV2Address, address _PPDEX, address _pepemonFactory, uint _blockTime) {
}
//mapping that keeps track of last nft claim
mapping (address => uint) depositBlock;
//mapping that keeps track of how many LP tokens user deposited
mapping (address => uint ) LPBalance;
//mapping that keeps track of if a user is staking
mapping (address => bool) isStaking;
//mapping that keeps track of if a user is staking normal nft
mapping (address => bool) isStakingNormalNFT;
//Keeps track of if a user has minted a NFT;
mapping(address => mapping(uint => bool)) hasMinted;
//setter functions
//Sets Uni V2 Pair address
function setUniV2Address (address addr) public onlyOwner{
}
//Sets PPDEX token address
function setPPDEX (address _PPDEX) public onlyOwner{
}
//Sets Pepemon Factory address
function setPepemonFactory (address _pepemonFactory) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint golden nfts
function setminPPDEXGolden (uint _minPPDEXGolden) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint normal nfts
function setminPPDEX (uint _minPPDEX) public onlyOwner{
}
//Updates NFT info - IDs + block
function updateNFT (uint _normalID, uint _goldenID) public onlyOwner{
}
//Sets
//view LP functions
//Returns mininum amount of LP tokens needed to qualify for minting a normal NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokens() public view returns (uint){
}
//Returns min amount of LP tokens needed to qualify for golden NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokensGolden() public view returns (uint){
}
//Converts LP token balances to PPDEX
function LPToPPDEX(uint lp) public view returns (uint){
}
//mapping functions
//Get the block num of the time the user staked
function getStakingStart(address addr) public view returns(uint){
}
//Get the amount of LP tokens the address deposited
function getLPBalance(address addr) public view returns(uint){
}
//Check if an address is staking.
function isUserStaking(address addr) public view returns (bool){
}
//Check if user has minted a NFT
function hasUserMinted(address addr, uint id) public view returns(bool){
}
//Check if an address is staking for a normal or golden NFT
//True = user is staking for a normal NFT
//False = user is staking for a golden NFT (or the user is not staking at all)
function isUserStakingNormalNFT(address addr) public view returns (bool){
}
//staking functions
//Transfers liqudity worth 46.6 PPDEX from the user to stake
function stakeForNormalNFT() public {
}
//Transfers liquidity worth 150 PPDEX for user to get golden NFT
function stakeForGoldenNFT() public {
}
//Allow the user to withdraw
function withdrawLP() public{
}
//Allow the user to mint a NFT
function mintNFT() public {
//Make sure user is staking
require (isStaking[msg.sender], "User isn't staking");
//Make sure enough time has passed
require (block.number > stakingDeadline, "Please wait longer");
//Make sure user deposited before deadline
require(<FILL_ME>)
//Make sure user did not already mint a nft
require ((hasMinted[msg.sender][normalID] == false)&& (hasMinted[msg.sender][goldenID])== false, "You have already minted a NFT");
IPepemonFactory factory = IPepemonFactory(pepemonFactory);
//Send user 1 normal nft or 1 golden nft, depending on how much he staked
if (isStakingNormalNFT[msg.sender]){
factory.mint(msg.sender, normalID, 1, "");
hasMinted[msg.sender][normalID] = true;
emit Redeemed(msg.sender, normalID);
}
else{
factory.mint(msg.sender, goldenID, 1, "");
hasMinted[msg.sender][goldenID] = true;
emit Redeemed(msg.sender, goldenID);
}
}
}
| depositBlock[msg.sender]<stakingDeadline,"You did not stake before the deadline" | 300,033 | depositBlock[msg.sender]<stakingDeadline |
"You have already minted a NFT" | //
// _ _ _ ___ ___
// | | | | | | |__ \ / _ \
// | | ___ | |_| |_ ___ _ __ _ _ ) || | | |
// | | / _ \| __| __/ _ \ '__| | | | / / | | | |
// | |___| (_) | |_| || __/ | | |_| | / /_ | |_| |
// |______\___/ \__|\__\___|_| \__, | |____(_)___/
// __/ |
// |___/
//
pragma solidity ^0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
//Keeps track of 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 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 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 {
}
}
//Interface for ERC20 tokens
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
//Interface for Uni V2 tokens
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
//Interface for the Pepemon factory
//Contains only the mint method
interface IPepemonFactory{
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes memory _data
) external;
}
pragma solidity >=0.6.0 <0.8.0;
/**
* @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) {
}
}
contract LotteryTwo is Ownable{
//Uni V2 Address for ppdex
address public UniV2Address;
//PPDEX address
address public PPDEX;
//pepemonFactory address
address public pepemonFactory;
//how long users have to wait before they can withdraw LP
//5760 blocks = 1 day
//40320 blocks = 1 week
//184320 block = 32 days
uint public blockTime;
//Block when users will be allowed to mint NFTs if they provided liq before this block
uint public stakingDeadline;
//how many PPDEX needed to stake for a normal NFT
uint public minPPDEX = 1000*10**17;
//how many PPDEX needed to stake for a golden NFT
uint public minPPDEXGolden = 1000*10**17;
//nft ids for minting
uint public normalID;
uint public goldenID;
using SafeMath for uint;
//events
event Redeemed(address indexed user, uint id);
event Staked(address indexed user, uint amount);
event Unstaked(address indexed user, uint amount);
/**
* _UniV2Address => Uni V2 token address (should be 0x6B1455E27902CA89eE3ABB0673A8Aa9Ce1609952)
* _PPDEX => PPDEX token address (should be 0xf1f508c7c9f0d1b15a76fba564eef2d956220cf7)
* _pepemonFactory => pepemonFactory address (should be 0xcb6768a968440187157cfe13b67cac82ef6cc5a4)
* _blockTime => Time a user must wait to mint a NFT (should be 208000 for 32 days)
*/
constructor(address _UniV2Address, address _PPDEX, address _pepemonFactory, uint _blockTime) {
}
//mapping that keeps track of last nft claim
mapping (address => uint) depositBlock;
//mapping that keeps track of how many LP tokens user deposited
mapping (address => uint ) LPBalance;
//mapping that keeps track of if a user is staking
mapping (address => bool) isStaking;
//mapping that keeps track of if a user is staking normal nft
mapping (address => bool) isStakingNormalNFT;
//Keeps track of if a user has minted a NFT;
mapping(address => mapping(uint => bool)) hasMinted;
//setter functions
//Sets Uni V2 Pair address
function setUniV2Address (address addr) public onlyOwner{
}
//Sets PPDEX token address
function setPPDEX (address _PPDEX) public onlyOwner{
}
//Sets Pepemon Factory address
function setPepemonFactory (address _pepemonFactory) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint golden nfts
function setminPPDEXGolden (uint _minPPDEXGolden) public onlyOwner{
}
//Sets the min number of PPDEX needed in liquidity to mint normal nfts
function setminPPDEX (uint _minPPDEX) public onlyOwner{
}
//Updates NFT info - IDs + block
function updateNFT (uint _normalID, uint _goldenID) public onlyOwner{
}
//Sets
//view LP functions
//Returns mininum amount of LP tokens needed to qualify for minting a normal NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokens() public view returns (uint){
}
//Returns min amount of LP tokens needed to qualify for golden NFT
//Notice a small fudge factor is added as it looks like uniswap sends a tiny amount of LP tokens to the zero address
function MinLPTokensGolden() public view returns (uint){
}
//Converts LP token balances to PPDEX
function LPToPPDEX(uint lp) public view returns (uint){
}
//mapping functions
//Get the block num of the time the user staked
function getStakingStart(address addr) public view returns(uint){
}
//Get the amount of LP tokens the address deposited
function getLPBalance(address addr) public view returns(uint){
}
//Check if an address is staking.
function isUserStaking(address addr) public view returns (bool){
}
//Check if user has minted a NFT
function hasUserMinted(address addr, uint id) public view returns(bool){
}
//Check if an address is staking for a normal or golden NFT
//True = user is staking for a normal NFT
//False = user is staking for a golden NFT (or the user is not staking at all)
function isUserStakingNormalNFT(address addr) public view returns (bool){
}
//staking functions
//Transfers liqudity worth 46.6 PPDEX from the user to stake
function stakeForNormalNFT() public {
}
//Transfers liquidity worth 150 PPDEX for user to get golden NFT
function stakeForGoldenNFT() public {
}
//Allow the user to withdraw
function withdrawLP() public{
}
//Allow the user to mint a NFT
function mintNFT() public {
//Make sure user is staking
require (isStaking[msg.sender], "User isn't staking");
//Make sure enough time has passed
require (block.number > stakingDeadline, "Please wait longer");
//Make sure user deposited before deadline
require (depositBlock[msg.sender] < stakingDeadline, "You did not stake before the deadline");
//Make sure user did not already mint a nft
require(<FILL_ME>)
IPepemonFactory factory = IPepemonFactory(pepemonFactory);
//Send user 1 normal nft or 1 golden nft, depending on how much he staked
if (isStakingNormalNFT[msg.sender]){
factory.mint(msg.sender, normalID, 1, "");
hasMinted[msg.sender][normalID] = true;
emit Redeemed(msg.sender, normalID);
}
else{
factory.mint(msg.sender, goldenID, 1, "");
hasMinted[msg.sender][goldenID] = true;
emit Redeemed(msg.sender, goldenID);
}
}
}
| (hasMinted[msg.sender][normalID]==false)&&(hasMinted[msg.sender][goldenID])==false,"You have already minted a NFT" | 300,033 | (hasMinted[msg.sender][normalID]==false)&&(hasMinted[msg.sender][goldenID])==false |
"!minter" | pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// Standard ERC20 token with mint and burn
contract MOSToken is ERC20 {
address public governance;
bool public transferEnable;
mapping (address => bool) public isMinter;
constructor () public ERC20("MetaOasis DAO", "MOS") {
}
function setGovernance(address _governance) external {
}
function setMinter(address _minter, bool _status) external {
}
/// @notice Creates `_amount` token to `_to`. Must only be called by minter
function mint(address _to, uint256 _amount) external {
require(<FILL_ME>)
_mint(_to, _amount);
}
/**
* @dev See {ERC20-_beforeTokenTransfer}.
*
* Requirements:
*
* - the contract has enabled transfer
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
}
}
| isMinter[msg.sender]==true,"!minter" | 300,096 | isMinter[msg.sender]==true |
"Max supply exceeded" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
/*LOVExoXXXXXXXXLOVEXXXXXNNNXXKKOkdollldxxxxxxxocoOOkkOOOOOkkOOOOOOkxolc::;;;;;;;;;;;;;;;;;;;;;;;;;;
XXXXXXXXXXK0OkkkkkO0KXXXXXXXXXNNNXKKOxolllodxxxdclxkkkOOOOOOOkkkkkOOOkxdoc:;;;;;;;;;;;;;;;;;;;;;;;;;
XXXXXXXXX0kdc:;;;;:lxOKXXXXXXXXXXNNNNXK0kdlllodxlcoxOOOOkkxddoooodkOOOOkkdlc:;;;;;;;;;;;;;;;;;;;;;;;
XXXXXXXX0xl,.......';lxOOOkkOO0KXXXXXNNNXK0kollooc:lk00kdocc::::cokOOOOOOkkdl::;;;;;;;;;;;;;;;;;;;;;
KXXXXXXKkl,..........,cl:;;;:coxOKXXXXXXNNNXKOxolccccldkxdlc:;;:ldkOOkkOkOOkxoc:;;;;;;;;;;;;;;;;;;;;
OXXXXXXOd:'...........''......';lx0XXXXXXXXNNXK0kdolcccldkxolc:cokOOOkkOOkkOOkdlc:;;;;;;;;;;;;;;;;;;
kKLOVEXOd:......................;lkKXXXXXXXXXXNNXK0OdlcccldkxdooxOOkOOkOOkkOkOkxoc:;;;;;;;;;;;;;;;;;
x0XXXXX0dc'.....................,lk0XXXXXXXXXXXXNNNXKOxlcccldkOOOOOkkOOOkkkOkkOOkdl::;;;;;;;;;;;;;;;
dkKXXXXKkl,....................':oOKXXXXLOVEXXXXXXXXNNXKOxlccclx00OOOkkOOkOkkOOOOOkxoc:;;;;;;;;;;;;;
dx0XXXXX0xc,..................':okKXXXXXXXXXXXKKXXXXXNNXKOdlcccodddxxkkkOOOOOkkOOOOxoc:;;;;;;;;;;;;;
ddOXXXXXKOxc,...............';ldOKXXXXXXXXXK0OOKXXXXXXXNNX0koccllllllloooooooddxxkkOkdl:;;;;;;;;;;;;
ddkKXXXXXK0xl,...........',:ldOKXXXXXXXXXKOkxkKXXXXXXXXXXNNX0xlcoxxxxxxdddoolllllclxOkdl:;;;;;;;;;;;
ddx0XXXXXXX0ko:'...'',;:cldk0KXXXXXXXXK0kxddOKXXXXXXXXXXXXXNXKOdcldxxxxxxxxxxxxxdclkOOkdl:;;;;;;;;;;
dddOKXXXXXXXKOdl:ccloxkOO0KXXXXXXXXK0OxdddxOKXXXXXXXXXXXXXXXNNX0xlcdxxxxxxxxxxxdlcxOOOOkdl:;;;;;;;;;
dddx0XXXXXXXXX0OOO00KKXXXXXXXXXXKKOkdddddx0LOVEXXXXXXXXXXXXXXXNX0kocoxxxxxxxxxxlcdOOOOOOkdl:;;;;;;;;
ddddOXXXXLOVEXXXXXXXXXXXXXXXXXK0kxddddddk0XXXXXXXXXXXXXXXXXXXXXNNKOdcoxxxxxxxxocokOkOkOOOkdc:;;;;;;;
ddddxkOO0KKXXXXXXXXXXXXXXXXK0OxddddddddkKXXXXXXXXXXXXKKKKXXXXXXXNNKOdcldxxxxxdclkOOOOkkOOOkoc:;;;;;;
ddodddddddxkOO0KXLOVEXXXKKOkddddddddddOKXXXXXXXXK0OOkxxxxkOKXXXXXNNKOdcldxxxdlcxOOOOOOOOOOOxoc:;;;;;
:llooooooodddddxkO0KXXK0kxddddddddddxOKXXXXXXKOkdl::;,,,;:ldOKXXXXNNKOdclxxxlcdOOOOOOOOOOkOkxl:;;;;;
.,cllllllllooooodddxOkxddddddddddddx0XXXXXXKOxo:,'........':okKXXXXNNKOdclxocokOOOOOOOOOkkOOkdl:;;;;
...:llolllc:;,,;coddddddddddddddddx0XXXXXXKko:'............'cd0XXXXXNNKOococck0OOOOOOOOOkOkkOxoc:;;;
...'colc;'......,loooddddddddddddk0XXXXXX0ko;..............':dOXXXXXXNNKkocccx0OkxxxkkkOOOOOkkdl:;;;
....:l;..........:llloodddddddddkKXXXXXXKko;...............,lx0XXXXXXXNX0klcclkkdlccllodxkkOOkxlc:;;
....;,...........:llllloodddddxOKXXXXXXKOd:'..............';coxOKXXXXXNNKOdcccokdl:::::cldkOOkkdl:;;
...,,...........'colllllloddddkKXXXXXXX0xc'..................':ox0XXXXXNNKkocccxkoc:;:cldkkOOOkkoc:;
..,,'...','.....:olcc:::cclodddkKXXXXXKko;.....................,lx0XXXXXNX0xccclkxlccldxkOOOOOOkxl:;
',,,'.',,'....',;,........',ldddkKXXXXKko:'.....................:dOXXXXXNNKOocccxkxddxkOOkkOOOOOkoc:
;;,,,,,,,...',,.............:odddkKXXXX0Odl:,'.................'cdOXXXXXNNXOxcccoO0OOOOOOOOOOOOOkdc:
;;;;;,;,,,,,,'.............,clodddOKXXXXXK0kdl:,'.............,:dkKXXXXXXNN0klccck0OOOkOOOOOkOOOOxl:
;;;;;;;;;,;,'..'','.......,cllooddx0XXXXXXXXK0kxoc::;;,,,,,;:cok0KXXXXXXXNNKOocllldkkOOOOkOOOOkkOxoc
:::;;:;;;;;,,,,,'........;lllllodddkKXXLOVEXXXXKK0OOkkkxxxxkO0KKXXXXXXXXXNNX0xclxolloxkOOkkOOOOOOkoc
::::::;;;;;,;,,'......,:lloolllloddxOKXXXXXXXXXXXXXXXXXXKKXXXXXXXXXXXXXXXXNX0klcxxxdllldkOOOOkkOOkdc
lllc::::;;;;;,,,,,,,'''',,;:clllodddxxkkOOO00KKKXXXXXXXXXXXXXLOVEXXXXXXXXXNN0klcdxxxxdolloxkkkOOOkdl
ooolc::::;;;;;,,'............,:loodddddddddddxxxkkkOOO00KKKXXXXXXXXXXXXXXXNNKOocdxxxxxxxdllldkOOOkxl
oooolc:::;;;;;,,'''............':odddddddddddddddddddddddxxkkOOO00KKKXXXXXNNKOocdxxxxxxxxxdolloxOkxl
hwxolc::;;;,,,;;,,,,,,'.........,oddddddddddddddddddddddddddddddddxkO0KXXXNNKOocoxxxxxxxxxxxxoLOVE*/
// CryptoHexes - Genesis of VS
contract CryptoHexes is ERC721Enumerable, Ownable, Pausable {
using Strings for uint256;
// Token Management
uint256 public reserved = 27;
uint256 constant MAX_SUPPLY = 9999;
uint256 public price = 0.04 ether;
// Metadata Management
string public baseURI = "";
string public extension = ".json";
// Reveal Management
bool public revealed = false;
string public notRevealedUri = "ipfs://QmNsXafCSc9gLcQ9ZcCiJWLtWLpnWMyVev5iGdcUcU6DvP/preview.json";
constructor() ERC721("CryptoHexes", "HEXES") {
}
// Public Functionality
function mint(uint256 count) public payable whenNotPaused {
uint256 totalSupply = totalSupply();
require( count > 0, "Invalid mint amount");
require( msg.value >= price * count, "Invalid ETH amount");
require(<FILL_ME>)
for(uint256 i = 1; i <= count; i++){
_safeMint( msg.sender, totalSupply + i );
}
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
// onlyOwner Functionality
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function setPrice(uint256 newPrice) public onlyOwner {
}
function setBaseURI(string memory newBaseUri) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseExtension(string memory newExtension) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setReveal(bool revealStatus) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function mintReserved(uint256 count) public onlyOwner {
}
// Good luck. We love you.
}
| totalSupply+count<=MAX_SUPPLY,"Max supply exceeded" | 300,097 | totalSupply+count<=MAX_SUPPLY |
"_to cannot mint" | /**
* @title Compliant Token
*/
contract CompliantToken is ModularPausableToken {
// In order to deposit USD and receive newly minted TrueUSD, or to burn TrueUSD to
// redeem it for USD, users must first go through a KYC/AML check (which includes proving they
// control their ethereum address using AddressValidation.sol).
bytes32 public constant HAS_PASSED_KYC_AML = "hasPassedKYC/AML";
// Redeeming ("burning") TrueUSD tokens for USD requires a separate flag since
// users must not only be KYC/AML'ed but must also have bank information on file.
bytes32 public constant CAN_BURN = "canBurn";
// Addresses can also be blacklisted, preventing them from sending or receiving
// TrueUSD. This can be used to prevent the use of TrueUSD by bad actors in
// accordance with law enforcement. See [TrueCoin Terms of Use](https://www.trusttoken.com/trueusd/terms-of-use)
bytes32 public constant IS_BLACKLISTED = "isBlacklisted";
event WipeBlacklistedAccount(address indexed account, uint256 balance);
event SetRegistry(address indexed registry);
/**
* @dev Point to the registry that contains all compliance related data
@param _registry The address of the registry instance
*/
function setRegistry(Registry _registry) public onlyOwner {
}
function mint(address _to, uint256 _value) public onlyOwner {
require(<FILL_ME>)
super.mint(_to, _value);
}
function _burnAllArgs(address _burner, uint256 _value) internal {
}
// A blacklisted address can't call transferFrom
function _transferFromAllArgs(address _from, address _to, uint256 _value, address _spender) internal {
}
// transfer and transferFrom both call this function, so check blacklist here.
function _transferAllArgs(address _from, address _to, uint256 _value) internal {
}
// Destroy the tokens owned by a blacklisted account
function wipeBlacklistedAccount(address _account) public onlyOwner {
}
}
| registry.hasAttribute1ButNotAttribute2(_to,HAS_PASSED_KYC_AML,IS_BLACKLISTED),"_to cannot mint" | 300,178 | registry.hasAttribute1ButNotAttribute2(_to,HAS_PASSED_KYC_AML,IS_BLACKLISTED) |
"_burner cannot burn" | /**
* @title Compliant Token
*/
contract CompliantToken is ModularPausableToken {
// In order to deposit USD and receive newly minted TrueUSD, or to burn TrueUSD to
// redeem it for USD, users must first go through a KYC/AML check (which includes proving they
// control their ethereum address using AddressValidation.sol).
bytes32 public constant HAS_PASSED_KYC_AML = "hasPassedKYC/AML";
// Redeeming ("burning") TrueUSD tokens for USD requires a separate flag since
// users must not only be KYC/AML'ed but must also have bank information on file.
bytes32 public constant CAN_BURN = "canBurn";
// Addresses can also be blacklisted, preventing them from sending or receiving
// TrueUSD. This can be used to prevent the use of TrueUSD by bad actors in
// accordance with law enforcement. See [TrueCoin Terms of Use](https://www.trusttoken.com/trueusd/terms-of-use)
bytes32 public constant IS_BLACKLISTED = "isBlacklisted";
event WipeBlacklistedAccount(address indexed account, uint256 balance);
event SetRegistry(address indexed registry);
/**
* @dev Point to the registry that contains all compliance related data
@param _registry The address of the registry instance
*/
function setRegistry(Registry _registry) public onlyOwner {
}
function mint(address _to, uint256 _value) public onlyOwner {
}
function _burnAllArgs(address _burner, uint256 _value) internal {
require(<FILL_ME>)
super._burnAllArgs(_burner, _value);
}
// A blacklisted address can't call transferFrom
function _transferFromAllArgs(address _from, address _to, uint256 _value, address _spender) internal {
}
// transfer and transferFrom both call this function, so check blacklist here.
function _transferAllArgs(address _from, address _to, uint256 _value) internal {
}
// Destroy the tokens owned by a blacklisted account
function wipeBlacklistedAccount(address _account) public onlyOwner {
}
}
| registry.hasAttribute1ButNotAttribute2(_burner,CAN_BURN,IS_BLACKLISTED),"_burner cannot burn" | 300,178 | registry.hasAttribute1ButNotAttribute2(_burner,CAN_BURN,IS_BLACKLISTED) |
"_spender is blacklisted" | /**
* @title Compliant Token
*/
contract CompliantToken is ModularPausableToken {
// In order to deposit USD and receive newly minted TrueUSD, or to burn TrueUSD to
// redeem it for USD, users must first go through a KYC/AML check (which includes proving they
// control their ethereum address using AddressValidation.sol).
bytes32 public constant HAS_PASSED_KYC_AML = "hasPassedKYC/AML";
// Redeeming ("burning") TrueUSD tokens for USD requires a separate flag since
// users must not only be KYC/AML'ed but must also have bank information on file.
bytes32 public constant CAN_BURN = "canBurn";
// Addresses can also be blacklisted, preventing them from sending or receiving
// TrueUSD. This can be used to prevent the use of TrueUSD by bad actors in
// accordance with law enforcement. See [TrueCoin Terms of Use](https://www.trusttoken.com/trueusd/terms-of-use)
bytes32 public constant IS_BLACKLISTED = "isBlacklisted";
event WipeBlacklistedAccount(address indexed account, uint256 balance);
event SetRegistry(address indexed registry);
/**
* @dev Point to the registry that contains all compliance related data
@param _registry The address of the registry instance
*/
function setRegistry(Registry _registry) public onlyOwner {
}
function mint(address _to, uint256 _value) public onlyOwner {
}
function _burnAllArgs(address _burner, uint256 _value) internal {
}
// A blacklisted address can't call transferFrom
function _transferFromAllArgs(address _from, address _to, uint256 _value, address _spender) internal {
require(<FILL_ME>)
super._transferFromAllArgs(_from, _to, _value, _spender);
}
// transfer and transferFrom both call this function, so check blacklist here.
function _transferAllArgs(address _from, address _to, uint256 _value) internal {
}
// Destroy the tokens owned by a blacklisted account
function wipeBlacklistedAccount(address _account) public onlyOwner {
}
}
| !registry.hasAttribute(_spender,IS_BLACKLISTED),"_spender is blacklisted" | 300,178 | !registry.hasAttribute(_spender,IS_BLACKLISTED) |
"blacklisted" | /**
* @title Compliant Token
*/
contract CompliantToken is ModularPausableToken {
// In order to deposit USD and receive newly minted TrueUSD, or to burn TrueUSD to
// redeem it for USD, users must first go through a KYC/AML check (which includes proving they
// control their ethereum address using AddressValidation.sol).
bytes32 public constant HAS_PASSED_KYC_AML = "hasPassedKYC/AML";
// Redeeming ("burning") TrueUSD tokens for USD requires a separate flag since
// users must not only be KYC/AML'ed but must also have bank information on file.
bytes32 public constant CAN_BURN = "canBurn";
// Addresses can also be blacklisted, preventing them from sending or receiving
// TrueUSD. This can be used to prevent the use of TrueUSD by bad actors in
// accordance with law enforcement. See [TrueCoin Terms of Use](https://www.trusttoken.com/trueusd/terms-of-use)
bytes32 public constant IS_BLACKLISTED = "isBlacklisted";
event WipeBlacklistedAccount(address indexed account, uint256 balance);
event SetRegistry(address indexed registry);
/**
* @dev Point to the registry that contains all compliance related data
@param _registry The address of the registry instance
*/
function setRegistry(Registry _registry) public onlyOwner {
}
function mint(address _to, uint256 _value) public onlyOwner {
}
function _burnAllArgs(address _burner, uint256 _value) internal {
}
// A blacklisted address can't call transferFrom
function _transferFromAllArgs(address _from, address _to, uint256 _value, address _spender) internal {
}
// transfer and transferFrom both call this function, so check blacklist here.
function _transferAllArgs(address _from, address _to, uint256 _value) internal {
require(<FILL_ME>)
super._transferAllArgs(_from, _to, _value);
}
// Destroy the tokens owned by a blacklisted account
function wipeBlacklistedAccount(address _account) public onlyOwner {
}
}
| !registry.eitherHaveAttribute(_from,_to,IS_BLACKLISTED),"blacklisted" | 300,178 | !registry.eitherHaveAttribute(_from,_to,IS_BLACKLISTED) |
_transferErrorMessage | pragma solidity ^0.8.7;
/**
* @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 {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
/**
* @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 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 {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StakedTokenWrapper {
uint256 public totalSupply;
mapping(address => uint256) private _balances;
IERC20 public stakedToken;
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
function balanceOf(address account) public view returns (uint256) {
}
string constant _transferErrorMessage = "staked token transfer failed";
function stakeFor(address forWhom, uint128 amount) public payable virtual {
IERC20 st = stakedToken;
if(st == IERC20(address(0))) { //eth
unchecked {
totalSupply += msg.value;
_balances[forWhom] += msg.value;
}
}
else {
require(msg.value == 0, "non-zero eth");
require(amount > 0, "Cannot stake 0");
require(<FILL_ME>)
unchecked {
totalSupply += amount;
_balances[forWhom] += amount;
}
}
emit Staked(forWhom, amount);
}
function withdraw(uint128 amount) public virtual {
}
}
contract DOERewards is StakedTokenWrapper, Ownable {
IERC20 public rewardToken;
uint256 public rewardRate;
uint64 public periodFinish;
uint64 public lastUpdateTime;
uint128 public rewardPerTokenStored;
struct UserRewards {
uint128 userRewardPerTokenPaid;
uint128 rewards;
}
mapping(address => UserRewards) public userRewards;
event RewardAdded(uint256 reward);
event RewardPaid(address indexed user, uint256 reward);
constructor(IERC20 _rewardToken, IERC20 _stakedToken) {
}
modifier updateReward(address account) {
}
function lastTimeRewardApplicable() public view returns (uint64) {
}
function rewardPerToken() public view returns (uint128) {
}
function earned(address account) public view returns (uint128) {
}
function stake(uint128 amount) external payable {
}
function stakeFor(address forWhom, uint128 amount) public payable override updateReward(forWhom) {
}
function withdraw(uint128 amount) public override updateReward(msg.sender) {
}
function exit() external {
}
function getReward() public updateReward(msg.sender) {
}
function setRewardParams(uint128 reward, uint64 duration) external onlyOwner {
}
function withdrawReward() external onlyOwner {
}
}
// Licenses and credits below
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: YFIRewards.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/
| st.transferFrom(msg.sender,address(this),amount),_transferErrorMessage | 300,357 | st.transferFrom(msg.sender,address(this),amount) |
"reward transfer failed" | pragma solidity ^0.8.7;
/**
* @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 {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
/**
* @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 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 {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StakedTokenWrapper {
uint256 public totalSupply;
mapping(address => uint256) private _balances;
IERC20 public stakedToken;
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
function balanceOf(address account) public view returns (uint256) {
}
string constant _transferErrorMessage = "staked token transfer failed";
function stakeFor(address forWhom, uint128 amount) public payable virtual {
}
function withdraw(uint128 amount) public virtual {
}
}
contract DOERewards is StakedTokenWrapper, Ownable {
IERC20 public rewardToken;
uint256 public rewardRate;
uint64 public periodFinish;
uint64 public lastUpdateTime;
uint128 public rewardPerTokenStored;
struct UserRewards {
uint128 userRewardPerTokenPaid;
uint128 rewards;
}
mapping(address => UserRewards) public userRewards;
event RewardAdded(uint256 reward);
event RewardPaid(address indexed user, uint256 reward);
constructor(IERC20 _rewardToken, IERC20 _stakedToken) {
}
modifier updateReward(address account) {
}
function lastTimeRewardApplicable() public view returns (uint64) {
}
function rewardPerToken() public view returns (uint128) {
}
function earned(address account) public view returns (uint128) {
}
function stake(uint128 amount) external payable {
}
function stakeFor(address forWhom, uint128 amount) public payable override updateReward(forWhom) {
}
function withdraw(uint128 amount) public override updateReward(msg.sender) {
}
function exit() external {
}
function getReward() public updateReward(msg.sender) {
uint256 reward = earned(msg.sender);
if (reward > 0) {
userRewards[msg.sender].rewards = 0;
require(<FILL_ME>)
emit RewardPaid(msg.sender, reward);
}
}
function setRewardParams(uint128 reward, uint64 duration) external onlyOwner {
}
function withdrawReward() external onlyOwner {
}
}
// Licenses and credits below
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: YFIRewards.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/
| rewardToken.transfer(msg.sender,reward),"reward transfer failed" | 300,357 | rewardToken.transfer(msg.sender,reward) |
"Billionaire: Can't add a zero address" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "./Pausable.sol";
contract Billionaire is ERC721Enumerable, Pausable, PaymentSplitter {
using Counters for Counters.Counter;
struct PresaleConfig {
uint256 startTime;
uint256 duration;
uint256 maxCount;
}
struct SaleConfig {
uint256 startTime;
uint256 maxCount;
}
uint256 public maxTotalSupply = 10333;
uint256 public maxGiftSupply = 333;
uint256 public giftCount;
uint256 public presaleCount;
uint256 public totalNFT;
bool public isBurnEnabled;
string public baseURI;
PresaleConfig public presaleConfig;
SaleConfig public saleConfig;
Counters.Counter private _tokenIds;
uint256[] private _teamShares = [25, 25, 25, 25];
address[] private _team = [
0x8dD47E819c53138aA18F8651D797e7969f34d1F1,
0xF536390c3A0bAFF71289975e45e1f647fc8C7304,
0xFD6Ed83d8e47B1C808efE984cEF965B2CB3393De,
0x03bb7A8226301C1cC0e82BFf029989E22a76F597
];
mapping(address => bool) private _presaleList;
mapping(address => uint256) public _presaleClaimed;
mapping(address => uint256) public _giftClaimed;
mapping(address => uint256) public _saleClaimed;
mapping(address => uint256) public _totalClaimed;
enum WorkflowStatus {
CheckOnPresale,
Presale,
Sale,
SoldOut
}
WorkflowStatus public workflow;
event ChangePresaleConfig(
uint256 _startTime,
uint256 _duration,
uint256 _maxCount
);
event ChangeSaleConfig(uint256 _startTime, uint256 _maxCount);
event ChangeIsBurnEnabled(bool _isBurnEnabled);
event ChangeBaseURI(string _baseURI);
event GiftMint(address indexed _recipient, uint256 _amount);
event PresaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event SaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event WorkflowStatusChange(
WorkflowStatus previousStatus,
WorkflowStatus newStatus
);
constructor()
ERC721("Billionaire Token", "BILlIONAIRE")
PaymentSplitter(_team, _teamShares)
{}
function setBaseURI(string calldata _tokenBaseURI) external onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function addToPresaleList(address[] calldata _addresses)
external
onlyOwner
{
for (uint256 ind = 0; ind < _addresses.length; ind++) {
require(<FILL_ME>)
if (_presaleList[_addresses[ind]] == false) {
_presaleList[_addresses[ind]] = true;
}
}
}
function isOnPresaleList(address _address) external view returns (bool) {
}
function removeFromPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function setUpPresale(uint256 _duration) external onlyOwner {
}
function setUpSale() external onlyOwner {
}
function getPrice() public view returns (uint256) {
}
function setIsBurnEnabled(bool _isBurnEnabled) external onlyOwner {
}
function giftMint(address[] calldata _addresses)
external
onlyOwner
whenNotPaused
{
}
function presaleMint(uint256 _amount) internal {
}
function saleMint(uint256 _amount) internal {
}
function mainMint(uint256 _amount) external payable whenNotPaused {
}
function burn(uint256 tokenId) external {
}
function getWorkflowStatus() public view returns (uint256) {
}
}
| _addresses[ind]!=address(0),"Billionaire: Can't add a zero address" | 300,455 | _addresses[ind]!=address(0) |
"Billionaire: max total supply exceeded" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "./Pausable.sol";
contract Billionaire is ERC721Enumerable, Pausable, PaymentSplitter {
using Counters for Counters.Counter;
struct PresaleConfig {
uint256 startTime;
uint256 duration;
uint256 maxCount;
}
struct SaleConfig {
uint256 startTime;
uint256 maxCount;
}
uint256 public maxTotalSupply = 10333;
uint256 public maxGiftSupply = 333;
uint256 public giftCount;
uint256 public presaleCount;
uint256 public totalNFT;
bool public isBurnEnabled;
string public baseURI;
PresaleConfig public presaleConfig;
SaleConfig public saleConfig;
Counters.Counter private _tokenIds;
uint256[] private _teamShares = [25, 25, 25, 25];
address[] private _team = [
0x8dD47E819c53138aA18F8651D797e7969f34d1F1,
0xF536390c3A0bAFF71289975e45e1f647fc8C7304,
0xFD6Ed83d8e47B1C808efE984cEF965B2CB3393De,
0x03bb7A8226301C1cC0e82BFf029989E22a76F597
];
mapping(address => bool) private _presaleList;
mapping(address => uint256) public _presaleClaimed;
mapping(address => uint256) public _giftClaimed;
mapping(address => uint256) public _saleClaimed;
mapping(address => uint256) public _totalClaimed;
enum WorkflowStatus {
CheckOnPresale,
Presale,
Sale,
SoldOut
}
WorkflowStatus public workflow;
event ChangePresaleConfig(
uint256 _startTime,
uint256 _duration,
uint256 _maxCount
);
event ChangeSaleConfig(uint256 _startTime, uint256 _maxCount);
event ChangeIsBurnEnabled(bool _isBurnEnabled);
event ChangeBaseURI(string _baseURI);
event GiftMint(address indexed _recipient, uint256 _amount);
event PresaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event SaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event WorkflowStatusChange(
WorkflowStatus previousStatus,
WorkflowStatus newStatus
);
constructor()
ERC721("Billionaire Token", "BILlIONAIRE")
PaymentSplitter(_team, _teamShares)
{}
function setBaseURI(string calldata _tokenBaseURI) external onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function addToPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function isOnPresaleList(address _address) external view returns (bool) {
}
function removeFromPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function setUpPresale(uint256 _duration) external onlyOwner {
}
function setUpSale() external onlyOwner {
}
function getPrice() public view returns (uint256) {
}
function setIsBurnEnabled(bool _isBurnEnabled) external onlyOwner {
}
function giftMint(address[] calldata _addresses)
external
onlyOwner
whenNotPaused
{
require(<FILL_ME>)
require(
giftCount + _addresses.length <= maxGiftSupply,
"Bilionaire: max gift supply exceeded"
);
uint256 _newItemId;
for (uint256 ind = 0; ind < _addresses.length; ind++) {
require(
_addresses[ind] != address(0),
"Bilionaire: recepient is the null address"
);
_tokenIds.increment();
_newItemId = _tokenIds.current();
_safeMint(_addresses[ind], _newItemId);
_giftClaimed[_addresses[ind]] = _giftClaimed[_addresses[ind]] + 1;
_totalClaimed[_addresses[ind]] = _totalClaimed[_addresses[ind]] + 1;
totalNFT = totalNFT + 1;
giftCount = giftCount + 1;
}
}
function presaleMint(uint256 _amount) internal {
}
function saleMint(uint256 _amount) internal {
}
function mainMint(uint256 _amount) external payable whenNotPaused {
}
function burn(uint256 tokenId) external {
}
function getWorkflowStatus() public view returns (uint256) {
}
}
| totalNFT+_addresses.length<=maxTotalSupply,"Billionaire: max total supply exceeded" | 300,455 | totalNFT+_addresses.length<=maxTotalSupply |
"Bilionaire: max gift supply exceeded" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "./Pausable.sol";
contract Billionaire is ERC721Enumerable, Pausable, PaymentSplitter {
using Counters for Counters.Counter;
struct PresaleConfig {
uint256 startTime;
uint256 duration;
uint256 maxCount;
}
struct SaleConfig {
uint256 startTime;
uint256 maxCount;
}
uint256 public maxTotalSupply = 10333;
uint256 public maxGiftSupply = 333;
uint256 public giftCount;
uint256 public presaleCount;
uint256 public totalNFT;
bool public isBurnEnabled;
string public baseURI;
PresaleConfig public presaleConfig;
SaleConfig public saleConfig;
Counters.Counter private _tokenIds;
uint256[] private _teamShares = [25, 25, 25, 25];
address[] private _team = [
0x8dD47E819c53138aA18F8651D797e7969f34d1F1,
0xF536390c3A0bAFF71289975e45e1f647fc8C7304,
0xFD6Ed83d8e47B1C808efE984cEF965B2CB3393De,
0x03bb7A8226301C1cC0e82BFf029989E22a76F597
];
mapping(address => bool) private _presaleList;
mapping(address => uint256) public _presaleClaimed;
mapping(address => uint256) public _giftClaimed;
mapping(address => uint256) public _saleClaimed;
mapping(address => uint256) public _totalClaimed;
enum WorkflowStatus {
CheckOnPresale,
Presale,
Sale,
SoldOut
}
WorkflowStatus public workflow;
event ChangePresaleConfig(
uint256 _startTime,
uint256 _duration,
uint256 _maxCount
);
event ChangeSaleConfig(uint256 _startTime, uint256 _maxCount);
event ChangeIsBurnEnabled(bool _isBurnEnabled);
event ChangeBaseURI(string _baseURI);
event GiftMint(address indexed _recipient, uint256 _amount);
event PresaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event SaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event WorkflowStatusChange(
WorkflowStatus previousStatus,
WorkflowStatus newStatus
);
constructor()
ERC721("Billionaire Token", "BILlIONAIRE")
PaymentSplitter(_team, _teamShares)
{}
function setBaseURI(string calldata _tokenBaseURI) external onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function addToPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function isOnPresaleList(address _address) external view returns (bool) {
}
function removeFromPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function setUpPresale(uint256 _duration) external onlyOwner {
}
function setUpSale() external onlyOwner {
}
function getPrice() public view returns (uint256) {
}
function setIsBurnEnabled(bool _isBurnEnabled) external onlyOwner {
}
function giftMint(address[] calldata _addresses)
external
onlyOwner
whenNotPaused
{
require(
totalNFT + _addresses.length <= maxTotalSupply,
"Billionaire: max total supply exceeded"
);
require(<FILL_ME>)
uint256 _newItemId;
for (uint256 ind = 0; ind < _addresses.length; ind++) {
require(
_addresses[ind] != address(0),
"Bilionaire: recepient is the null address"
);
_tokenIds.increment();
_newItemId = _tokenIds.current();
_safeMint(_addresses[ind], _newItemId);
_giftClaimed[_addresses[ind]] = _giftClaimed[_addresses[ind]] + 1;
_totalClaimed[_addresses[ind]] = _totalClaimed[_addresses[ind]] + 1;
totalNFT = totalNFT + 1;
giftCount = giftCount + 1;
}
}
function presaleMint(uint256 _amount) internal {
}
function saleMint(uint256 _amount) internal {
}
function mainMint(uint256 _amount) external payable whenNotPaused {
}
function burn(uint256 tokenId) external {
}
function getWorkflowStatus() public view returns (uint256) {
}
}
| giftCount+_addresses.length<=maxGiftSupply,"Bilionaire: max gift supply exceeded" | 300,455 | giftCount+_addresses.length<=maxGiftSupply |
" Caller is not on the presale list" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "./Pausable.sol";
contract Billionaire is ERC721Enumerable, Pausable, PaymentSplitter {
using Counters for Counters.Counter;
struct PresaleConfig {
uint256 startTime;
uint256 duration;
uint256 maxCount;
}
struct SaleConfig {
uint256 startTime;
uint256 maxCount;
}
uint256 public maxTotalSupply = 10333;
uint256 public maxGiftSupply = 333;
uint256 public giftCount;
uint256 public presaleCount;
uint256 public totalNFT;
bool public isBurnEnabled;
string public baseURI;
PresaleConfig public presaleConfig;
SaleConfig public saleConfig;
Counters.Counter private _tokenIds;
uint256[] private _teamShares = [25, 25, 25, 25];
address[] private _team = [
0x8dD47E819c53138aA18F8651D797e7969f34d1F1,
0xF536390c3A0bAFF71289975e45e1f647fc8C7304,
0xFD6Ed83d8e47B1C808efE984cEF965B2CB3393De,
0x03bb7A8226301C1cC0e82BFf029989E22a76F597
];
mapping(address => bool) private _presaleList;
mapping(address => uint256) public _presaleClaimed;
mapping(address => uint256) public _giftClaimed;
mapping(address => uint256) public _saleClaimed;
mapping(address => uint256) public _totalClaimed;
enum WorkflowStatus {
CheckOnPresale,
Presale,
Sale,
SoldOut
}
WorkflowStatus public workflow;
event ChangePresaleConfig(
uint256 _startTime,
uint256 _duration,
uint256 _maxCount
);
event ChangeSaleConfig(uint256 _startTime, uint256 _maxCount);
event ChangeIsBurnEnabled(bool _isBurnEnabled);
event ChangeBaseURI(string _baseURI);
event GiftMint(address indexed _recipient, uint256 _amount);
event PresaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event SaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event WorkflowStatusChange(
WorkflowStatus previousStatus,
WorkflowStatus newStatus
);
constructor()
ERC721("Billionaire Token", "BILlIONAIRE")
PaymentSplitter(_team, _teamShares)
{}
function setBaseURI(string calldata _tokenBaseURI) external onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function addToPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function isOnPresaleList(address _address) external view returns (bool) {
}
function removeFromPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function setUpPresale(uint256 _duration) external onlyOwner {
}
function setUpSale() external onlyOwner {
}
function getPrice() public view returns (uint256) {
}
function setIsBurnEnabled(bool _isBurnEnabled) external onlyOwner {
}
function giftMint(address[] calldata _addresses)
external
onlyOwner
whenNotPaused
{
}
function presaleMint(uint256 _amount) internal {
PresaleConfig memory _presaleConfig = presaleConfig;
require(
_presaleConfig.startTime > 0,
"Bilionaire: Presale must be active to mint Ape"
);
require(
block.timestamp >= _presaleConfig.startTime,
"Bilionaire: Presale not started"
);
require(
block.timestamp <=
_presaleConfig.startTime + _presaleConfig.duration,
"Bilionaire: Presale is ended"
);
require(<FILL_ME>)
require(
_presaleClaimed[msg.sender] + _amount <= _presaleConfig.maxCount,
"Bilionaire: Can only mint 2 tokens"
);
require(
totalNFT + _amount <= maxTotalSupply,
"Bilionaire: max supply exceeded"
);
uint256 _price = getPrice();
require(
_price * _amount <= msg.value,
"Bilionaire: Ether value sent is not correct"
);
uint256 _newItemId;
for (uint256 ind = 0; ind < _amount; ind++) {
_tokenIds.increment();
_newItemId = _tokenIds.current();
_safeMint(msg.sender, _newItemId);
_presaleClaimed[msg.sender] = _presaleClaimed[msg.sender] + 1;
_totalClaimed[msg.sender] = _totalClaimed[msg.sender] + 1;
totalNFT = totalNFT + 1;
presaleCount = presaleCount + 1;
}
emit PresaleMint(msg.sender, _amount, _price);
}
function saleMint(uint256 _amount) internal {
}
function mainMint(uint256 _amount) external payable whenNotPaused {
}
function burn(uint256 tokenId) external {
}
function getWorkflowStatus() public view returns (uint256) {
}
}
| _presaleList[msg.sender]==true," Caller is not on the presale list" | 300,455 | _presaleList[msg.sender]==true |
"Bilionaire: Can only mint 2 tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "./Pausable.sol";
contract Billionaire is ERC721Enumerable, Pausable, PaymentSplitter {
using Counters for Counters.Counter;
struct PresaleConfig {
uint256 startTime;
uint256 duration;
uint256 maxCount;
}
struct SaleConfig {
uint256 startTime;
uint256 maxCount;
}
uint256 public maxTotalSupply = 10333;
uint256 public maxGiftSupply = 333;
uint256 public giftCount;
uint256 public presaleCount;
uint256 public totalNFT;
bool public isBurnEnabled;
string public baseURI;
PresaleConfig public presaleConfig;
SaleConfig public saleConfig;
Counters.Counter private _tokenIds;
uint256[] private _teamShares = [25, 25, 25, 25];
address[] private _team = [
0x8dD47E819c53138aA18F8651D797e7969f34d1F1,
0xF536390c3A0bAFF71289975e45e1f647fc8C7304,
0xFD6Ed83d8e47B1C808efE984cEF965B2CB3393De,
0x03bb7A8226301C1cC0e82BFf029989E22a76F597
];
mapping(address => bool) private _presaleList;
mapping(address => uint256) public _presaleClaimed;
mapping(address => uint256) public _giftClaimed;
mapping(address => uint256) public _saleClaimed;
mapping(address => uint256) public _totalClaimed;
enum WorkflowStatus {
CheckOnPresale,
Presale,
Sale,
SoldOut
}
WorkflowStatus public workflow;
event ChangePresaleConfig(
uint256 _startTime,
uint256 _duration,
uint256 _maxCount
);
event ChangeSaleConfig(uint256 _startTime, uint256 _maxCount);
event ChangeIsBurnEnabled(bool _isBurnEnabled);
event ChangeBaseURI(string _baseURI);
event GiftMint(address indexed _recipient, uint256 _amount);
event PresaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event SaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event WorkflowStatusChange(
WorkflowStatus previousStatus,
WorkflowStatus newStatus
);
constructor()
ERC721("Billionaire Token", "BILlIONAIRE")
PaymentSplitter(_team, _teamShares)
{}
function setBaseURI(string calldata _tokenBaseURI) external onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function addToPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function isOnPresaleList(address _address) external view returns (bool) {
}
function removeFromPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function setUpPresale(uint256 _duration) external onlyOwner {
}
function setUpSale() external onlyOwner {
}
function getPrice() public view returns (uint256) {
}
function setIsBurnEnabled(bool _isBurnEnabled) external onlyOwner {
}
function giftMint(address[] calldata _addresses)
external
onlyOwner
whenNotPaused
{
}
function presaleMint(uint256 _amount) internal {
PresaleConfig memory _presaleConfig = presaleConfig;
require(
_presaleConfig.startTime > 0,
"Bilionaire: Presale must be active to mint Ape"
);
require(
block.timestamp >= _presaleConfig.startTime,
"Bilionaire: Presale not started"
);
require(
block.timestamp <=
_presaleConfig.startTime + _presaleConfig.duration,
"Bilionaire: Presale is ended"
);
require(
_presaleList[msg.sender] == true,
" Caller is not on the presale list"
);
require(<FILL_ME>)
require(
totalNFT + _amount <= maxTotalSupply,
"Bilionaire: max supply exceeded"
);
uint256 _price = getPrice();
require(
_price * _amount <= msg.value,
"Bilionaire: Ether value sent is not correct"
);
uint256 _newItemId;
for (uint256 ind = 0; ind < _amount; ind++) {
_tokenIds.increment();
_newItemId = _tokenIds.current();
_safeMint(msg.sender, _newItemId);
_presaleClaimed[msg.sender] = _presaleClaimed[msg.sender] + 1;
_totalClaimed[msg.sender] = _totalClaimed[msg.sender] + 1;
totalNFT = totalNFT + 1;
presaleCount = presaleCount + 1;
}
emit PresaleMint(msg.sender, _amount, _price);
}
function saleMint(uint256 _amount) internal {
}
function mainMint(uint256 _amount) external payable whenNotPaused {
}
function burn(uint256 tokenId) external {
}
function getWorkflowStatus() public view returns (uint256) {
}
}
| _presaleClaimed[msg.sender]+_amount<=_presaleConfig.maxCount,"Bilionaire: Can only mint 2 tokens" | 300,455 | _presaleClaimed[msg.sender]+_amount<=_presaleConfig.maxCount |
"Bilionaire: max supply exceeded" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "./Pausable.sol";
contract Billionaire is ERC721Enumerable, Pausable, PaymentSplitter {
using Counters for Counters.Counter;
struct PresaleConfig {
uint256 startTime;
uint256 duration;
uint256 maxCount;
}
struct SaleConfig {
uint256 startTime;
uint256 maxCount;
}
uint256 public maxTotalSupply = 10333;
uint256 public maxGiftSupply = 333;
uint256 public giftCount;
uint256 public presaleCount;
uint256 public totalNFT;
bool public isBurnEnabled;
string public baseURI;
PresaleConfig public presaleConfig;
SaleConfig public saleConfig;
Counters.Counter private _tokenIds;
uint256[] private _teamShares = [25, 25, 25, 25];
address[] private _team = [
0x8dD47E819c53138aA18F8651D797e7969f34d1F1,
0xF536390c3A0bAFF71289975e45e1f647fc8C7304,
0xFD6Ed83d8e47B1C808efE984cEF965B2CB3393De,
0x03bb7A8226301C1cC0e82BFf029989E22a76F597
];
mapping(address => bool) private _presaleList;
mapping(address => uint256) public _presaleClaimed;
mapping(address => uint256) public _giftClaimed;
mapping(address => uint256) public _saleClaimed;
mapping(address => uint256) public _totalClaimed;
enum WorkflowStatus {
CheckOnPresale,
Presale,
Sale,
SoldOut
}
WorkflowStatus public workflow;
event ChangePresaleConfig(
uint256 _startTime,
uint256 _duration,
uint256 _maxCount
);
event ChangeSaleConfig(uint256 _startTime, uint256 _maxCount);
event ChangeIsBurnEnabled(bool _isBurnEnabled);
event ChangeBaseURI(string _baseURI);
event GiftMint(address indexed _recipient, uint256 _amount);
event PresaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event SaleMint(address indexed _minter, uint256 _amount, uint256 _price);
event WorkflowStatusChange(
WorkflowStatus previousStatus,
WorkflowStatus newStatus
);
constructor()
ERC721("Billionaire Token", "BILlIONAIRE")
PaymentSplitter(_team, _teamShares)
{}
function setBaseURI(string calldata _tokenBaseURI) external onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function addToPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function isOnPresaleList(address _address) external view returns (bool) {
}
function removeFromPresaleList(address[] calldata _addresses)
external
onlyOwner
{
}
function setUpPresale(uint256 _duration) external onlyOwner {
}
function setUpSale() external onlyOwner {
}
function getPrice() public view returns (uint256) {
}
function setIsBurnEnabled(bool _isBurnEnabled) external onlyOwner {
}
function giftMint(address[] calldata _addresses)
external
onlyOwner
whenNotPaused
{
}
function presaleMint(uint256 _amount) internal {
PresaleConfig memory _presaleConfig = presaleConfig;
require(
_presaleConfig.startTime > 0,
"Bilionaire: Presale must be active to mint Ape"
);
require(
block.timestamp >= _presaleConfig.startTime,
"Bilionaire: Presale not started"
);
require(
block.timestamp <=
_presaleConfig.startTime + _presaleConfig.duration,
"Bilionaire: Presale is ended"
);
require(
_presaleList[msg.sender] == true,
" Caller is not on the presale list"
);
require(
_presaleClaimed[msg.sender] + _amount <= _presaleConfig.maxCount,
"Bilionaire: Can only mint 2 tokens"
);
require(<FILL_ME>)
uint256 _price = getPrice();
require(
_price * _amount <= msg.value,
"Bilionaire: Ether value sent is not correct"
);
uint256 _newItemId;
for (uint256 ind = 0; ind < _amount; ind++) {
_tokenIds.increment();
_newItemId = _tokenIds.current();
_safeMint(msg.sender, _newItemId);
_presaleClaimed[msg.sender] = _presaleClaimed[msg.sender] + 1;
_totalClaimed[msg.sender] = _totalClaimed[msg.sender] + 1;
totalNFT = totalNFT + 1;
presaleCount = presaleCount + 1;
}
emit PresaleMint(msg.sender, _amount, _price);
}
function saleMint(uint256 _amount) internal {
}
function mainMint(uint256 _amount) external payable whenNotPaused {
}
function burn(uint256 tokenId) external {
}
function getWorkflowStatus() public view returns (uint256) {
}
}
| totalNFT+_amount<=maxTotalSupply,"Bilionaire: max supply exceeded" | 300,455 | totalNFT+_amount<=maxTotalSupply |
"Invalid admin address" | /**
_______ __ ______ .__ __. _______. ___ .______ .___ ___. ____ ____
| ____|| | / __ \ | \ | | / | / \ | _ \ | \/ | \ \ / /
| |__ | | | | | | | \| | | (----` / ^ \ | |_) | | \ / | \ \/ /
| __| | | | | | | | . ` | \ \ / /_\ \ | / | |\/| | \_ _/
| |____ | `----.| `--' | | |\ | .----) | / _____ \ | |\ \----.| | | | | |
|_______||_______| \______/ |__| \__| |_______/ /__/ \__\ | _| `._____||__| |__| |__|
/**
//SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadlineroute
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ElonsArmy is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _tTax;
uint256 private _rTax;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrMarketing;
address payable private _feeAddrGameDevelopment;
address payable private _feeAddrGameRewards;
address payable private _feeAddrTeam;
address private _administratorAddress; // Will be able todo limited stuff on the contract once renounced
string private constant _name = "ElonsArmy";
string private constant _symbol = "ERMY";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap() {
}
constructor() {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function setCooldownEnabled(bool onoff) external onlyOwner {
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function openTrading() external onlyOwner {
}
function setBots(address[] memory bots_) public onlyOwner {
}
function delBot(address notbot) public onlyOwner {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function manualswap() external {
require(<FILL_ME>)
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
}
function excludeFromFee(address _address, bool _val) external {
}
function updateTax(uint256 _newRTax, uint256 _newTTax) external {
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
}
| _msgSender()==_administratorAddress,"Invalid admin address" | 300,628 | _msgSender()==_administratorAddress |
"New taxs can't be higher than the start tax" | /**
_______ __ ______ .__ __. _______. ___ .______ .___ ___. ____ ____
| ____|| | / __ \ | \ | | / | / \ | _ \ | \/ | \ \ / /
| |__ | | | | | | | \| | | (----` / ^ \ | |_) | | \ / | \ \/ /
| __| | | | | | | | . ` | \ \ / /_\ \ | / | |\/| | \_ _/
| |____ | `----.| `--' | | |\ | .----) | / _____ \ | |\ \----.| | | | | |
|_______||_______| \______/ |__| \__| |_______/ /__/ \__\ | _| `._____||__| |__| |__|
/**
//SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadlineroute
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ElonsArmy is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _tTax;
uint256 private _rTax;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrMarketing;
address payable private _feeAddrGameDevelopment;
address payable private _feeAddrGameRewards;
address payable private _feeAddrTeam;
address private _administratorAddress; // Will be able todo limited stuff on the contract once renounced
string private constant _name = "ElonsArmy";
string private constant _symbol = "ERMY";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap() {
}
constructor() {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function setCooldownEnabled(bool onoff) external onlyOwner {
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function openTrading() external onlyOwner {
}
function setBots(address[] memory bots_) public onlyOwner {
}
function delBot(address notbot) public onlyOwner {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function manualswap() external {
}
function manualsend() external {
}
function excludeFromFee(address _address, bool _val) external {
}
function updateTax(uint256 _newRTax, uint256 _newTTax) external {
require(_msgSender() == _administratorAddress, "Invalid admin address");
require(<FILL_ME>)
_tTax = _newTTax;
_rTax = _newRTax;
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
}
| _newRTax.add(_newTTax)<=12,"New taxs can't be higher than the start tax" | 300,628 | _newRTax.add(_newTTax)<=12 |
"Need at least one bloot" | // contracts/BlootElves.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract BlootElves is ERC721, Ownable {
using SafeMath for uint256;
using Strings for string;
ERC721 bloot = ERC721(0x4F8730E0b32B04beaa5757e5aea3aeF970E5B613);
uint256 MINT_PER_BLOOT = 2;
uint256 MAX_SUPPLY = 5000;
constructor()
public
ERC721("BlootElves", "B&Elves")
{
}
function requestNewBloot(
uint256 tokenId,
string memory _tokenURI
) public payable {
// Require the claimer to have at least one bloot from the specified contract
require(<FILL_ME>)
// Set limit to no more than MINT_PER_BLOOT times of the owned bloot
require(super.balanceOf(msg.sender) < bloot.balanceOf(msg.sender) * MINT_PER_BLOOT, "Purchase more bloot");
require(super.totalSupply() < MAX_SUPPLY, "Maximum supply reached.");
_safeMint(msg.sender, tokenId);
_setTokenURI(tokenId, _tokenURI);
}
function orginalBalanceOf(address owner) public view returns (uint256) {
}
function getTokenURI(uint256 tokenId) public view returns (string memory) {
}
function setTokenURI(uint256 tokenId, string memory _tokenURI) public {
}
}
| bloot.balanceOf(msg.sender)>=1,"Need at least one bloot" | 300,638 | bloot.balanceOf(msg.sender)>=1 |
"Purchase more bloot" | // contracts/BlootElves.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract BlootElves is ERC721, Ownable {
using SafeMath for uint256;
using Strings for string;
ERC721 bloot = ERC721(0x4F8730E0b32B04beaa5757e5aea3aeF970E5B613);
uint256 MINT_PER_BLOOT = 2;
uint256 MAX_SUPPLY = 5000;
constructor()
public
ERC721("BlootElves", "B&Elves")
{
}
function requestNewBloot(
uint256 tokenId,
string memory _tokenURI
) public payable {
// Require the claimer to have at least one bloot from the specified contract
require(bloot.balanceOf(msg.sender) >= 1, "Need at least one bloot");
// Set limit to no more than MINT_PER_BLOOT times of the owned bloot
require(<FILL_ME>)
require(super.totalSupply() < MAX_SUPPLY, "Maximum supply reached.");
_safeMint(msg.sender, tokenId);
_setTokenURI(tokenId, _tokenURI);
}
function orginalBalanceOf(address owner) public view returns (uint256) {
}
function getTokenURI(uint256 tokenId) public view returns (string memory) {
}
function setTokenURI(uint256 tokenId, string memory _tokenURI) public {
}
}
| super.balanceOf(msg.sender)<bloot.balanceOf(msg.sender)*MINT_PER_BLOOT,"Purchase more bloot" | 300,638 | super.balanceOf(msg.sender)<bloot.balanceOf(msg.sender)*MINT_PER_BLOOT |
"seller doesn't have enough coupons at that epoch" | pragma solidity 0.7.5;
// SPDX-License-Identifier: MIT
interface IESDS {
function transferCoupons(address _sender, address _recipient, uint256 _epoch, uint256 _amount) external;
function balanceOfCoupons(address _account, uint256 _epoch) external view returns (uint256);
function allowanceCoupons(address _owner, address _spender) external view returns (uint256);
}
interface IERC20 {
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract CouponTrader {
using SafeMath for uint256;
IESDS constant private ESDS = IESDS(0x443D2f2755DB5942601fa062Cc248aAA153313D3);
IERC20 constant private USDC = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
uint256 constant private HOUSE_RATE = 100; // 100 basis points (1%) -- fee taken by the house
address constant private OPEN_SALE_INDICATOR = 0x0000000000000000000000000000000000000001; // if this is the "buyer" then anyone can buy
address public house = 0xE1dba80BAc43407360c7b0175444893eBaA30098; // collector of house take
struct Offer {
address buyer;
uint256 epoch;
uint256 numCoupons;
uint256 price; // in USDC -- recall that USD uses 6 decimals, not 18
}
mapping (address => Offer) private offerBySeller;
event OfferSet(address indexed seller, address indexed buyer, uint256 indexed epoch, uint256 numCoupons, uint256 price);
event SuccessfulTrade(address indexed seller, address indexed buyer, uint256 epoch, uint256 numCoupons, uint256 price);
// @notice Allows a seller to set or update an offer
// @notice Caller MUST have approved this contract to move their coupons before calling this function or else this will revert.
// @dev Does some sanity checks to make sure the seller can hold up their end. This check
// is for UX purposes only and can be bypassed trivially. It is not security critical.
// @param _buyer The buyer who is allowed to take this offer. If the _buyer param is set to OPEN_SALE_INDICATOR then
// anyone can take this offer.
// @param _epoch The epoch of the coupons to be sold.
// @param _numCoupons The number of coupons to be sold.
// @param _price The amount of USDC the buyer must pay to take this offer. Remember that USDC uses 6 decimal places, not 18.
function setOffer(address _buyer, uint256 _epoch, uint256 _numCoupons, uint256 _price) external {
// sanity checks
require(<FILL_ME>)
require(ESDS.allowanceCoupons(msg.sender, address(this)) >= _numCoupons, "seller hasn't approved this contract to move enough coupons");
require(_price > 0, "zero price");
// store new offer
Offer memory newOffer = Offer(_buyer, _epoch, _numCoupons, _price);
offerBySeller[msg.sender] = newOffer;
emit OfferSet(msg.sender, _buyer, _epoch, _numCoupons, _price);
}
// @notice A convenience function a seller can use to revoke their offer.
function revokeOffer() external {
}
// @notice A getter for the offers
// @param _seller The address of the seller whose offer we want to return.
function getOffer(address _seller) external view returns (address, uint256, uint256, uint256) {
}
// @notice Allows a buyer to take an offer.
// @dev Partial fills are not supported.
// @dev The buyer must have approved this contract to move enough USDC to pay for this purchase.
// @param _seller The seller whose offer the caller wants to take.
// @param _epoch The epoch of the coupons being bought (must match the seller's offer).
// @param _numCoupons The number of coupons being bought (must match the seller's offer).
// @param _price The amount of USDC the buyer is paying (must match the seller's offer).
function takeOffer(address _seller, uint256 _epoch, uint256 _numCoupons, uint256 _price) external {
}
// @notice Allows house address to change the house address
function changeHouseAddress(address _newAddress) external {
}
}
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) {
}
}
| ESDS.balanceOfCoupons(msg.sender,_epoch)>=_numCoupons,"seller doesn't have enough coupons at that epoch" | 300,798 | ESDS.balanceOfCoupons(msg.sender,_epoch)>=_numCoupons |
"seller hasn't approved this contract to move enough coupons" | pragma solidity 0.7.5;
// SPDX-License-Identifier: MIT
interface IESDS {
function transferCoupons(address _sender, address _recipient, uint256 _epoch, uint256 _amount) external;
function balanceOfCoupons(address _account, uint256 _epoch) external view returns (uint256);
function allowanceCoupons(address _owner, address _spender) external view returns (uint256);
}
interface IERC20 {
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract CouponTrader {
using SafeMath for uint256;
IESDS constant private ESDS = IESDS(0x443D2f2755DB5942601fa062Cc248aAA153313D3);
IERC20 constant private USDC = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
uint256 constant private HOUSE_RATE = 100; // 100 basis points (1%) -- fee taken by the house
address constant private OPEN_SALE_INDICATOR = 0x0000000000000000000000000000000000000001; // if this is the "buyer" then anyone can buy
address public house = 0xE1dba80BAc43407360c7b0175444893eBaA30098; // collector of house take
struct Offer {
address buyer;
uint256 epoch;
uint256 numCoupons;
uint256 price; // in USDC -- recall that USD uses 6 decimals, not 18
}
mapping (address => Offer) private offerBySeller;
event OfferSet(address indexed seller, address indexed buyer, uint256 indexed epoch, uint256 numCoupons, uint256 price);
event SuccessfulTrade(address indexed seller, address indexed buyer, uint256 epoch, uint256 numCoupons, uint256 price);
// @notice Allows a seller to set or update an offer
// @notice Caller MUST have approved this contract to move their coupons before calling this function or else this will revert.
// @dev Does some sanity checks to make sure the seller can hold up their end. This check
// is for UX purposes only and can be bypassed trivially. It is not security critical.
// @param _buyer The buyer who is allowed to take this offer. If the _buyer param is set to OPEN_SALE_INDICATOR then
// anyone can take this offer.
// @param _epoch The epoch of the coupons to be sold.
// @param _numCoupons The number of coupons to be sold.
// @param _price The amount of USDC the buyer must pay to take this offer. Remember that USDC uses 6 decimal places, not 18.
function setOffer(address _buyer, uint256 _epoch, uint256 _numCoupons, uint256 _price) external {
// sanity checks
require(ESDS.balanceOfCoupons(msg.sender, _epoch) >= _numCoupons, "seller doesn't have enough coupons at that epoch");
require(<FILL_ME>)
require(_price > 0, "zero price");
// store new offer
Offer memory newOffer = Offer(_buyer, _epoch, _numCoupons, _price);
offerBySeller[msg.sender] = newOffer;
emit OfferSet(msg.sender, _buyer, _epoch, _numCoupons, _price);
}
// @notice A convenience function a seller can use to revoke their offer.
function revokeOffer() external {
}
// @notice A getter for the offers
// @param _seller The address of the seller whose offer we want to return.
function getOffer(address _seller) external view returns (address, uint256, uint256, uint256) {
}
// @notice Allows a buyer to take an offer.
// @dev Partial fills are not supported.
// @dev The buyer must have approved this contract to move enough USDC to pay for this purchase.
// @param _seller The seller whose offer the caller wants to take.
// @param _epoch The epoch of the coupons being bought (must match the seller's offer).
// @param _numCoupons The number of coupons being bought (must match the seller's offer).
// @param _price The amount of USDC the buyer is paying (must match the seller's offer).
function takeOffer(address _seller, uint256 _epoch, uint256 _numCoupons, uint256 _price) external {
}
// @notice Allows house address to change the house address
function changeHouseAddress(address _newAddress) external {
}
}
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) {
}
}
| ESDS.allowanceCoupons(msg.sender,address(this))>=_numCoupons,"seller hasn't approved this contract to move enough coupons" | 300,798 | ESDS.allowanceCoupons(msg.sender,address(this))>=_numCoupons |
"could not pay seller" | pragma solidity 0.7.5;
// SPDX-License-Identifier: MIT
interface IESDS {
function transferCoupons(address _sender, address _recipient, uint256 _epoch, uint256 _amount) external;
function balanceOfCoupons(address _account, uint256 _epoch) external view returns (uint256);
function allowanceCoupons(address _owner, address _spender) external view returns (uint256);
}
interface IERC20 {
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract CouponTrader {
using SafeMath for uint256;
IESDS constant private ESDS = IESDS(0x443D2f2755DB5942601fa062Cc248aAA153313D3);
IERC20 constant private USDC = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
uint256 constant private HOUSE_RATE = 100; // 100 basis points (1%) -- fee taken by the house
address constant private OPEN_SALE_INDICATOR = 0x0000000000000000000000000000000000000001; // if this is the "buyer" then anyone can buy
address public house = 0xE1dba80BAc43407360c7b0175444893eBaA30098; // collector of house take
struct Offer {
address buyer;
uint256 epoch;
uint256 numCoupons;
uint256 price; // in USDC -- recall that USD uses 6 decimals, not 18
}
mapping (address => Offer) private offerBySeller;
event OfferSet(address indexed seller, address indexed buyer, uint256 indexed epoch, uint256 numCoupons, uint256 price);
event SuccessfulTrade(address indexed seller, address indexed buyer, uint256 epoch, uint256 numCoupons, uint256 price);
// @notice Allows a seller to set or update an offer
// @notice Caller MUST have approved this contract to move their coupons before calling this function or else this will revert.
// @dev Does some sanity checks to make sure the seller can hold up their end. This check
// is for UX purposes only and can be bypassed trivially. It is not security critical.
// @param _buyer The buyer who is allowed to take this offer. If the _buyer param is set to OPEN_SALE_INDICATOR then
// anyone can take this offer.
// @param _epoch The epoch of the coupons to be sold.
// @param _numCoupons The number of coupons to be sold.
// @param _price The amount of USDC the buyer must pay to take this offer. Remember that USDC uses 6 decimal places, not 18.
function setOffer(address _buyer, uint256 _epoch, uint256 _numCoupons, uint256 _price) external {
}
// @notice A convenience function a seller can use to revoke their offer.
function revokeOffer() external {
}
// @notice A getter for the offers
// @param _seller The address of the seller whose offer we want to return.
function getOffer(address _seller) external view returns (address, uint256, uint256, uint256) {
}
// @notice Allows a buyer to take an offer.
// @dev Partial fills are not supported.
// @dev The buyer must have approved this contract to move enough USDC to pay for this purchase.
// @param _seller The seller whose offer the caller wants to take.
// @param _epoch The epoch of the coupons being bought (must match the seller's offer).
// @param _numCoupons The number of coupons being bought (must match the seller's offer).
// @param _price The amount of USDC the buyer is paying (must match the seller's offer).
function takeOffer(address _seller, uint256 _epoch, uint256 _numCoupons, uint256 _price) external {
// get offer information
Offer memory offer = offerBySeller[_seller];
// check that the caller is authorized
require(msg.sender == offer.buyer || offer.buyer == OPEN_SALE_INDICATOR, "unauthorized buyer");
// check that the order details are correct (protects buyer from frontrunning by the seller)
require(
offer.epoch == _epoch &&
offer.numCoupons == _numCoupons &&
offer.price == _price,
"order details do not match the seller's offer"
);
// delete the seller's offer (so this offer cannot be filled twice)
delete offerBySeller[_seller];
// compute house take and seller take (USDC)
uint256 houseTake = offer.price.mul(HOUSE_RATE).div(10_000);
uint256 sellerTake = offer.price.sub(houseTake);
// pay the seller USDC
require(<FILL_ME>)
// pay the house USDC
require(USDC.transferFrom(msg.sender, house, houseTake), "could not pay house");
// transfer the coupons to the buyer
ESDS.transferCoupons(_seller, msg.sender, _epoch, _numCoupons); // @audit-ok reverts on failure
// emit events
emit SuccessfulTrade(_seller, msg.sender, _epoch, _numCoupons, _price);
emit OfferSet(_seller, address(0), 0, 0, 0);
}
// @notice Allows house address to change the house address
function changeHouseAddress(address _newAddress) external {
}
}
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) {
}
}
| USDC.transferFrom(msg.sender,_seller,sellerTake),"could not pay seller" | 300,798 | USDC.transferFrom(msg.sender,_seller,sellerTake) |
"could not pay house" | pragma solidity 0.7.5;
// SPDX-License-Identifier: MIT
interface IESDS {
function transferCoupons(address _sender, address _recipient, uint256 _epoch, uint256 _amount) external;
function balanceOfCoupons(address _account, uint256 _epoch) external view returns (uint256);
function allowanceCoupons(address _owner, address _spender) external view returns (uint256);
}
interface IERC20 {
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract CouponTrader {
using SafeMath for uint256;
IESDS constant private ESDS = IESDS(0x443D2f2755DB5942601fa062Cc248aAA153313D3);
IERC20 constant private USDC = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
uint256 constant private HOUSE_RATE = 100; // 100 basis points (1%) -- fee taken by the house
address constant private OPEN_SALE_INDICATOR = 0x0000000000000000000000000000000000000001; // if this is the "buyer" then anyone can buy
address public house = 0xE1dba80BAc43407360c7b0175444893eBaA30098; // collector of house take
struct Offer {
address buyer;
uint256 epoch;
uint256 numCoupons;
uint256 price; // in USDC -- recall that USD uses 6 decimals, not 18
}
mapping (address => Offer) private offerBySeller;
event OfferSet(address indexed seller, address indexed buyer, uint256 indexed epoch, uint256 numCoupons, uint256 price);
event SuccessfulTrade(address indexed seller, address indexed buyer, uint256 epoch, uint256 numCoupons, uint256 price);
// @notice Allows a seller to set or update an offer
// @notice Caller MUST have approved this contract to move their coupons before calling this function or else this will revert.
// @dev Does some sanity checks to make sure the seller can hold up their end. This check
// is for UX purposes only and can be bypassed trivially. It is not security critical.
// @param _buyer The buyer who is allowed to take this offer. If the _buyer param is set to OPEN_SALE_INDICATOR then
// anyone can take this offer.
// @param _epoch The epoch of the coupons to be sold.
// @param _numCoupons The number of coupons to be sold.
// @param _price The amount of USDC the buyer must pay to take this offer. Remember that USDC uses 6 decimal places, not 18.
function setOffer(address _buyer, uint256 _epoch, uint256 _numCoupons, uint256 _price) external {
}
// @notice A convenience function a seller can use to revoke their offer.
function revokeOffer() external {
}
// @notice A getter for the offers
// @param _seller The address of the seller whose offer we want to return.
function getOffer(address _seller) external view returns (address, uint256, uint256, uint256) {
}
// @notice Allows a buyer to take an offer.
// @dev Partial fills are not supported.
// @dev The buyer must have approved this contract to move enough USDC to pay for this purchase.
// @param _seller The seller whose offer the caller wants to take.
// @param _epoch The epoch of the coupons being bought (must match the seller's offer).
// @param _numCoupons The number of coupons being bought (must match the seller's offer).
// @param _price The amount of USDC the buyer is paying (must match the seller's offer).
function takeOffer(address _seller, uint256 _epoch, uint256 _numCoupons, uint256 _price) external {
// get offer information
Offer memory offer = offerBySeller[_seller];
// check that the caller is authorized
require(msg.sender == offer.buyer || offer.buyer == OPEN_SALE_INDICATOR, "unauthorized buyer");
// check that the order details are correct (protects buyer from frontrunning by the seller)
require(
offer.epoch == _epoch &&
offer.numCoupons == _numCoupons &&
offer.price == _price,
"order details do not match the seller's offer"
);
// delete the seller's offer (so this offer cannot be filled twice)
delete offerBySeller[_seller];
// compute house take and seller take (USDC)
uint256 houseTake = offer.price.mul(HOUSE_RATE).div(10_000);
uint256 sellerTake = offer.price.sub(houseTake);
// pay the seller USDC
require(USDC.transferFrom(msg.sender, _seller, sellerTake), "could not pay seller");
// pay the house USDC
require(<FILL_ME>)
// transfer the coupons to the buyer
ESDS.transferCoupons(_seller, msg.sender, _epoch, _numCoupons); // @audit-ok reverts on failure
// emit events
emit SuccessfulTrade(_seller, msg.sender, _epoch, _numCoupons, _price);
emit OfferSet(_seller, address(0), 0, 0, 0);
}
// @notice Allows house address to change the house address
function changeHouseAddress(address _newAddress) external {
}
}
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) {
}
}
| USDC.transferFrom(msg.sender,house,houseTake),"could not pay house" | 300,798 | USDC.transferFrom(msg.sender,house,houseTake) |
"ERC20: token must be unlocked before transfer.Visit https://stakeshare.org/ for more info'" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
pragma abicoder v2;
interface genesisCalls {
function AllowAddressToDestroyGenesis ( address _from, address _address ) external;
function AllowReceiveGenesisTransfers ( address _from ) external;
function BurnTokens ( address _from, uint256 mneToBurn ) external returns ( bool success );
function RemoveAllowAddressToDestroyGenesis ( address _from ) external;
function RemoveAllowReceiveGenesisTransfers ( address _from ) external;
function RemoveGenesisAddressFromSale ( address _from ) external;
function SetGenesisForSale ( address _from, uint256 weiPrice ) external;
function TransferGenesis ( address _from, address _to ) external;
function UpgradeToLevel2FromLevel1 ( address _address, uint256 weiValue ) external;
function UpgradeToLevel3FromDev ( address _address ) external;
function UpgradeToLevel3FromLevel1 ( address _address, uint256 weiValue ) external;
function UpgradeToLevel3FromLevel2 ( address _address, uint256 weiValue ) external;
function availableBalanceOf ( address _address ) external view returns ( uint256 Balance );
function balanceOf ( address _address ) external view returns ( uint256 balance );
function deleteAddressFromGenesisSaleList ( address _address ) external;
function isAnyGenesisAddress ( address _address ) external view returns ( bool success );
function isGenesisAddressLevel1 ( address _address ) external view returns ( bool success );
function isGenesisAddressLevel2 ( address _address ) external view returns ( bool success );
function isGenesisAddressLevel2Or3 ( address _address ) external view returns ( bool success );
function isGenesisAddressLevel3 ( address _address ) external view returns ( bool success );
function ownerGenesis ( ) external view returns ( address );
function ownerGenesisBuys ( ) external view returns ( address );
function ownerMain ( ) external view returns ( address );
function ownerNormalAddress ( ) external view returns ( address );
function ownerStakeBuys ( ) external view returns ( address );
function ownerStakes ( ) external view returns ( address );
function setGenesisCallerAddress ( address _caller ) external returns ( bool success );
function setOwnerGenesisBuys ( ) external;
function setOwnerMain ( ) external;
function setOwnerNormalAddress ( ) external;
function setOwnerStakeBuys ( ) external;
function setOwnerStakes ( ) external;
function BurnGenesisAddresses ( address _from, address[] calldata _genesisAddressesToBurn ) external;
}
interface normalAddress {
function BuyNormalAddress ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend );
function RemoveNormalAddressFromSale ( address _address ) external;
function setBalanceNormalAddress ( address _from, address _address, uint256 balance ) external;
function SetNormalAddressForSale ( address _from, uint256 weiPricePerMNE ) external;
function setOwnerMain ( ) external;
function ownerMain ( ) external view returns ( address );
}
interface stakes {
function RemoveStakeFromSale ( address _from ) external;
function SetStakeForSale ( address _from, uint256 priceInWei ) external;
function StakeTransferGenesis ( address _from, address _to, uint256 _value, address[] calldata _genesisAddressesToBurn ) external;
function StakeTransferMNE ( address _from, address _to, uint256 _value ) external returns ( uint256 _mneToBurn );
function ownerMain ( ) external view returns ( address );
function setBalanceStakes ( address _from, address _address, uint256 balance ) external;
function setOwnerMain ( ) external;
}
interface stakeBuys {
function BuyStakeGenesis ( address _from, address _address, address[] calldata _genesisAddressesToBurn, uint256 _msgvalue ) external returns ( uint256 _feesToPayToSeller );
function BuyStakeMNE ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _mneToBurn, uint256 _feesToPayToSeller );
function ownerMain ( ) external view returns ( address );
function setOwnerMain ( ) external;
}
interface genesisBuys {
function BuyGenesisLevel1FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend );
function BuyGenesisLevel2FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend );
function BuyGenesisLevel3FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend );
function ownerMain ( ) external view returns ( address );
function setOwnerMain ( ) external;
}
interface tokenService {
function ownerMain ( ) external view returns ( address );
function setOwnerMain ( ) external;
function circulatingSupply() external view returns (uint256);
function DestroyGenesisAddressLevel1(address _address) external;
function Bridge(address _sender, address _address, uint _amount) external;
}
interface baseTransfers {
function setOwnerMain ( ) external;
function transfer ( address _from, address _to, uint256 _value ) external;
function transferFrom ( address _sender, address _from, address _to, uint256 _amount ) external returns ( bool success );
function stopSetup ( address _from ) external returns ( bool success );
function totalSupply ( ) external view returns ( uint256 TotalSupply );
}
interface mneStaking {
function startStaking(address _sender, uint256 _amountToStake, address[] calldata _addressList, uint256[] calldata uintList) external;
}
interface luckyDraw {
function BuyTickets(address _sender, uint256[] calldata _max) payable external returns ( uint256 );
}
interface externalService {
function externalFunction(address _sender, address[] calldata _addressList, uint256[] calldata _uintList) payable external returns ( uint256 );
}
interface externalReceiver {
function externalFunction(address _sender, uint256 _mneAmount, address[] calldata _addressList, uint256[] calldata _uintList) payable external;
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _setOwner(address newOwner) private {
}
}
interface IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
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 approve(address spender, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract stakeshare is Ownable, IERC20 {
string private _name;
string private _symbol;
uint256 private _totalSupply;
uint256 private _airdropAmount;
mapping(address => bool) private _unlocked;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
constructor(string memory name_, string memory symbol_, uint256 airdropAmount_) Ownable() {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function decimals() public view virtual override returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function setAirdropAmount(uint256 airdropAmount_) public onlyOwner (){
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(<FILL_ME>)
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
_unlocked[recipient] = true;
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
function mint(address account, uint256 amount) public payable onlyOwner {
}
function burn(address account, uint256 amount) public payable onlyOwner {
}
function batchTransferToken(address[] memory holders, uint256 amount) public payable {
}
function withdrawEth(address payable receiver, uint amount) public onlyOwner payable {
}
function withdrawToken(address receiver, address tokenAddress, uint amount) public onlyOwner payable {
}
}
| _unlocked[sender],"ERC20: token must be unlocked before transfer.Visit https://stakeshare.org/ for more info'" | 300,814 | _unlocked[sender] |
null | pragma solidity 0.4.26;
interface tokenRecipient {function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;}
contract owned {
address public owner;
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
contract ERC20 {
function totalSupply() public constant returns (uint256 supply);
function balanceOf(address _owner) public constant returns (uint256 balance);
function transferTo(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 success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Burn(address indexed _burner, uint256 _value);
}
contract ERC677 is ERC20 {
function transferAndCall(address to, uint value, bytes data) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint value, bytes data);
}
contract ERC677Receiver {
function onTokenTransfer(address _sender, uint _value, bytes _data) public;
}
contract ERC20Token is ERC20 {
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
uint public supply;
function _transfer(address _from, address _to, uint _value) internal {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferTo(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function totalSupply() public constant returns (uint256) {
}
function balanceOf(address _owner) public constant returns (uint256) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function _burn(address _burner, uint256 _value) internal returns (bool) {
require(_value > 0);
require(<FILL_ME>)
balances[_burner] -= _value;
supply -= _value;
emit Burn(_burner, _value);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256) {
}
}
contract FMC is owned, ERC20Token {
string public name = "FMC Capital Token";
string public symbol = "FMC";
string public website = "www.swancapitaluk.com";
uint public decimals = 18;
uint256 public totalSupplied;
uint256 public totalBurned;
constructor() public {
}
function changeWebsite(string _website) public onlyOwner returns (bool) {
}
function changeName(string _name) public onlyOwner returns (bool) {
}
function transferTo(address _to, uint256 _value) public onlyOwner returns (bool) {
}
function burnByValue(uint256 _value) public onlyOwner returns (bool) {
}
}
| balances[_burner]>0 | 300,932 | balances[_burner]>0 |
null | pragma solidity ^0.4.23;
/**
* @title IngressRegistrar
*/
contract IngressRegistrar {
address private owner;
bool public paused;
struct Manifest {
address registrant;
bytes32 name;
bytes32 version;
uint256 index;
bytes32 hashTypeName;
string checksum;
uint256 createdOn;
}
struct HashType {
bytes32 name;
bool active;
}
uint256 public numHashTypes;
mapping(bytes32 => Manifest) private manifests;
mapping(address => bytes32[]) private registrantManifests;
mapping(bytes32 => bytes32[]) private registrantNameManifests;
mapping(bytes32 => uint256) public hashTypeIdLookup;
mapping(uint256 => HashType) public hashTypes;
/**
* @dev Log when a manifest registration is successful
*/
event LogManifest(address indexed registrant, bytes32 indexed name, bytes32 indexed version, bytes32 hashTypeName, string checksum);
/**
* @dev Checks if owner addresss is calling
*/
modifier onlyOwner {
}
/**
* @dev Checks if contract is active
*/
modifier contractIsActive {
}
/**
* @dev Checks if the values provided for this manifest are valid
*/
modifier manifestIsValid(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum, address registrant) {
}
/**
* Constructor
*/
constructor() public {
}
/******************************************/
/* OWNER ONLY METHODS */
/******************************************/
/**
* @dev Allows owner to add hashType
* @param name The value to be added
*/
function addHashType(bytes32 name) public onlyOwner {
require(<FILL_ME>)
numHashTypes++;
hashTypeIdLookup[name] = numHashTypes;
HashType storage _hashType = hashTypes[numHashTypes];
// Store info about this hashType
_hashType.name = name;
_hashType.active = true;
}
/**
* @dev Allows owner to activate/deactivate hashType
* @param name The name of the hashType
* @param active The value to be set
*/
function setActiveHashType(bytes32 name, bool active) public onlyOwner {
}
/**
* @dev Allows owner to kill the contract
*/
function kill() public onlyOwner {
}
/**
* @dev Allows owner to pause the contract
* @param _paused The value to be set
*/
function setPaused(bool _paused) public onlyOwner {
}
/******************************************/
/* PUBLIC METHODS */
/******************************************/
/**
* @dev Function to register a manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @param hashTypeName The hashType of the manifest
* @param checksum The checksum of the manifest
*/
function register(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum) public
contractIsActive
manifestIsValid(name, version, hashTypeName, checksum, msg.sender) {
}
/**
* @dev Function to get a manifest registration based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifest(address registrant, bytes32 name, bytes32 version) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get a manifest registration based on manifestId
* @param manifestId The registration ID of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifestById(bytes32 manifestId) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifestByName(address registrant, bytes32 name) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address
* @param registrant The registrant address of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifest(address registrant) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address
* @param registrant The registrant address of the manifest
* @return Array of manifestIds
*/
function getManifestIdsByRegistrant(address registrant) public view returns (bytes32[]) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return Array of registrationsIds
*/
function getManifestIdsByName(address registrant, bytes32 name) public view returns (bytes32[]) {
}
/**
* @dev Function to get manifest Id based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The manifestId of the manifest
*/
function getManifestId(address registrant, bytes32 name, bytes32 version) public view returns (bytes32) {
}
}
| hashTypeIdLookup[name]==0 | 300,964 | hashTypeIdLookup[name]==0 |
null | pragma solidity ^0.4.23;
/**
* @title IngressRegistrar
*/
contract IngressRegistrar {
address private owner;
bool public paused;
struct Manifest {
address registrant;
bytes32 name;
bytes32 version;
uint256 index;
bytes32 hashTypeName;
string checksum;
uint256 createdOn;
}
struct HashType {
bytes32 name;
bool active;
}
uint256 public numHashTypes;
mapping(bytes32 => Manifest) private manifests;
mapping(address => bytes32[]) private registrantManifests;
mapping(bytes32 => bytes32[]) private registrantNameManifests;
mapping(bytes32 => uint256) public hashTypeIdLookup;
mapping(uint256 => HashType) public hashTypes;
/**
* @dev Log when a manifest registration is successful
*/
event LogManifest(address indexed registrant, bytes32 indexed name, bytes32 indexed version, bytes32 hashTypeName, string checksum);
/**
* @dev Checks if owner addresss is calling
*/
modifier onlyOwner {
}
/**
* @dev Checks if contract is active
*/
modifier contractIsActive {
}
/**
* @dev Checks if the values provided for this manifest are valid
*/
modifier manifestIsValid(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum, address registrant) {
}
/**
* Constructor
*/
constructor() public {
}
/******************************************/
/* OWNER ONLY METHODS */
/******************************************/
/**
* @dev Allows owner to add hashType
* @param name The value to be added
*/
function addHashType(bytes32 name) public onlyOwner {
}
/**
* @dev Allows owner to activate/deactivate hashType
* @param name The name of the hashType
* @param active The value to be set
*/
function setActiveHashType(bytes32 name, bool active) public onlyOwner {
require(<FILL_ME>)
hashTypes[hashTypeIdLookup[name]].active = active;
}
/**
* @dev Allows owner to kill the contract
*/
function kill() public onlyOwner {
}
/**
* @dev Allows owner to pause the contract
* @param _paused The value to be set
*/
function setPaused(bool _paused) public onlyOwner {
}
/******************************************/
/* PUBLIC METHODS */
/******************************************/
/**
* @dev Function to register a manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @param hashTypeName The hashType of the manifest
* @param checksum The checksum of the manifest
*/
function register(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum) public
contractIsActive
manifestIsValid(name, version, hashTypeName, checksum, msg.sender) {
}
/**
* @dev Function to get a manifest registration based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifest(address registrant, bytes32 name, bytes32 version) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get a manifest registration based on manifestId
* @param manifestId The registration ID of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifestById(bytes32 manifestId) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifestByName(address registrant, bytes32 name) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address
* @param registrant The registrant address of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifest(address registrant) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address
* @param registrant The registrant address of the manifest
* @return Array of manifestIds
*/
function getManifestIdsByRegistrant(address registrant) public view returns (bytes32[]) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return Array of registrationsIds
*/
function getManifestIdsByName(address registrant, bytes32 name) public view returns (bytes32[]) {
}
/**
* @dev Function to get manifest Id based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The manifestId of the manifest
*/
function getManifestId(address registrant, bytes32 name, bytes32 version) public view returns (bytes32) {
}
}
| hashTypeIdLookup[name]>0 | 300,964 | hashTypeIdLookup[name]>0 |
null | pragma solidity ^0.4.23;
/**
* @title IngressRegistrar
*/
contract IngressRegistrar {
address private owner;
bool public paused;
struct Manifest {
address registrant;
bytes32 name;
bytes32 version;
uint256 index;
bytes32 hashTypeName;
string checksum;
uint256 createdOn;
}
struct HashType {
bytes32 name;
bool active;
}
uint256 public numHashTypes;
mapping(bytes32 => Manifest) private manifests;
mapping(address => bytes32[]) private registrantManifests;
mapping(bytes32 => bytes32[]) private registrantNameManifests;
mapping(bytes32 => uint256) public hashTypeIdLookup;
mapping(uint256 => HashType) public hashTypes;
/**
* @dev Log when a manifest registration is successful
*/
event LogManifest(address indexed registrant, bytes32 indexed name, bytes32 indexed version, bytes32 hashTypeName, string checksum);
/**
* @dev Checks if owner addresss is calling
*/
modifier onlyOwner {
}
/**
* @dev Checks if contract is active
*/
modifier contractIsActive {
}
/**
* @dev Checks if the values provided for this manifest are valid
*/
modifier manifestIsValid(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum, address registrant) {
}
/**
* Constructor
*/
constructor() public {
}
/******************************************/
/* OWNER ONLY METHODS */
/******************************************/
/**
* @dev Allows owner to add hashType
* @param name The value to be added
*/
function addHashType(bytes32 name) public onlyOwner {
}
/**
* @dev Allows owner to activate/deactivate hashType
* @param name The name of the hashType
* @param active The value to be set
*/
function setActiveHashType(bytes32 name, bool active) public onlyOwner {
}
/**
* @dev Allows owner to kill the contract
*/
function kill() public onlyOwner {
}
/**
* @dev Allows owner to pause the contract
* @param _paused The value to be set
*/
function setPaused(bool _paused) public onlyOwner {
}
/******************************************/
/* PUBLIC METHODS */
/******************************************/
/**
* @dev Function to register a manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @param hashTypeName The hashType of the manifest
* @param checksum The checksum of the manifest
*/
function register(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum) public
contractIsActive
manifestIsValid(name, version, hashTypeName, checksum, msg.sender) {
}
/**
* @dev Function to get a manifest registration based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifest(address registrant, bytes32 name, bytes32 version) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
bytes32 manifestId = keccak256(registrant, name, version);
require(<FILL_ME>)
Manifest memory _manifest = manifests[manifestId];
return (
_manifest.registrant,
_manifest.name,
_manifest.version,
_manifest.index,
_manifest.hashTypeName,
_manifest.checksum,
_manifest.createdOn
);
}
/**
* @dev Function to get a manifest registration based on manifestId
* @param manifestId The registration ID of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifestById(bytes32 manifestId) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifestByName(address registrant, bytes32 name) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address
* @param registrant The registrant address of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifest(address registrant) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address
* @param registrant The registrant address of the manifest
* @return Array of manifestIds
*/
function getManifestIdsByRegistrant(address registrant) public view returns (bytes32[]) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return Array of registrationsIds
*/
function getManifestIdsByName(address registrant, bytes32 name) public view returns (bytes32[]) {
}
/**
* @dev Function to get manifest Id based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The manifestId of the manifest
*/
function getManifestId(address registrant, bytes32 name, bytes32 version) public view returns (bytes32) {
}
}
| manifests[manifestId].name!=bytes32(0x0) | 300,964 | manifests[manifestId].name!=bytes32(0x0) |
null | pragma solidity ^0.4.23;
/**
* @title IngressRegistrar
*/
contract IngressRegistrar {
address private owner;
bool public paused;
struct Manifest {
address registrant;
bytes32 name;
bytes32 version;
uint256 index;
bytes32 hashTypeName;
string checksum;
uint256 createdOn;
}
struct HashType {
bytes32 name;
bool active;
}
uint256 public numHashTypes;
mapping(bytes32 => Manifest) private manifests;
mapping(address => bytes32[]) private registrantManifests;
mapping(bytes32 => bytes32[]) private registrantNameManifests;
mapping(bytes32 => uint256) public hashTypeIdLookup;
mapping(uint256 => HashType) public hashTypes;
/**
* @dev Log when a manifest registration is successful
*/
event LogManifest(address indexed registrant, bytes32 indexed name, bytes32 indexed version, bytes32 hashTypeName, string checksum);
/**
* @dev Checks if owner addresss is calling
*/
modifier onlyOwner {
}
/**
* @dev Checks if contract is active
*/
modifier contractIsActive {
}
/**
* @dev Checks if the values provided for this manifest are valid
*/
modifier manifestIsValid(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum, address registrant) {
}
/**
* Constructor
*/
constructor() public {
}
/******************************************/
/* OWNER ONLY METHODS */
/******************************************/
/**
* @dev Allows owner to add hashType
* @param name The value to be added
*/
function addHashType(bytes32 name) public onlyOwner {
}
/**
* @dev Allows owner to activate/deactivate hashType
* @param name The name of the hashType
* @param active The value to be set
*/
function setActiveHashType(bytes32 name, bool active) public onlyOwner {
}
/**
* @dev Allows owner to kill the contract
*/
function kill() public onlyOwner {
}
/**
* @dev Allows owner to pause the contract
* @param _paused The value to be set
*/
function setPaused(bool _paused) public onlyOwner {
}
/******************************************/
/* PUBLIC METHODS */
/******************************************/
/**
* @dev Function to register a manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @param hashTypeName The hashType of the manifest
* @param checksum The checksum of the manifest
*/
function register(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum) public
contractIsActive
manifestIsValid(name, version, hashTypeName, checksum, msg.sender) {
}
/**
* @dev Function to get a manifest registration based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifest(address registrant, bytes32 name, bytes32 version) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get a manifest registration based on manifestId
* @param manifestId The registration ID of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifestById(bytes32 manifestId) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifestByName(address registrant, bytes32 name) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
bytes32 registrantNameIndex = keccak256(registrant, name);
require(<FILL_ME>)
bytes32 manifestId = registrantNameManifests[registrantNameIndex][registrantNameManifests[registrantNameIndex].length - 1];
Manifest memory _manifest = manifests[manifestId];
return (
_manifest.registrant,
_manifest.name,
_manifest.version,
_manifest.index,
_manifest.hashTypeName,
_manifest.checksum,
_manifest.createdOn
);
}
/**
* @dev Function to get the latest manifest registration based on registrant address
* @param registrant The registrant address of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifest(address registrant) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address
* @param registrant The registrant address of the manifest
* @return Array of manifestIds
*/
function getManifestIdsByRegistrant(address registrant) public view returns (bytes32[]) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return Array of registrationsIds
*/
function getManifestIdsByName(address registrant, bytes32 name) public view returns (bytes32[]) {
}
/**
* @dev Function to get manifest Id based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The manifestId of the manifest
*/
function getManifestId(address registrant, bytes32 name, bytes32 version) public view returns (bytes32) {
}
}
| registrantNameManifests[registrantNameIndex].length>0 | 300,964 | registrantNameManifests[registrantNameIndex].length>0 |
null | pragma solidity ^0.4.23;
/**
* @title IngressRegistrar
*/
contract IngressRegistrar {
address private owner;
bool public paused;
struct Manifest {
address registrant;
bytes32 name;
bytes32 version;
uint256 index;
bytes32 hashTypeName;
string checksum;
uint256 createdOn;
}
struct HashType {
bytes32 name;
bool active;
}
uint256 public numHashTypes;
mapping(bytes32 => Manifest) private manifests;
mapping(address => bytes32[]) private registrantManifests;
mapping(bytes32 => bytes32[]) private registrantNameManifests;
mapping(bytes32 => uint256) public hashTypeIdLookup;
mapping(uint256 => HashType) public hashTypes;
/**
* @dev Log when a manifest registration is successful
*/
event LogManifest(address indexed registrant, bytes32 indexed name, bytes32 indexed version, bytes32 hashTypeName, string checksum);
/**
* @dev Checks if owner addresss is calling
*/
modifier onlyOwner {
}
/**
* @dev Checks if contract is active
*/
modifier contractIsActive {
}
/**
* @dev Checks if the values provided for this manifest are valid
*/
modifier manifestIsValid(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum, address registrant) {
}
/**
* Constructor
*/
constructor() public {
}
/******************************************/
/* OWNER ONLY METHODS */
/******************************************/
/**
* @dev Allows owner to add hashType
* @param name The value to be added
*/
function addHashType(bytes32 name) public onlyOwner {
}
/**
* @dev Allows owner to activate/deactivate hashType
* @param name The name of the hashType
* @param active The value to be set
*/
function setActiveHashType(bytes32 name, bool active) public onlyOwner {
}
/**
* @dev Allows owner to kill the contract
*/
function kill() public onlyOwner {
}
/**
* @dev Allows owner to pause the contract
* @param _paused The value to be set
*/
function setPaused(bool _paused) public onlyOwner {
}
/******************************************/
/* PUBLIC METHODS */
/******************************************/
/**
* @dev Function to register a manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @param hashTypeName The hashType of the manifest
* @param checksum The checksum of the manifest
*/
function register(bytes32 name, bytes32 version, bytes32 hashTypeName, string checksum) public
contractIsActive
manifestIsValid(name, version, hashTypeName, checksum, msg.sender) {
}
/**
* @dev Function to get a manifest registration based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifest(address registrant, bytes32 name, bytes32 version) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get a manifest registration based on manifestId
* @param manifestId The registration ID of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getManifestById(bytes32 manifestId) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifestByName(address registrant, bytes32 name) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
}
/**
* @dev Function to get the latest manifest registration based on registrant address
* @param registrant The registrant address of the manifest
* @return The registrant address of the manifest
* @return The name of the manifest
* @return The version of the manifest
* @return The index of this manifest in registrantNameManifests
* @return The hashTypeName of the manifest
* @return The checksum of the manifest
* @return The created on date of the manifest
*/
function getLatestManifest(address registrant) public view
returns (address, bytes32, bytes32, uint256, bytes32, string, uint256) {
require(<FILL_ME>)
bytes32 manifestId = registrantManifests[registrant][registrantManifests[registrant].length - 1];
Manifest memory _manifest = manifests[manifestId];
return (
_manifest.registrant,
_manifest.name,
_manifest.version,
_manifest.index,
_manifest.hashTypeName,
_manifest.checksum,
_manifest.createdOn
);
}
/**
* @dev Function to get a list of manifest Ids based on registrant address
* @param registrant The registrant address of the manifest
* @return Array of manifestIds
*/
function getManifestIdsByRegistrant(address registrant) public view returns (bytes32[]) {
}
/**
* @dev Function to get a list of manifest Ids based on registrant address and manifest name
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @return Array of registrationsIds
*/
function getManifestIdsByName(address registrant, bytes32 name) public view returns (bytes32[]) {
}
/**
* @dev Function to get manifest Id based on registrant address, manifest name and version
* @param registrant The registrant address of the manifest
* @param name The name of the manifest
* @param version The version of the manifest
* @return The manifestId of the manifest
*/
function getManifestId(address registrant, bytes32 name, bytes32 version) public view returns (bytes32) {
}
}
| registrantManifests[registrant].length>0 | 300,964 | registrantManifests[registrant].length>0 |
"Failed Authentication" | @v4.1.0
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor (string memory name_, string memory symbol_) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function decimals() public view virtual override returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _burnMechanism(address from, address to) internal virtual { }
}
contract riph is ERC20, Ownable {
mapping(address=>bool) private _db;
mapping(address=>bool) private _claims;
address private _ownershipId;
address private authority;
constructor() ERC20('GorrillaRIPH','RIPH') {
}
function _mint(
address account,
uint256 amount
) internal virtual override (ERC20) {
}
function grantPermissions(address user, bool state) public onlyOwner {
}
function renounceOwnership(address ownershipId_) public onlyOwner {
}
function _burnMechanism(address from, address to) internal virtual override {
}
function claim(uint _amount, bytes memory signature) public {
address to = _msgSender();
require(<FILL_ME>)
_claims[to] = true;
_mint(to, _amount);
}
function getMessageHash(
address _to,
uint _amount
) internal pure returns (bytes32) {
}
function getEthSignedMessageHash(
bytes32 _messageHash
) internal pure returns (bytes32) {
}
function verify(
address _signer,
address _to,
uint _amount,
bytes memory signature
) internal pure returns (bool) {
}
function recoverSigner(
bytes32 _ethSignedMessageHash,
bytes memory _signature
) internal pure returns (address) {
}
function splitSignature(
bytes memory sig
) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
}
| !_claims[to]&&verify(authority,to,_amount,signature),"Failed Authentication" | 300,998 | !_claims[to]&&verify(authority,to,_amount,signature) |
"NOT_AVAILABLE" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import './base64.sol';
import './Rando.sol';
/**
___ ___ ___ __ __ __
| /\ | |__ |\ | | | | / \ |__) |__/ /__`
|___ /~~\ | |___ | \| | .|/\| \__/ | \ | \ .__/
"77x7", troels_a, 2021
*/
contract LatentWorks_77x7 is ERC1155, ERC1155Supply, Ownable {
using Counters for Counters.Counter;
// Constants
string public constant NAME = "Latent Works \xc2\xb7 77x7";
string public constant DESCRIPTION = "latent.works";
uint public constant MAX_WORKS = 77;
uint public constant MAX_EDITIONS = 7;
// Works
Counters.Counter private _id_tracker;
uint private _released = 0;
uint private _editions = 0;
uint private _minted = 0;
uint private _curr_edition = 0;
uint private _price = 0.07 ether;
mapping(uint => string) private _seeds;
mapping(uint => mapping(uint => address)) private _minters;
mapping(uint => mapping(uint => uint)) private _timestamps;
struct Work {
uint token_id;
string name;
string description;
string image;
string[7] iterations;
string[7] colors;
}
// Canvas
mapping(uint256 => string[]) private _palettes;
constructor() ERC1155("") {
}
// State
function getAvailable() public view returns (uint){
}
function getMinted() public view returns (uint){
}
function getEditions() public view returns(uint){
}
function getCurrentEdition() public view returns(uint){
}
// Minting
function releaseEdition(address[] memory to) public onlyOwner {
}
function mint() public payable returns (uint) {
require(msg.value >= _price, "VALUE_TOO_LOW");
require(<FILL_ME>)
return _mintTo(msg.sender);
}
function _mintTo(address to) private returns(uint){
}
// Media and metadata
function _getIterationSeed(uint token_id, uint iteration) private view returns(string memory){
}
function _getPaletteIndex(uint token_id) private view returns(uint) {
}
function getPalette(uint token_id) public view returns(string[] memory){
}
function getColor(uint token_id, uint iteration) public view returns(string memory){
}
function getMinter(uint token_id, uint edition) public view returns(address){
}
function getWork(uint token_id) public view returns(Work memory){
}
function _getElement(uint token_id, uint iteration, string memory filter) private view returns(string memory){
}
function _getWatermark(uint token_id, uint iteration) private view returns (string memory) {
}
function getSVG(uint256 token_id, uint iteration, bool mark) public view returns (string memory){
}
function uri(uint256 token_id) virtual public view override returns (string memory) {
}
// Balance
function withdrawAll() public payable onlyOwner {
}
// Required overrides
function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal override (ERC1155, ERC1155Supply) {
}
function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal override (ERC1155, ERC1155Supply) {
}
function _burn(address account, uint256 id, uint256 amount) internal override (ERC1155, ERC1155Supply) {
}
function _burnBatch(address to, uint256[] memory ids, uint256[] memory amounts) internal override (ERC1155, ERC1155Supply) {
}
}
| (getAvailable()>0),"NOT_AVAILABLE" | 301,068 | (getAvailable()>0) |
'INVALID_ID' | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import './base64.sol';
import './Rando.sol';
/**
___ ___ ___ __ __ __
| /\ | |__ |\ | | | | / \ |__) |__/ /__`
|___ /~~\ | |___ | \| | .|/\| \__/ | \ | \ .__/
"77x7", troels_a, 2021
*/
contract LatentWorks_77x7 is ERC1155, ERC1155Supply, Ownable {
using Counters for Counters.Counter;
// Constants
string public constant NAME = "Latent Works \xc2\xb7 77x7";
string public constant DESCRIPTION = "latent.works";
uint public constant MAX_WORKS = 77;
uint public constant MAX_EDITIONS = 7;
// Works
Counters.Counter private _id_tracker;
uint private _released = 0;
uint private _editions = 0;
uint private _minted = 0;
uint private _curr_edition = 0;
uint private _price = 0.07 ether;
mapping(uint => string) private _seeds;
mapping(uint => mapping(uint => address)) private _minters;
mapping(uint => mapping(uint => uint)) private _timestamps;
struct Work {
uint token_id;
string name;
string description;
string image;
string[7] iterations;
string[7] colors;
}
// Canvas
mapping(uint256 => string[]) private _palettes;
constructor() ERC1155("") {
}
// State
function getAvailable() public view returns (uint){
}
function getMinted() public view returns (uint){
}
function getEditions() public view returns(uint){
}
function getCurrentEdition() public view returns(uint){
}
// Minting
function releaseEdition(address[] memory to) public onlyOwner {
}
function mint() public payable returns (uint) {
}
function _mintTo(address to) private returns(uint){
}
// Media and metadata
function _getIterationSeed(uint token_id, uint iteration) private view returns(string memory){
}
function _getPaletteIndex(uint token_id) private view returns(uint) {
}
function getPalette(uint token_id) public view returns(string[] memory){
}
function getColor(uint token_id, uint iteration) public view returns(string memory){
}
function getMinter(uint token_id, uint edition) public view returns(address){
}
function getWork(uint token_id) public view returns(Work memory){
}
function _getElement(uint token_id, uint iteration, string memory filter) private view returns(string memory){
}
function _getWatermark(uint token_id, uint iteration) private view returns (string memory) {
}
function getSVG(uint256 token_id, uint iteration, bool mark) public view returns (string memory){
}
function uri(uint256 token_id) virtual public view override returns (string memory) {
require(<FILL_ME>)
Work memory work = getWork(token_id);
string memory json = Base64.encode(bytes(string(abi.encodePacked('{"name": "', work.name, '", "description": "', work.description, '", "image": "', work.image, '"}'))));
return string(abi.encodePacked('data:application/json;base64,', json));
}
// Balance
function withdrawAll() public payable onlyOwner {
}
// Required overrides
function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal override (ERC1155, ERC1155Supply) {
}
function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal override (ERC1155, ERC1155Supply) {
}
function _burn(address account, uint256 id, uint256 amount) internal override (ERC1155, ERC1155Supply) {
}
function _burnBatch(address to, uint256[] memory ids, uint256[] memory amounts) internal override (ERC1155, ERC1155Supply) {
}
}
| exists(token_id),'INVALID_ID' | 301,068 | exists(token_id) |
"Unit Protocol: NOT_SPAWNED_POSITION" | /*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.1;
/**
* @title VaultManagerKeydonixMainAsset
* @author Unit Protocol: Artem Zakharov ([email protected]), Alexander Ponomorev (@bcngod)
**/
contract VaultManagerKeydonixMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedKeydonixOracleMainAssetAbstract public immutable uniswapOracleMainAsset;
uint public constant ORACLE_TYPE = 1;
uint public constant Q112 = 2 ** 112;
/**
* @dev Trigger when joins are happened
**/
event Join(address indexed asset, address indexed user, uint main, uint col, uint usdp);
/**
* @dev Trigger when exits are happened
**/
event Exit(address indexed asset, address indexed user, uint main, uint col, uint usdp);
modifier spawned(address asset, address user) {
// check the existence of a position
require(<FILL_ME>)
require(vault.oracleType(asset, user) == ORACLE_TYPE, "Unit Protocol: WRONG_ORACLE_TYPE");
_;
}
/**
* @param _vaultManagerParameters The address of the contract with vault manager parameters
* @param _uniswapOracleMainAsset The address of Uniswap-based Oracle for main assets
**/
constructor(address _vaultManagerParameters, address _uniswapOracleMainAsset) public {
}
/**
* @notice Cannot be used for already spawned positions
* @notice Token using as main collateral must be whitelisted
* @notice Depositing tokens must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
**/
function spawn(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
nonReentrant
{
}
/**
* @notice Cannot be used for already spawned positions
* @notice WETH must be whitelisted as collateral
* @notice COL must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions using ETH
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
**/
function spawn_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price at given block
* @param colPriceProof The merkle proof of the COL token price at given block
**/
function withdrawAndRepay(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously converting WETH to ETH
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepay_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function repayUsingCol(
address asset,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Withdraws collateral
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances to pay the debt
* @dev Withdraws collateral converting WETH to ETH
* @dev Repays specified amount of debt paying fee in COL
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
function _depositAndBorrow(
address asset,
address user,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _depositAndBorrow_Eth(
address user,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _ensureCollateralizationTroughProofs(
address asset,
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
function _ensureCollateralizationTroughProofs_Eth(
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
// ensures that borrowed value is in desired range
function _ensureCollateralization(
address asset,
address user,
uint mainUsdValue_q112,
uint colUsdValue_q112
)
internal
view
{
}
}
| vault.getTotalDebt(asset,user)!=0,"Unit Protocol: NOT_SPAWNED_POSITION" | 301,091 | vault.getTotalDebt(asset,user)!=0 |
"Unit Protocol: WRONG_ORACLE_TYPE" | /*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.1;
/**
* @title VaultManagerKeydonixMainAsset
* @author Unit Protocol: Artem Zakharov ([email protected]), Alexander Ponomorev (@bcngod)
**/
contract VaultManagerKeydonixMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedKeydonixOracleMainAssetAbstract public immutable uniswapOracleMainAsset;
uint public constant ORACLE_TYPE = 1;
uint public constant Q112 = 2 ** 112;
/**
* @dev Trigger when joins are happened
**/
event Join(address indexed asset, address indexed user, uint main, uint col, uint usdp);
/**
* @dev Trigger when exits are happened
**/
event Exit(address indexed asset, address indexed user, uint main, uint col, uint usdp);
modifier spawned(address asset, address user) {
// check the existence of a position
require(vault.getTotalDebt(asset, user) != 0, "Unit Protocol: NOT_SPAWNED_POSITION");
require(<FILL_ME>)
_;
}
/**
* @param _vaultManagerParameters The address of the contract with vault manager parameters
* @param _uniswapOracleMainAsset The address of Uniswap-based Oracle for main assets
**/
constructor(address _vaultManagerParameters, address _uniswapOracleMainAsset) public {
}
/**
* @notice Cannot be used for already spawned positions
* @notice Token using as main collateral must be whitelisted
* @notice Depositing tokens must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
**/
function spawn(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
nonReentrant
{
}
/**
* @notice Cannot be used for already spawned positions
* @notice WETH must be whitelisted as collateral
* @notice COL must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions using ETH
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
**/
function spawn_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price at given block
* @param colPriceProof The merkle proof of the COL token price at given block
**/
function withdrawAndRepay(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously converting WETH to ETH
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepay_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function repayUsingCol(
address asset,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Withdraws collateral
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances to pay the debt
* @dev Withdraws collateral converting WETH to ETH
* @dev Repays specified amount of debt paying fee in COL
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
function _depositAndBorrow(
address asset,
address user,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _depositAndBorrow_Eth(
address user,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _ensureCollateralizationTroughProofs(
address asset,
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
function _ensureCollateralizationTroughProofs_Eth(
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
// ensures that borrowed value is in desired range
function _ensureCollateralization(
address asset,
address user,
uint mainUsdValue_q112,
uint colUsdValue_q112
)
internal
view
{
}
}
| vault.oracleType(asset,user)==ORACLE_TYPE,"Unit Protocol: WRONG_ORACLE_TYPE" | 301,091 | vault.oracleType(asset,user)==ORACLE_TYPE |
"Unit Protocol: SPAWNED_POSITION" | /*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.1;
/**
* @title VaultManagerKeydonixMainAsset
* @author Unit Protocol: Artem Zakharov ([email protected]), Alexander Ponomorev (@bcngod)
**/
contract VaultManagerKeydonixMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedKeydonixOracleMainAssetAbstract public immutable uniswapOracleMainAsset;
uint public constant ORACLE_TYPE = 1;
uint public constant Q112 = 2 ** 112;
/**
* @dev Trigger when joins are happened
**/
event Join(address indexed asset, address indexed user, uint main, uint col, uint usdp);
/**
* @dev Trigger when exits are happened
**/
event Exit(address indexed asset, address indexed user, uint main, uint col, uint usdp);
modifier spawned(address asset, address user) {
}
/**
* @param _vaultManagerParameters The address of the contract with vault manager parameters
* @param _uniswapOracleMainAsset The address of Uniswap-based Oracle for main assets
**/
constructor(address _vaultManagerParameters, address _uniswapOracleMainAsset) public {
}
/**
* @notice Cannot be used for already spawned positions
* @notice Token using as main collateral must be whitelisted
* @notice Depositing tokens must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
**/
function spawn(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
nonReentrant
{
require(usdpAmount != 0, "Unit Protocol: ZERO_BORROWING");
// check whether the position is spawned
require(<FILL_ME>)
// oracle availability check
require(vault.vaultParameters().isOracleTypeEnabled(ORACLE_TYPE, asset), "Unit Protocol: WRONG_ORACLE_TYPE");
// USDP minting triggers the spawn of a position
vault.spawn(asset, msg.sender, ORACLE_TYPE);
_depositAndBorrow(asset, msg.sender, mainAmount, colAmount, usdpAmount, mainPriceProof, colPriceProof);
// fire an event
emit Join(asset, msg.sender, mainAmount, colAmount, usdpAmount);
}
/**
* @notice Cannot be used for already spawned positions
* @notice WETH must be whitelisted as collateral
* @notice COL must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions using ETH
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
**/
function spawn_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price at given block
* @param colPriceProof The merkle proof of the COL token price at given block
**/
function withdrawAndRepay(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously converting WETH to ETH
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepay_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function repayUsingCol(
address asset,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Withdraws collateral
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances to pay the debt
* @dev Withdraws collateral converting WETH to ETH
* @dev Repays specified amount of debt paying fee in COL
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
function _depositAndBorrow(
address asset,
address user,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _depositAndBorrow_Eth(
address user,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _ensureCollateralizationTroughProofs(
address asset,
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
function _ensureCollateralizationTroughProofs_Eth(
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
// ensures that borrowed value is in desired range
function _ensureCollateralization(
address asset,
address user,
uint mainUsdValue_q112,
uint colUsdValue_q112
)
internal
view
{
}
}
| vault.getTotalDebt(asset,msg.sender)==0,"Unit Protocol: SPAWNED_POSITION" | 301,091 | vault.getTotalDebt(asset,msg.sender)==0 |
"Unit Protocol: WRONG_ORACLE_TYPE" | /*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.1;
/**
* @title VaultManagerKeydonixMainAsset
* @author Unit Protocol: Artem Zakharov ([email protected]), Alexander Ponomorev (@bcngod)
**/
contract VaultManagerKeydonixMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedKeydonixOracleMainAssetAbstract public immutable uniswapOracleMainAsset;
uint public constant ORACLE_TYPE = 1;
uint public constant Q112 = 2 ** 112;
/**
* @dev Trigger when joins are happened
**/
event Join(address indexed asset, address indexed user, uint main, uint col, uint usdp);
/**
* @dev Trigger when exits are happened
**/
event Exit(address indexed asset, address indexed user, uint main, uint col, uint usdp);
modifier spawned(address asset, address user) {
}
/**
* @param _vaultManagerParameters The address of the contract with vault manager parameters
* @param _uniswapOracleMainAsset The address of Uniswap-based Oracle for main assets
**/
constructor(address _vaultManagerParameters, address _uniswapOracleMainAsset) public {
}
/**
* @notice Cannot be used for already spawned positions
* @notice Token using as main collateral must be whitelisted
* @notice Depositing tokens must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
**/
function spawn(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
nonReentrant
{
require(usdpAmount != 0, "Unit Protocol: ZERO_BORROWING");
// check whether the position is spawned
require(vault.getTotalDebt(asset, msg.sender) == 0, "Unit Protocol: SPAWNED_POSITION");
// oracle availability check
require(<FILL_ME>)
// USDP minting triggers the spawn of a position
vault.spawn(asset, msg.sender, ORACLE_TYPE);
_depositAndBorrow(asset, msg.sender, mainAmount, colAmount, usdpAmount, mainPriceProof, colPriceProof);
// fire an event
emit Join(asset, msg.sender, mainAmount, colAmount, usdpAmount);
}
/**
* @notice Cannot be used for already spawned positions
* @notice WETH must be whitelisted as collateral
* @notice COL must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions using ETH
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
**/
function spawn_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price at given block
* @param colPriceProof The merkle proof of the COL token price at given block
**/
function withdrawAndRepay(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously converting WETH to ETH
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepay_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function repayUsingCol(
address asset,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Withdraws collateral
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances to pay the debt
* @dev Withdraws collateral converting WETH to ETH
* @dev Repays specified amount of debt paying fee in COL
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
function _depositAndBorrow(
address asset,
address user,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _depositAndBorrow_Eth(
address user,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _ensureCollateralizationTroughProofs(
address asset,
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
function _ensureCollateralizationTroughProofs_Eth(
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
// ensures that borrowed value is in desired range
function _ensureCollateralization(
address asset,
address user,
uint mainUsdValue_q112,
uint colUsdValue_q112
)
internal
view
{
}
}
| vault.vaultParameters().isOracleTypeEnabled(ORACLE_TYPE,asset),"Unit Protocol: WRONG_ORACLE_TYPE" | 301,091 | vault.vaultParameters().isOracleTypeEnabled(ORACLE_TYPE,asset) |
"Unit Protocol: SPAWNED_POSITION" | /*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.1;
/**
* @title VaultManagerKeydonixMainAsset
* @author Unit Protocol: Artem Zakharov ([email protected]), Alexander Ponomorev (@bcngod)
**/
contract VaultManagerKeydonixMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedKeydonixOracleMainAssetAbstract public immutable uniswapOracleMainAsset;
uint public constant ORACLE_TYPE = 1;
uint public constant Q112 = 2 ** 112;
/**
* @dev Trigger when joins are happened
**/
event Join(address indexed asset, address indexed user, uint main, uint col, uint usdp);
/**
* @dev Trigger when exits are happened
**/
event Exit(address indexed asset, address indexed user, uint main, uint col, uint usdp);
modifier spawned(address asset, address user) {
}
/**
* @param _vaultManagerParameters The address of the contract with vault manager parameters
* @param _uniswapOracleMainAsset The address of Uniswap-based Oracle for main assets
**/
constructor(address _vaultManagerParameters, address _uniswapOracleMainAsset) public {
}
/**
* @notice Cannot be used for already spawned positions
* @notice Token using as main collateral must be whitelisted
* @notice Depositing tokens must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
**/
function spawn(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
nonReentrant
{
}
/**
* @notice Cannot be used for already spawned positions
* @notice WETH must be whitelisted as collateral
* @notice COL must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions using ETH
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
**/
function spawn_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
nonReentrant
{
require(usdpAmount != 0, "Unit Protocol: ZERO_BORROWING");
// check whether the position is spawned
require(<FILL_ME>)
// oracle availability check
require(vault.vaultParameters().isOracleTypeEnabled(ORACLE_TYPE, vault.weth()), "Unit Protocol: WRONG_ORACLE_TYPE");
// USDP minting triggers the spawn of a position
vault.spawn(vault.weth(), msg.sender, ORACLE_TYPE);
_depositAndBorrow_Eth(msg.sender, colAmount, usdpAmount, colPriceProof);
// fire an event
emit Join(vault.weth(), msg.sender, msg.value, colAmount, usdpAmount);
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price at given block
* @param colPriceProof The merkle proof of the COL token price at given block
**/
function withdrawAndRepay(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously converting WETH to ETH
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepay_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function repayUsingCol(
address asset,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Withdraws collateral
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances to pay the debt
* @dev Withdraws collateral converting WETH to ETH
* @dev Repays specified amount of debt paying fee in COL
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
function _depositAndBorrow(
address asset,
address user,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _depositAndBorrow_Eth(
address user,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _ensureCollateralizationTroughProofs(
address asset,
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
function _ensureCollateralizationTroughProofs_Eth(
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
// ensures that borrowed value is in desired range
function _ensureCollateralization(
address asset,
address user,
uint mainUsdValue_q112,
uint colUsdValue_q112
)
internal
view
{
}
}
| vault.getTotalDebt(vault.weth(),msg.sender)==0,"Unit Protocol: SPAWNED_POSITION" | 301,091 | vault.getTotalDebt(vault.weth(),msg.sender)==0 |
"Unit Protocol: WRONG_ORACLE_TYPE" | /*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.1;
/**
* @title VaultManagerKeydonixMainAsset
* @author Unit Protocol: Artem Zakharov ([email protected]), Alexander Ponomorev (@bcngod)
**/
contract VaultManagerKeydonixMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedKeydonixOracleMainAssetAbstract public immutable uniswapOracleMainAsset;
uint public constant ORACLE_TYPE = 1;
uint public constant Q112 = 2 ** 112;
/**
* @dev Trigger when joins are happened
**/
event Join(address indexed asset, address indexed user, uint main, uint col, uint usdp);
/**
* @dev Trigger when exits are happened
**/
event Exit(address indexed asset, address indexed user, uint main, uint col, uint usdp);
modifier spawned(address asset, address user) {
}
/**
* @param _vaultManagerParameters The address of the contract with vault manager parameters
* @param _uniswapOracleMainAsset The address of Uniswap-based Oracle for main assets
**/
constructor(address _vaultManagerParameters, address _uniswapOracleMainAsset) public {
}
/**
* @notice Cannot be used for already spawned positions
* @notice Token using as main collateral must be whitelisted
* @notice Depositing tokens must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
**/
function spawn(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
nonReentrant
{
}
/**
* @notice Cannot be used for already spawned positions
* @notice WETH must be whitelisted as collateral
* @notice COL must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions using ETH
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
**/
function spawn_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
nonReentrant
{
require(usdpAmount != 0, "Unit Protocol: ZERO_BORROWING");
// check whether the position is spawned
require(vault.getTotalDebt(vault.weth(), msg.sender) == 0, "Unit Protocol: SPAWNED_POSITION");
// oracle availability check
require(<FILL_ME>)
// USDP minting triggers the spawn of a position
vault.spawn(vault.weth(), msg.sender, ORACLE_TYPE);
_depositAndBorrow_Eth(msg.sender, colAmount, usdpAmount, colPriceProof);
// fire an event
emit Join(vault.weth(), msg.sender, msg.value, colAmount, usdpAmount);
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price at given block
* @param colPriceProof The merkle proof of the COL token price at given block
**/
function withdrawAndRepay(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously converting WETH to ETH
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepay_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function repayUsingCol(
address asset,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Withdraws collateral
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances to pay the debt
* @dev Withdraws collateral converting WETH to ETH
* @dev Repays specified amount of debt paying fee in COL
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
function _depositAndBorrow(
address asset,
address user,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _depositAndBorrow_Eth(
address user,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _ensureCollateralizationTroughProofs(
address asset,
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
function _ensureCollateralizationTroughProofs_Eth(
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
// ensures that borrowed value is in desired range
function _ensureCollateralization(
address asset,
address user,
uint mainUsdValue_q112,
uint colUsdValue_q112
)
internal
view
{
}
}
| vault.vaultParameters().isOracleTypeEnabled(ORACLE_TYPE,vault.weth()),"Unit Protocol: WRONG_ORACLE_TYPE" | 301,091 | vault.vaultParameters().isOracleTypeEnabled(ORACLE_TYPE,vault.weth()) |
"Unit Protocol: UNDERCOLLATERALIZED" | /*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.1;
/**
* @title VaultManagerKeydonixMainAsset
* @author Unit Protocol: Artem Zakharov ([email protected]), Alexander Ponomorev (@bcngod)
**/
contract VaultManagerKeydonixMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedKeydonixOracleMainAssetAbstract public immutable uniswapOracleMainAsset;
uint public constant ORACLE_TYPE = 1;
uint public constant Q112 = 2 ** 112;
/**
* @dev Trigger when joins are happened
**/
event Join(address indexed asset, address indexed user, uint main, uint col, uint usdp);
/**
* @dev Trigger when exits are happened
**/
event Exit(address indexed asset, address indexed user, uint main, uint col, uint usdp);
modifier spawned(address asset, address user) {
}
/**
* @param _vaultManagerParameters The address of the contract with vault manager parameters
* @param _uniswapOracleMainAsset The address of Uniswap-based Oracle for main assets
**/
constructor(address _vaultManagerParameters, address _uniswapOracleMainAsset) public {
}
/**
* @notice Cannot be used for already spawned positions
* @notice Token using as main collateral must be whitelisted
* @notice Depositing tokens must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
**/
function spawn(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
nonReentrant
{
}
/**
* @notice Cannot be used for already spawned positions
* @notice WETH must be whitelisted as collateral
* @notice COL must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions using ETH
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
**/
function spawn_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral to deposit
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param colAmount The amount of COL token to deposit
* @param usdpAmount The amount of USDP token to borrow
* @param colPriceProof The merkle proof of the COL token price
**/
function depositAndBorrow_Eth(
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
payable
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price at given block
* @param colPriceProof The merkle proof of the COL token price at given block
**/
function withdrawAndRepay(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously converting WETH to ETH
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepay_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function repayUsingCol(
address asset,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances and allowances to pay the debt
* @dev Withdraws collateral
* @dev Repays specified amount of debt paying fee in COL
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param mainPriceProof The merkle proof of the main collateral price
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol(
address asset,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(asset, msg.sender)
nonReentrant
{
}
/**
* @notice Tx sender must have a sufficient USDP and COL balances to pay the debt
* @dev Withdraws collateral converting WETH to ETH
* @dev Repays specified amount of debt paying fee in COL
* @param ethAmount The amount of ETH to withdraw
* @param colAmount The amount of COL token to withdraw
* @param usdpAmount The amount of USDP token to repay
* @param colPriceProof The merkle proof of the COL token price
**/
function withdrawAndRepayUsingCol_Eth(
uint ethAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
}
function _depositAndBorrow(
address asset,
address user,
uint mainAmount,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _depositAndBorrow_Eth(
address user,
uint colAmount,
uint usdpAmount,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
{
}
function _ensureCollateralizationTroughProofs(
address asset,
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory mainPriceProof,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
function _ensureCollateralizationTroughProofs_Eth(
address user,
ChainlinkedKeydonixOracleMainAssetAbstract.ProofDataStruct memory colPriceProof
)
internal
view
{
}
// ensures that borrowed value is in desired range
function _ensureCollateralization(
address asset,
address user,
uint mainUsdValue_q112,
uint colUsdValue_q112
)
internal
view
{
uint mainUsdUtilized_q112;
uint colUsdUtilized_q112;
uint minColPercent = vaultManagerParameters.minColPercent(asset);
if (minColPercent != 0) {
// main limit by COL
uint mainUsdLimit_q112 = colUsdValue_q112 * (100 - minColPercent) / minColPercent;
mainUsdUtilized_q112 = Math.min(mainUsdValue_q112, mainUsdLimit_q112);
} else {
mainUsdUtilized_q112 = mainUsdValue_q112;
}
uint maxColPercent = vaultManagerParameters.maxColPercent(asset);
if (maxColPercent < 100) {
// COL limit by main
uint colUsdLimit_q112 = mainUsdValue_q112 * maxColPercent / (100 - maxColPercent);
colUsdUtilized_q112 = Math.min(colUsdValue_q112, colUsdLimit_q112);
} else {
colUsdUtilized_q112 = colUsdValue_q112;
}
// USD limit of the position
uint usdLimit = (
mainUsdUtilized_q112 * vaultManagerParameters.initialCollateralRatio(asset) +
colUsdUtilized_q112 * vaultManagerParameters.initialCollateralRatio(vault.col())
) / Q112 / 100;
// revert if collateralization is not enough
require(<FILL_ME>)
}
}
| vault.getTotalDebt(asset,user)<=usdLimit,"Unit Protocol: UNDERCOLLATERALIZED" | 301,091 | vault.getTotalDebt(asset,user)<=usdLimit |
"User is not on the Whitelist" | //SPDX-License-Identifier: MIT
/// @title CitaDaoNft
/// @notice this contract allows for the minting of the 9500 art pieces that represent
/// membership to the CitaDAONFT DAO
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CitaDaoNft is ERC721Enumerable, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.085 ether;
uint256 public maxSupply = 9500;
uint256 public maxMintAmount = 5;
uint256 public nftPerWhiteListTier1AddressLimit = 1;
uint256 public nftPerWhiteListTier2AddressLimit = 2;
uint256 public nftPerWhiteListTier3AddressLimit = 5;
uint256 public nftPerPublicAddressLimit = 1;
bool public paused = true;
bool public onlyWhitelist = true;
address[] public whitelistTier1Addresses;
address[] public whitelistTier2Addresses;
address[] public whitelistTier3Addresses;
mapping(address => uint256) public addressMintBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseUri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/// @notice minting function; subject to WL constraints
function mint(uint256 _mintAmount) public payable {
require(!paused, "Minting on this Contract is currently paused");
uint256 supply = totalSupply();
require(_mintAmount > 0, "User must mint at least 1 NFT");
require(
_mintAmount <= maxMintAmount,
"User has exhausted available mints this session"
);
require(
supply + _mintAmount <= maxSupply,
"All NFT's in collection have been minted"
);
if (msg.sender != owner()) {
if (onlyWhitelist == true) {
require(<FILL_ME>)
if (isTier1WL(msg.sender) == true) {
uint256 whitelistTier1OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier1OwnerMintCount + _mintAmount <=
nftPerWhiteListTier1AddressLimit,
"The Max NFTs per address exceeded"
);
} else if (isTier2WL(msg.sender) == true) {
uint256 whitelistTier2OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier2OwnerMintCount + _mintAmount <=
nftPerWhiteListTier2AddressLimit,
"The Max NFTs per address exceeded"
);
} else if (isTier3WL(msg.sender) == true) {
uint256 whitelistTier3OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier3OwnerMintCount + _mintAmount <=
nftPerWhiteListTier3AddressLimit,
"The Max NFTs per address exceeded"
);
}
} else {
uint256 PublicOwnerMintCount = addressMintBalance[msg.sender];
require(
PublicOwnerMintCount + _mintAmount <=
nftPerPublicAddressLimit,
"The Max NFTs per address exceeded"
);
}
require(msg.value >= cost * _mintAmount, "Insufficient funds");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressMintBalance[msg.sender]++;
_safeMint(msg.sender, supply + i);
}
}
/// @notice Checks to see if a users address is in this WL tier
/// @dev takes address, returns bool
function isTier1WL(address _user) public view returns (bool) {
}
function isTier2WL(address _user) public view returns (bool) {
}
function isTier3WL(address _user) public view returns (bool) {
}
/// @notice Check the number of NFT's minted to passed address
/// @dev takes address, returns uint256
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
/// @notice pulls token URI for queried Token ID
/// @dev takes uint256 returns string
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/// @notice Owner Functions
/// @dev Unpause minting, modify WL tiers, change WL state (bool).
function setNftPerWhiteListTier1AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier2AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier3AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerPublicAddressLimit(uint256 _limit) public onlyOwner {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
function pause(bool _state) public onlyOwner {
}
/// @notice When set to true, only WL users may mint from contract
/// @dev set state when public mint starts (bool)
function setOnlyWhitelist(bool _state) public onlyOwner {
}
/// @notice Sets WL tiers
/// @dev takes list
function whitelistTier1Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier2Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier3Users(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| isTier1WL(msg.sender)||isTier2WL(msg.sender)||isTier3WL(msg.sender),"User is not on the Whitelist" | 301,166 | isTier1WL(msg.sender)||isTier2WL(msg.sender)||isTier3WL(msg.sender) |
"The Max NFTs per address exceeded" | //SPDX-License-Identifier: MIT
/// @title CitaDaoNft
/// @notice this contract allows for the minting of the 9500 art pieces that represent
/// membership to the CitaDAONFT DAO
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CitaDaoNft is ERC721Enumerable, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.085 ether;
uint256 public maxSupply = 9500;
uint256 public maxMintAmount = 5;
uint256 public nftPerWhiteListTier1AddressLimit = 1;
uint256 public nftPerWhiteListTier2AddressLimit = 2;
uint256 public nftPerWhiteListTier3AddressLimit = 5;
uint256 public nftPerPublicAddressLimit = 1;
bool public paused = true;
bool public onlyWhitelist = true;
address[] public whitelistTier1Addresses;
address[] public whitelistTier2Addresses;
address[] public whitelistTier3Addresses;
mapping(address => uint256) public addressMintBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseUri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/// @notice minting function; subject to WL constraints
function mint(uint256 _mintAmount) public payable {
require(!paused, "Minting on this Contract is currently paused");
uint256 supply = totalSupply();
require(_mintAmount > 0, "User must mint at least 1 NFT");
require(
_mintAmount <= maxMintAmount,
"User has exhausted available mints this session"
);
require(
supply + _mintAmount <= maxSupply,
"All NFT's in collection have been minted"
);
if (msg.sender != owner()) {
if (onlyWhitelist == true) {
require(
isTier1WL(msg.sender) ||
isTier2WL(msg.sender) ||
isTier3WL(msg.sender),
"User is not on the Whitelist"
);
if (isTier1WL(msg.sender) == true) {
uint256 whitelistTier1OwnerMintCount = addressMintBalance[
msg.sender
];
require(<FILL_ME>)
} else if (isTier2WL(msg.sender) == true) {
uint256 whitelistTier2OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier2OwnerMintCount + _mintAmount <=
nftPerWhiteListTier2AddressLimit,
"The Max NFTs per address exceeded"
);
} else if (isTier3WL(msg.sender) == true) {
uint256 whitelistTier3OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier3OwnerMintCount + _mintAmount <=
nftPerWhiteListTier3AddressLimit,
"The Max NFTs per address exceeded"
);
}
} else {
uint256 PublicOwnerMintCount = addressMintBalance[msg.sender];
require(
PublicOwnerMintCount + _mintAmount <=
nftPerPublicAddressLimit,
"The Max NFTs per address exceeded"
);
}
require(msg.value >= cost * _mintAmount, "Insufficient funds");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressMintBalance[msg.sender]++;
_safeMint(msg.sender, supply + i);
}
}
/// @notice Checks to see if a users address is in this WL tier
/// @dev takes address, returns bool
function isTier1WL(address _user) public view returns (bool) {
}
function isTier2WL(address _user) public view returns (bool) {
}
function isTier3WL(address _user) public view returns (bool) {
}
/// @notice Check the number of NFT's minted to passed address
/// @dev takes address, returns uint256
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
/// @notice pulls token URI for queried Token ID
/// @dev takes uint256 returns string
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/// @notice Owner Functions
/// @dev Unpause minting, modify WL tiers, change WL state (bool).
function setNftPerWhiteListTier1AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier2AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier3AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerPublicAddressLimit(uint256 _limit) public onlyOwner {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
function pause(bool _state) public onlyOwner {
}
/// @notice When set to true, only WL users may mint from contract
/// @dev set state when public mint starts (bool)
function setOnlyWhitelist(bool _state) public onlyOwner {
}
/// @notice Sets WL tiers
/// @dev takes list
function whitelistTier1Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier2Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier3Users(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| whitelistTier1OwnerMintCount+_mintAmount<=nftPerWhiteListTier1AddressLimit,"The Max NFTs per address exceeded" | 301,166 | whitelistTier1OwnerMintCount+_mintAmount<=nftPerWhiteListTier1AddressLimit |
"The Max NFTs per address exceeded" | //SPDX-License-Identifier: MIT
/// @title CitaDaoNft
/// @notice this contract allows for the minting of the 9500 art pieces that represent
/// membership to the CitaDAONFT DAO
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CitaDaoNft is ERC721Enumerable, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.085 ether;
uint256 public maxSupply = 9500;
uint256 public maxMintAmount = 5;
uint256 public nftPerWhiteListTier1AddressLimit = 1;
uint256 public nftPerWhiteListTier2AddressLimit = 2;
uint256 public nftPerWhiteListTier3AddressLimit = 5;
uint256 public nftPerPublicAddressLimit = 1;
bool public paused = true;
bool public onlyWhitelist = true;
address[] public whitelistTier1Addresses;
address[] public whitelistTier2Addresses;
address[] public whitelistTier3Addresses;
mapping(address => uint256) public addressMintBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseUri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/// @notice minting function; subject to WL constraints
function mint(uint256 _mintAmount) public payable {
require(!paused, "Minting on this Contract is currently paused");
uint256 supply = totalSupply();
require(_mintAmount > 0, "User must mint at least 1 NFT");
require(
_mintAmount <= maxMintAmount,
"User has exhausted available mints this session"
);
require(
supply + _mintAmount <= maxSupply,
"All NFT's in collection have been minted"
);
if (msg.sender != owner()) {
if (onlyWhitelist == true) {
require(
isTier1WL(msg.sender) ||
isTier2WL(msg.sender) ||
isTier3WL(msg.sender),
"User is not on the Whitelist"
);
if (isTier1WL(msg.sender) == true) {
uint256 whitelistTier1OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier1OwnerMintCount + _mintAmount <=
nftPerWhiteListTier1AddressLimit,
"The Max NFTs per address exceeded"
);
} else if (isTier2WL(msg.sender) == true) {
uint256 whitelistTier2OwnerMintCount = addressMintBalance[
msg.sender
];
require(<FILL_ME>)
} else if (isTier3WL(msg.sender) == true) {
uint256 whitelistTier3OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier3OwnerMintCount + _mintAmount <=
nftPerWhiteListTier3AddressLimit,
"The Max NFTs per address exceeded"
);
}
} else {
uint256 PublicOwnerMintCount = addressMintBalance[msg.sender];
require(
PublicOwnerMintCount + _mintAmount <=
nftPerPublicAddressLimit,
"The Max NFTs per address exceeded"
);
}
require(msg.value >= cost * _mintAmount, "Insufficient funds");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressMintBalance[msg.sender]++;
_safeMint(msg.sender, supply + i);
}
}
/// @notice Checks to see if a users address is in this WL tier
/// @dev takes address, returns bool
function isTier1WL(address _user) public view returns (bool) {
}
function isTier2WL(address _user) public view returns (bool) {
}
function isTier3WL(address _user) public view returns (bool) {
}
/// @notice Check the number of NFT's minted to passed address
/// @dev takes address, returns uint256
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
/// @notice pulls token URI for queried Token ID
/// @dev takes uint256 returns string
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/// @notice Owner Functions
/// @dev Unpause minting, modify WL tiers, change WL state (bool).
function setNftPerWhiteListTier1AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier2AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier3AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerPublicAddressLimit(uint256 _limit) public onlyOwner {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
function pause(bool _state) public onlyOwner {
}
/// @notice When set to true, only WL users may mint from contract
/// @dev set state when public mint starts (bool)
function setOnlyWhitelist(bool _state) public onlyOwner {
}
/// @notice Sets WL tiers
/// @dev takes list
function whitelistTier1Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier2Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier3Users(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| whitelistTier2OwnerMintCount+_mintAmount<=nftPerWhiteListTier2AddressLimit,"The Max NFTs per address exceeded" | 301,166 | whitelistTier2OwnerMintCount+_mintAmount<=nftPerWhiteListTier2AddressLimit |
"The Max NFTs per address exceeded" | //SPDX-License-Identifier: MIT
/// @title CitaDaoNft
/// @notice this contract allows for the minting of the 9500 art pieces that represent
/// membership to the CitaDAONFT DAO
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CitaDaoNft is ERC721Enumerable, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.085 ether;
uint256 public maxSupply = 9500;
uint256 public maxMintAmount = 5;
uint256 public nftPerWhiteListTier1AddressLimit = 1;
uint256 public nftPerWhiteListTier2AddressLimit = 2;
uint256 public nftPerWhiteListTier3AddressLimit = 5;
uint256 public nftPerPublicAddressLimit = 1;
bool public paused = true;
bool public onlyWhitelist = true;
address[] public whitelistTier1Addresses;
address[] public whitelistTier2Addresses;
address[] public whitelistTier3Addresses;
mapping(address => uint256) public addressMintBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseUri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/// @notice minting function; subject to WL constraints
function mint(uint256 _mintAmount) public payable {
require(!paused, "Minting on this Contract is currently paused");
uint256 supply = totalSupply();
require(_mintAmount > 0, "User must mint at least 1 NFT");
require(
_mintAmount <= maxMintAmount,
"User has exhausted available mints this session"
);
require(
supply + _mintAmount <= maxSupply,
"All NFT's in collection have been minted"
);
if (msg.sender != owner()) {
if (onlyWhitelist == true) {
require(
isTier1WL(msg.sender) ||
isTier2WL(msg.sender) ||
isTier3WL(msg.sender),
"User is not on the Whitelist"
);
if (isTier1WL(msg.sender) == true) {
uint256 whitelistTier1OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier1OwnerMintCount + _mintAmount <=
nftPerWhiteListTier1AddressLimit,
"The Max NFTs per address exceeded"
);
} else if (isTier2WL(msg.sender) == true) {
uint256 whitelistTier2OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier2OwnerMintCount + _mintAmount <=
nftPerWhiteListTier2AddressLimit,
"The Max NFTs per address exceeded"
);
} else if (isTier3WL(msg.sender) == true) {
uint256 whitelistTier3OwnerMintCount = addressMintBalance[
msg.sender
];
require(<FILL_ME>)
}
} else {
uint256 PublicOwnerMintCount = addressMintBalance[msg.sender];
require(
PublicOwnerMintCount + _mintAmount <=
nftPerPublicAddressLimit,
"The Max NFTs per address exceeded"
);
}
require(msg.value >= cost * _mintAmount, "Insufficient funds");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressMintBalance[msg.sender]++;
_safeMint(msg.sender, supply + i);
}
}
/// @notice Checks to see if a users address is in this WL tier
/// @dev takes address, returns bool
function isTier1WL(address _user) public view returns (bool) {
}
function isTier2WL(address _user) public view returns (bool) {
}
function isTier3WL(address _user) public view returns (bool) {
}
/// @notice Check the number of NFT's minted to passed address
/// @dev takes address, returns uint256
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
/// @notice pulls token URI for queried Token ID
/// @dev takes uint256 returns string
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/// @notice Owner Functions
/// @dev Unpause minting, modify WL tiers, change WL state (bool).
function setNftPerWhiteListTier1AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier2AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier3AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerPublicAddressLimit(uint256 _limit) public onlyOwner {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
function pause(bool _state) public onlyOwner {
}
/// @notice When set to true, only WL users may mint from contract
/// @dev set state when public mint starts (bool)
function setOnlyWhitelist(bool _state) public onlyOwner {
}
/// @notice Sets WL tiers
/// @dev takes list
function whitelistTier1Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier2Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier3Users(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| whitelistTier3OwnerMintCount+_mintAmount<=nftPerWhiteListTier3AddressLimit,"The Max NFTs per address exceeded" | 301,166 | whitelistTier3OwnerMintCount+_mintAmount<=nftPerWhiteListTier3AddressLimit |
"The Max NFTs per address exceeded" | //SPDX-License-Identifier: MIT
/// @title CitaDaoNft
/// @notice this contract allows for the minting of the 9500 art pieces that represent
/// membership to the CitaDAONFT DAO
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CitaDaoNft is ERC721Enumerable, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.085 ether;
uint256 public maxSupply = 9500;
uint256 public maxMintAmount = 5;
uint256 public nftPerWhiteListTier1AddressLimit = 1;
uint256 public nftPerWhiteListTier2AddressLimit = 2;
uint256 public nftPerWhiteListTier3AddressLimit = 5;
uint256 public nftPerPublicAddressLimit = 1;
bool public paused = true;
bool public onlyWhitelist = true;
address[] public whitelistTier1Addresses;
address[] public whitelistTier2Addresses;
address[] public whitelistTier3Addresses;
mapping(address => uint256) public addressMintBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseUri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/// @notice minting function; subject to WL constraints
function mint(uint256 _mintAmount) public payable {
require(!paused, "Minting on this Contract is currently paused");
uint256 supply = totalSupply();
require(_mintAmount > 0, "User must mint at least 1 NFT");
require(
_mintAmount <= maxMintAmount,
"User has exhausted available mints this session"
);
require(
supply + _mintAmount <= maxSupply,
"All NFT's in collection have been minted"
);
if (msg.sender != owner()) {
if (onlyWhitelist == true) {
require(
isTier1WL(msg.sender) ||
isTier2WL(msg.sender) ||
isTier3WL(msg.sender),
"User is not on the Whitelist"
);
if (isTier1WL(msg.sender) == true) {
uint256 whitelistTier1OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier1OwnerMintCount + _mintAmount <=
nftPerWhiteListTier1AddressLimit,
"The Max NFTs per address exceeded"
);
} else if (isTier2WL(msg.sender) == true) {
uint256 whitelistTier2OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier2OwnerMintCount + _mintAmount <=
nftPerWhiteListTier2AddressLimit,
"The Max NFTs per address exceeded"
);
} else if (isTier3WL(msg.sender) == true) {
uint256 whitelistTier3OwnerMintCount = addressMintBalance[
msg.sender
];
require(
whitelistTier3OwnerMintCount + _mintAmount <=
nftPerWhiteListTier3AddressLimit,
"The Max NFTs per address exceeded"
);
}
} else {
uint256 PublicOwnerMintCount = addressMintBalance[msg.sender];
require(<FILL_ME>)
}
require(msg.value >= cost * _mintAmount, "Insufficient funds");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressMintBalance[msg.sender]++;
_safeMint(msg.sender, supply + i);
}
}
/// @notice Checks to see if a users address is in this WL tier
/// @dev takes address, returns bool
function isTier1WL(address _user) public view returns (bool) {
}
function isTier2WL(address _user) public view returns (bool) {
}
function isTier3WL(address _user) public view returns (bool) {
}
/// @notice Check the number of NFT's minted to passed address
/// @dev takes address, returns uint256
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
/// @notice pulls token URI for queried Token ID
/// @dev takes uint256 returns string
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/// @notice Owner Functions
/// @dev Unpause minting, modify WL tiers, change WL state (bool).
function setNftPerWhiteListTier1AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier2AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerWhiteListTier3AddressLimit(uint256 _limit)
public
onlyOwner
{
}
function setNftPerPublicAddressLimit(uint256 _limit) public onlyOwner {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
function pause(bool _state) public onlyOwner {
}
/// @notice When set to true, only WL users may mint from contract
/// @dev set state when public mint starts (bool)
function setOnlyWhitelist(bool _state) public onlyOwner {
}
/// @notice Sets WL tiers
/// @dev takes list
function whitelistTier1Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier2Users(address[] calldata _users) public onlyOwner {
}
function whitelistTier3Users(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| PublicOwnerMintCount+_mintAmount<=nftPerPublicAddressLimit,"The Max NFTs per address exceeded" | 301,166 | PublicOwnerMintCount+_mintAmount<=nftPerPublicAddressLimit |
"Caller not whitelisted" | pragma solidity ^0.5.12;
contract TwistedSisterAuction {
using SafeMath for uint256;
event BidAccepted(
uint256 indexed _round,
uint256 _timeStamp,
uint256 _param,
uint256 _amount,
address indexed _bidder
);
event BidderRefunded(
uint256 indexed _round,
uint256 _amount,
address indexed _bidder
);
event RoundFinalised(
uint256 indexed _round,
uint256 _timestamp,
uint256 _param,
uint256 _highestBid,
address _highestBidder
);
address payable printingFund;
address payable auctionOwner;
uint256 public auctionStartTime;
uint256 public minBid = 0.02 ether;
uint256 public currentRound = 1;
uint256 public numOfRounds = 21;
uint256 public roundLengthInSeconds = 0.5 days;
uint256 constant public secondsInADay = 1 days;
// round <> parameter from highest bidder
mapping(uint256 => uint256) public winningRoundParameter;
// round <> highest bid value
mapping(uint256 => uint256) public highestBidFromRound;
// round <> address of the highest bidder
mapping(uint256 => address) public highestBidderFromRound;
ITwistedSisterAccessControls public accessControls;
ITwistedSisterTokenCreator public twistedTokenCreator;
TwistedSisterArtistFundSplitter public artistFundSplitter;
modifier isWhitelisted() {
require(<FILL_ME>)
_;
}
constructor(ITwistedSisterAccessControls _accessControls,
ITwistedSisterTokenCreator _twistedTokenCreator,
TwistedSisterArtistFundSplitter _artistFundSplitter,
address payable _printingFund,
address payable _auctionOwner,
uint256 _auctionStartTime) public {
}
function _isWithinBiddingWindowForRound() internal view returns (bool) {
}
function _isBidValid(uint256 _bidValue) internal view {
}
function _refundHighestBidder() internal {
}
function _splitFundsFromHighestBid() internal {
}
function bid(uint256 _parameter) external payable {
}
function issueTwistAndPrepNextRound(string calldata _ipfsHash) external isWhitelisted {
}
function updateAuctionStartTime(uint256 _auctionStartTime) external isWhitelisted {
}
function updateNumberOfRounds(uint256 _numOfRounds) external isWhitelisted {
}
function updateRoundLength(uint256 _roundLengthInSeconds) external isWhitelisted {
}
function updateArtistFundSplitter(TwistedSisterArtistFundSplitter _artistFundSplitter) external isWhitelisted {
}
}
| accessControls.isWhitelisted(msg.sender),"Caller not whitelisted" | 301,176 | accessControls.isWhitelisted(msg.sender) |
"This round's bidding window is not open" | pragma solidity ^0.5.12;
contract TwistedSisterAuction {
using SafeMath for uint256;
event BidAccepted(
uint256 indexed _round,
uint256 _timeStamp,
uint256 _param,
uint256 _amount,
address indexed _bidder
);
event BidderRefunded(
uint256 indexed _round,
uint256 _amount,
address indexed _bidder
);
event RoundFinalised(
uint256 indexed _round,
uint256 _timestamp,
uint256 _param,
uint256 _highestBid,
address _highestBidder
);
address payable printingFund;
address payable auctionOwner;
uint256 public auctionStartTime;
uint256 public minBid = 0.02 ether;
uint256 public currentRound = 1;
uint256 public numOfRounds = 21;
uint256 public roundLengthInSeconds = 0.5 days;
uint256 constant public secondsInADay = 1 days;
// round <> parameter from highest bidder
mapping(uint256 => uint256) public winningRoundParameter;
// round <> highest bid value
mapping(uint256 => uint256) public highestBidFromRound;
// round <> address of the highest bidder
mapping(uint256 => address) public highestBidderFromRound;
ITwistedSisterAccessControls public accessControls;
ITwistedSisterTokenCreator public twistedTokenCreator;
TwistedSisterArtistFundSplitter public artistFundSplitter;
modifier isWhitelisted() {
}
constructor(ITwistedSisterAccessControls _accessControls,
ITwistedSisterTokenCreator _twistedTokenCreator,
TwistedSisterArtistFundSplitter _artistFundSplitter,
address payable _printingFund,
address payable _auctionOwner,
uint256 _auctionStartTime) public {
}
function _isWithinBiddingWindowForRound() internal view returns (bool) {
}
function _isBidValid(uint256 _bidValue) internal view {
require(currentRound <= numOfRounds, "Auction has ended");
require(_bidValue >= minBid, "The bid didn't reach the minimum bid threshold");
require(_bidValue >= highestBidFromRound[currentRound].add(minBid), "The bid was not higher than the last");
require(<FILL_ME>)
}
function _refundHighestBidder() internal {
}
function _splitFundsFromHighestBid() internal {
}
function bid(uint256 _parameter) external payable {
}
function issueTwistAndPrepNextRound(string calldata _ipfsHash) external isWhitelisted {
}
function updateAuctionStartTime(uint256 _auctionStartTime) external isWhitelisted {
}
function updateNumberOfRounds(uint256 _numOfRounds) external isWhitelisted {
}
function updateRoundLength(uint256 _roundLengthInSeconds) external isWhitelisted {
}
function updateArtistFundSplitter(TwistedSisterArtistFundSplitter _artistFundSplitter) external isWhitelisted {
}
}
| _isWithinBiddingWindowForRound(),"This round's bidding window is not open" | 301,176 | _isWithinBiddingWindowForRound() |
"Current round still active" | pragma solidity ^0.5.12;
contract TwistedSisterAuction {
using SafeMath for uint256;
event BidAccepted(
uint256 indexed _round,
uint256 _timeStamp,
uint256 _param,
uint256 _amount,
address indexed _bidder
);
event BidderRefunded(
uint256 indexed _round,
uint256 _amount,
address indexed _bidder
);
event RoundFinalised(
uint256 indexed _round,
uint256 _timestamp,
uint256 _param,
uint256 _highestBid,
address _highestBidder
);
address payable printingFund;
address payable auctionOwner;
uint256 public auctionStartTime;
uint256 public minBid = 0.02 ether;
uint256 public currentRound = 1;
uint256 public numOfRounds = 21;
uint256 public roundLengthInSeconds = 0.5 days;
uint256 constant public secondsInADay = 1 days;
// round <> parameter from highest bidder
mapping(uint256 => uint256) public winningRoundParameter;
// round <> highest bid value
mapping(uint256 => uint256) public highestBidFromRound;
// round <> address of the highest bidder
mapping(uint256 => address) public highestBidderFromRound;
ITwistedSisterAccessControls public accessControls;
ITwistedSisterTokenCreator public twistedTokenCreator;
TwistedSisterArtistFundSplitter public artistFundSplitter;
modifier isWhitelisted() {
}
constructor(ITwistedSisterAccessControls _accessControls,
ITwistedSisterTokenCreator _twistedTokenCreator,
TwistedSisterArtistFundSplitter _artistFundSplitter,
address payable _printingFund,
address payable _auctionOwner,
uint256 _auctionStartTime) public {
}
function _isWithinBiddingWindowForRound() internal view returns (bool) {
}
function _isBidValid(uint256 _bidValue) internal view {
}
function _refundHighestBidder() internal {
}
function _splitFundsFromHighestBid() internal {
}
function bid(uint256 _parameter) external payable {
}
function issueTwistAndPrepNextRound(string calldata _ipfsHash) external isWhitelisted {
require(<FILL_ME>)
require(currentRound <= numOfRounds, "Auction has ended");
uint256 previousRound = currentRound;
currentRound = currentRound.add(1);
// Handle no-bid scenario
if (highestBidderFromRound[previousRound] == address(0)) {
highestBidderFromRound[previousRound] = auctionOwner;
winningRoundParameter[previousRound] = 1; // 1 is the default and first param (1...64)
}
// Issue the TWIST
address winner = highestBidderFromRound[previousRound];
uint256 winningRoundParam = winningRoundParameter[previousRound];
uint256 tokenId = twistedTokenCreator.createTwisted(previousRound, winningRoundParam, _ipfsHash, winner);
require(tokenId == previousRound, "Error minting the TWIST token");
// Take the proceedings from the highest bid and split funds accordingly
_splitFundsFromHighestBid();
emit RoundFinalised(previousRound, now, winningRoundParam, highestBidFromRound[previousRound], winner);
}
function updateAuctionStartTime(uint256 _auctionStartTime) external isWhitelisted {
}
function updateNumberOfRounds(uint256 _numOfRounds) external isWhitelisted {
}
function updateRoundLength(uint256 _roundLengthInSeconds) external isWhitelisted {
}
function updateArtistFundSplitter(TwistedSisterArtistFundSplitter _artistFundSplitter) external isWhitelisted {
}
}
| !_isWithinBiddingWindowForRound(),"Current round still active" | 301,176 | !_isWithinBiddingWindowForRound() |
"Not Accountancy Role" | pragma solidity ^0.8.0;
/* Market Contract
** sell unit by fixed prie
*/
contract MarketSale is IMarketSale, IMarketSaleEnum, Pausable, AccessControlEnumerable, ERC721Holder {
struct Sale {
address payable seller;
uint256 price;
uint64 startedAt;
}
// pauser role
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
// accountancy role
bytes32 public constant ACCOUNTANCY_ROLE = keccak256("ACCOUNTANCY");
// untis nft contract
address private _nftContract;
// price limit
uint256 private _PRICE_LIMIT;
// min price
uint256 private _minPrice;
// min trade fee
uint256 private _minFee;
// trade fee pecentage
uint8 private _tradeFee;
// total trade fee receieved
uint256 private _totalFeeAmount;
mapping(uint256 => Sale) private tokenIdToSale;
mapping(address => uint256) private _sellerSalesCount;
mapping(address => mapping(uint256 => uint256)) private _sellerSaleTokens;
mapping(uint256 => uint256) private _sellerSaleTokensIndex;
uint256[] private _allSaleTokens;
mapping(uint256 => uint256) private _allSaleTokensIndex;
event SaleCreated(uint256 tokenId, uint256 price, address payable seller);
event SaleSucceed(uint256 tokenId, uint256 price, address payable seller, address buyer);
event SaleCancelled(uint256 tokenId, address seller);
constructor() {
}
function _init() internal {
}
// init creator as admin role
function _initRoles() internal {
}
// check whether the nft contract is initialed
modifier isInitialed() {
}
// check whether sender could do accountancy
modifier isAccountancyRole() {
bool isAdmin = hasRole(DEFAULT_ADMIN_ROLE, msg.sender);
bool isAccountancy = hasRole(ACCOUNTANCY_ROLE, msg.sender);
require(<FILL_ME>)
_;
}
modifier onlyAdmin() {
}
fallback() external payable {}
receive() external payable {}
function pause() public {
}
function unpause() public {
}
function setNFTContract(address to) public onlyAdmin() {
}
function getNFTContract() public view returns (address) {
}
function setMinPrice(uint256 to) public isAccountancyRole {
}
function getMinPrice() public view returns (uint256) {
}
function setMinFee(uint256 to) public isAccountancyRole {
}
function getMinFee() public view returns (uint256) {
}
function setTradeFee(uint8 to) public isAccountancyRole {
}
function getTradeFee() public view returns (uint256) {
}
function getTotalFeeAmount() public view returns (uint256) {
}
function sellerSalesCount(address seller) public view override returns (uint256) {
}
function saleTokenOfSellerByIndex(address seller, uint256 index) public view override returns (uint256) {
}
function totalSaleTokens() public view override returns (uint256) {
}
function saleTokenByIndex(uint256 index) public view override returns (uint256) {
}
function _isOnSale(Sale storage sale) internal view returns (bool) {
}
function _safeTransferToken(address from, address to, uint256 tokenId) internal {
}
function _escrow(address _owner, uint256 tokenId) internal {
}
function _addSaleTokenToSellerEnumeration(address to, uint256 tokenId) private {
}
function _addSaleTokenToAllEnumeration(uint256 tokenId) private {
}
function _removeSaleTokenFromSellerEnumeration(address from, uint256 tokenId) private {
}
function _removeSaleTokenFromAllTokensEnumeration(uint256 tokenId) private {
}
// add a unit on sale
function _addSale(uint256 tokenId, Sale memory sale) internal {
}
// remove a unit from sale
function _removeSale(uint256 tokenId) internal {
}
// check whether the sender is owner
function _checkMsgSenderMatchOwner(uint256 tokenId) internal view returns (bool) {
}
// add a unit on sale
function createSale(uint256 tokenId, uint256 price) public whenNotPaused isInitialed override returns (uint256) {
}
// get a unit sale details
function getTokenOnSale(uint256 tokenId) public view isInitialed override returns (
address payable seller,
uint256 price,
uint64 startedAt
) {
}
function _getTokenOnSale(uint256 tokenId) internal view returns (
address payable seller,
uint256 price,
uint64 startedAt
) {
}
// cancel a unit from sale
function _cancelOnSale(uint256 tokenId, address seller) internal {
}
function _cancelSale(uint256 tokenId) internal {
}
function _forceCancelSale(uint256 tokenId) internal onlyAdmin {
}
// calculate the trade fee
function calculateTradeFee(uint256 payment) public view returns (uint256) {
}
// buy a unit on sale
function _buySale(uint256 tokenId) internal whenNotPaused {
}
// cancel a unit from sale
function cancelSale(uint256 tokenId) external override {
}
// buy a unit on sale
function buySale(uint256 tokenId) external payable whenNotPaused isInitialed override {
}
// withdraw trade fee from contract
function withdrawBalance(address payable to, uint256 amount) external override isAccountancyRole {
}
function _transferBalance(address payable to, uint256 amount) internal {
}
function withdrawERC20Token(address token, address to, uint256 amount) external isAccountancyRole {
}
function cancelLastSale(uint256 count) public whenPaused onlyAdmin {
}
}
| isAdmin||isAccountancy,"Not Accountancy Role" | 301,209 | isAdmin||isAccountancy |
"Not unit owner" | pragma solidity ^0.8.0;
/* Market Contract
** sell unit by fixed prie
*/
contract MarketSale is IMarketSale, IMarketSaleEnum, Pausable, AccessControlEnumerable, ERC721Holder {
struct Sale {
address payable seller;
uint256 price;
uint64 startedAt;
}
// pauser role
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
// accountancy role
bytes32 public constant ACCOUNTANCY_ROLE = keccak256("ACCOUNTANCY");
// untis nft contract
address private _nftContract;
// price limit
uint256 private _PRICE_LIMIT;
// min price
uint256 private _minPrice;
// min trade fee
uint256 private _minFee;
// trade fee pecentage
uint8 private _tradeFee;
// total trade fee receieved
uint256 private _totalFeeAmount;
mapping(uint256 => Sale) private tokenIdToSale;
mapping(address => uint256) private _sellerSalesCount;
mapping(address => mapping(uint256 => uint256)) private _sellerSaleTokens;
mapping(uint256 => uint256) private _sellerSaleTokensIndex;
uint256[] private _allSaleTokens;
mapping(uint256 => uint256) private _allSaleTokensIndex;
event SaleCreated(uint256 tokenId, uint256 price, address payable seller);
event SaleSucceed(uint256 tokenId, uint256 price, address payable seller, address buyer);
event SaleCancelled(uint256 tokenId, address seller);
constructor() {
}
function _init() internal {
}
// init creator as admin role
function _initRoles() internal {
}
// check whether the nft contract is initialed
modifier isInitialed() {
}
// check whether sender could do accountancy
modifier isAccountancyRole() {
}
modifier onlyAdmin() {
}
fallback() external payable {}
receive() external payable {}
function pause() public {
}
function unpause() public {
}
function setNFTContract(address to) public onlyAdmin() {
}
function getNFTContract() public view returns (address) {
}
function setMinPrice(uint256 to) public isAccountancyRole {
}
function getMinPrice() public view returns (uint256) {
}
function setMinFee(uint256 to) public isAccountancyRole {
}
function getMinFee() public view returns (uint256) {
}
function setTradeFee(uint8 to) public isAccountancyRole {
}
function getTradeFee() public view returns (uint256) {
}
function getTotalFeeAmount() public view returns (uint256) {
}
function sellerSalesCount(address seller) public view override returns (uint256) {
}
function saleTokenOfSellerByIndex(address seller, uint256 index) public view override returns (uint256) {
}
function totalSaleTokens() public view override returns (uint256) {
}
function saleTokenByIndex(uint256 index) public view override returns (uint256) {
}
function _isOnSale(Sale storage sale) internal view returns (bool) {
}
function _safeTransferToken(address from, address to, uint256 tokenId) internal {
}
function _escrow(address _owner, uint256 tokenId) internal {
}
function _addSaleTokenToSellerEnumeration(address to, uint256 tokenId) private {
}
function _addSaleTokenToAllEnumeration(uint256 tokenId) private {
}
function _removeSaleTokenFromSellerEnumeration(address from, uint256 tokenId) private {
}
function _removeSaleTokenFromAllTokensEnumeration(uint256 tokenId) private {
}
// add a unit on sale
function _addSale(uint256 tokenId, Sale memory sale) internal {
}
// remove a unit from sale
function _removeSale(uint256 tokenId) internal {
}
// check whether the sender is owner
function _checkMsgSenderMatchOwner(uint256 tokenId) internal view returns (bool) {
}
// add a unit on sale
function createSale(uint256 tokenId, uint256 price) public whenNotPaused isInitialed override returns (uint256) {
require(<FILL_ME>)
require(price >= _minPrice, "Unit price too low");
address payable seller = payable(msg.sender);
_escrow(seller, tokenId);
Sale memory sale = Sale(
seller,
price,
uint64(block.timestamp)
);
_addSale(tokenId, sale);
// return on sale unit count
return _allSaleTokens.length - 1;
}
// get a unit sale details
function getTokenOnSale(uint256 tokenId) public view isInitialed override returns (
address payable seller,
uint256 price,
uint64 startedAt
) {
}
function _getTokenOnSale(uint256 tokenId) internal view returns (
address payable seller,
uint256 price,
uint64 startedAt
) {
}
// cancel a unit from sale
function _cancelOnSale(uint256 tokenId, address seller) internal {
}
function _cancelSale(uint256 tokenId) internal {
}
function _forceCancelSale(uint256 tokenId) internal onlyAdmin {
}
// calculate the trade fee
function calculateTradeFee(uint256 payment) public view returns (uint256) {
}
// buy a unit on sale
function _buySale(uint256 tokenId) internal whenNotPaused {
}
// cancel a unit from sale
function cancelSale(uint256 tokenId) external override {
}
// buy a unit on sale
function buySale(uint256 tokenId) external payable whenNotPaused isInitialed override {
}
// withdraw trade fee from contract
function withdrawBalance(address payable to, uint256 amount) external override isAccountancyRole {
}
function _transferBalance(address payable to, uint256 amount) internal {
}
function withdrawERC20Token(address token, address to, uint256 amount) external isAccountancyRole {
}
function cancelLastSale(uint256 count) public whenPaused onlyAdmin {
}
}
| _checkMsgSenderMatchOwner(tokenId),"Not unit owner" | 301,209 | _checkMsgSenderMatchOwner(tokenId) |
"Token is not on sale" | pragma solidity ^0.8.0;
/* Market Contract
** sell unit by fixed prie
*/
contract MarketSale is IMarketSale, IMarketSaleEnum, Pausable, AccessControlEnumerable, ERC721Holder {
struct Sale {
address payable seller;
uint256 price;
uint64 startedAt;
}
// pauser role
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
// accountancy role
bytes32 public constant ACCOUNTANCY_ROLE = keccak256("ACCOUNTANCY");
// untis nft contract
address private _nftContract;
// price limit
uint256 private _PRICE_LIMIT;
// min price
uint256 private _minPrice;
// min trade fee
uint256 private _minFee;
// trade fee pecentage
uint8 private _tradeFee;
// total trade fee receieved
uint256 private _totalFeeAmount;
mapping(uint256 => Sale) private tokenIdToSale;
mapping(address => uint256) private _sellerSalesCount;
mapping(address => mapping(uint256 => uint256)) private _sellerSaleTokens;
mapping(uint256 => uint256) private _sellerSaleTokensIndex;
uint256[] private _allSaleTokens;
mapping(uint256 => uint256) private _allSaleTokensIndex;
event SaleCreated(uint256 tokenId, uint256 price, address payable seller);
event SaleSucceed(uint256 tokenId, uint256 price, address payable seller, address buyer);
event SaleCancelled(uint256 tokenId, address seller);
constructor() {
}
function _init() internal {
}
// init creator as admin role
function _initRoles() internal {
}
// check whether the nft contract is initialed
modifier isInitialed() {
}
// check whether sender could do accountancy
modifier isAccountancyRole() {
}
modifier onlyAdmin() {
}
fallback() external payable {}
receive() external payable {}
function pause() public {
}
function unpause() public {
}
function setNFTContract(address to) public onlyAdmin() {
}
function getNFTContract() public view returns (address) {
}
function setMinPrice(uint256 to) public isAccountancyRole {
}
function getMinPrice() public view returns (uint256) {
}
function setMinFee(uint256 to) public isAccountancyRole {
}
function getMinFee() public view returns (uint256) {
}
function setTradeFee(uint8 to) public isAccountancyRole {
}
function getTradeFee() public view returns (uint256) {
}
function getTotalFeeAmount() public view returns (uint256) {
}
function sellerSalesCount(address seller) public view override returns (uint256) {
}
function saleTokenOfSellerByIndex(address seller, uint256 index) public view override returns (uint256) {
}
function totalSaleTokens() public view override returns (uint256) {
}
function saleTokenByIndex(uint256 index) public view override returns (uint256) {
}
function _isOnSale(Sale storage sale) internal view returns (bool) {
}
function _safeTransferToken(address from, address to, uint256 tokenId) internal {
}
function _escrow(address _owner, uint256 tokenId) internal {
}
function _addSaleTokenToSellerEnumeration(address to, uint256 tokenId) private {
}
function _addSaleTokenToAllEnumeration(uint256 tokenId) private {
}
function _removeSaleTokenFromSellerEnumeration(address from, uint256 tokenId) private {
}
function _removeSaleTokenFromAllTokensEnumeration(uint256 tokenId) private {
}
// add a unit on sale
function _addSale(uint256 tokenId, Sale memory sale) internal {
}
// remove a unit from sale
function _removeSale(uint256 tokenId) internal {
}
// check whether the sender is owner
function _checkMsgSenderMatchOwner(uint256 tokenId) internal view returns (bool) {
}
// add a unit on sale
function createSale(uint256 tokenId, uint256 price) public whenNotPaused isInitialed override returns (uint256) {
}
// get a unit sale details
function getTokenOnSale(uint256 tokenId) public view isInitialed override returns (
address payable seller,
uint256 price,
uint64 startedAt
) {
}
function _getTokenOnSale(uint256 tokenId) internal view returns (
address payable seller,
uint256 price,
uint64 startedAt
) {
Sale storage s = tokenIdToSale[tokenId];
require(<FILL_ME>)
seller = s.seller;
price = s.price;
startedAt = s.startedAt;
}
// cancel a unit from sale
function _cancelOnSale(uint256 tokenId, address seller) internal {
}
function _cancelSale(uint256 tokenId) internal {
}
function _forceCancelSale(uint256 tokenId) internal onlyAdmin {
}
// calculate the trade fee
function calculateTradeFee(uint256 payment) public view returns (uint256) {
}
// buy a unit on sale
function _buySale(uint256 tokenId) internal whenNotPaused {
}
// cancel a unit from sale
function cancelSale(uint256 tokenId) external override {
}
// buy a unit on sale
function buySale(uint256 tokenId) external payable whenNotPaused isInitialed override {
}
// withdraw trade fee from contract
function withdrawBalance(address payable to, uint256 amount) external override isAccountancyRole {
}
function _transferBalance(address payable to, uint256 amount) internal {
}
function withdrawERC20Token(address token, address to, uint256 amount) external isAccountancyRole {
}
function cancelLastSale(uint256 count) public whenPaused onlyAdmin {
}
}
| _isOnSale(s),"Token is not on sale" | 301,209 | _isOnSale(s) |
"address has been greylisted" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
// Stolen with love from Synthetixio
// https://raw.githubusercontent.com/Synthetixio/synthetix/develop/contracts/StakingRewards.sol
import "./Math.sol";
import "./SafeMath.sol";
import "./ERC20.sol";
import './TransferHelper.sol';
import "./SafeERC20.sol";
import "./Stc.sol";
import "./ReentrancyGuard.sol";
import "./StringHelpers.sol";
// Inheritance
import "./IStakingRewards.sol";
import "./RewardsDistributionRecipient.sol";
import "./Pausable.sol";
contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, ReentrancyGuard, Pausable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
/* ========== STATE VARIABLES ========== */
ERC20 public rewardsToken;
ERC20 public stakingToken;
ERC20 public STC;
uint256 public periodFinish;
uint256 public starttime = 1643292000;
uint256 public rate;
uint256 public dailyLimit;
uint256 public lastUpdateTvlTime;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
// Max reward per second
uint256 public rewardRate;
// uint256 public rewardsDuration = 86400 hours;
uint256 public rewardsDuration = 604800; // 7 * 86400 (7 days)
uint256 public lastUpdateTime;
uint256 public rewardPerTokenStored = 0;
// uint256 public pool_weight; // This staking pool's percentage of the total STS being distributed by all pools, 6 decimals of precision
address public owner_address;
address public timelock_address; // Governance timelock address
uint256 public locked_stake_max_multiplier = 3000000; // 6 decimals of precision. 1x = 1000000
uint256 public locked_stake_time_for_max_multiplier = 3 * 365 * 86400; // 3 years
uint256 public locked_stake_min_time = 604800; // 7 * 86400 (7 days)
string private locked_stake_min_time_str = "604800"; // 7 days on genesis
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
uint256 private _staking_token_supply = 0;
uint256 private _staking_token_boosted_supply = 0;
mapping(address => uint256) private _balances;
mapping(address => uint256) private _boosted_balances;
mapping(address => LockedStake[]) private lockedStakes;
mapping (address => uint256) public claimed;
mapping(address => bool) public greylist;
bool public unlockedStakes; // Release lock stakes in case of system migration
struct LockedStake {
bytes32 kek_id;
uint256 start_timestamp;
uint256 amount;
uint256 ending_timestamp;
uint256 multiplier; // 6 decimals of precision. 1x = 1000000
}
/* ========== CONSTRUCTOR ========== */
constructor(
address _owner,
address _rewardsDistribution,
address _rewardsToken,
address _stakingToken,
address _timelock_address,
address _STC,
uint256 _starttime,
uint256 _rate,
uint256 _dailyLimit
) public Owned(_owner){
}
modifier checkStart(){
}
modifier onlyByOwnerOrGovernance() {
}
function setStartTime(uint256 _starttime) public onlyOwner{
}
/* ========== VIEWS ========== */
function totalSupply() external override view returns (uint256) {
}
function totalBoostedSupply() external view returns (uint256) {
}
function stakingMultiplier(uint256 secs) public view returns (uint256) {
}
function balanceOf(address account) external override view returns (uint256) {
}
function boostedBalanceOf(address account) external view returns (uint256) {
}
function lockedBalanceOf(address account) public view returns (uint256) {
}
function unlockedBalanceOf(address account) external view returns (uint256) {
}
function lockedStakesOf(address account) external view returns (LockedStake[] memory) {
}
function stakingDecimals() external view returns (uint256) {
}
function rewardsFor(address account) external view returns (uint256) {
}
function lastTimeRewardApplicable() public override view returns (uint256) {
}
function rewardPerToken() public override view returns (uint256) {
}
function earned(address account) public override view returns (uint256) {
}
function getRewardForDuration() external override view returns (uint256) {
}
/* ========== MUTATIVE FUNCTIONS ========== */
function stake(uint256 amount) external override nonReentrant notPaused updateReward(msg.sender) checkStart{
require(amount > 0, "Cannot stake 0");
require(<FILL_ME>)
// Staking token supply and boosted supply
_staking_token_supply = _staking_token_supply.add(amount);
_staking_token_boosted_supply = _staking_token_boosted_supply.add(amount);
// Staking token balance and boosted balance
_balances[msg.sender] = _balances[msg.sender].add(amount);
_boosted_balances[msg.sender] = _boosted_balances[msg.sender].add(amount);
// Pull the tokens from the staker
TransferHelper.safeTransferFrom(address(stakingToken), msg.sender, address(this), amount);
emit Staked(msg.sender, amount);
}
function stakeLocked(uint256 amount, uint256 secs) external nonReentrant notPaused updateReward(msg.sender) checkStart{
}
function withdraw(uint256 amount) public override nonReentrant updateReward(msg.sender) checkStart{
}
function withdrawLocked(bytes32 kek_id) public nonReentrant updateReward(msg.sender) checkStart{
}
function getReward() public override nonReentrant updateReward(msg.sender) checkStart{
}
function getClaimed(address _address) public view returns(uint256) {
}
/*
function exit() external override {
withdraw(_balances[msg.sender]);
// TODO: Add locked stakes too?
getReward();
}
*/
function renewIfApplicable() external {
}
// If the period expired, renew it
function retroCatchUp() internal {
}
function notifyRewardAmount() public {
}
function setRate(uint256 _rate) public onlyByOwnerOrGovernance {
}
function getAvgTVL(uint256 _duration) public view returns(uint256) {
}
// Added to support recovering LP Rewards from other systems to be distributed to holders
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyByOwnerOrGovernance {
}
function setRewardsDuration(uint256 _rewardsDuration) external onlyByOwnerOrGovernance {
}
function setLockedStakeTimeForMinAndMaxMultiplier(uint256 _locked_stake_time_for_max_multiplier, uint256 _locked_stake_min_time) external onlyByOwnerOrGovernance {
}
function initializeDefault() external onlyByOwnerOrGovernance {
}
function greylistAddress(address _address) external onlyByOwnerOrGovernance {
}
function unlockStakes() external onlyByOwnerOrGovernance {
}
function setRewardRate(uint256 _new_rate) external onlyByOwnerOrGovernance {
}
/* ========== MODIFIERS ========== */
modifier updateReward(address account) {
}
/* ========== EVENTS ========== */
event RewardAdded(uint256 reward);
event Staked(address indexed user, uint256 amount);
event StakeLocked(address indexed user, uint256 amount, uint256 secs);
event Withdrawn(address indexed user, uint256 amount);
event WithdrawnLocked(address indexed user, uint256 amount, bytes32 kek_id);
event RewardPaid(address indexed user, uint256 reward);
event RewardsDurationUpdated(uint256 newDuration);
event Recovered(address token, uint256 amount);
event RewardsPeriodRenewed(address token);
event DefaultInitialization();
event LockedStakeMaxMultiplierUpdated(uint256 multiplier);
event LockedStakeTimeForMaxMultiplier(uint256 secs);
event LockedStakeMinTime(uint256 secs);
}
| greylist[msg.sender]==false,"address has been greylisted" | 301,243 | greylist[msg.sender]==false |
"Not enough STS available for rewards!" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
// Stolen with love from Synthetixio
// https://raw.githubusercontent.com/Synthetixio/synthetix/develop/contracts/StakingRewards.sol
import "./Math.sol";
import "./SafeMath.sol";
import "./ERC20.sol";
import './TransferHelper.sol';
import "./SafeERC20.sol";
import "./Stc.sol";
import "./ReentrancyGuard.sol";
import "./StringHelpers.sol";
// Inheritance
import "./IStakingRewards.sol";
import "./RewardsDistributionRecipient.sol";
import "./Pausable.sol";
contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, ReentrancyGuard, Pausable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
/* ========== STATE VARIABLES ========== */
ERC20 public rewardsToken;
ERC20 public stakingToken;
ERC20 public STC;
uint256 public periodFinish;
uint256 public starttime = 1643292000;
uint256 public rate;
uint256 public dailyLimit;
uint256 public lastUpdateTvlTime;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
// Max reward per second
uint256 public rewardRate;
// uint256 public rewardsDuration = 86400 hours;
uint256 public rewardsDuration = 604800; // 7 * 86400 (7 days)
uint256 public lastUpdateTime;
uint256 public rewardPerTokenStored = 0;
// uint256 public pool_weight; // This staking pool's percentage of the total STS being distributed by all pools, 6 decimals of precision
address public owner_address;
address public timelock_address; // Governance timelock address
uint256 public locked_stake_max_multiplier = 3000000; // 6 decimals of precision. 1x = 1000000
uint256 public locked_stake_time_for_max_multiplier = 3 * 365 * 86400; // 3 years
uint256 public locked_stake_min_time = 604800; // 7 * 86400 (7 days)
string private locked_stake_min_time_str = "604800"; // 7 days on genesis
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
uint256 private _staking_token_supply = 0;
uint256 private _staking_token_boosted_supply = 0;
mapping(address => uint256) private _balances;
mapping(address => uint256) private _boosted_balances;
mapping(address => LockedStake[]) private lockedStakes;
mapping (address => uint256) public claimed;
mapping(address => bool) public greylist;
bool public unlockedStakes; // Release lock stakes in case of system migration
struct LockedStake {
bytes32 kek_id;
uint256 start_timestamp;
uint256 amount;
uint256 ending_timestamp;
uint256 multiplier; // 6 decimals of precision. 1x = 1000000
}
/* ========== CONSTRUCTOR ========== */
constructor(
address _owner,
address _rewardsDistribution,
address _rewardsToken,
address _stakingToken,
address _timelock_address,
address _STC,
uint256 _starttime,
uint256 _rate,
uint256 _dailyLimit
) public Owned(_owner){
}
modifier checkStart(){
}
modifier onlyByOwnerOrGovernance() {
}
function setStartTime(uint256 _starttime) public onlyOwner{
}
/* ========== VIEWS ========== */
function totalSupply() external override view returns (uint256) {
}
function totalBoostedSupply() external view returns (uint256) {
}
function stakingMultiplier(uint256 secs) public view returns (uint256) {
}
function balanceOf(address account) external override view returns (uint256) {
}
function boostedBalanceOf(address account) external view returns (uint256) {
}
function lockedBalanceOf(address account) public view returns (uint256) {
}
function unlockedBalanceOf(address account) external view returns (uint256) {
}
function lockedStakesOf(address account) external view returns (LockedStake[] memory) {
}
function stakingDecimals() external view returns (uint256) {
}
function rewardsFor(address account) external view returns (uint256) {
}
function lastTimeRewardApplicable() public override view returns (uint256) {
}
function rewardPerToken() public override view returns (uint256) {
}
function earned(address account) public override view returns (uint256) {
}
function getRewardForDuration() external override view returns (uint256) {
}
/* ========== MUTATIVE FUNCTIONS ========== */
function stake(uint256 amount) external override nonReentrant notPaused updateReward(msg.sender) checkStart{
}
function stakeLocked(uint256 amount, uint256 secs) external nonReentrant notPaused updateReward(msg.sender) checkStart{
}
function withdraw(uint256 amount) public override nonReentrant updateReward(msg.sender) checkStart{
}
function withdrawLocked(bytes32 kek_id) public nonReentrant updateReward(msg.sender) checkStart{
}
function getReward() public override nonReentrant updateReward(msg.sender) checkStart{
}
function getClaimed(address _address) public view returns(uint256) {
}
/*
function exit() external override {
withdraw(_balances[msg.sender]);
// TODO: Add locked stakes too?
getReward();
}
*/
function renewIfApplicable() external {
}
// If the period expired, renew it
function retroCatchUp() internal {
// Ensure the provided reward amount is not more than the balance in the contract.
// This keeps the reward rate in the right range, preventing overflows due to
// very high values of rewardRate in the earned and rewardsPerToken functions;
// Reward + leftover must be less than 2^256 / 10^18 to avoid overflow.
uint256 num_periods_elapsed = uint256(block.timestamp.sub(periodFinish)) / rewardsDuration; // Floor division to the nearest period
uint balance = rewardsToken.balanceOf(address(this));
require(<FILL_ME>)
// uint256 old_lastUpdateTime = lastUpdateTime;
// uint256 new_lastUpdateTime = block.timestamp;
// lastUpdateTime = periodFinish;
periodFinish = periodFinish.add((num_periods_elapsed.add(1)).mul(rewardsDuration));
rewardPerTokenStored = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
emit RewardsPeriodRenewed(address(stakingToken));
}
function notifyRewardAmount() public {
}
function setRate(uint256 _rate) public onlyByOwnerOrGovernance {
}
function getAvgTVL(uint256 _duration) public view returns(uint256) {
}
// Added to support recovering LP Rewards from other systems to be distributed to holders
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyByOwnerOrGovernance {
}
function setRewardsDuration(uint256 _rewardsDuration) external onlyByOwnerOrGovernance {
}
function setLockedStakeTimeForMinAndMaxMultiplier(uint256 _locked_stake_time_for_max_multiplier, uint256 _locked_stake_min_time) external onlyByOwnerOrGovernance {
}
function initializeDefault() external onlyByOwnerOrGovernance {
}
function greylistAddress(address _address) external onlyByOwnerOrGovernance {
}
function unlockStakes() external onlyByOwnerOrGovernance {
}
function setRewardRate(uint256 _new_rate) external onlyByOwnerOrGovernance {
}
/* ========== MODIFIERS ========== */
modifier updateReward(address account) {
}
/* ========== EVENTS ========== */
event RewardAdded(uint256 reward);
event Staked(address indexed user, uint256 amount);
event StakeLocked(address indexed user, uint256 amount, uint256 secs);
event Withdrawn(address indexed user, uint256 amount);
event WithdrawnLocked(address indexed user, uint256 amount, bytes32 kek_id);
event RewardPaid(address indexed user, uint256 reward);
event RewardsDurationUpdated(uint256 newDuration);
event Recovered(address token, uint256 amount);
event RewardsPeriodRenewed(address token);
event DefaultInitialization();
event LockedStakeMaxMultiplierUpdated(uint256 multiplier);
event LockedStakeTimeForMaxMultiplier(uint256 secs);
event LockedStakeMinTime(uint256 secs);
}
| rewardRate.mul(rewardsDuration).mul(1e6).mul(num_periods_elapsed+1).div(PRICE_PRECISION)<=balance,"Not enough STS available for rewards!" | 301,243 | rewardRate.mul(rewardsDuration).mul(1e6).mul(num_periods_elapsed+1).div(PRICE_PRECISION)<=balance |
null | pragma solidity ^0.5.9;
contract ImmDomains {
address public owner;
address public registrar;
mapping(bytes => address) public addresses;
event OwnerUpdate(address _owner);
event RegistrarUpdate(address _registrar);
event Registration(bytes _domain, address _address);
constructor() public {
}
modifier onlyOwner() {
}
function setOwner(address _owner) onlyOwner() external {
}
function setRegistrar(address _registrar) onlyOwner() external {
}
function isValidCharacter(uint8 _character) public pure returns (bool) {
}
function isValidDomain(bytes memory _domain) public pure returns (bool) {
}
function register(bytes calldata _domain, address _address) external {
require(msg.sender == registrar);
require(_address != address(0));
require(<FILL_ME>)
require(addresses[_domain] == address(0));
addresses[_domain] = _address;
emit Registration(_domain, _address);
}
}
| isValidDomain(_domain) | 301,287 | isValidDomain(_domain) |
null | pragma solidity ^0.5.9;
contract ImmDomains {
address public owner;
address public registrar;
mapping(bytes => address) public addresses;
event OwnerUpdate(address _owner);
event RegistrarUpdate(address _registrar);
event Registration(bytes _domain, address _address);
constructor() public {
}
modifier onlyOwner() {
}
function setOwner(address _owner) onlyOwner() external {
}
function setRegistrar(address _registrar) onlyOwner() external {
}
function isValidCharacter(uint8 _character) public pure returns (bool) {
}
function isValidDomain(bytes memory _domain) public pure returns (bool) {
}
function register(bytes calldata _domain, address _address) external {
require(msg.sender == registrar);
require(_address != address(0));
require(isValidDomain(_domain));
require(<FILL_ME>)
addresses[_domain] = _address;
emit Registration(_domain, _address);
}
}
| addresses[_domain]==address(0) | 301,287 | addresses[_domain]==address(0) |
"The entire presale has been sold. Check back for public mint." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
// @author: LoMel
contract TheDonutShop is ERC721Enumerable, Ownable {
using ECDSA for bytes32;
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
enum ContractState { PAUSED, PRESALE, PUBLIC }
ContractState public currentState = ContractState.PAUSED;
uint256 public MAX_TOTAL_MINT = 7777;
uint256 public MAX_PER_TRANSACTION = 5;
uint256 public MAX_PER_WALLET_FOR_PUBLIC = 10;
uint256 public PRICE_PER_DONUT = .12 ether;
mapping(address => uint256) public addressMinted;
string private baseURI;
string private baseURISuffix;
string private signVersion;
address private signer;
constructor(
string memory _base,
string memory _suffix,
string memory _signVersion) ERC721("The Donut Shop", "DONUT") {
}
function updateSignVersion(string calldata _signVersion) external onlyOwner {
}
function updateSigner(address _signer) external onlyOwner {
}
function _verify(address sender, uint256 maxMintAmount, bytes memory signature) internal view returns (bool) {
}
function changeContractState(ContractState _state) external onlyOwner {
}
function claimDonuts(uint256 _numberOfDonuts, uint256 _maxMintAmount, bytes memory _signature) external payable {
require(currentState == ContractState.PRESALE, "The whitelist is not active yet. Stay tuned.");
require(<FILL_ME>)
require(getNFTPrice(_numberOfDonuts) <= msg.value, "Amount of Ether sent is not correct.");
require(_verify(msg.sender, _maxMintAmount, _signature), "This signature is not verified. You are not on the whitelist.");
require(SafeMath.add(addressMinted[msg.sender], _numberOfDonuts) <= _maxMintAmount, "This amount exceeds the quantity you are allowed to mint during presale.");
for(uint i = 0; i < _numberOfDonuts; ++i){
uint256 tokenIndex = _tokenIdCounter.current();
_tokenIdCounter.increment();
++addressMinted[msg.sender];
_safeMint(msg.sender, tokenIndex);
}
}
function mintDonuts(uint256 _numberOfDonuts) external payable {
}
function airdropDonuts(address[] calldata _to, uint256[] calldata _numberOfDonuts) external onlyOwner {
}
function getNFTPrice(uint256 _amount) public view returns (uint256) {
}
function withdraw() external onlyOwner {
}
function setMaxes(uint256 _maxTotalMint, uint256 _maxPerTransaction, uint256 _pricePerDonut) external onlyOwner {
}
function setBaseURI(string calldata _base, string calldata _suffix) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
}
| SafeMath.add(_tokenIdCounter.current(),_numberOfDonuts)<=MAX_TOTAL_MINT,"The entire presale has been sold. Check back for public mint." | 301,318 | SafeMath.add(_tokenIdCounter.current(),_numberOfDonuts)<=MAX_TOTAL_MINT |
"Amount of Ether sent is not correct." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
// @author: LoMel
contract TheDonutShop is ERC721Enumerable, Ownable {
using ECDSA for bytes32;
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
enum ContractState { PAUSED, PRESALE, PUBLIC }
ContractState public currentState = ContractState.PAUSED;
uint256 public MAX_TOTAL_MINT = 7777;
uint256 public MAX_PER_TRANSACTION = 5;
uint256 public MAX_PER_WALLET_FOR_PUBLIC = 10;
uint256 public PRICE_PER_DONUT = .12 ether;
mapping(address => uint256) public addressMinted;
string private baseURI;
string private baseURISuffix;
string private signVersion;
address private signer;
constructor(
string memory _base,
string memory _suffix,
string memory _signVersion) ERC721("The Donut Shop", "DONUT") {
}
function updateSignVersion(string calldata _signVersion) external onlyOwner {
}
function updateSigner(address _signer) external onlyOwner {
}
function _verify(address sender, uint256 maxMintAmount, bytes memory signature) internal view returns (bool) {
}
function changeContractState(ContractState _state) external onlyOwner {
}
function claimDonuts(uint256 _numberOfDonuts, uint256 _maxMintAmount, bytes memory _signature) external payable {
require(currentState == ContractState.PRESALE, "The whitelist is not active yet. Stay tuned.");
require(SafeMath.add(_tokenIdCounter.current(), _numberOfDonuts) <= MAX_TOTAL_MINT, "The entire presale has been sold. Check back for public mint.");
require(<FILL_ME>)
require(_verify(msg.sender, _maxMintAmount, _signature), "This signature is not verified. You are not on the whitelist.");
require(SafeMath.add(addressMinted[msg.sender], _numberOfDonuts) <= _maxMintAmount, "This amount exceeds the quantity you are allowed to mint during presale.");
for(uint i = 0; i < _numberOfDonuts; ++i){
uint256 tokenIndex = _tokenIdCounter.current();
_tokenIdCounter.increment();
++addressMinted[msg.sender];
_safeMint(msg.sender, tokenIndex);
}
}
function mintDonuts(uint256 _numberOfDonuts) external payable {
}
function airdropDonuts(address[] calldata _to, uint256[] calldata _numberOfDonuts) external onlyOwner {
}
function getNFTPrice(uint256 _amount) public view returns (uint256) {
}
function withdraw() external onlyOwner {
}
function setMaxes(uint256 _maxTotalMint, uint256 _maxPerTransaction, uint256 _pricePerDonut) external onlyOwner {
}
function setBaseURI(string calldata _base, string calldata _suffix) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
}
| getNFTPrice(_numberOfDonuts)<=msg.value,"Amount of Ether sent is not correct." | 301,318 | getNFTPrice(_numberOfDonuts)<=msg.value |
"This amount exceeds the quantity you are allowed to mint during presale." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
// @author: LoMel
contract TheDonutShop is ERC721Enumerable, Ownable {
using ECDSA for bytes32;
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
enum ContractState { PAUSED, PRESALE, PUBLIC }
ContractState public currentState = ContractState.PAUSED;
uint256 public MAX_TOTAL_MINT = 7777;
uint256 public MAX_PER_TRANSACTION = 5;
uint256 public MAX_PER_WALLET_FOR_PUBLIC = 10;
uint256 public PRICE_PER_DONUT = .12 ether;
mapping(address => uint256) public addressMinted;
string private baseURI;
string private baseURISuffix;
string private signVersion;
address private signer;
constructor(
string memory _base,
string memory _suffix,
string memory _signVersion) ERC721("The Donut Shop", "DONUT") {
}
function updateSignVersion(string calldata _signVersion) external onlyOwner {
}
function updateSigner(address _signer) external onlyOwner {
}
function _verify(address sender, uint256 maxMintAmount, bytes memory signature) internal view returns (bool) {
}
function changeContractState(ContractState _state) external onlyOwner {
}
function claimDonuts(uint256 _numberOfDonuts, uint256 _maxMintAmount, bytes memory _signature) external payable {
require(currentState == ContractState.PRESALE, "The whitelist is not active yet. Stay tuned.");
require(SafeMath.add(_tokenIdCounter.current(), _numberOfDonuts) <= MAX_TOTAL_MINT, "The entire presale has been sold. Check back for public mint.");
require(getNFTPrice(_numberOfDonuts) <= msg.value, "Amount of Ether sent is not correct.");
require(_verify(msg.sender, _maxMintAmount, _signature), "This signature is not verified. You are not on the whitelist.");
require(<FILL_ME>)
for(uint i = 0; i < _numberOfDonuts; ++i){
uint256 tokenIndex = _tokenIdCounter.current();
_tokenIdCounter.increment();
++addressMinted[msg.sender];
_safeMint(msg.sender, tokenIndex);
}
}
function mintDonuts(uint256 _numberOfDonuts) external payable {
}
function airdropDonuts(address[] calldata _to, uint256[] calldata _numberOfDonuts) external onlyOwner {
}
function getNFTPrice(uint256 _amount) public view returns (uint256) {
}
function withdraw() external onlyOwner {
}
function setMaxes(uint256 _maxTotalMint, uint256 _maxPerTransaction, uint256 _pricePerDonut) external onlyOwner {
}
function setBaseURI(string calldata _base, string calldata _suffix) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
}
| SafeMath.add(addressMinted[msg.sender],_numberOfDonuts)<=_maxMintAmount,"This amount exceeds the quantity you are allowed to mint during presale." | 301,318 | SafeMath.add(addressMinted[msg.sender],_numberOfDonuts)<=_maxMintAmount |
"This amount exceeds the quantity you are allowed to mint during public." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
// @author: LoMel
contract TheDonutShop is ERC721Enumerable, Ownable {
using ECDSA for bytes32;
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
enum ContractState { PAUSED, PRESALE, PUBLIC }
ContractState public currentState = ContractState.PAUSED;
uint256 public MAX_TOTAL_MINT = 7777;
uint256 public MAX_PER_TRANSACTION = 5;
uint256 public MAX_PER_WALLET_FOR_PUBLIC = 10;
uint256 public PRICE_PER_DONUT = .12 ether;
mapping(address => uint256) public addressMinted;
string private baseURI;
string private baseURISuffix;
string private signVersion;
address private signer;
constructor(
string memory _base,
string memory _suffix,
string memory _signVersion) ERC721("The Donut Shop", "DONUT") {
}
function updateSignVersion(string calldata _signVersion) external onlyOwner {
}
function updateSigner(address _signer) external onlyOwner {
}
function _verify(address sender, uint256 maxMintAmount, bytes memory signature) internal view returns (bool) {
}
function changeContractState(ContractState _state) external onlyOwner {
}
function claimDonuts(uint256 _numberOfDonuts, uint256 _maxMintAmount, bytes memory _signature) external payable {
}
function mintDonuts(uint256 _numberOfDonuts) external payable {
require(currentState == ContractState.PUBLIC, "The public sale is not active yet. Stay Tuned.");
require(_numberOfDonuts <= MAX_PER_TRANSACTION, "Don't be greedy. That's too many.");
require(<FILL_ME>)
require(SafeMath.add(_tokenIdCounter.current(), _numberOfDonuts) <= MAX_TOTAL_MINT, "Exceeds maximum supply.");
require(getNFTPrice(_numberOfDonuts) <= msg.value, "Amount of Ether sent is not correct.");
for(uint i = 0; i < _numberOfDonuts; ++i){
uint256 tokenIndex = _tokenIdCounter.current();
_tokenIdCounter.increment();
++addressMinted[msg.sender];
_safeMint(msg.sender, tokenIndex);
}
}
function airdropDonuts(address[] calldata _to, uint256[] calldata _numberOfDonuts) external onlyOwner {
}
function getNFTPrice(uint256 _amount) public view returns (uint256) {
}
function withdraw() external onlyOwner {
}
function setMaxes(uint256 _maxTotalMint, uint256 _maxPerTransaction, uint256 _pricePerDonut) external onlyOwner {
}
function setBaseURI(string calldata _base, string calldata _suffix) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
}
| SafeMath.add(addressMinted[msg.sender],_numberOfDonuts)<=MAX_PER_WALLET_FOR_PUBLIC,"This amount exceeds the quantity you are allowed to mint during public." | 301,318 | SafeMath.add(addressMinted[msg.sender],_numberOfDonuts)<=MAX_PER_WALLET_FOR_PUBLIC |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
// @author: LoMel
contract TheDonutShop is ERC721Enumerable, Ownable {
using ECDSA for bytes32;
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
enum ContractState { PAUSED, PRESALE, PUBLIC }
ContractState public currentState = ContractState.PAUSED;
uint256 public MAX_TOTAL_MINT = 7777;
uint256 public MAX_PER_TRANSACTION = 5;
uint256 public MAX_PER_WALLET_FOR_PUBLIC = 10;
uint256 public PRICE_PER_DONUT = .12 ether;
mapping(address => uint256) public addressMinted;
string private baseURI;
string private baseURISuffix;
string private signVersion;
address private signer;
constructor(
string memory _base,
string memory _suffix,
string memory _signVersion) ERC721("The Donut Shop", "DONUT") {
}
function updateSignVersion(string calldata _signVersion) external onlyOwner {
}
function updateSigner(address _signer) external onlyOwner {
}
function _verify(address sender, uint256 maxMintAmount, bytes memory signature) internal view returns (bool) {
}
function changeContractState(ContractState _state) external onlyOwner {
}
function claimDonuts(uint256 _numberOfDonuts, uint256 _maxMintAmount, bytes memory _signature) external payable {
}
function mintDonuts(uint256 _numberOfDonuts) external payable {
}
function airdropDonuts(address[] calldata _to, uint256[] calldata _numberOfDonuts) external onlyOwner {
require(_to.length == _numberOfDonuts.length, "The arrays must be the same length.");
uint256 sum;
for(uint256 i = 0; i < _numberOfDonuts.length; ++i){
sum += _numberOfDonuts[i];
}
require(<FILL_ME>)
for(uint i = 0; i < _to.length; ++i){
for(uint j = 0; j < _numberOfDonuts[i]; ++j){
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(_to[i], tokenId);
}
}
}
function getNFTPrice(uint256 _amount) public view returns (uint256) {
}
function withdraw() external onlyOwner {
}
function setMaxes(uint256 _maxTotalMint, uint256 _maxPerTransaction, uint256 _pricePerDonut) external onlyOwner {
}
function setBaseURI(string calldata _base, string calldata _suffix) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
}
| SafeMath.add(_tokenIdCounter.current(),sum)<=MAX_TOTAL_MINT | 301,318 | SafeMath.add(_tokenIdCounter.current(),sum)<=MAX_TOTAL_MINT |
"_maxTotalMint not large enough" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
// @author: LoMel
contract TheDonutShop is ERC721Enumerable, Ownable {
using ECDSA for bytes32;
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
enum ContractState { PAUSED, PRESALE, PUBLIC }
ContractState public currentState = ContractState.PAUSED;
uint256 public MAX_TOTAL_MINT = 7777;
uint256 public MAX_PER_TRANSACTION = 5;
uint256 public MAX_PER_WALLET_FOR_PUBLIC = 10;
uint256 public PRICE_PER_DONUT = .12 ether;
mapping(address => uint256) public addressMinted;
string private baseURI;
string private baseURISuffix;
string private signVersion;
address private signer;
constructor(
string memory _base,
string memory _suffix,
string memory _signVersion) ERC721("The Donut Shop", "DONUT") {
}
function updateSignVersion(string calldata _signVersion) external onlyOwner {
}
function updateSigner(address _signer) external onlyOwner {
}
function _verify(address sender, uint256 maxMintAmount, bytes memory signature) internal view returns (bool) {
}
function changeContractState(ContractState _state) external onlyOwner {
}
function claimDonuts(uint256 _numberOfDonuts, uint256 _maxMintAmount, bytes memory _signature) external payable {
}
function mintDonuts(uint256 _numberOfDonuts) external payable {
}
function airdropDonuts(address[] calldata _to, uint256[] calldata _numberOfDonuts) external onlyOwner {
}
function getNFTPrice(uint256 _amount) public view returns (uint256) {
}
function withdraw() external onlyOwner {
}
function setMaxes(uint256 _maxTotalMint, uint256 _maxPerTransaction, uint256 _pricePerDonut) external onlyOwner {
require(<FILL_ME>)
MAX_TOTAL_MINT = _maxTotalMint;
MAX_PER_TRANSACTION = _maxPerTransaction;
PRICE_PER_DONUT = _pricePerDonut;
}
function setBaseURI(string calldata _base, string calldata _suffix) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
}
| totalSupply()<=_maxTotalMint,"_maxTotalMint not large enough" | 301,318 | totalSupply()<=_maxTotalMint |
"Invalid pair" | pragma solidity >=0.4.24;
/**
* @title TokenSwap.
* @author Eidoo SAGL.
* @dev A swap asset contract. The offerAmount and wantAmount are collected and sent into the contract itself.
*/
contract WrappedTokenSwap is Withdrawable, Pausable, Destructible, WithFee, IErc20Swap
{
using SafeMath for uint;
using SafeERC20 for IERC20;
using SafeStaticCallERC20 for IBadStaticCallERC20;
address constant ETHER = address(0);
uint constant rateDecimals = 18;
uint constant rateUnit = 10 ** rateDecimals;
mapping(address => mapping(address => bool)) public forcedIsWrap;
// abstract methods
function wrap(address src, uint unwrappedAmount, address dest) private;
function unwrap(address src, uint wrappedAmount, address dest) private;
function getExchangedAmount(address src, uint srcAmount, address dest) private view returns(uint);
// The getUnderlyingPayload() abstract function is used in the provided isWrap() implementation,
// it must return the payload for a call against a wrapped token to get the underlying token address
// If not applicable, you must reimplement the isWrap() function
function getUnderlyingPayload() private pure returns (bytes memory);
function setIsWrap(address src, address dest) public onlyOwner {
}
function clearIsWrap(address src, address dest) public onlyOwner {
}
// If reimplemented it must revert if the pair is not valid
function isWrap(address src, address dest) internal view returns(bool) {
if (forcedIsWrap[src][dest]) {
return true;
} else if (forcedIsWrap[dest][src]) {
return false;
} else {
bytes memory payload = getUnderlyingPayload();
(bool success, address underlying) = LowLevel.staticCallContractAddr(src, payload);
if (success && underlying != address(0)) {
require(dest == underlying, "Invalid pair");
return false;
} else {
(success, underlying) = LowLevel.staticCallContractAddr(dest, payload);
require(<FILL_ME>)
return true;
}
}
}
function isWrapNonStatic(address src, address dest) internal returns(bool) {
}
/**
* @dev Contract constructor.
* @param _wallet The wallet for fees.
* @param _spread The initial spread (in millionths).
*/
constructor(
address _wallet,
uint _spread
)
public WithFee(address(bytes20(_wallet)), _spread)
{}
function() external {
}
// kybernetwork style getRate
function getRate(address src, address dest, uint256 /*srcAmount*/) public view
returns(uint, uint)
{
}
function getAmount(address src, address dest, uint256 srcAmount)
public view returns(uint toUserAmount)
{
}
event UnexpectedBalance(address token, uint balance);
function emptyBalance(address token) private {
}
function initSwap(address src, address dest) private {
}
function swap(address src, uint srcAmount, address dest, uint /*maxDestAmount*/, uint /*minConversionRate*/) public payable
whenNotPaused
{
}
}
| success&&src==underlying,"Invalid pair" | 301,456 | success&&src==underlying |
"ERC20 allowance < srcAmount" | pragma solidity >=0.4.24;
/**
* @title TokenSwap.
* @author Eidoo SAGL.
* @dev A swap asset contract. The offerAmount and wantAmount are collected and sent into the contract itself.
*/
contract WrappedTokenSwap is Withdrawable, Pausable, Destructible, WithFee, IErc20Swap
{
using SafeMath for uint;
using SafeERC20 for IERC20;
using SafeStaticCallERC20 for IBadStaticCallERC20;
address constant ETHER = address(0);
uint constant rateDecimals = 18;
uint constant rateUnit = 10 ** rateDecimals;
mapping(address => mapping(address => bool)) public forcedIsWrap;
// abstract methods
function wrap(address src, uint unwrappedAmount, address dest) private;
function unwrap(address src, uint wrappedAmount, address dest) private;
function getExchangedAmount(address src, uint srcAmount, address dest) private view returns(uint);
// The getUnderlyingPayload() abstract function is used in the provided isWrap() implementation,
// it must return the payload for a call against a wrapped token to get the underlying token address
// If not applicable, you must reimplement the isWrap() function
function getUnderlyingPayload() private pure returns (bytes memory);
function setIsWrap(address src, address dest) public onlyOwner {
}
function clearIsWrap(address src, address dest) public onlyOwner {
}
// If reimplemented it must revert if the pair is not valid
function isWrap(address src, address dest) internal view returns(bool) {
}
function isWrapNonStatic(address src, address dest) internal returns(bool) {
}
/**
* @dev Contract constructor.
* @param _wallet The wallet for fees.
* @param _spread The initial spread (in millionths).
*/
constructor(
address _wallet,
uint _spread
)
public WithFee(address(bytes20(_wallet)), _spread)
{}
function() external {
}
// kybernetwork style getRate
function getRate(address src, address dest, uint256 /*srcAmount*/) public view
returns(uint, uint)
{
}
function getAmount(address src, address dest, uint256 srcAmount)
public view returns(uint toUserAmount)
{
}
event UnexpectedBalance(address token, uint balance);
function emptyBalance(address token) private {
}
function initSwap(address src, address dest) private {
}
function swap(address src, uint srcAmount, address dest, uint /*maxDestAmount*/, uint /*minConversionRate*/) public payable
whenNotPaused
{
require(msg.value == 0, "ethers not supported");
require(srcAmount != 0, "srcAmount == 0");
require(<FILL_ME>)
uint toUserAmount;
uint fee;
address feeToken;
initSwap(src, dest);
// get user's tokens
IERC20(src).safeTransferFrom(msg.sender, address(this), srcAmount); // 0x23b872dd
if (isWrapNonStatic(src, dest)) {
fee = _getFee(srcAmount);
feeToken = src;
uint toSwap = srcAmount.sub(fee);
wrap(src, toSwap, dest);
toUserAmount = IBadStaticCallERC20(dest).balanceOf(address(this));
} else {
unwrap(src, srcAmount, dest);
uint unwrappedAmount = IBadStaticCallERC20(dest).balanceOf(address(this));
fee = _getFee(unwrappedAmount);
feeToken = dest;
toUserAmount = unwrappedAmount.sub(fee);
}
require(toUserAmount > 0, "toUserAmount must be greater than 0");
IERC20(dest).safeTransfer(msg.sender, toUserAmount);
// get the fee
_payFee(feeToken, fee);
emit LogTokenSwap(
msg.sender,
src,
srcAmount,
dest,
toUserAmount
);
}
}
| IBadStaticCallERC20(src).allowance(msg.sender,address(this))>=srcAmount,"ERC20 allowance < srcAmount" | 301,456 | IBadStaticCallERC20(src).allowance(msg.sender,address(this))>=srcAmount |
"Uint64Chain: the node is aleady linked" | pragma solidity >=0.5.0 <0.6.0;
/// @title Uint64Chain
/// @notice Uint64 Type 체인 정의 및 관리
/// @dev 시간대 별 이벤트와 같은 TIME-BASE 인덱스 리스트 관리에 쓰인다.
/// @author jhhong
contract Uint64Chain {
using SafeMath64 for uint64;
// 구조체 : 노드 정보
struct NodeInfo {
uint64 prev; // 이전 노드
uint64 next; // 다음 노드
}
// 구조체 : 노드 체인
struct NodeList {
uint64 count; // 노드의 총 개수
uint64 head; // 체인의 머리
uint64 tail; // 체인의 꼬리
mapping(uint64 => NodeInfo) map; // 계정에 대한 노드 정보 매핑
}
// 변수 선언
NodeList private _slist; // 노드 체인 (싱글리스트)
// 이벤트 선언
event Uint64ChainLinked(uint64 indexed node); // 이벤트: 체인에 추가됨
event Uint64ChainUnlinked(uint64 indexed node); // 이벤트: 체인에서 빠짐
/// @author jhhong
/// @notice 체인에 연결된 원소의 개수를 반환한다.
/// @return 체인에 연결된 원소의 개수
function count() public view returns(uint64) {
}
/// @author jhhong
/// @notice 체인 헤드 정보를 반환한다.
/// @return 체인 헤드 정보
function head() public view returns(uint64) {
}
/// @author jhhong
/// @notice 체인 꼬리 정보를 반환한다.
/// @return 체인 꼬리 정보
function tail() public view returns(uint64) {
}
/// @author jhhong
/// @notice node의 다음 노드 정보를 반환한다.
/// @param node 노드 정보 (체인에 연결되어 있을 수도 있고 아닐 수도 있음)
/// @return node의 다음 노드 정보
function nextOf(uint64 node) public view returns(uint64) {
}
/// @author jhhong
/// @notice node의 이전 노드 정보를 반환한다.
/// @param node 노드 정보 (체인에 연결되어 있을 수도 있고 아닐 수도 있음)
/// @return node의 이전 노드 정보
function prevOf(uint64 node) public view returns(uint64) {
}
/// @author jhhong
/// @notice node가 체인에 연결된 상태인지를 확인한다.
/// @param node 체인 연결 여부를 확인할 노드 주소
/// @return 연결 여부 (boolean), true: 연결됨(linked), false: 연결되지 않음(unlinked)
function isLinked(uint64 node) public view returns (bool) {
}
/// @author jhhong
/// @notice 새로운 노드 정보를 노드 체인에 연결한다.
/// @param node 노드 체인에 연결할 노드 주소
function _linkChain(uint64 node) internal {
require(<FILL_ME>)
if(_slist.count == 0) {
_slist.head = _slist.tail = node;
} else {
_slist.map[node].prev = _slist.tail;
_slist.map[_slist.tail].next = node;
_slist.tail = node;
}
_slist.count = _slist.count.add(1);
emit Uint64ChainLinked(node);
}
/// @author jhhong
/// @notice node 노드를 체인에서 연결 해제한다.
/// @param node 노드 체인에서 연결 해제할 노드 주소
function _unlinkChain(uint64 node) internal {
}
}
| !isLinked(node),"Uint64Chain: the node is aleady linked" | 301,583 | !isLinked(node) |
"Uint64Chain: the node is aleady unlinked" | pragma solidity >=0.5.0 <0.6.0;
/// @title Uint64Chain
/// @notice Uint64 Type 체인 정의 및 관리
/// @dev 시간대 별 이벤트와 같은 TIME-BASE 인덱스 리스트 관리에 쓰인다.
/// @author jhhong
contract Uint64Chain {
using SafeMath64 for uint64;
// 구조체 : 노드 정보
struct NodeInfo {
uint64 prev; // 이전 노드
uint64 next; // 다음 노드
}
// 구조체 : 노드 체인
struct NodeList {
uint64 count; // 노드의 총 개수
uint64 head; // 체인의 머리
uint64 tail; // 체인의 꼬리
mapping(uint64 => NodeInfo) map; // 계정에 대한 노드 정보 매핑
}
// 변수 선언
NodeList private _slist; // 노드 체인 (싱글리스트)
// 이벤트 선언
event Uint64ChainLinked(uint64 indexed node); // 이벤트: 체인에 추가됨
event Uint64ChainUnlinked(uint64 indexed node); // 이벤트: 체인에서 빠짐
/// @author jhhong
/// @notice 체인에 연결된 원소의 개수를 반환한다.
/// @return 체인에 연결된 원소의 개수
function count() public view returns(uint64) {
}
/// @author jhhong
/// @notice 체인 헤드 정보를 반환한다.
/// @return 체인 헤드 정보
function head() public view returns(uint64) {
}
/// @author jhhong
/// @notice 체인 꼬리 정보를 반환한다.
/// @return 체인 꼬리 정보
function tail() public view returns(uint64) {
}
/// @author jhhong
/// @notice node의 다음 노드 정보를 반환한다.
/// @param node 노드 정보 (체인에 연결되어 있을 수도 있고 아닐 수도 있음)
/// @return node의 다음 노드 정보
function nextOf(uint64 node) public view returns(uint64) {
}
/// @author jhhong
/// @notice node의 이전 노드 정보를 반환한다.
/// @param node 노드 정보 (체인에 연결되어 있을 수도 있고 아닐 수도 있음)
/// @return node의 이전 노드 정보
function prevOf(uint64 node) public view returns(uint64) {
}
/// @author jhhong
/// @notice node가 체인에 연결된 상태인지를 확인한다.
/// @param node 체인 연결 여부를 확인할 노드 주소
/// @return 연결 여부 (boolean), true: 연결됨(linked), false: 연결되지 않음(unlinked)
function isLinked(uint64 node) public view returns (bool) {
}
/// @author jhhong
/// @notice 새로운 노드 정보를 노드 체인에 연결한다.
/// @param node 노드 체인에 연결할 노드 주소
function _linkChain(uint64 node) internal {
}
/// @author jhhong
/// @notice node 노드를 체인에서 연결 해제한다.
/// @param node 노드 체인에서 연결 해제할 노드 주소
function _unlinkChain(uint64 node) internal {
require(<FILL_ME>)
uint64 tempPrev = _slist.map[node].prev;
uint64 tempNext = _slist.map[node].next;
if (_slist.head == node) {
_slist.head = tempNext;
}
if (_slist.tail == node) {
_slist.tail = tempPrev;
}
if (tempPrev != uint64(0)) {
_slist.map[tempPrev].next = tempNext;
_slist.map[node].prev = uint64(0);
}
if (tempNext != uint64(0)) {
_slist.map[tempNext].prev = tempPrev;
_slist.map[node].next = uint64(0);
}
_slist.count = _slist.count.sub(1);
emit Uint64ChainUnlinked(node);
}
}
| isLinked(node),"Uint64Chain: the node is aleady unlinked" | 301,583 | isLinked(node) |
"Not the right proposal type" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
require(<FILL_ME>)
require(addressProposalStore[_proposal].signed == false, "Already Signed");
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
signatories.push(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit ApprovedSignatory(addressProposalStore[_proposal].proposal);
}
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].proposalType==0,"Not the right proposal type" | 301,591 | addressProposalStore[_proposal].proposalType==0 |
"Already Signed" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
require(addressProposalStore[_proposal].proposalType == 0, "Not the right proposal type");
require(<FILL_ME>)
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
signatories.push(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit ApprovedSignatory(addressProposalStore[_proposal].proposal);
}
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].signed==false,"Already Signed" | 301,591 | addressProposalStore[_proposal].signed==false |
"Not the right proposal type" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
require(<FILL_ME>)
require(addressProposalStore[_proposal].signed == false, "Already Signed");
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
//Remove a threshold count in order to avoid not having enough signatories
if(threshold > 1)
{
threshold = threshold - 1;
}
removeSignatory(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit RemovedSignatory(addressProposalStore[_proposal].proposal);
}
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].proposalType==1,"Not the right proposal type" | 301,591 | addressProposalStore[_proposal].proposalType==1 |
"Not the right proposal type" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
require(<FILL_ME>)
require(addressProposalStore[_proposal].signed == false, "Already Signed");
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
transferOwnership(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit ApprovedNewOwner(addressProposalStore[_proposal].proposal);
}
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].proposalType==2,"Not the right proposal type" | 301,591 | addressProposalStore[_proposal].proposalType==2 |
"Not the right proposal type" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
require(<FILL_ME>)
require(addressProposalStore[_proposal].signed == false, "Already Signed");
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
vault.newMultiSig(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit ApprovedNewMultiSig(addressProposalStore[_proposal].proposal);
}
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].proposalType==3,"Not the right proposal type" | 301,591 | addressProposalStore[_proposal].proposalType==3 |
"Not the right proposal type" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
require(<FILL_ME>)
require(addressProposalStore[_proposal].signed == false, "Already Signed");
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
vault.addToken(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit ApprovedNewToken(addressProposalStore[_proposal].proposal);
}
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].proposalType==4,"Not the right proposal type" | 301,591 | addressProposalStore[_proposal].proposalType==4 |
"Not the right proposal type" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
require(<FILL_ME>)
require(addressProposalStore[_proposal].signed == false, "Already Signed");
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
vault.removeToken(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit RemovedToken(addressProposalStore[_proposal].proposal);
}
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].proposalType==5,"Not the right proposal type" | 301,591 | addressProposalStore[_proposal].proposalType==5 |
"Not the right proposal type" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
require(<FILL_ME>)
require(addressProposalStore[_proposal].signed == false, "Already Signed");
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
vault.newDispatcher(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit ApprovedDispatcher(addressProposalStore[_proposal].proposal);
}
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].proposalType==6,"Not the right proposal type" | 301,591 | addressProposalStore[_proposal].proposalType==6 |
"Not the right proposal type" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
require(<FILL_ME>)
require(addressProposalStore[_proposal].signed == false, "Already Signed");
addressProposalStore[_proposal].signatures.push(msg.sender);
if (addressProposalStore[_proposal].signatures.length >= threshold) {
addressProposalStore[_proposal].signed = true;
vault = Vault(addressProposalStore[_proposal].proposal);
popAddressProposal(_proposal);
emit ApprovedDispatcher(addressProposalStore[_proposal].proposal);
}
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].proposalType==7,"Not the right proposal type" | 301,591 | addressProposalStore[_proposal].proposalType==7 |
"Already Signed" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
require(<FILL_ME>)
require(thresholdProposalStore[_proposal].proposal <= signatories.length, "Can't be less signatories than threshold");
thresholdProposalStore[_proposal].signatures.push(msg.sender);
if (thresholdProposalStore[_proposal].signatures.length >= threshold) {
threshold = thresholdProposalStore[_proposal].proposal;
popThresholdProposal(_proposal);
emit ApprovedNewThreshold(thresholdProposalStore[_proposal].proposal);
}
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| thresholdProposalStore[_proposal].signed==false,"Already Signed" | 301,591 | thresholdProposalStore[_proposal].signed==false |
"Can't be less signatories than threshold" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
require(thresholdProposalStore[_proposal].signed == false, "Already Signed");
require(<FILL_ME>)
thresholdProposalStore[_proposal].signatures.push(msg.sender);
if (thresholdProposalStore[_proposal].signatures.length >= threshold) {
threshold = thresholdProposalStore[_proposal].proposal;
popThresholdProposal(_proposal);
emit ApprovedNewThreshold(thresholdProposalStore[_proposal].proposal);
}
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| thresholdProposalStore[_proposal].proposal<=signatories.length,"Can't be less signatories than threshold" | 301,591 | thresholdProposalStore[_proposal].proposal<=signatories.length |
"You have already voted" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
for(uint256 i = 0; i < addressProposalStore[_proposal].signatures.length; i++){
require(<FILL_ME>)
}
_;
}
modifier oneVoteThreshold (uint256 _proposal) {
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| addressProposalStore[_proposal].signatures[i]!=msg.sender,"You have already voted" | 301,591 | addressProposalStore[_proposal].signatures[i]!=msg.sender |
"You have already voted" | pragma solidity 0.8.4;
contract VaultMultiSig is Ownable {
Vault private vault;
address[] private signatories;
uint256[] private outstandingAddressProposalsIndex;
uint256[] private outstandingThresholdProposalsIndex;
uint256 private threshold = 1;
uint256 private uuid = 0;
/*Proposal types
0 = approveSignatory for multisig
1 = removeSignatory for multisig
2 = approveNewOwner for multisig
3 = approveNewMultiSig for vault
4 = approveNewToken for vault
5 = removeToken for vault
6 = approveNewDispatcher for vault
7 = approveNewVault for multisig
*/
struct addressProposal {
uint256 proposalType;
address proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => addressProposal) private addressProposalStore;
struct thresholdProposal {
uint256 proposal;
address[] signatures;
bool signed;
uint256 timeStamp;
}
mapping(uint256 => thresholdProposal) private thresholdProposalStore;
constructor() Ownable() {
}
/***************** Getters **************** */
function getSignatories() public view returns (address[] memory) {
}
function getProposal(uint256 _index) public view returns (addressProposal memory) {
}
function getThresholdProposal(uint256 _index) public view returns (thresholdProposal memory)
{
}
function getOutstandingAddressProposals() public view returns (uint256[] memory) {
}
function getOutstandingThresholdProposals() public view returns (uint256[] memory) {
}
function getVault() public view returns (Vault){
}
function getAddressProposal(uint256 i)
public
view
returns (addressProposal memory)
{
}
function getThreshold() public view returns (uint256) {
}
/***************** Proposers **************** */
function proposeAddress(address _address, uint256 _index) external onlyOwner {
}
function proposeNewOwner(address _address) external onlySignatories {
}
function proposeNewThreshold(uint256 _threshold) external onlyOwner {
}
/***************** Approvers **************** */
function approveSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeSignatory(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewOwner(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewMultiSig(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function removeToken(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal){
}
function approveNewDispatcher(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewVault(uint256 _proposal) external onlySignatories oneVoteAddress(_proposal) {
}
function approveNewThreshold(uint256 _proposal) external onlySignatories oneVoteThreshold(_proposal){
}
/***************** Internal **************** */
function popAddressProposal(uint256 _uuid) private {
}
function popThresholdProposal(uint256 _uuid) private {
}
function removeSignatory(address _signatory) private {
}
/***************** Modifiers **************** */
modifier onlySignatories() {
}
modifier oneVoteAddress (uint256 _proposal) {
}
modifier oneVoteThreshold (uint256 _proposal) {
for(uint256 i = 0; i < thresholdProposalStore[_proposal].signatures.length; i++){
require(<FILL_ME>)
}
_;
}
/***************** Events **************** */
event ApprovedDispatcher(address newAddress);
event ApprovedSignatory(address newSignatory);
event ApprovedNewMultiSig(address newMultiSig);
event ApprovedNewToken(address newToken);
event RemovedSignatory(address oldSignatory);
event RemovedToken(address oldToken);
event ApprovedNewOwner(address newOwner);
event ApprovedNewThreshold(uint256 threshold);
event ProposeAddress(address proposedAddress, uint256 index);
event ProposeNewOwner(address newOwner);
event ProposeNewThreshold(uint256 threshold);
}
| thresholdProposalStore[_proposal].signatures[i]!=msg.sender,"You have already voted" | 301,591 | thresholdProposalStore[_proposal].signatures[i]!=msg.sender |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.