comment
stringlengths 1
211
β | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
'Sold out!' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract TipsyTiger is ERC721Enumerable, Ownable {
using Strings for uint256;
string public PROVENANCE = "";
string _baseTokenURI;
string public baseExtension = '.json';
uint256 public reserved = 100;
uint256 public publicSalePrice = 0.05 ether;
uint256 public presalePrice = 0.04 ether;
uint256 public presaleSupply = 1000;
uint256 public createTime = block.timestamp;
uint256 public maxSupply = 8000;
mapping(address => uint256) public presaleMintedAmount;
bool public publicSaleOpen = false;
bool public presaleOpen = false;
constructor(string memory baseURI) ERC721("TipsyTiger Club", "TIPSY") {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mintTiger(uint256 num) public payable {
}
function mintPresale(uint256 _mintNum) public payable {
require(presaleOpen, 'Presale not open');
require(_mintNum < 6, 'Exceeded presale limit');
require(_mintNum < 6 - presaleMintedAmount[msg.sender], 'Exceeded limit of 5 per address');
uint256 supply = totalSupply();
require(<FILL_ME>)
require(msg.value >= presalePrice * _mintNum, 'Ether sent is not correct');
for (uint256 i; i < _mintNum; i++) {
_safeMint(msg.sender, supply + i);
}
presaleMintedAmount[msg.sender] = presaleMintedAmount[msg.sender] + _mintNum;
}
function walletOfOwner(address _owner) public view returns(uint256[] memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
// only owner
function setPublicPrice(uint256 _newPublic) public onlyOwner() {
}
function setPresalePrice(uint256 _newPresale) public onlyOwner() {
}
function setPresaleSupply(uint256 _newSupply) public onlyOwner() {
}
// reserve some tigers aside
function giveAway(address _to, uint256 _amount) external onlyOwner() {
}
// set provenance once it's calculated
function setProvenanceHash(string memory _provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function setBaseExtension(string memory _newExtension) public onlyOwner() {
}
// burn token
function burn(uint256 _tokenId) public onlyOwner {
}
function togglePublicSale() public onlyOwner {
}
function togglePresale() public onlyOwner {
}
function withdraw() public onlyOwner {
}
function sendBalance() public onlyOwner {
}
}
| supply+_mintNum<=presaleSupply,'Sold out!' | 347,314 | supply+_mintNum<=presaleSupply |
"own" | // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./IERC721.sol";
import "./Ownable.sol";
import "./Stats.sol";
import "./IRenderer.sol";
import "./IMGear.sol";
import "./IMineablePunks.sol";
import "./IMineableWords.sol";
contract MGear is ERC721Enumerable, Ownable {
uint8 NORMAL;
uint8 SOLID = 1;
uint8 NOTEWORTHY = 2;
uint8 EXTRAORDINARY = 3;
uint8 FABLED = 4;
uint8 UNREAL = 5;
uint16 minedCount;
uint8 unrealUpgrades;
uint8 fabledUpgrades;
uint8 extraordinaryUpgrades;
IMineablePunks public mineablePunks;
IMineableWords public mineableWords;
IMGear public mgearRenderer;
uint256[] public tokenIdToMGear;
mapping(uint256 => bool) public transmuted;
mapping(uint16 => bool) public inscribed;
uint256[3] public rarityToDifficulties;
uint8[3][3] public rarityToUpgradeRoll;
uint88[6] rarityNames;
uint8[3] public mpunkRolls;
constructor(
IMineablePunks _mineablePunks,
IMineableWords _mineableWords,
IMGear _mgear,
uint256 normal,
uint256 solid,
uint256 noteworthy
) ERC721("MineableGear", "MGEAR") Ownable() {
}
fallback() external payable {}
receive() external payable {}
function withdraw(uint256 amount) external onlyOwner {
}
function toMWordEncoding(uint64 abbr) internal pure returns (uint88) {
}
function encodeNonce(address sender, uint96 nonce) internal pure returns (uint256) {
}
function encodeMgear(
uint256 mgear,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) internal returns (uint256) {
if (mwordIndex > 0) {
require(<FILL_ME>)
require(!inscribed[mwordIndex], "alr");
}
require(nameFormat < 2, "inv");
if (mwordIndex > 0) {
inscribed[mwordIndex] = true;
}
return
(mgear & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8) +
rarity +
(uint256(mwordIndex) << 127) +
(uint256(nameFormat) << 140);
}
function upgradeAndEncode(
uint256 mgear,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) internal returns (uint256) {
}
function getTransmutationRarity(uint256 hashed, uint256 mpunk) public view returns (uint8) {
}
function renderData(uint256 mgear) public view returns (string memory data) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function rename(
uint256 tokenId,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
function mint(
uint96 nonce,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
function transmute(
uint256 mpunk,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
}
| mineableWords.ownerOf(mineableWords.tokenByIndex(mwordIndex-1))==msg.sender,"own" | 347,364 | mineableWords.ownerOf(mineableWords.tokenByIndex(mwordIndex-1))==msg.sender |
"alr" | // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./IERC721.sol";
import "./Ownable.sol";
import "./Stats.sol";
import "./IRenderer.sol";
import "./IMGear.sol";
import "./IMineablePunks.sol";
import "./IMineableWords.sol";
contract MGear is ERC721Enumerable, Ownable {
uint8 NORMAL;
uint8 SOLID = 1;
uint8 NOTEWORTHY = 2;
uint8 EXTRAORDINARY = 3;
uint8 FABLED = 4;
uint8 UNREAL = 5;
uint16 minedCount;
uint8 unrealUpgrades;
uint8 fabledUpgrades;
uint8 extraordinaryUpgrades;
IMineablePunks public mineablePunks;
IMineableWords public mineableWords;
IMGear public mgearRenderer;
uint256[] public tokenIdToMGear;
mapping(uint256 => bool) public transmuted;
mapping(uint16 => bool) public inscribed;
uint256[3] public rarityToDifficulties;
uint8[3][3] public rarityToUpgradeRoll;
uint88[6] rarityNames;
uint8[3] public mpunkRolls;
constructor(
IMineablePunks _mineablePunks,
IMineableWords _mineableWords,
IMGear _mgear,
uint256 normal,
uint256 solid,
uint256 noteworthy
) ERC721("MineableGear", "MGEAR") Ownable() {
}
fallback() external payable {}
receive() external payable {}
function withdraw(uint256 amount) external onlyOwner {
}
function toMWordEncoding(uint64 abbr) internal pure returns (uint88) {
}
function encodeNonce(address sender, uint96 nonce) internal pure returns (uint256) {
}
function encodeMgear(
uint256 mgear,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) internal returns (uint256) {
if (mwordIndex > 0) {
require(
mineableWords.ownerOf(mineableWords.tokenByIndex(mwordIndex - 1)) == msg.sender,
"own"
);
require(<FILL_ME>)
}
require(nameFormat < 2, "inv");
if (mwordIndex > 0) {
inscribed[mwordIndex] = true;
}
return
(mgear & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8) +
rarity +
(uint256(mwordIndex) << 127) +
(uint256(nameFormat) << 140);
}
function upgradeAndEncode(
uint256 mgear,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) internal returns (uint256) {
}
function getTransmutationRarity(uint256 hashed, uint256 mpunk) public view returns (uint8) {
}
function renderData(uint256 mgear) public view returns (string memory data) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function rename(
uint256 tokenId,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
function mint(
uint96 nonce,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
function transmute(
uint256 mpunk,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
}
| !inscribed[mwordIndex],"alr" | 347,364 | !inscribed[mwordIndex] |
"own" | // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./IERC721.sol";
import "./Ownable.sol";
import "./Stats.sol";
import "./IRenderer.sol";
import "./IMGear.sol";
import "./IMineablePunks.sol";
import "./IMineableWords.sol";
contract MGear is ERC721Enumerable, Ownable {
uint8 NORMAL;
uint8 SOLID = 1;
uint8 NOTEWORTHY = 2;
uint8 EXTRAORDINARY = 3;
uint8 FABLED = 4;
uint8 UNREAL = 5;
uint16 minedCount;
uint8 unrealUpgrades;
uint8 fabledUpgrades;
uint8 extraordinaryUpgrades;
IMineablePunks public mineablePunks;
IMineableWords public mineableWords;
IMGear public mgearRenderer;
uint256[] public tokenIdToMGear;
mapping(uint256 => bool) public transmuted;
mapping(uint16 => bool) public inscribed;
uint256[3] public rarityToDifficulties;
uint8[3][3] public rarityToUpgradeRoll;
uint88[6] rarityNames;
uint8[3] public mpunkRolls;
constructor(
IMineablePunks _mineablePunks,
IMineableWords _mineableWords,
IMGear _mgear,
uint256 normal,
uint256 solid,
uint256 noteworthy
) ERC721("MineableGear", "MGEAR") Ownable() {
}
fallback() external payable {}
receive() external payable {}
function withdraw(uint256 amount) external onlyOwner {
}
function toMWordEncoding(uint64 abbr) internal pure returns (uint88) {
}
function encodeNonce(address sender, uint96 nonce) internal pure returns (uint256) {
}
function encodeMgear(
uint256 mgear,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) internal returns (uint256) {
}
function upgradeAndEncode(
uint256 mgear,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) internal returns (uint256) {
}
function getTransmutationRarity(uint256 hashed, uint256 mpunk) public view returns (uint8) {
}
function renderData(uint256 mgear) public view returns (string memory data) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function rename(
uint256 tokenId,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
function mint(
uint96 nonce,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
function transmute(
uint256 mpunk,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
require(minedCount == 2048, "lock");
require(<FILL_ME>)
require(!transmuted[mpunk], "alr");
require(msg.value >= 10000000000000000, "fee");
uint256 hashed = encodeNonce(address(mineablePunks), uint96(mpunk));
uint256 tokenId = tokenIdToMGear.length;
tokenIdToMGear.push(
encodeMgear(hashed, getTransmutationRarity(hashed, mpunk), mwordIndex, nameFormat)
);
ERC721._safeMint(msg.sender, tokenId);
transmuted[mpunk] = true;
}
}
| mineablePunks.ownerOf(mpunk)==msg.sender,"own" | 347,364 | mineablePunks.ownerOf(mpunk)==msg.sender |
"alr" | // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721Enumerable.sol";
import "./IERC721.sol";
import "./Ownable.sol";
import "./Stats.sol";
import "./IRenderer.sol";
import "./IMGear.sol";
import "./IMineablePunks.sol";
import "./IMineableWords.sol";
contract MGear is ERC721Enumerable, Ownable {
uint8 NORMAL;
uint8 SOLID = 1;
uint8 NOTEWORTHY = 2;
uint8 EXTRAORDINARY = 3;
uint8 FABLED = 4;
uint8 UNREAL = 5;
uint16 minedCount;
uint8 unrealUpgrades;
uint8 fabledUpgrades;
uint8 extraordinaryUpgrades;
IMineablePunks public mineablePunks;
IMineableWords public mineableWords;
IMGear public mgearRenderer;
uint256[] public tokenIdToMGear;
mapping(uint256 => bool) public transmuted;
mapping(uint16 => bool) public inscribed;
uint256[3] public rarityToDifficulties;
uint8[3][3] public rarityToUpgradeRoll;
uint88[6] rarityNames;
uint8[3] public mpunkRolls;
constructor(
IMineablePunks _mineablePunks,
IMineableWords _mineableWords,
IMGear _mgear,
uint256 normal,
uint256 solid,
uint256 noteworthy
) ERC721("MineableGear", "MGEAR") Ownable() {
}
fallback() external payable {}
receive() external payable {}
function withdraw(uint256 amount) external onlyOwner {
}
function toMWordEncoding(uint64 abbr) internal pure returns (uint88) {
}
function encodeNonce(address sender, uint96 nonce) internal pure returns (uint256) {
}
function encodeMgear(
uint256 mgear,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) internal returns (uint256) {
}
function upgradeAndEncode(
uint256 mgear,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) internal returns (uint256) {
}
function getTransmutationRarity(uint256 hashed, uint256 mpunk) public view returns (uint8) {
}
function renderData(uint256 mgear) public view returns (string memory data) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function rename(
uint256 tokenId,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
function mint(
uint96 nonce,
uint8 rarity,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
}
function transmute(
uint256 mpunk,
uint16 mwordIndex,
uint8 nameFormat
) external payable {
require(minedCount == 2048, "lock");
require(mineablePunks.ownerOf(mpunk) == msg.sender, "own");
require(<FILL_ME>)
require(msg.value >= 10000000000000000, "fee");
uint256 hashed = encodeNonce(address(mineablePunks), uint96(mpunk));
uint256 tokenId = tokenIdToMGear.length;
tokenIdToMGear.push(
encodeMgear(hashed, getTransmutationRarity(hashed, mpunk), mwordIndex, nameFormat)
);
ERC721._safeMint(msg.sender, tokenId);
transmuted[mpunk] = true;
}
}
| !transmuted[mpunk],"alr" | 347,364 | !transmuted[mpunk] |
"Supply exceeded!" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
abstract contract TamaToken{
function getNFTGiveAwayForId(address _address) public virtual view returns (bool);
}
pragma solidity >=0.6.0 <0.8.0;
contract Lefty is ERC721, Ownable {
using SafeMath for uint256;
uint256 private _price = 100000000000000000;
bool private _paused = true;
uint private _reserve = 500;
bool freeMint = true;
TamaToken tama;
mapping (address => bool) public mintedGiveaway;
address _withdrawAddress = 0xA8D4C801E5194eEA821089E93110d79F9Fb19718;
constructor(string memory _baseURI) ERC721('Left Doge Army', 'LeftyDoge') {
}
//MINT x amount of leftys
function mint(uint256 _num) public payable {
uint supply = totalSupply();
require(!_paused, "Minting is currently paused!");
require(_num < 21, "You can only mint 20 Lefty's with each transaction!");
require(<FILL_ME>)
if(!freeMint){
require(msg.value >= _price * _num, "ETH sent not correct!");
}
for(uint i = 1; i < _num+1; i++) {
_safeMint(msg.sender, supply+i);
}
}
function setTamaToken(address tamaAddress) external onlyOwner {
}
function hasFreeMint(address _address) public view returns (bool) {
}
function freeMintGiveAway () public {
}
function mintReserve(address _to, uint256 _num) private {
}
//GIVEAWAY x tokens to specific address
function giveAway(address _to, uint256 _num) external onlyOwner() {
}
//CHANGE PAUSE STATE
function pause(bool _value) public onlyOwner {
}
//CHANGE PAUSE STATE
function setFreeMint(bool _value) public onlyOwner {
}
//GET PRICE
function getPrice() public view returns (uint256) {
}
//GET PRICE
function setPrice(uint256 price) external onlyOwner {
}
function setWithdrawal(address _withdrawal) external onlyOwner(){
}
//RETURN ALL TOKENS OF A SPECIFIC ADDRESS
function walletOfOwner(address _owner)
external
view
returns (uint256[] memory)
{
}
//RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY
function returnSupply() external view returns (uint256) {
}
//WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS
function withdraw() public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
}
| supply+_num<10001-_reserve,"Supply exceeded!" | 347,481 | supply+_num<10001-_reserve |
"address has not been added for a free mint" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
abstract contract TamaToken{
function getNFTGiveAwayForId(address _address) public virtual view returns (bool);
}
pragma solidity >=0.6.0 <0.8.0;
contract Lefty is ERC721, Ownable {
using SafeMath for uint256;
uint256 private _price = 100000000000000000;
bool private _paused = true;
uint private _reserve = 500;
bool freeMint = true;
TamaToken tama;
mapping (address => bool) public mintedGiveaway;
address _withdrawAddress = 0xA8D4C801E5194eEA821089E93110d79F9Fb19718;
constructor(string memory _baseURI) ERC721('Left Doge Army', 'LeftyDoge') {
}
//MINT x amount of leftys
function mint(uint256 _num) public payable {
}
function setTamaToken(address tamaAddress) external onlyOwner {
}
function hasFreeMint(address _address) public view returns (bool) {
}
function freeMintGiveAway () public {
require(<FILL_ME>)
require(!mintedGiveaway[msg.sender], "this address already claimed free mint");
mintReserve(msg.sender, 1);
mintedGiveaway[msg.sender] = true;
}
function mintReserve(address _to, uint256 _num) private {
}
//GIVEAWAY x tokens to specific address
function giveAway(address _to, uint256 _num) external onlyOwner() {
}
//CHANGE PAUSE STATE
function pause(bool _value) public onlyOwner {
}
//CHANGE PAUSE STATE
function setFreeMint(bool _value) public onlyOwner {
}
//GET PRICE
function getPrice() public view returns (uint256) {
}
//GET PRICE
function setPrice(uint256 price) external onlyOwner {
}
function setWithdrawal(address _withdrawal) external onlyOwner(){
}
//RETURN ALL TOKENS OF A SPECIFIC ADDRESS
function walletOfOwner(address _owner)
external
view
returns (uint256[] memory)
{
}
//RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY
function returnSupply() external view returns (uint256) {
}
//WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS
function withdraw() public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
}
| tama.getNFTGiveAwayForId(msg.sender),"address has not been added for a free mint" | 347,481 | tama.getNFTGiveAwayForId(msg.sender) |
"this address already claimed free mint" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
abstract contract TamaToken{
function getNFTGiveAwayForId(address _address) public virtual view returns (bool);
}
pragma solidity >=0.6.0 <0.8.0;
contract Lefty is ERC721, Ownable {
using SafeMath for uint256;
uint256 private _price = 100000000000000000;
bool private _paused = true;
uint private _reserve = 500;
bool freeMint = true;
TamaToken tama;
mapping (address => bool) public mintedGiveaway;
address _withdrawAddress = 0xA8D4C801E5194eEA821089E93110d79F9Fb19718;
constructor(string memory _baseURI) ERC721('Left Doge Army', 'LeftyDoge') {
}
//MINT x amount of leftys
function mint(uint256 _num) public payable {
}
function setTamaToken(address tamaAddress) external onlyOwner {
}
function hasFreeMint(address _address) public view returns (bool) {
}
function freeMintGiveAway () public {
require(tama.getNFTGiveAwayForId(msg.sender), "address has not been added for a free mint");
require(<FILL_ME>)
mintReserve(msg.sender, 1);
mintedGiveaway[msg.sender] = true;
}
function mintReserve(address _to, uint256 _num) private {
}
//GIVEAWAY x tokens to specific address
function giveAway(address _to, uint256 _num) external onlyOwner() {
}
//CHANGE PAUSE STATE
function pause(bool _value) public onlyOwner {
}
//CHANGE PAUSE STATE
function setFreeMint(bool _value) public onlyOwner {
}
//GET PRICE
function getPrice() public view returns (uint256) {
}
//GET PRICE
function setPrice(uint256 price) external onlyOwner {
}
function setWithdrawal(address _withdrawal) external onlyOwner(){
}
//RETURN ALL TOKENS OF A SPECIFIC ADDRESS
function walletOfOwner(address _owner)
external
view
returns (uint256[] memory)
{
}
//RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY
function returnSupply() external view returns (uint256) {
}
//WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS
function withdraw() public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
}
| !mintedGiveaway[msg.sender],"this address already claimed free mint" | 347,481 | !mintedGiveaway[msg.sender] |
"LP allowance is less than nessecary" | pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "prb-math/contracts/PRBMathUD60x18.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "./interfaces/IOracleFactory.sol";
import "./interfaces/IOracle.sol";
/**
* @title LMaaS Escrow contract
* @author Maximiliaan van Dijk - AllianceBlock
* @notice Allows the locking of UniswapV2 LiquidityPool tokens, in order to gain access to the Liquidity Mining as a Service platform. The pair must contain ALBT
*/
contract Escrow is Ownable, ReentrancyGuard {
using PRBMathUD60x18 for uint256;
using SafeERC20 for IERC20;
uint public price;
uint public lockTime;
IERC20 public immutable albtToken;
IUniswapV2Factory public immutable uniswapV2Factory;
IOracleFactory public immutable oracleFactory;
IOracle public immutable albtOracle;
struct EscrowData {
address pair;
bool withdrawn;
uint amountDeposited;
uint startTime;
}
mapping (address => EscrowData) public walletToEscrow;
event EscrowPaid (address wallet);
event EscrowWithdrawn (address wallet);
/**
* @dev Constructor defining the initial configuration
* @param _price The required amount to be locked in ALBT, which gets converted to it's worth in LP tokens
* @param _albtToken The ERC20 ALBT token address, in which the _price shall be paid
* @param _lockTime The duration of the lock time in seconds.
*/
constructor (uint _price, address _albtToken, uint _lockTime, address _uniswapV2FactoryAddress, address _oracleFactoryAddress) {
}
/**
* @dev Deposit the required LP tokens of a pair containing ALBT for escrow/locking
* @param _userToken A user supplied ERC20 compliant token, for which there's sufficient ALBT(_price) in it's UniswapV2 Liquidity Pool.
*/
function pay (address _userToken) public nonReentrant {
address pairAddress = uniswapV2Factory
.getPair(_userToken, address(albtToken));
IUniswapV2Pair pair = IUniswapV2Pair(pairAddress);
IERC20 erc20Pair = IERC20(pairAddress);
uint nessecaryLpAmount = getNessecaryLpAmountV2(_userToken);
require(<FILL_ME>)
require(
walletToEscrow[msg.sender].pair == address(0),
"Already paid for"
);
erc20Pair.safeTransferFrom(msg.sender, address(this), nessecaryLpAmount);
walletToEscrow[msg.sender] = EscrowData({
pair: pairAddress,
withdrawn: false,
amountDeposited: nessecaryLpAmount,
startTime: block.timestamp
});
emit EscrowPaid (msg.sender);
}
/**
* @dev Withdraw the deposited Liquidity Pool tokens from the contract, after they've been locked longer than the _lockTime.
*/
function withdraw () public nonReentrant {
}
function getFairReserves (address _userToken) public view returns (
uint fairReserve0,
uint fairReserve1
) {
}
function getNessecaryLpAmountV2 (address _userToken) public view returns (uint) {
}
/**
* @dev Calculates the required amount of Liquidity Pool tokens of a ALBT/_userToken UniswapV2 pair. Left for backwards compatibility with the frontend.
* @param _lpAddress The liquidity pool's address, containing both ALBT and user's ERC20 token.
*/
function getNessecaryLpAmount (address _lpAddress) public view returns (uint) {
}
/**
* @dev Allows the owner of the contract to change the required amount of ALBT tokens
* @param _newPrice The new amount of ALBT tokens that need to be locked
*/
function changePrice (uint _newPrice) public onlyOwner {
}
/**
* @dev Allows the owner of the contract to change the amount of time the liquidity pool's tokens need to be locked
* @param _lockTime The newly required time the tokens need to be locked
*/
function changeLockTime(uint _lockTime) public onlyOwner {
}
}
| pair.allowance(msg.sender,address(this))>=nessecaryLpAmount,"LP allowance is less than nessecary" | 347,515 | pair.allowance(msg.sender,address(this))>=nessecaryLpAmount |
"Already paid for" | pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "prb-math/contracts/PRBMathUD60x18.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "./interfaces/IOracleFactory.sol";
import "./interfaces/IOracle.sol";
/**
* @title LMaaS Escrow contract
* @author Maximiliaan van Dijk - AllianceBlock
* @notice Allows the locking of UniswapV2 LiquidityPool tokens, in order to gain access to the Liquidity Mining as a Service platform. The pair must contain ALBT
*/
contract Escrow is Ownable, ReentrancyGuard {
using PRBMathUD60x18 for uint256;
using SafeERC20 for IERC20;
uint public price;
uint public lockTime;
IERC20 public immutable albtToken;
IUniswapV2Factory public immutable uniswapV2Factory;
IOracleFactory public immutable oracleFactory;
IOracle public immutable albtOracle;
struct EscrowData {
address pair;
bool withdrawn;
uint amountDeposited;
uint startTime;
}
mapping (address => EscrowData) public walletToEscrow;
event EscrowPaid (address wallet);
event EscrowWithdrawn (address wallet);
/**
* @dev Constructor defining the initial configuration
* @param _price The required amount to be locked in ALBT, which gets converted to it's worth in LP tokens
* @param _albtToken The ERC20 ALBT token address, in which the _price shall be paid
* @param _lockTime The duration of the lock time in seconds.
*/
constructor (uint _price, address _albtToken, uint _lockTime, address _uniswapV2FactoryAddress, address _oracleFactoryAddress) {
}
/**
* @dev Deposit the required LP tokens of a pair containing ALBT for escrow/locking
* @param _userToken A user supplied ERC20 compliant token, for which there's sufficient ALBT(_price) in it's UniswapV2 Liquidity Pool.
*/
function pay (address _userToken) public nonReentrant {
address pairAddress = uniswapV2Factory
.getPair(_userToken, address(albtToken));
IUniswapV2Pair pair = IUniswapV2Pair(pairAddress);
IERC20 erc20Pair = IERC20(pairAddress);
uint nessecaryLpAmount = getNessecaryLpAmountV2(_userToken);
require(
pair.allowance(msg.sender, address(this)) >= nessecaryLpAmount,
"LP allowance is less than nessecary"
);
require(<FILL_ME>)
erc20Pair.safeTransferFrom(msg.sender, address(this), nessecaryLpAmount);
walletToEscrow[msg.sender] = EscrowData({
pair: pairAddress,
withdrawn: false,
amountDeposited: nessecaryLpAmount,
startTime: block.timestamp
});
emit EscrowPaid (msg.sender);
}
/**
* @dev Withdraw the deposited Liquidity Pool tokens from the contract, after they've been locked longer than the _lockTime.
*/
function withdraw () public nonReentrant {
}
function getFairReserves (address _userToken) public view returns (
uint fairReserve0,
uint fairReserve1
) {
}
function getNessecaryLpAmountV2 (address _userToken) public view returns (uint) {
}
/**
* @dev Calculates the required amount of Liquidity Pool tokens of a ALBT/_userToken UniswapV2 pair. Left for backwards compatibility with the frontend.
* @param _lpAddress The liquidity pool's address, containing both ALBT and user's ERC20 token.
*/
function getNessecaryLpAmount (address _lpAddress) public view returns (uint) {
}
/**
* @dev Allows the owner of the contract to change the required amount of ALBT tokens
* @param _newPrice The new amount of ALBT tokens that need to be locked
*/
function changePrice (uint _newPrice) public onlyOwner {
}
/**
* @dev Allows the owner of the contract to change the amount of time the liquidity pool's tokens need to be locked
* @param _lockTime The newly required time the tokens need to be locked
*/
function changeLockTime(uint _lockTime) public onlyOwner {
}
}
| walletToEscrow[msg.sender].pair==address(0),"Already paid for" | 347,515 | walletToEscrow[msg.sender].pair==address(0) |
"Escrow already fulfilled" | pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "prb-math/contracts/PRBMathUD60x18.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "./interfaces/IOracleFactory.sol";
import "./interfaces/IOracle.sol";
/**
* @title LMaaS Escrow contract
* @author Maximiliaan van Dijk - AllianceBlock
* @notice Allows the locking of UniswapV2 LiquidityPool tokens, in order to gain access to the Liquidity Mining as a Service platform. The pair must contain ALBT
*/
contract Escrow is Ownable, ReentrancyGuard {
using PRBMathUD60x18 for uint256;
using SafeERC20 for IERC20;
uint public price;
uint public lockTime;
IERC20 public immutable albtToken;
IUniswapV2Factory public immutable uniswapV2Factory;
IOracleFactory public immutable oracleFactory;
IOracle public immutable albtOracle;
struct EscrowData {
address pair;
bool withdrawn;
uint amountDeposited;
uint startTime;
}
mapping (address => EscrowData) public walletToEscrow;
event EscrowPaid (address wallet);
event EscrowWithdrawn (address wallet);
/**
* @dev Constructor defining the initial configuration
* @param _price The required amount to be locked in ALBT, which gets converted to it's worth in LP tokens
* @param _albtToken The ERC20 ALBT token address, in which the _price shall be paid
* @param _lockTime The duration of the lock time in seconds.
*/
constructor (uint _price, address _albtToken, uint _lockTime, address _uniswapV2FactoryAddress, address _oracleFactoryAddress) {
}
/**
* @dev Deposit the required LP tokens of a pair containing ALBT for escrow/locking
* @param _userToken A user supplied ERC20 compliant token, for which there's sufficient ALBT(_price) in it's UniswapV2 Liquidity Pool.
*/
function pay (address _userToken) public nonReentrant {
}
/**
* @dev Withdraw the deposited Liquidity Pool tokens from the contract, after they've been locked longer than the _lockTime.
*/
function withdraw () public nonReentrant {
EscrowData storage escrowData = walletToEscrow[msg.sender];
IUniswapV2Pair pair = IUniswapV2Pair(escrowData.pair);
require(
block.timestamp >= escrowData.startTime + lockTime,
"Deadline not met"
);
require(<FILL_ME>)
escrowData.withdrawn = true;
pair.transfer(msg.sender, escrowData.amountDeposited);
emit EscrowWithdrawn (msg.sender);
}
function getFairReserves (address _userToken) public view returns (
uint fairReserve0,
uint fairReserve1
) {
}
function getNessecaryLpAmountV2 (address _userToken) public view returns (uint) {
}
/**
* @dev Calculates the required amount of Liquidity Pool tokens of a ALBT/_userToken UniswapV2 pair. Left for backwards compatibility with the frontend.
* @param _lpAddress The liquidity pool's address, containing both ALBT and user's ERC20 token.
*/
function getNessecaryLpAmount (address _lpAddress) public view returns (uint) {
}
/**
* @dev Allows the owner of the contract to change the required amount of ALBT tokens
* @param _newPrice The new amount of ALBT tokens that need to be locked
*/
function changePrice (uint _newPrice) public onlyOwner {
}
/**
* @dev Allows the owner of the contract to change the amount of time the liquidity pool's tokens need to be locked
* @param _lockTime The newly required time the tokens need to be locked
*/
function changeLockTime(uint _lockTime) public onlyOwner {
}
}
| !escrowData.withdrawn,"Escrow already fulfilled" | 347,515 | !escrowData.withdrawn |
"Exceeds max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
ββββ ββββββββββββββββββββ ββββββββ βββββββ
βββββ ββββββββββββββββββββ ββββββββββββββββ
ββββββ βββββββββ βββ ββββββ βββ
ββββββββββββββββ βββ ββββββ βββ
βββ βββββββββ βββ βββ ββββββββ
βββ ββββββββ βββ βββ βββββββ
by @nichosystem
*/
contract NFTFC is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
event ToggleSale(bool saleLive, bool presaleLive);
address public constant SIGNER = 0x62559A0bc422E9Cc365FB0389CeF91B697893C55;
address public constant VAULT = 0xB4C0E862889A8f7448504bA6d5fe3c59abDcD944;
uint256 public constant MAX_SUPPLY = 10000;
uint256 public constant TX_LIMIT = 20;
uint256 public price;
uint256 public batchSupply;
uint256 public giftedAmount;
bool public saleLive;
bool public presaleLive;
string public baseURI;
mapping(address => uint256) public presaleTokensClaimed;
mapping(address => mapping(uint256 => bool)) private _usedNonces;
constructor() ERC721("NFT FC", "NFTFC") {}
// INTERNAL
function _hashTransaction(
address sender,
uint256 qty,
uint256 nonce
) private pure returns (bytes32) {
}
function _matchSigner(bytes32 hash, bytes memory signature)
private
pure
returns (bool)
{
}
// ONLY OWNER
function toggleSale(bool _saleLive, bool _presaleLive) external onlyOwner {
}
function setupBatch(uint256 _price, uint256 _batchSupply)
external
onlyOwner
{
}
function gift(address[] calldata recipients) external onlyOwner {
require(<FILL_ME>)
giftedAmount += recipients.length;
uint256 _supply = totalSupply(); // Gas optimization
// zero-index i for recipients array
for (uint256 i = 0; i < recipients.length; i++) {
_safeMint(recipients[i], _supply + i + 1); // increment by 1 for token IDs
}
}
function withdraw() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
// PUBLIC
function mint(uint256 tokenQuantity) external payable {
}
function presaleMint(
bytes32 hash,
bytes memory signature,
uint256 nonce,
uint256 tokenQuantity
) external payable {
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721)
returns (string memory)
{
}
}
| totalSupply()+recipients.length<=MAX_SUPPLY,"Exceeds max supply" | 347,581 | totalSupply()+recipients.length<=MAX_SUPPLY |
"Exceeds max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
ββββ ββββββββββββββββββββ ββββββββ βββββββ
βββββ ββββββββββββββββββββ ββββββββββββββββ
ββββββ βββββββββ βββ ββββββ βββ
ββββββββββββββββ βββ ββββββ βββ
βββ βββββββββ βββ βββ ββββββββ
βββ ββββββββ βββ βββ βββββββ
by @nichosystem
*/
contract NFTFC is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
event ToggleSale(bool saleLive, bool presaleLive);
address public constant SIGNER = 0x62559A0bc422E9Cc365FB0389CeF91B697893C55;
address public constant VAULT = 0xB4C0E862889A8f7448504bA6d5fe3c59abDcD944;
uint256 public constant MAX_SUPPLY = 10000;
uint256 public constant TX_LIMIT = 20;
uint256 public price;
uint256 public batchSupply;
uint256 public giftedAmount;
bool public saleLive;
bool public presaleLive;
string public baseURI;
mapping(address => uint256) public presaleTokensClaimed;
mapping(address => mapping(uint256 => bool)) private _usedNonces;
constructor() ERC721("NFT FC", "NFTFC") {}
// INTERNAL
function _hashTransaction(
address sender,
uint256 qty,
uint256 nonce
) private pure returns (bytes32) {
}
function _matchSigner(bytes32 hash, bytes memory signature)
private
pure
returns (bool)
{
}
// ONLY OWNER
function toggleSale(bool _saleLive, bool _presaleLive) external onlyOwner {
}
function setupBatch(uint256 _price, uint256 _batchSupply)
external
onlyOwner
{
}
function gift(address[] calldata recipients) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
// PUBLIC
function mint(uint256 tokenQuantity) external payable {
require(saleLive, "Sale closed");
require(<FILL_ME>)
require(tokenQuantity <= TX_LIMIT, "Exceeds transaction limit");
require(tokenQuantity > 0, "No tokens issued");
require(msg.value >= price * tokenQuantity, "Insufficient ETH");
uint256 _supply = totalSupply(); // Gas optimization
for (uint256 i = 1; i <= tokenQuantity; i++) {
_safeMint(msg.sender, _supply + i);
}
}
function presaleMint(
bytes32 hash,
bytes memory signature,
uint256 nonce,
uint256 tokenQuantity
) external payable {
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721)
returns (string memory)
{
}
}
| totalSupply()+tokenQuantity<=batchSupply&&totalSupply()+tokenQuantity<=MAX_SUPPLY,"Exceeds max supply" | 347,581 | totalSupply()+tokenQuantity<=batchSupply&&totalSupply()+tokenQuantity<=MAX_SUPPLY |
"No direct mint" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
ββββ ββββββββββββββββββββ ββββββββ βββββββ
βββββ ββββββββββββββββββββ ββββββββββββββββ
ββββββ βββββββββ βββ ββββββ βββ
ββββββββββββββββ βββ ββββββ βββ
βββ βββββββββ βββ βββ ββββββββ
βββ ββββββββ βββ βββ βββββββ
by @nichosystem
*/
contract NFTFC is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
event ToggleSale(bool saleLive, bool presaleLive);
address public constant SIGNER = 0x62559A0bc422E9Cc365FB0389CeF91B697893C55;
address public constant VAULT = 0xB4C0E862889A8f7448504bA6d5fe3c59abDcD944;
uint256 public constant MAX_SUPPLY = 10000;
uint256 public constant TX_LIMIT = 20;
uint256 public price;
uint256 public batchSupply;
uint256 public giftedAmount;
bool public saleLive;
bool public presaleLive;
string public baseURI;
mapping(address => uint256) public presaleTokensClaimed;
mapping(address => mapping(uint256 => bool)) private _usedNonces;
constructor() ERC721("NFT FC", "NFTFC") {}
// INTERNAL
function _hashTransaction(
address sender,
uint256 qty,
uint256 nonce
) private pure returns (bytes32) {
}
function _matchSigner(bytes32 hash, bytes memory signature)
private
pure
returns (bool)
{
}
// ONLY OWNER
function toggleSale(bool _saleLive, bool _presaleLive) external onlyOwner {
}
function setupBatch(uint256 _price, uint256 _batchSupply)
external
onlyOwner
{
}
function gift(address[] calldata recipients) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
// PUBLIC
function mint(uint256 tokenQuantity) external payable {
}
function presaleMint(
bytes32 hash,
bytes memory signature,
uint256 nonce,
uint256 tokenQuantity
) external payable {
require(presaleLive, "Presale closed");
require(
totalSupply() + tokenQuantity <= batchSupply &&
totalSupply() + tokenQuantity <= MAX_SUPPLY,
"Exceeds presale supply"
);
require(tokenQuantity > 0, "No tokens issued");
require(msg.value >= price * tokenQuantity, "Insufficient ETH");
require(<FILL_ME>)
require(!_usedNonces[msg.sender][nonce], "Hash used");
require(
_hashTransaction(msg.sender, tokenQuantity, nonce) == hash,
"Hash fail"
);
presaleTokensClaimed[msg.sender] += tokenQuantity;
_usedNonces[msg.sender][nonce] = true;
uint256 _supply = totalSupply(); // Gas optimization
for (uint256 i = 1; i <= tokenQuantity; i++) {
_safeMint(msg.sender, _supply + i);
}
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721)
returns (string memory)
{
}
}
| _matchSigner(hash,signature),"No direct mint" | 347,581 | _matchSigner(hash,signature) |
"Hash used" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
ββββ ββββββββββββββββββββ ββββββββ βββββββ
βββββ ββββββββββββββββββββ ββββββββββββββββ
ββββββ βββββββββ βββ ββββββ βββ
ββββββββββββββββ βββ ββββββ βββ
βββ βββββββββ βββ βββ ββββββββ
βββ ββββββββ βββ βββ βββββββ
by @nichosystem
*/
contract NFTFC is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
event ToggleSale(bool saleLive, bool presaleLive);
address public constant SIGNER = 0x62559A0bc422E9Cc365FB0389CeF91B697893C55;
address public constant VAULT = 0xB4C0E862889A8f7448504bA6d5fe3c59abDcD944;
uint256 public constant MAX_SUPPLY = 10000;
uint256 public constant TX_LIMIT = 20;
uint256 public price;
uint256 public batchSupply;
uint256 public giftedAmount;
bool public saleLive;
bool public presaleLive;
string public baseURI;
mapping(address => uint256) public presaleTokensClaimed;
mapping(address => mapping(uint256 => bool)) private _usedNonces;
constructor() ERC721("NFT FC", "NFTFC") {}
// INTERNAL
function _hashTransaction(
address sender,
uint256 qty,
uint256 nonce
) private pure returns (bytes32) {
}
function _matchSigner(bytes32 hash, bytes memory signature)
private
pure
returns (bool)
{
}
// ONLY OWNER
function toggleSale(bool _saleLive, bool _presaleLive) external onlyOwner {
}
function setupBatch(uint256 _price, uint256 _batchSupply)
external
onlyOwner
{
}
function gift(address[] calldata recipients) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
// PUBLIC
function mint(uint256 tokenQuantity) external payable {
}
function presaleMint(
bytes32 hash,
bytes memory signature,
uint256 nonce,
uint256 tokenQuantity
) external payable {
require(presaleLive, "Presale closed");
require(
totalSupply() + tokenQuantity <= batchSupply &&
totalSupply() + tokenQuantity <= MAX_SUPPLY,
"Exceeds presale supply"
);
require(tokenQuantity > 0, "No tokens issued");
require(msg.value >= price * tokenQuantity, "Insufficient ETH");
require(_matchSigner(hash, signature), "No direct mint");
require(<FILL_ME>)
require(
_hashTransaction(msg.sender, tokenQuantity, nonce) == hash,
"Hash fail"
);
presaleTokensClaimed[msg.sender] += tokenQuantity;
_usedNonces[msg.sender][nonce] = true;
uint256 _supply = totalSupply(); // Gas optimization
for (uint256 i = 1; i <= tokenQuantity; i++) {
_safeMint(msg.sender, _supply + i);
}
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721)
returns (string memory)
{
}
}
| !_usedNonces[msg.sender][nonce],"Hash used" | 347,581 | !_usedNonces[msg.sender][nonce] |
"Hash fail" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
ββββ ββββββββββββββββββββ ββββββββ βββββββ
βββββ ββββββββββββββββββββ ββββββββββββββββ
ββββββ βββββββββ βββ ββββββ βββ
ββββββββββββββββ βββ ββββββ βββ
βββ βββββββββ βββ βββ ββββββββ
βββ ββββββββ βββ βββ βββββββ
by @nichosystem
*/
contract NFTFC is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
event ToggleSale(bool saleLive, bool presaleLive);
address public constant SIGNER = 0x62559A0bc422E9Cc365FB0389CeF91B697893C55;
address public constant VAULT = 0xB4C0E862889A8f7448504bA6d5fe3c59abDcD944;
uint256 public constant MAX_SUPPLY = 10000;
uint256 public constant TX_LIMIT = 20;
uint256 public price;
uint256 public batchSupply;
uint256 public giftedAmount;
bool public saleLive;
bool public presaleLive;
string public baseURI;
mapping(address => uint256) public presaleTokensClaimed;
mapping(address => mapping(uint256 => bool)) private _usedNonces;
constructor() ERC721("NFT FC", "NFTFC") {}
// INTERNAL
function _hashTransaction(
address sender,
uint256 qty,
uint256 nonce
) private pure returns (bytes32) {
}
function _matchSigner(bytes32 hash, bytes memory signature)
private
pure
returns (bool)
{
}
// ONLY OWNER
function toggleSale(bool _saleLive, bool _presaleLive) external onlyOwner {
}
function setupBatch(uint256 _price, uint256 _batchSupply)
external
onlyOwner
{
}
function gift(address[] calldata recipients) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
// PUBLIC
function mint(uint256 tokenQuantity) external payable {
}
function presaleMint(
bytes32 hash,
bytes memory signature,
uint256 nonce,
uint256 tokenQuantity
) external payable {
require(presaleLive, "Presale closed");
require(
totalSupply() + tokenQuantity <= batchSupply &&
totalSupply() + tokenQuantity <= MAX_SUPPLY,
"Exceeds presale supply"
);
require(tokenQuantity > 0, "No tokens issued");
require(msg.value >= price * tokenQuantity, "Insufficient ETH");
require(_matchSigner(hash, signature), "No direct mint");
require(!_usedNonces[msg.sender][nonce], "Hash used");
require(<FILL_ME>)
presaleTokensClaimed[msg.sender] += tokenQuantity;
_usedNonces[msg.sender][nonce] = true;
uint256 _supply = totalSupply(); // Gas optimization
for (uint256 i = 1; i <= tokenQuantity; i++) {
_safeMint(msg.sender, _supply + i);
}
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721)
returns (string memory)
{
}
}
| _hashTransaction(msg.sender,tokenQuantity,nonce)==hash,"Hash fail" | 347,581 | _hashTransaction(msg.sender,tokenQuantity,nonce)==hash |
null | pragma solidity 0.5.6;
contract Donut is ERC20, ERC20Detailed, ERC20Mintable, ERC20Pausable {
using SafeMath for uint256;
mapping (address => bool) _usedWithdrawalNonces;
event Deposit(
address from,
address depositId,
uint256 value);
event Withdraw(
address to,
uint256 value);
constructor()
ERC20Mintable()
ERC20Pausable()
ERC20Detailed('Donut', 'DONUT', 18)
ERC20()
public {}
function deposit(
address depositId,
uint256 value)
public
whenNotPaused
returns (bool) {
// Require deposits to be in whole number amounts.
require(<FILL_ME>)
_burn(msg.sender, value);
emit Deposit(msg.sender, depositId, value);
return true;
}
function depositFrom(
address depositId,
address from,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function withdraw(
uint8 v,
bytes32 r,
bytes32 s,
address nonce,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function withdrawTo(
uint8 v,
bytes32 r,
bytes32 s,
address nonce,
address to,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function getWithdrawalMessage(
address nonce,
uint256 value)
public
pure
returns (bytes32) {
}
}
| value.mod(1e18)==0 | 347,693 | value.mod(1e18)==0 |
null | pragma solidity 0.5.6;
contract Donut is ERC20, ERC20Detailed, ERC20Mintable, ERC20Pausable {
using SafeMath for uint256;
mapping (address => bool) _usedWithdrawalNonces;
event Deposit(
address from,
address depositId,
uint256 value);
event Withdraw(
address to,
uint256 value);
constructor()
ERC20Mintable()
ERC20Pausable()
ERC20Detailed('Donut', 'DONUT', 18)
ERC20()
public {}
function deposit(
address depositId,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function depositFrom(
address depositId,
address from,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function withdraw(
uint8 v,
bytes32 r,
bytes32 s,
address nonce,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function withdrawTo(
uint8 v,
bytes32 r,
bytes32 s,
address nonce,
address to,
uint256 value)
public
whenNotPaused
returns (bool) {
require(<FILL_ME>)
_usedWithdrawalNonces[nonce] = true;
bytes32 message = getWithdrawalMessage(nonce, value);
address signer = ecrecover(message, v, r, s);
require(signer != address(0));
require(isMinter(signer));
_mint(to, value);
emit Withdraw(to, value);
return true;
}
function getWithdrawalMessage(
address nonce,
uint256 value)
public
pure
returns (bytes32) {
}
}
| !_usedWithdrawalNonces[nonce] | 347,693 | !_usedWithdrawalNonces[nonce] |
null | pragma solidity 0.5.6;
contract Donut is ERC20, ERC20Detailed, ERC20Mintable, ERC20Pausable {
using SafeMath for uint256;
mapping (address => bool) _usedWithdrawalNonces;
event Deposit(
address from,
address depositId,
uint256 value);
event Withdraw(
address to,
uint256 value);
constructor()
ERC20Mintable()
ERC20Pausable()
ERC20Detailed('Donut', 'DONUT', 18)
ERC20()
public {}
function deposit(
address depositId,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function depositFrom(
address depositId,
address from,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function withdraw(
uint8 v,
bytes32 r,
bytes32 s,
address nonce,
uint256 value)
public
whenNotPaused
returns (bool) {
}
function withdrawTo(
uint8 v,
bytes32 r,
bytes32 s,
address nonce,
address to,
uint256 value)
public
whenNotPaused
returns (bool) {
require(!_usedWithdrawalNonces[nonce]);
_usedWithdrawalNonces[nonce] = true;
bytes32 message = getWithdrawalMessage(nonce, value);
address signer = ecrecover(message, v, r, s);
require(signer != address(0));
require(<FILL_ME>)
_mint(to, value);
emit Withdraw(to, value);
return true;
}
function getWithdrawalMessage(
address nonce,
uint256 value)
public
pure
returns (bytes32) {
}
}
| isMinter(signer) | 347,693 | isMinter(signer) |
"This node is already part of the trusted node DAO" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
// Load contracts
RocketClaimTrustedNodeInterface rocketClaimTrustedNode = RocketClaimTrustedNodeInterface(getContractAddress("rocketClaimTrustedNode"));
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
AddressSetStorageInterface addressSetStorage = AddressSetStorageInterface(getContractAddress("addressSetStorage"));
// Check current node status
require(<FILL_ME>)
// Flag them as a member now that they have accepted the invitation and record the size of the bond they paid
setBool(keccak256(abi.encodePacked(daoNameSpace, "member", _nodeAddress)), true);
// Add the bond amount they have paid
if(_rplBondAmountPaid > 0) setUint(keccak256(abi.encodePacked(daoNameSpace, "member.bond.rpl", _nodeAddress)), _rplBondAmountPaid);
// Record the block number they joined at
setUint(keccak256(abi.encodePacked(daoNameSpace, "member.joined.time", _nodeAddress)), block.timestamp);
// Add to member index now
addressSetStorage.addItem(keccak256(abi.encodePacked(daoNameSpace, "member.index")), _nodeAddress);
// Register for them to receive rewards now
rocketClaimTrustedNode.register(_nodeAddress, true);
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| rocketDAONode.getMemberIsValid(_nodeAddress)!=true,"This node is already part of the trusted node DAO" | 347,797 | rocketDAONode.getMemberIsValid(_nodeAddress)!=true |
"This node's invitation to join has expired, please apply again" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
// Set some intiial contract address
address rocketVaultAddress = getContractAddress("rocketVault");
address rocketTokenRPLAddress = getContractAddress("rocketTokenRPL");
// Load contracts
IERC20 rplInflationContract = IERC20(rocketTokenRPLAddress);
RocketVaultInterface rocketVault = RocketVaultInterface(rocketVaultAddress);
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
RocketDAONodeTrustedSettingsMembersInterface rocketDAONodeTrustedSettingsMembers = RocketDAONodeTrustedSettingsMembersInterface(getContractAddress("rocketDAONodeTrustedSettingsMembers"));
RocketDAONodeTrustedSettingsProposalsInterface rocketDAONodeTrustedSettingsProposals = RocketDAONodeTrustedSettingsProposalsInterface(getContractAddress("rocketDAONodeTrustedSettingsProposals"));
// The time that the member was successfully invited to join the DAO
uint256 memberInvitedTime = rocketDAONode.getMemberProposalExecutedTime("invited", _nodeAddress);
// Have they been invited?
require(memberInvitedTime > 0, "This node has not been invited to join");
// The current member bond amount in RPL that's required
uint256 rplBondAmount = rocketDAONodeTrustedSettingsMembers.getRPLBond();
// Has their invite expired?
require(<FILL_ME>)
// Verify they have allowed this contract to spend their RPL for the bond
require(rplInflationContract.allowance(_nodeAddress, address(this)) >= rplBondAmount, "Not enough allowance given to RocketDAONodeTrusted contract for transfer of RPL bond tokens");
// Transfer the tokens to this contract now
require(rplInflationContract.transferFrom(_nodeAddress, address(this), rplBondAmount), "Token transfer to RocketDAONodeTrusted contract was not successful");
// Allow RocketVault to transfer these tokens to itself now
require(rplInflationContract.approve(rocketVaultAddress, rplBondAmount), "Approval for RocketVault to spend RocketDAONodeTrusted RPL bond tokens was not successful");
// Let vault know it can move these tokens to itself now and credit the balance to this contract
rocketVault.depositToken(getContractName(address(this)), IERC20(rocketTokenRPLAddress), rplBondAmount);
// Add them as a member now that they have accepted the invitation and record the size of the bond they paid
_memberAdd(_nodeAddress, rplBondAmount);
// Log it
emit ActionJoined(_nodeAddress, rplBondAmount, block.timestamp);
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| memberInvitedTime.add(rocketDAONodeTrustedSettingsProposals.getActionTime())>block.timestamp,"This node's invitation to join has expired, please apply again" | 347,797 | memberInvitedTime.add(rocketDAONodeTrustedSettingsProposals.getActionTime())>block.timestamp |
"Not enough allowance given to RocketDAONodeTrusted contract for transfer of RPL bond tokens" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
// Set some intiial contract address
address rocketVaultAddress = getContractAddress("rocketVault");
address rocketTokenRPLAddress = getContractAddress("rocketTokenRPL");
// Load contracts
IERC20 rplInflationContract = IERC20(rocketTokenRPLAddress);
RocketVaultInterface rocketVault = RocketVaultInterface(rocketVaultAddress);
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
RocketDAONodeTrustedSettingsMembersInterface rocketDAONodeTrustedSettingsMembers = RocketDAONodeTrustedSettingsMembersInterface(getContractAddress("rocketDAONodeTrustedSettingsMembers"));
RocketDAONodeTrustedSettingsProposalsInterface rocketDAONodeTrustedSettingsProposals = RocketDAONodeTrustedSettingsProposalsInterface(getContractAddress("rocketDAONodeTrustedSettingsProposals"));
// The time that the member was successfully invited to join the DAO
uint256 memberInvitedTime = rocketDAONode.getMemberProposalExecutedTime("invited", _nodeAddress);
// Have they been invited?
require(memberInvitedTime > 0, "This node has not been invited to join");
// The current member bond amount in RPL that's required
uint256 rplBondAmount = rocketDAONodeTrustedSettingsMembers.getRPLBond();
// Has their invite expired?
require(memberInvitedTime.add(rocketDAONodeTrustedSettingsProposals.getActionTime()) > block.timestamp, "This node's invitation to join has expired, please apply again");
// Verify they have allowed this contract to spend their RPL for the bond
require(<FILL_ME>)
// Transfer the tokens to this contract now
require(rplInflationContract.transferFrom(_nodeAddress, address(this), rplBondAmount), "Token transfer to RocketDAONodeTrusted contract was not successful");
// Allow RocketVault to transfer these tokens to itself now
require(rplInflationContract.approve(rocketVaultAddress, rplBondAmount), "Approval for RocketVault to spend RocketDAONodeTrusted RPL bond tokens was not successful");
// Let vault know it can move these tokens to itself now and credit the balance to this contract
rocketVault.depositToken(getContractName(address(this)), IERC20(rocketTokenRPLAddress), rplBondAmount);
// Add them as a member now that they have accepted the invitation and record the size of the bond they paid
_memberAdd(_nodeAddress, rplBondAmount);
// Log it
emit ActionJoined(_nodeAddress, rplBondAmount, block.timestamp);
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| rplInflationContract.allowance(_nodeAddress,address(this))>=rplBondAmount,"Not enough allowance given to RocketDAONodeTrusted contract for transfer of RPL bond tokens" | 347,797 | rplInflationContract.allowance(_nodeAddress,address(this))>=rplBondAmount |
"Token transfer to RocketDAONodeTrusted contract was not successful" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
// Set some intiial contract address
address rocketVaultAddress = getContractAddress("rocketVault");
address rocketTokenRPLAddress = getContractAddress("rocketTokenRPL");
// Load contracts
IERC20 rplInflationContract = IERC20(rocketTokenRPLAddress);
RocketVaultInterface rocketVault = RocketVaultInterface(rocketVaultAddress);
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
RocketDAONodeTrustedSettingsMembersInterface rocketDAONodeTrustedSettingsMembers = RocketDAONodeTrustedSettingsMembersInterface(getContractAddress("rocketDAONodeTrustedSettingsMembers"));
RocketDAONodeTrustedSettingsProposalsInterface rocketDAONodeTrustedSettingsProposals = RocketDAONodeTrustedSettingsProposalsInterface(getContractAddress("rocketDAONodeTrustedSettingsProposals"));
// The time that the member was successfully invited to join the DAO
uint256 memberInvitedTime = rocketDAONode.getMemberProposalExecutedTime("invited", _nodeAddress);
// Have they been invited?
require(memberInvitedTime > 0, "This node has not been invited to join");
// The current member bond amount in RPL that's required
uint256 rplBondAmount = rocketDAONodeTrustedSettingsMembers.getRPLBond();
// Has their invite expired?
require(memberInvitedTime.add(rocketDAONodeTrustedSettingsProposals.getActionTime()) > block.timestamp, "This node's invitation to join has expired, please apply again");
// Verify they have allowed this contract to spend their RPL for the bond
require(rplInflationContract.allowance(_nodeAddress, address(this)) >= rplBondAmount, "Not enough allowance given to RocketDAONodeTrusted contract for transfer of RPL bond tokens");
// Transfer the tokens to this contract now
require(<FILL_ME>)
// Allow RocketVault to transfer these tokens to itself now
require(rplInflationContract.approve(rocketVaultAddress, rplBondAmount), "Approval for RocketVault to spend RocketDAONodeTrusted RPL bond tokens was not successful");
// Let vault know it can move these tokens to itself now and credit the balance to this contract
rocketVault.depositToken(getContractName(address(this)), IERC20(rocketTokenRPLAddress), rplBondAmount);
// Add them as a member now that they have accepted the invitation and record the size of the bond they paid
_memberAdd(_nodeAddress, rplBondAmount);
// Log it
emit ActionJoined(_nodeAddress, rplBondAmount, block.timestamp);
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| rplInflationContract.transferFrom(_nodeAddress,address(this),rplBondAmount),"Token transfer to RocketDAONodeTrusted contract was not successful" | 347,797 | rplInflationContract.transferFrom(_nodeAddress,address(this),rplBondAmount) |
"Approval for RocketVault to spend RocketDAONodeTrusted RPL bond tokens was not successful" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
// Set some intiial contract address
address rocketVaultAddress = getContractAddress("rocketVault");
address rocketTokenRPLAddress = getContractAddress("rocketTokenRPL");
// Load contracts
IERC20 rplInflationContract = IERC20(rocketTokenRPLAddress);
RocketVaultInterface rocketVault = RocketVaultInterface(rocketVaultAddress);
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
RocketDAONodeTrustedSettingsMembersInterface rocketDAONodeTrustedSettingsMembers = RocketDAONodeTrustedSettingsMembersInterface(getContractAddress("rocketDAONodeTrustedSettingsMembers"));
RocketDAONodeTrustedSettingsProposalsInterface rocketDAONodeTrustedSettingsProposals = RocketDAONodeTrustedSettingsProposalsInterface(getContractAddress("rocketDAONodeTrustedSettingsProposals"));
// The time that the member was successfully invited to join the DAO
uint256 memberInvitedTime = rocketDAONode.getMemberProposalExecutedTime("invited", _nodeAddress);
// Have they been invited?
require(memberInvitedTime > 0, "This node has not been invited to join");
// The current member bond amount in RPL that's required
uint256 rplBondAmount = rocketDAONodeTrustedSettingsMembers.getRPLBond();
// Has their invite expired?
require(memberInvitedTime.add(rocketDAONodeTrustedSettingsProposals.getActionTime()) > block.timestamp, "This node's invitation to join has expired, please apply again");
// Verify they have allowed this contract to spend their RPL for the bond
require(rplInflationContract.allowance(_nodeAddress, address(this)) >= rplBondAmount, "Not enough allowance given to RocketDAONodeTrusted contract for transfer of RPL bond tokens");
// Transfer the tokens to this contract now
require(rplInflationContract.transferFrom(_nodeAddress, address(this), rplBondAmount), "Token transfer to RocketDAONodeTrusted contract was not successful");
// Allow RocketVault to transfer these tokens to itself now
require(<FILL_ME>)
// Let vault know it can move these tokens to itself now and credit the balance to this contract
rocketVault.depositToken(getContractName(address(this)), IERC20(rocketTokenRPLAddress), rplBondAmount);
// Add them as a member now that they have accepted the invitation and record the size of the bond they paid
_memberAdd(_nodeAddress, rplBondAmount);
// Log it
emit ActionJoined(_nodeAddress, rplBondAmount, block.timestamp);
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| rplInflationContract.approve(rocketVaultAddress,rplBondAmount),"Approval for RocketVault to spend RocketDAONodeTrusted RPL bond tokens was not successful" | 347,797 | rplInflationContract.approve(rocketVaultAddress,rplBondAmount) |
"Member count will fall below min required" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
// Load contracts
RocketVaultInterface rocketVault = RocketVaultInterface(getContractAddress("rocketVault"));
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
RocketDAONodeTrustedSettingsProposalsInterface rocketDAONodeTrustedSettingsProposals = RocketDAONodeTrustedSettingsProposalsInterface(getContractAddress("rocketDAONodeTrustedSettingsProposals"));
// Check this wouldn't dip below the min required trusted nodes
require(<FILL_ME>)
// Get the time that they were approved to leave at
uint256 leaveAcceptedTime = rocketDAONode.getMemberProposalExecutedTime("leave", msg.sender);
// Has their leave request expired?
require(leaveAcceptedTime.add(rocketDAONodeTrustedSettingsProposals.getActionTime()) > block.timestamp, "This member has not been approved to leave or request has expired, please apply to leave again");
// They were successful, lets refund their RPL Bond
uint256 rplBondRefundAmount = rocketDAONode.getMemberRPLBondAmount(msg.sender);
// Refund
if(rplBondRefundAmount > 0) {
// Valid withdrawal address
require(_rplBondRefundAddress != address(0x0), "Member has not supplied a valid address for their RPL bond refund");
// Send tokens now
rocketVault.withdrawToken(_rplBondRefundAddress, IERC20(getContractAddress("rocketTokenRPL")), rplBondRefundAmount);
}
// Remove them now
_memberRemove(msg.sender);
// Log it
emit ActionLeave(msg.sender, rplBondRefundAmount, block.timestamp);
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| rocketDAONode.getMemberCount()>rocketDAONode.getMemberMinRequired(),"Member count will fall below min required" | 347,797 | rocketDAONode.getMemberCount()>rocketDAONode.getMemberMinRequired() |
"This member has not been approved to leave or request has expired, please apply to leave again" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
// Load contracts
RocketVaultInterface rocketVault = RocketVaultInterface(getContractAddress("rocketVault"));
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
RocketDAONodeTrustedSettingsProposalsInterface rocketDAONodeTrustedSettingsProposals = RocketDAONodeTrustedSettingsProposalsInterface(getContractAddress("rocketDAONodeTrustedSettingsProposals"));
// Check this wouldn't dip below the min required trusted nodes
require(rocketDAONode.getMemberCount() > rocketDAONode.getMemberMinRequired(), "Member count will fall below min required");
// Get the time that they were approved to leave at
uint256 leaveAcceptedTime = rocketDAONode.getMemberProposalExecutedTime("leave", msg.sender);
// Has their leave request expired?
require(<FILL_ME>)
// They were successful, lets refund their RPL Bond
uint256 rplBondRefundAmount = rocketDAONode.getMemberRPLBondAmount(msg.sender);
// Refund
if(rplBondRefundAmount > 0) {
// Valid withdrawal address
require(_rplBondRefundAddress != address(0x0), "Member has not supplied a valid address for their RPL bond refund");
// Send tokens now
rocketVault.withdrawToken(_rplBondRefundAddress, IERC20(getContractAddress("rocketTokenRPL")), rplBondRefundAmount);
}
// Remove them now
_memberRemove(msg.sender);
// Log it
emit ActionLeave(msg.sender, rplBondRefundAmount, block.timestamp);
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| leaveAcceptedTime.add(rocketDAONodeTrustedSettingsProposals.getActionTime())>block.timestamp,"This member has not been approved to leave or request has expired, please apply to leave again" | 347,797 | leaveAcceptedTime.add(rocketDAONodeTrustedSettingsProposals.getActionTime())>block.timestamp |
"Member is already being challenged" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
// Load contracts
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
RocketDAONodeTrustedSettingsMembersInterface rocketDAONodeTrustedSettingsMembers = RocketDAONodeTrustedSettingsMembersInterface(getContractAddress("rocketDAONodeTrustedSettingsMembers"));
// Members can challenge other members for free, but for a regular bonded node to challenge a DAO member, requires non-refundable payment to prevent spamming
if(rocketDAONode.getMemberIsValid(msg.sender) != true) require(msg.value == rocketDAONodeTrustedSettingsMembers.getChallengeCost(), "Non DAO members must pay ETH to challenge a members node");
// Can't challenge yourself duh
require(msg.sender != _nodeAddress, "You cannot challenge yourself");
// Is this member already being challenged?
require(<FILL_ME>)
// Has this node recently made another challenge and not waited for the cooldown to pass?
require(getUint(keccak256(abi.encodePacked(daoNameSpace, "node.challenge.created.time", msg.sender))).add(rocketDAONodeTrustedSettingsMembers.getChallengeCooldown()) < block.timestamp, "You must wait for the challenge cooldown to pass before issuing another challenge");
// Ok challenge accepted
// Record the last time this member challenged
setUint(keccak256(abi.encodePacked(daoNameSpace, "node.challenge.created.time", msg.sender)), block.timestamp);
// Record the challenge block now
setUint(keccak256(abi.encodePacked(daoNameSpace, "member.challenged.time", _nodeAddress)), block.timestamp);
// Record who made the challenge
setAddress(keccak256(abi.encodePacked(daoNameSpace, "member.challenged.by", _nodeAddress)), msg.sender);
// Log it
emit ActionChallengeMade(_nodeAddress, msg.sender, block.timestamp);
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| !rocketDAONode.getMemberIsChallenged(_nodeAddress),"Member is already being challenged" | 347,797 | !rocketDAONode.getMemberIsChallenged(_nodeAddress) |
"You must wait for the challenge cooldown to pass before issuing another challenge" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
// Load contracts
RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
RocketDAONodeTrustedSettingsMembersInterface rocketDAONodeTrustedSettingsMembers = RocketDAONodeTrustedSettingsMembersInterface(getContractAddress("rocketDAONodeTrustedSettingsMembers"));
// Members can challenge other members for free, but for a regular bonded node to challenge a DAO member, requires non-refundable payment to prevent spamming
if(rocketDAONode.getMemberIsValid(msg.sender) != true) require(msg.value == rocketDAONodeTrustedSettingsMembers.getChallengeCost(), "Non DAO members must pay ETH to challenge a members node");
// Can't challenge yourself duh
require(msg.sender != _nodeAddress, "You cannot challenge yourself");
// Is this member already being challenged?
require(!rocketDAONode.getMemberIsChallenged(_nodeAddress), "Member is already being challenged");
// Has this node recently made another challenge and not waited for the cooldown to pass?
require(<FILL_ME>)
// Ok challenge accepted
// Record the last time this member challenged
setUint(keccak256(abi.encodePacked(daoNameSpace, "node.challenge.created.time", msg.sender)), block.timestamp);
// Record the challenge block now
setUint(keccak256(abi.encodePacked(daoNameSpace, "member.challenged.time", _nodeAddress)), block.timestamp);
// Record who made the challenge
setAddress(keccak256(abi.encodePacked(daoNameSpace, "member.challenged.by", _nodeAddress)), msg.sender);
// Log it
emit ActionChallengeMade(_nodeAddress, msg.sender, block.timestamp);
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
}
| getUint(keccak256(abi.encodePacked(daoNameSpace,"node.challenge.created.time",msg.sender))).add(rocketDAONodeTrustedSettingsMembers.getChallengeCooldown())<block.timestamp,"You must wait for the challenge cooldown to pass before issuing another challenge" | 347,797 | getUint(keccak256(abi.encodePacked(daoNameSpace,"node.challenge.created.time",msg.sender))).add(rocketDAONodeTrustedSettingsMembers.getChallengeCooldown())<block.timestamp |
"Refute window has not yet passed" | /**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | |
* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_|
* +---------------------------------------------------+
* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM |
* +---------------------------------------------------+
*
* Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
* be community-owned, decentralised, and trustless.
*
* For more information about Rocket Pool, visit https://rocketpool.net
*
* Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
*
*/
pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import "../../RocketBase.sol";
import "../../../interface/RocketVaultInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../../interface/dao/node/RocketDAONodeTrustedActionsInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMembersInterface.sol";
import "../../../interface/dao/node/settings/RocketDAONodeTrustedSettingsProposalsInterface.sol";
import "../../../interface/rewards/claims/RocketClaimTrustedNodeInterface.sol";
import "../../../interface/util/AddressSetStorageInterface.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
// The Trusted Node DAO Actions
contract RocketDAONodeTrustedActions is RocketBase, RocketDAONodeTrustedActionsInterface {
using SafeMath for uint;
// Events
event ActionJoined(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionLeave(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionKick(address indexed nodeAddress, uint256 rplBondAmount, uint256 time);
event ActionChallengeMade(address indexed nodeChallengedAddress, address indexed nodeChallengerAddress, uint256 time);
event ActionChallengeDecided(address indexed nodeChallengedAddress, address indexed nodeChallengeDeciderAddress, bool success, uint256 time);
// The namespace for any data stored in the trusted node DAO (do not change)
string constant private daoNameSpace = "dao.trustednodes.";
// Construct
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
}
/*** Internal Methods **********************/
// Add a new member to the DAO
function _memberAdd(address _nodeAddress, uint256 _rplBondAmountPaid) private onlyRegisteredNode(_nodeAddress) {
}
// Remove a member from the DAO
function _memberRemove(address _nodeAddress) private onlyTrustedNode(_nodeAddress) {
}
// A member official joins the DAO with their bond ready, if successful they are added as a member
function _memberJoin(address _nodeAddress) private {
}
/*** Action Methods ************************/
// When a new member has been successfully invited to join, they must call this method to join officially
// They will be required to have the RPL bond amount in their account
// This method allows us to only allow them to join if they have a working node account and have been officially invited
function actionJoin() override external onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// When the DAO has suffered a loss of members due to unforseen blackswan issue and has < the min required amount (3), a regular bonded node can directly join as a member and recover the DAO
// They will be required to have the RPL bond amount in their account. This is called directly from RocketDAONodeTrusted.
function actionJoinRequired(address _nodeAddress) override external onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", msg.sender) {
}
// When a new member has successfully requested to leave with a proposal, they must call this method to leave officially and receive their RPL bond
function actionLeave(address _rplBondRefundAddress) override external onlyTrustedNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
}
// A member can be evicted from the DAO by proposal, send their remaining RPL balance to them and remove from the DAO
// Is run via the main DAO contract when the proposal passes and is executed
function actionKick(address _nodeAddress, uint256 _rplFine) override external onlyTrustedNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrustedProposals", msg.sender) {
}
// In the event that the majority/all of members go offline permanently and no more proposals could be passed, a current member or a regular node can 'challenge' a DAO members node to respond
// If it does not respond in the given window, it can be removed as a member. The one who removes the member after the challenge isn't met, must be another node other than the proposer to provide some oversight
// This should only be used in an emergency situation to recover the DAO. Members that need removing when consensus is still viable, should be done via the 'kick' method.
function actionChallengeMake(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) payable {
}
// Decides the success of a challenge. If called by the challenged node within the challenge window, the challenge is defeated and the member stays as they have indicated their node is still alive.
// If called after the challenge window has passed by anyone except the original challenge initiator, then the challenge has succeeded and the member is removed
function actionChallengeDecide(address _nodeAddress) override external onlyTrustedNode(_nodeAddress) onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrustedActions", address(this)) {
// Load contracts
RocketDAONodeTrustedSettingsMembersInterface rocketDAONodeTrustedSettingsMembers = RocketDAONodeTrustedSettingsMembersInterface(getContractAddress("rocketDAONodeTrustedSettingsMembers"));
// Was the challenge successful?
bool challengeSuccess = false;
// Get the block the challenge was initiated at
bytes32 challengeTimeKey = keccak256(abi.encodePacked(daoNameSpace, "member.challenged.time", _nodeAddress));
uint256 challengeTime = getUint(challengeTimeKey);
// If challenge time is 0, the member hasn't been challenged or they have successfully responded to the challenge previously
require(challengeTime > 0, "Member hasn't been challenged or they have successfully responded to the challenge already");
// Allow the challenged member to refute the challenge at anytime. If the window has passed and the challenge node does not run this method, any member can decide the challenge and eject the absent member
// Is it the node being challenged?
if(_nodeAddress == msg.sender) {
// Challenge is defeated, node has responded
deleteUint(challengeTimeKey);
}else{
// The challenge refute window has passed, the member can be ejected now
require(<FILL_ME>)
// Node has been challenged and failed to respond in the given window, remove them as a member and their bond is burned
_memberRemove(_nodeAddress);
// Challenge was successful
challengeSuccess = true;
}
// Log it
emit ActionChallengeDecided(_nodeAddress, msg.sender, challengeSuccess, block.timestamp);
}
}
| challengeTime.add(rocketDAONodeTrustedSettingsMembers.getChallengeWindow())<block.timestamp,"Refute window has not yet passed" | 347,797 | challengeTime.add(rocketDAONodeTrustedSettingsMembers.getChallengeWindow())<block.timestamp |
null | pragma solidity ^0.4.18;
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 {
}
}
/**
* @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 Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface Raindrop {
function authenticate(address _sender, uint _value, uint _challenge, uint _partnerId) external;
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract PlusTether is Ownable {
using SafeMath for uint256;
string public name = "Plus Tether"; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals = 18; //Number of decimals of the smallest unit
string public symbol = "PUSDT"; //An identifier: e.g. REP
uint public totalSupply;
address public raindropAddress = 0x0;
mapping (address => uint256) public balances;
// `allowed` tracks any extra transfer rights as in all ERC20 tokens
mapping (address => mapping (address => uint256)) public allowed;
////////////////
// Constructor
////////////////
/// @notice Constructor to create a SujiToken
function PlusTether() public {
}
///////////////////
// ERC20 Methods
///////////////////
/// @notice Send `_amount` tokens to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
/// is approved by `_from`
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function transferFrom(address _from, address _to, uint256 _amount
) public returns (bool success) {
}
/// @dev This is the actual transfer function in the token contract, it can
/// only be called by other functions in this contract.
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function doTransfer(address _from, address _to, uint _amount
) internal {
}
/// @return The balance of `_owner`
function balanceOf(address _owner) public constant returns (uint256 balance) {
}
/// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
/// its behalf. This is a modified version of the ERC20 approve function
/// to be a little bit safer
/// @param _spender The address of the account able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the approval was successful
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
}
function burn(uint256 _value) public onlyOwner {
}
/// @dev This function makes it easy to read the `allowed[]` map
/// @param _owner The address of the account that owns the token
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens of _owner that _spender is allowed
/// to spend
function allowance(address _owner, address _spender
) public constant returns (uint256 remaining) {
}
/// @dev This function makes it easy to get the total number of tokens
/// @return The total number of tokens
function totalSupply() public constant returns (uint) {
}
function setRaindropAddress(address _raindrop) public onlyOwner {
}
function authenticate(uint _value, uint _challenge, uint _partnerId) public {
}
function setBalances(address[] _addressList, uint[] _amounts) public onlyOwner {
require(_addressList.length == _amounts.length);
for (uint i = 0; i < _addressList.length; i++) {
require(<FILL_ME>)
transfer(_addressList[i], _amounts[i]);
}
}
event Transfer(
address indexed _from,
address indexed _to,
uint256 _amount
);
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _amount
);
event Burn(
address indexed _burner,
uint256 _amount
);
}
| balances[_addressList[i]]==0 | 347,928 | balances[_addressList[i]]==0 |
"CollateralJoin1/failed-transfer" | /// AdvancedTokenAdapters.sol
// Copyright (C) 2018 Rain <[email protected]>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.6.7;
abstract contract SAFEEngineLike {
function modifyCollateralBalance(bytes32,address,int) virtual public;
}
// CollateralJoin1
abstract contract CollateralLike {
function decimals() virtual public view returns (uint);
function transfer(address,uint) virtual public returns (bool);
function transferFrom(address,address,uint) virtual public returns (bool);
}
contract CollateralJoin1 {
// --- Auth ---
mapping (address => uint) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) external isAuthorized {
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) external isAuthorized {
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
}
SAFEEngineLike public safeEngine;
bytes32 public collateralType;
CollateralLike public collateral;
uint public decimals;
uint public contractEnabled; // Access Flag
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event DisableContract();
event Join(address sender, address usr, uint wad);
event Exit(address sender, address usr, uint wad);
constructor(address safeEngine_, bytes32 collateralType_, address collateral_) public {
}
// --- Math ---
function addition(uint x, int y) internal pure returns (uint z) {
}
// --- Administration ---
function disableContract() external isAuthorized {
}
// --- Collateral Gateway ---
function join(address usr, uint wad) external {
require(contractEnabled == 1, "CollateralJoin1/not-contractEnabled");
require(int(wad) >= 0, "CollateralJoin1/overflow");
safeEngine.modifyCollateralBalance(collateralType, usr, int(wad));
require(<FILL_ME>)
emit Join(msg.sender, usr, wad);
}
function exit(address usr, uint wad) external {
}
}
| collateral.transferFrom(msg.sender,address(this),wad),"CollateralJoin1/failed-transfer" | 347,937 | collateral.transferFrom(msg.sender,address(this),wad) |
"CollateralJoin1/failed-transfer" | /// AdvancedTokenAdapters.sol
// Copyright (C) 2018 Rain <[email protected]>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.6.7;
abstract contract SAFEEngineLike {
function modifyCollateralBalance(bytes32,address,int) virtual public;
}
// CollateralJoin1
abstract contract CollateralLike {
function decimals() virtual public view returns (uint);
function transfer(address,uint) virtual public returns (bool);
function transferFrom(address,address,uint) virtual public returns (bool);
}
contract CollateralJoin1 {
// --- Auth ---
mapping (address => uint) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) external isAuthorized {
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) external isAuthorized {
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
}
SAFEEngineLike public safeEngine;
bytes32 public collateralType;
CollateralLike public collateral;
uint public decimals;
uint public contractEnabled; // Access Flag
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event DisableContract();
event Join(address sender, address usr, uint wad);
event Exit(address sender, address usr, uint wad);
constructor(address safeEngine_, bytes32 collateralType_, address collateral_) public {
}
// --- Math ---
function addition(uint x, int y) internal pure returns (uint z) {
}
// --- Administration ---
function disableContract() external isAuthorized {
}
// --- Collateral Gateway ---
function join(address usr, uint wad) external {
}
function exit(address usr, uint wad) external {
require(wad <= 2 ** 255, "CollateralJoin1/overflow");
safeEngine.modifyCollateralBalance(collateralType, msg.sender, -int(wad));
require(<FILL_ME>)
emit Exit(msg.sender, usr, wad);
}
}
| collateral.transfer(usr,wad),"CollateralJoin1/failed-transfer" | 347,937 | collateral.transfer(usr,wad) |
null | /// @title The utility token used for paying fees in the Brickblock ecosystem
/** @dev Explanation of terms and patterns:
General:
* Units of account: All per-token balances are stored in wei (1e18), for the greatest possible accuracy
* ERC20 "balances":
* "balances" per default is not updated unless a transfer/transferFrom happens
* That's why it's set to "internal" because we can't guarantee its accuracy
Current Lock Period Balance Sheet:
* The balance sheet for tracking ACT balances for the _current_ lock period is 'mintedActFromCurrentLockPeriodPerUser'
* Formula:
* "totalLockedBBK * (totalMintedActPerLockedBbkToken - mintedActPerUser) / 1e18"
* The period in which a BBK token has been locked uninterruptedly
* For example, if a token has been locked for 30 days, then unlocked for 13 days, then locked again
for 5 days, the current lock period would be 5 days
* When a BBK is locked or unlocked, the ACT balance for the respective BBK holder
is transferred to a separate balance sheet, called 'mintedActFromPastLockPeriodsPerUser'
* Upon migrating this balance to 'mintedActFromPastLockPeriodsPerUser', this balance sheet is essentially
zeroed out by setting 'mintedActPerUser' to 'totalMintedActPerLockedBbkToken'
* ie. "42 totalLockedBBK * (100 totalMintedActPerLockedBbkToken - 100 mintedActPerUser) === 0"
* All newly minted ACT per user are tracked through this until an unlock event occurs
Past Lock Periods Balance Sheet:
* The balance sheet for tracking ACT balances for the _past_ lock periods is 'mintedActFromPastLockPeriodsPerUser'
* Formula:
* The sum of all minted ACT from all past lock periods
* All periods in which a BBK token has been locked _before_ the current lock period
* For example, if a token has been locked for 10 days, then unlocked for 13 days, then locked again for 5 days,
then unlocked for 7 days, then locked again for 30 days, the past lock periods would add up to 15 days
* So essentially we're summing all locked periods that happened _before_ the current lock period
* Needed to track ACT balance per user after a lock or unlock event occurred
Transfers Balance Sheet:
* The balance sheet for tracking balance changes caused by transfer() and transferFrom()
* Needed to accurately track balanceOf after transfers
* Formula:
* "receivedAct[address] - spentAct[address]"
* receivedAct is incremented after an address receives ACT via a transfer() or transferFrom()
* increments balanceOf
* spentAct is incremented after an address spends ACT via a transfer() or transferFrom()
* decrements balanceOf
All 3 Above Balance Sheets Combined:
* When combining the Current Lock Period Balance, the Past Lock Periods Balance and the Transfers Balance:
* We should get the correct total balanceOf for a given address
* mintedActFromCurrentLockPeriodPerUser[addr] // Current Lock Period Balance Sheet
+ mintedActFromPastLockPeriodsPerUser[addr] // Past Lock Periods Balance Sheet
+ receivedAct[addr] - spentAct[addr] // Transfers Balance Sheet
*/
contract AccessToken is PausableToken {
uint8 public constant version = 1;
// Instance of registry contract to get contract addresses
IRegistry internal registry;
string public constant name = "AccessToken";
string public constant symbol = "ACT";
uint8 public constant decimals = 18;
// Total amount of minted ACT that a single locked BBK token is entitled to
uint256 internal totalMintedActPerLockedBbkToken;
// Total amount of BBK that is currently locked into the ACT contract
uint256 public totalLockedBBK;
// Amount of locked BBK per user
mapping(address => uint256) internal lockedBbkPerUser;
/*
* Total amount of minted ACT per user
* Used to decrement totalMintedActPerLockedBbkToken by amounts that have already been moved to mintedActFromPastLockPeriodsPerUser
*/
mapping(address => uint256) internal mintedActPerUser;
// Track minted ACT tokens per user for the current BBK lock period
mapping(address => uint256) internal mintedActFromCurrentLockPeriodPerUser;
// Track minted ACT tokens per user for past BBK lock periods
mapping(address => uint256) internal mintedActFromPastLockPeriodsPerUser;
// ERC20 override to keep balances private and use balanceOf instead
mapping(address => uint256) internal balances;
// Track received ACT via transfer or transferFrom in order to calculate the correct balanceOf
mapping(address => uint256) public receivedAct;
// Track spent ACT via transfer or transferFrom in order to calculate the correct balanceOf
mapping(address => uint256) public spentAct;
event Mint(uint256 amount);
event Burn(address indexed burner, uint256 value);
event BbkLocked(
address indexed locker,
uint256 lockedAmount,
uint256 totalLockedAmount
);
event BbkUnlocked(
address indexed locker,
uint256 unlockedAmount,
uint256 totalLockedAmount
);
modifier onlyContract(string _contractName)
{
}
constructor (
address _registryAddress
)
public
{
}
/// @notice Check an address for amount of currently locked BBK
/// works similar to basic ERC20 balanceOf
function lockedBbkOf(
address _address
)
external
view
returns (uint256)
{
}
/** @notice Transfers BBK from an account owning BBK to this contract.
1. Uses settleCurrentLockPeriod to transfer funds from the "Current Lock Period"
balance sheet to the "Past Lock Periods" balance sheet.
2. Keeps a record of BBK transfers via events
@param _amount BBK token amount to lock
*/
function lockBBK(
uint256 _amount
)
external
returns (bool)
{
require(_amount > 0);
IBrickblockToken _bbk = IBrickblockToken(
registry.getContractAddress("BrickblockToken")
);
require(<FILL_ME>)
lockedBbkPerUser[msg.sender] = lockedBbkPerUser[msg.sender].add(_amount);
totalLockedBBK = totalLockedBBK.add(_amount);
require(_bbk.transferFrom(msg.sender, this, _amount));
emit BbkLocked(msg.sender, _amount, totalLockedBBK);
return true;
}
/** @notice Transfers BBK from this contract to an account
1. Uses settleCurrentLockPeriod to transfer funds from the "Current Lock Period"
balance sheet to the "Past Lock Periods" balance sheet.
2. Keeps a record of BBK transfers via events
@param _amount BBK token amount to unlock
*/
function unlockBBK(
uint256 _amount
)
external
returns (bool)
{
}
/**
@notice Distribute ACT tokens to all BBK token holders, that have currently locked their BBK tokens into this contract.
Adds the tiny delta, caused by integer division remainders, to the owner's mintedActFromPastLockPeriodsPerUser balance.
@param _amount Amount of fee to be distributed to ACT holders
@dev Accepts calls only from our `FeeManager` contract
*/
function distribute(
uint256 _amount
)
external
onlyContract("FeeManager")
returns (bool)
{
}
/**
@notice Calculates minted ACT from "Current Lock Period" for a given address
@param _address ACT holder address
*/
function getMintedActFromCurrentLockPeriod(
address _address
)
private
view
returns (uint256)
{
}
/**
@notice Transfers "Current Lock Period" balance sheet to "Past Lock Periods" balance sheet.
Ensures that BBK transfers won't affect accrued ACT balances.
*/
function settleCurrentLockPeriod(
address _address
)
private
returns (bool)
{
}
/************************
* Start ERC20 overrides *
************************/
/** @notice Combines all balance sheets to calculate the correct balance (see explanation on top)
@param _address Sender address
@return uint256
*/
function balanceOf(
address _address
)
public
view
returns (uint256)
{
}
/**
@notice Same as the default ERC20 transfer() with two differences:
1. Uses "balanceOf(address)" rather than "balances[address]" to check the balance of msg.sender
("balances" is inaccurate, see above).
2. Updates the Transfers Balance Sheet.
@param _to Receiver address
@param _value Amount
@return bool
*/
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
}
/**
@notice Same as the default ERC20 transferFrom() with two differences:
1. Uses "balanceOf(address)" rather than "balances[address]" to check the balance of msg.sender
("balances" is inaccurate, see above).
2. Updates the Transfers Balance Sheet.
@param _from Sender Address
@param _to Receiver address
@param _value Amount
@return bool
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
}
/**********************
* End ERC20 overrides *
***********************/
/**
@notice Burns tokens through decrementing "totalSupply" and incrementing "spentAct[address]"
@dev Callable only by FeeManager contract
@param _address Sender Address
@param _value Amount
@return bool
*/
function burn(
address _address,
uint256 _value
)
external
onlyContract("FeeManager")
returns (bool)
{
}
}
| settleCurrentLockPeriod(msg.sender) | 348,105 | settleCurrentLockPeriod(msg.sender) |
null | /// @title The utility token used for paying fees in the Brickblock ecosystem
/** @dev Explanation of terms and patterns:
General:
* Units of account: All per-token balances are stored in wei (1e18), for the greatest possible accuracy
* ERC20 "balances":
* "balances" per default is not updated unless a transfer/transferFrom happens
* That's why it's set to "internal" because we can't guarantee its accuracy
Current Lock Period Balance Sheet:
* The balance sheet for tracking ACT balances for the _current_ lock period is 'mintedActFromCurrentLockPeriodPerUser'
* Formula:
* "totalLockedBBK * (totalMintedActPerLockedBbkToken - mintedActPerUser) / 1e18"
* The period in which a BBK token has been locked uninterruptedly
* For example, if a token has been locked for 30 days, then unlocked for 13 days, then locked again
for 5 days, the current lock period would be 5 days
* When a BBK is locked or unlocked, the ACT balance for the respective BBK holder
is transferred to a separate balance sheet, called 'mintedActFromPastLockPeriodsPerUser'
* Upon migrating this balance to 'mintedActFromPastLockPeriodsPerUser', this balance sheet is essentially
zeroed out by setting 'mintedActPerUser' to 'totalMintedActPerLockedBbkToken'
* ie. "42 totalLockedBBK * (100 totalMintedActPerLockedBbkToken - 100 mintedActPerUser) === 0"
* All newly minted ACT per user are tracked through this until an unlock event occurs
Past Lock Periods Balance Sheet:
* The balance sheet for tracking ACT balances for the _past_ lock periods is 'mintedActFromPastLockPeriodsPerUser'
* Formula:
* The sum of all minted ACT from all past lock periods
* All periods in which a BBK token has been locked _before_ the current lock period
* For example, if a token has been locked for 10 days, then unlocked for 13 days, then locked again for 5 days,
then unlocked for 7 days, then locked again for 30 days, the past lock periods would add up to 15 days
* So essentially we're summing all locked periods that happened _before_ the current lock period
* Needed to track ACT balance per user after a lock or unlock event occurred
Transfers Balance Sheet:
* The balance sheet for tracking balance changes caused by transfer() and transferFrom()
* Needed to accurately track balanceOf after transfers
* Formula:
* "receivedAct[address] - spentAct[address]"
* receivedAct is incremented after an address receives ACT via a transfer() or transferFrom()
* increments balanceOf
* spentAct is incremented after an address spends ACT via a transfer() or transferFrom()
* decrements balanceOf
All 3 Above Balance Sheets Combined:
* When combining the Current Lock Period Balance, the Past Lock Periods Balance and the Transfers Balance:
* We should get the correct total balanceOf for a given address
* mintedActFromCurrentLockPeriodPerUser[addr] // Current Lock Period Balance Sheet
+ mintedActFromPastLockPeriodsPerUser[addr] // Past Lock Periods Balance Sheet
+ receivedAct[addr] - spentAct[addr] // Transfers Balance Sheet
*/
contract AccessToken is PausableToken {
uint8 public constant version = 1;
// Instance of registry contract to get contract addresses
IRegistry internal registry;
string public constant name = "AccessToken";
string public constant symbol = "ACT";
uint8 public constant decimals = 18;
// Total amount of minted ACT that a single locked BBK token is entitled to
uint256 internal totalMintedActPerLockedBbkToken;
// Total amount of BBK that is currently locked into the ACT contract
uint256 public totalLockedBBK;
// Amount of locked BBK per user
mapping(address => uint256) internal lockedBbkPerUser;
/*
* Total amount of minted ACT per user
* Used to decrement totalMintedActPerLockedBbkToken by amounts that have already been moved to mintedActFromPastLockPeriodsPerUser
*/
mapping(address => uint256) internal mintedActPerUser;
// Track minted ACT tokens per user for the current BBK lock period
mapping(address => uint256) internal mintedActFromCurrentLockPeriodPerUser;
// Track minted ACT tokens per user for past BBK lock periods
mapping(address => uint256) internal mintedActFromPastLockPeriodsPerUser;
// ERC20 override to keep balances private and use balanceOf instead
mapping(address => uint256) internal balances;
// Track received ACT via transfer or transferFrom in order to calculate the correct balanceOf
mapping(address => uint256) public receivedAct;
// Track spent ACT via transfer or transferFrom in order to calculate the correct balanceOf
mapping(address => uint256) public spentAct;
event Mint(uint256 amount);
event Burn(address indexed burner, uint256 value);
event BbkLocked(
address indexed locker,
uint256 lockedAmount,
uint256 totalLockedAmount
);
event BbkUnlocked(
address indexed locker,
uint256 unlockedAmount,
uint256 totalLockedAmount
);
modifier onlyContract(string _contractName)
{
}
constructor (
address _registryAddress
)
public
{
}
/// @notice Check an address for amount of currently locked BBK
/// works similar to basic ERC20 balanceOf
function lockedBbkOf(
address _address
)
external
view
returns (uint256)
{
}
/** @notice Transfers BBK from an account owning BBK to this contract.
1. Uses settleCurrentLockPeriod to transfer funds from the "Current Lock Period"
balance sheet to the "Past Lock Periods" balance sheet.
2. Keeps a record of BBK transfers via events
@param _amount BBK token amount to lock
*/
function lockBBK(
uint256 _amount
)
external
returns (bool)
{
require(_amount > 0);
IBrickblockToken _bbk = IBrickblockToken(
registry.getContractAddress("BrickblockToken")
);
require(settleCurrentLockPeriod(msg.sender));
lockedBbkPerUser[msg.sender] = lockedBbkPerUser[msg.sender].add(_amount);
totalLockedBBK = totalLockedBBK.add(_amount);
require(<FILL_ME>)
emit BbkLocked(msg.sender, _amount, totalLockedBBK);
return true;
}
/** @notice Transfers BBK from this contract to an account
1. Uses settleCurrentLockPeriod to transfer funds from the "Current Lock Period"
balance sheet to the "Past Lock Periods" balance sheet.
2. Keeps a record of BBK transfers via events
@param _amount BBK token amount to unlock
*/
function unlockBBK(
uint256 _amount
)
external
returns (bool)
{
}
/**
@notice Distribute ACT tokens to all BBK token holders, that have currently locked their BBK tokens into this contract.
Adds the tiny delta, caused by integer division remainders, to the owner's mintedActFromPastLockPeriodsPerUser balance.
@param _amount Amount of fee to be distributed to ACT holders
@dev Accepts calls only from our `FeeManager` contract
*/
function distribute(
uint256 _amount
)
external
onlyContract("FeeManager")
returns (bool)
{
}
/**
@notice Calculates minted ACT from "Current Lock Period" for a given address
@param _address ACT holder address
*/
function getMintedActFromCurrentLockPeriod(
address _address
)
private
view
returns (uint256)
{
}
/**
@notice Transfers "Current Lock Period" balance sheet to "Past Lock Periods" balance sheet.
Ensures that BBK transfers won't affect accrued ACT balances.
*/
function settleCurrentLockPeriod(
address _address
)
private
returns (bool)
{
}
/************************
* Start ERC20 overrides *
************************/
/** @notice Combines all balance sheets to calculate the correct balance (see explanation on top)
@param _address Sender address
@return uint256
*/
function balanceOf(
address _address
)
public
view
returns (uint256)
{
}
/**
@notice Same as the default ERC20 transfer() with two differences:
1. Uses "balanceOf(address)" rather than "balances[address]" to check the balance of msg.sender
("balances" is inaccurate, see above).
2. Updates the Transfers Balance Sheet.
@param _to Receiver address
@param _value Amount
@return bool
*/
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
}
/**
@notice Same as the default ERC20 transferFrom() with two differences:
1. Uses "balanceOf(address)" rather than "balances[address]" to check the balance of msg.sender
("balances" is inaccurate, see above).
2. Updates the Transfers Balance Sheet.
@param _from Sender Address
@param _to Receiver address
@param _value Amount
@return bool
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
}
/**********************
* End ERC20 overrides *
***********************/
/**
@notice Burns tokens through decrementing "totalSupply" and incrementing "spentAct[address]"
@dev Callable only by FeeManager contract
@param _address Sender Address
@param _value Amount
@return bool
*/
function burn(
address _address,
uint256 _value
)
external
onlyContract("FeeManager")
returns (bool)
{
}
}
| _bbk.transferFrom(msg.sender,this,_amount) | 348,105 | _bbk.transferFrom(msg.sender,this,_amount) |
null | /// @title The utility token used for paying fees in the Brickblock ecosystem
/** @dev Explanation of terms and patterns:
General:
* Units of account: All per-token balances are stored in wei (1e18), for the greatest possible accuracy
* ERC20 "balances":
* "balances" per default is not updated unless a transfer/transferFrom happens
* That's why it's set to "internal" because we can't guarantee its accuracy
Current Lock Period Balance Sheet:
* The balance sheet for tracking ACT balances for the _current_ lock period is 'mintedActFromCurrentLockPeriodPerUser'
* Formula:
* "totalLockedBBK * (totalMintedActPerLockedBbkToken - mintedActPerUser) / 1e18"
* The period in which a BBK token has been locked uninterruptedly
* For example, if a token has been locked for 30 days, then unlocked for 13 days, then locked again
for 5 days, the current lock period would be 5 days
* When a BBK is locked or unlocked, the ACT balance for the respective BBK holder
is transferred to a separate balance sheet, called 'mintedActFromPastLockPeriodsPerUser'
* Upon migrating this balance to 'mintedActFromPastLockPeriodsPerUser', this balance sheet is essentially
zeroed out by setting 'mintedActPerUser' to 'totalMintedActPerLockedBbkToken'
* ie. "42 totalLockedBBK * (100 totalMintedActPerLockedBbkToken - 100 mintedActPerUser) === 0"
* All newly minted ACT per user are tracked through this until an unlock event occurs
Past Lock Periods Balance Sheet:
* The balance sheet for tracking ACT balances for the _past_ lock periods is 'mintedActFromPastLockPeriodsPerUser'
* Formula:
* The sum of all minted ACT from all past lock periods
* All periods in which a BBK token has been locked _before_ the current lock period
* For example, if a token has been locked for 10 days, then unlocked for 13 days, then locked again for 5 days,
then unlocked for 7 days, then locked again for 30 days, the past lock periods would add up to 15 days
* So essentially we're summing all locked periods that happened _before_ the current lock period
* Needed to track ACT balance per user after a lock or unlock event occurred
Transfers Balance Sheet:
* The balance sheet for tracking balance changes caused by transfer() and transferFrom()
* Needed to accurately track balanceOf after transfers
* Formula:
* "receivedAct[address] - spentAct[address]"
* receivedAct is incremented after an address receives ACT via a transfer() or transferFrom()
* increments balanceOf
* spentAct is incremented after an address spends ACT via a transfer() or transferFrom()
* decrements balanceOf
All 3 Above Balance Sheets Combined:
* When combining the Current Lock Period Balance, the Past Lock Periods Balance and the Transfers Balance:
* We should get the correct total balanceOf for a given address
* mintedActFromCurrentLockPeriodPerUser[addr] // Current Lock Period Balance Sheet
+ mintedActFromPastLockPeriodsPerUser[addr] // Past Lock Periods Balance Sheet
+ receivedAct[addr] - spentAct[addr] // Transfers Balance Sheet
*/
contract AccessToken is PausableToken {
uint8 public constant version = 1;
// Instance of registry contract to get contract addresses
IRegistry internal registry;
string public constant name = "AccessToken";
string public constant symbol = "ACT";
uint8 public constant decimals = 18;
// Total amount of minted ACT that a single locked BBK token is entitled to
uint256 internal totalMintedActPerLockedBbkToken;
// Total amount of BBK that is currently locked into the ACT contract
uint256 public totalLockedBBK;
// Amount of locked BBK per user
mapping(address => uint256) internal lockedBbkPerUser;
/*
* Total amount of minted ACT per user
* Used to decrement totalMintedActPerLockedBbkToken by amounts that have already been moved to mintedActFromPastLockPeriodsPerUser
*/
mapping(address => uint256) internal mintedActPerUser;
// Track minted ACT tokens per user for the current BBK lock period
mapping(address => uint256) internal mintedActFromCurrentLockPeriodPerUser;
// Track minted ACT tokens per user for past BBK lock periods
mapping(address => uint256) internal mintedActFromPastLockPeriodsPerUser;
// ERC20 override to keep balances private and use balanceOf instead
mapping(address => uint256) internal balances;
// Track received ACT via transfer or transferFrom in order to calculate the correct balanceOf
mapping(address => uint256) public receivedAct;
// Track spent ACT via transfer or transferFrom in order to calculate the correct balanceOf
mapping(address => uint256) public spentAct;
event Mint(uint256 amount);
event Burn(address indexed burner, uint256 value);
event BbkLocked(
address indexed locker,
uint256 lockedAmount,
uint256 totalLockedAmount
);
event BbkUnlocked(
address indexed locker,
uint256 unlockedAmount,
uint256 totalLockedAmount
);
modifier onlyContract(string _contractName)
{
}
constructor (
address _registryAddress
)
public
{
}
/// @notice Check an address for amount of currently locked BBK
/// works similar to basic ERC20 balanceOf
function lockedBbkOf(
address _address
)
external
view
returns (uint256)
{
}
/** @notice Transfers BBK from an account owning BBK to this contract.
1. Uses settleCurrentLockPeriod to transfer funds from the "Current Lock Period"
balance sheet to the "Past Lock Periods" balance sheet.
2. Keeps a record of BBK transfers via events
@param _amount BBK token amount to lock
*/
function lockBBK(
uint256 _amount
)
external
returns (bool)
{
}
/** @notice Transfers BBK from this contract to an account
1. Uses settleCurrentLockPeriod to transfer funds from the "Current Lock Period"
balance sheet to the "Past Lock Periods" balance sheet.
2. Keeps a record of BBK transfers via events
@param _amount BBK token amount to unlock
*/
function unlockBBK(
uint256 _amount
)
external
returns (bool)
{
require(_amount > 0);
IBrickblockToken _bbk = IBrickblockToken(
registry.getContractAddress("BrickblockToken")
);
require(_amount <= lockedBbkPerUser[msg.sender]);
require(settleCurrentLockPeriod(msg.sender));
lockedBbkPerUser[msg.sender] = lockedBbkPerUser[msg.sender].sub(_amount);
totalLockedBBK = totalLockedBBK.sub(_amount);
require(<FILL_ME>)
emit BbkUnlocked(msg.sender, _amount, totalLockedBBK);
return true;
}
/**
@notice Distribute ACT tokens to all BBK token holders, that have currently locked their BBK tokens into this contract.
Adds the tiny delta, caused by integer division remainders, to the owner's mintedActFromPastLockPeriodsPerUser balance.
@param _amount Amount of fee to be distributed to ACT holders
@dev Accepts calls only from our `FeeManager` contract
*/
function distribute(
uint256 _amount
)
external
onlyContract("FeeManager")
returns (bool)
{
}
/**
@notice Calculates minted ACT from "Current Lock Period" for a given address
@param _address ACT holder address
*/
function getMintedActFromCurrentLockPeriod(
address _address
)
private
view
returns (uint256)
{
}
/**
@notice Transfers "Current Lock Period" balance sheet to "Past Lock Periods" balance sheet.
Ensures that BBK transfers won't affect accrued ACT balances.
*/
function settleCurrentLockPeriod(
address _address
)
private
returns (bool)
{
}
/************************
* Start ERC20 overrides *
************************/
/** @notice Combines all balance sheets to calculate the correct balance (see explanation on top)
@param _address Sender address
@return uint256
*/
function balanceOf(
address _address
)
public
view
returns (uint256)
{
}
/**
@notice Same as the default ERC20 transfer() with two differences:
1. Uses "balanceOf(address)" rather than "balances[address]" to check the balance of msg.sender
("balances" is inaccurate, see above).
2. Updates the Transfers Balance Sheet.
@param _to Receiver address
@param _value Amount
@return bool
*/
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
}
/**
@notice Same as the default ERC20 transferFrom() with two differences:
1. Uses "balanceOf(address)" rather than "balances[address]" to check the balance of msg.sender
("balances" is inaccurate, see above).
2. Updates the Transfers Balance Sheet.
@param _from Sender Address
@param _to Receiver address
@param _value Amount
@return bool
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
}
/**********************
* End ERC20 overrides *
***********************/
/**
@notice Burns tokens through decrementing "totalSupply" and incrementing "spentAct[address]"
@dev Callable only by FeeManager contract
@param _address Sender Address
@param _value Amount
@return bool
*/
function burn(
address _address,
uint256 _value
)
external
onlyContract("FeeManager")
returns (bool)
{
}
}
| _bbk.transfer(msg.sender,_amount) | 348,105 | _bbk.transfer(msg.sender,_amount) |
"Message with offset is too long" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./Base64.sol";
/* _ ____ ____ ___ ___ */
/* / \ / ___| / ___|_ _|_ _| */
/* / _ \ \___ \| | | | | | */
/* / ___ \ ___) | |___ | | | | */
/* /_/ \_\____/ \____|___|___| */
/* __ __ _ _ */
/* \ \ / /_ _| | | */
/* \ \ /\ / / _` | | | */
/* \ V V / (_| | | | */
/* \_/\_/ \__,_|_|_| */
// https://twitter.com/praetorian/
/* ASCII Canvas Size 40x18 */
/* 0123456789012345678901234567890123456789 */
/* 0 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 1 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 2 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 3 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 4 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 5 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 6 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 7 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 8 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 9 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 10 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 11 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 12 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 13 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 14 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 15 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 16 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 17 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
// This is a contract that allows minters to add a small bit of text
// to a shared canvas/wall. The imagery and data is completely stored
// on the blockchain. My assumption is, if the contract was called too
// many times, the image will be completely unreadable which is
// alright by me. A few inspirations:
// http://www.milliondollarhomepage.com/
// https://en.wikipedia.org/wiki/Place_(Reddit)
// https://en.wikipedia.org/wiki/Latrinalia
//
// Example Call
// wall.safeMint("0xB5be4AefB1E996831781ADf936b1457805c617B2", "#FF0000", "@praetorian", 17, 29, {value: "20000000000000000"});
//
// - to: the address we're going to give the token to
// - hexColor: a string that represents the color of the text that you're going to add to the wall
// - message: the text of the message that you're going to add
// - line: the line that you're going to put your text. Should be a number from 0 to 17
// - offset: if you want to push your text over to the right side, you can offset it a certain number of spaces
// - the cost right now is 0.02 ETH.
//
// I'm not planning to create a discord, social media, or roadmap for
// this project. Just try it out if you're interested. Find me on
// twitter if you want to talk.
//
// If each minter uses the full size of the line, each mint will add
// about 80 bytes to the size of the SVG. If we want to keep the size
// of the final SVG under 100KB we need to limit the number of mints
// to about 1280 (/ (* 1024 100) 80)
contract ASCIIWall is ERC721, ERC721Enumerable, Pausable, Ownable {
// Internal state tracking for the token id counter
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
// The max number of lines that the canvas supports
uint256 public constant MAX_LINE_COUNT = 18;
// The max number of characters that are supportred on each line
uint256 public constant MAX_LINE_LENGTH = 40;
// The amount of space between each line
uint256 public constant TEXT_LINE_HEIGHT = 32;
// The amount of space (ideally) between each character
uint256 public constant TEXT_CHARACTER_WIDTH = 16;
// The max number of tokens that can be minted
uint256 public constant MAX_TOKEN_COUNT = 1280;
// The cost of each minte
uint256 public constant TOKEN_COST = 20000000000000000;
// The address to deposit
address public constant DEPOSIT_ADDRESS = 0xB5be4AefB1E996831781ADf936b1457805c617B2;
// The description of the project
string public projectDescription = "ASCIIWall is a blockchain-based shared canvas. Anyone can write on it. It's like latrinalia, but in the blockchain. Each mint captures the current state of the wall. Future mints can overwrite and augment the wall.";
// The base style of the image
string public baseStyle = "text { font-family: monospace; font-size: 2em; letter-spacing: 0.38px; }";
// Each mint will create a WordPlacement which is then used to render the final image
struct WordPlacement {
string color;
string message;
uint256 line;
uint256 offset;
}
// The collection of word placements that have been minted
WordPlacement[] public wordPlacements;
// Basic constructor to start in paused state
constructor() ERC721("ASCIIWall", "ASC") {
}
// pause the minting process
function pause() public onlyOwner {
}
// unpause the minting process
function unpause() public onlyOwner {
}
// modify the description in case we want to add more context or something down the road
function setDescription(string memory desc) public onlyOwner {
}
// leave an option for ourselves modify the style a bit
function setBaseStyle(string memory style) public onlyOwner {
}
// basic minting function
function safeMint(address to, string memory hexColor, string memory message, uint256 line, uint256 offset) public payable {
require(offset >= 0, "The offset must be zero or positive");
require(line >= 0, "The line number must be zero or positive");
require(<FILL_ME>)
require(isValidColor(hexColor), "The color needs to be a valid HEX string like #012ABC");
require(isValidMessage(message), "The message contains an invalid character (&'\"#<>)");
require(line < MAX_LINE_COUNT, "The line number is too high");
require(this.totalSupply() < MAX_TOKEN_COUNT, "The supply has been exhausted.");
require(msg.value >= TOKEN_COST, "Value below price");
require(address(msg.sender).balance > TOKEN_COST, "Not enough ETH!");
address payable p = payable(DEPOSIT_ADDRESS);
p.transfer(TOKEN_COST);
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, tokenId);
wordPlacements.push(WordPlacement({color: hexColor, message: message, line: line, offset: offset}));
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
// color validation. Needs to be in the format like #123ABC
function isValidColor(string memory color) public pure returns(bool) {
}
// Message validation. Need to make sure that there are no characters that are going to break the SVG
function isValidMessage(string memory message) public pure returns(bool) {
}
// draw the svg image for the token
function renderForIndex(uint256 idx) public view returns (string memory) {
}
// return the encoded payload for the token
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| offset+bytes(message).length<=MAX_LINE_LENGTH,"Message with offset is too long" | 348,123 | offset+bytes(message).length<=MAX_LINE_LENGTH |
"The color needs to be a valid HEX string like #012ABC" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./Base64.sol";
/* _ ____ ____ ___ ___ */
/* / \ / ___| / ___|_ _|_ _| */
/* / _ \ \___ \| | | | | | */
/* / ___ \ ___) | |___ | | | | */
/* /_/ \_\____/ \____|___|___| */
/* __ __ _ _ */
/* \ \ / /_ _| | | */
/* \ \ /\ / / _` | | | */
/* \ V V / (_| | | | */
/* \_/\_/ \__,_|_|_| */
// https://twitter.com/praetorian/
/* ASCII Canvas Size 40x18 */
/* 0123456789012345678901234567890123456789 */
/* 0 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 1 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 2 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 3 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 4 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 5 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 6 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 7 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 8 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 9 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 10 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 11 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 12 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 13 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 14 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 15 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 16 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 17 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
// This is a contract that allows minters to add a small bit of text
// to a shared canvas/wall. The imagery and data is completely stored
// on the blockchain. My assumption is, if the contract was called too
// many times, the image will be completely unreadable which is
// alright by me. A few inspirations:
// http://www.milliondollarhomepage.com/
// https://en.wikipedia.org/wiki/Place_(Reddit)
// https://en.wikipedia.org/wiki/Latrinalia
//
// Example Call
// wall.safeMint("0xB5be4AefB1E996831781ADf936b1457805c617B2", "#FF0000", "@praetorian", 17, 29, {value: "20000000000000000"});
//
// - to: the address we're going to give the token to
// - hexColor: a string that represents the color of the text that you're going to add to the wall
// - message: the text of the message that you're going to add
// - line: the line that you're going to put your text. Should be a number from 0 to 17
// - offset: if you want to push your text over to the right side, you can offset it a certain number of spaces
// - the cost right now is 0.02 ETH.
//
// I'm not planning to create a discord, social media, or roadmap for
// this project. Just try it out if you're interested. Find me on
// twitter if you want to talk.
//
// If each minter uses the full size of the line, each mint will add
// about 80 bytes to the size of the SVG. If we want to keep the size
// of the final SVG under 100KB we need to limit the number of mints
// to about 1280 (/ (* 1024 100) 80)
contract ASCIIWall is ERC721, ERC721Enumerable, Pausable, Ownable {
// Internal state tracking for the token id counter
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
// The max number of lines that the canvas supports
uint256 public constant MAX_LINE_COUNT = 18;
// The max number of characters that are supportred on each line
uint256 public constant MAX_LINE_LENGTH = 40;
// The amount of space between each line
uint256 public constant TEXT_LINE_HEIGHT = 32;
// The amount of space (ideally) between each character
uint256 public constant TEXT_CHARACTER_WIDTH = 16;
// The max number of tokens that can be minted
uint256 public constant MAX_TOKEN_COUNT = 1280;
// The cost of each minte
uint256 public constant TOKEN_COST = 20000000000000000;
// The address to deposit
address public constant DEPOSIT_ADDRESS = 0xB5be4AefB1E996831781ADf936b1457805c617B2;
// The description of the project
string public projectDescription = "ASCIIWall is a blockchain-based shared canvas. Anyone can write on it. It's like latrinalia, but in the blockchain. Each mint captures the current state of the wall. Future mints can overwrite and augment the wall.";
// The base style of the image
string public baseStyle = "text { font-family: monospace; font-size: 2em; letter-spacing: 0.38px; }";
// Each mint will create a WordPlacement which is then used to render the final image
struct WordPlacement {
string color;
string message;
uint256 line;
uint256 offset;
}
// The collection of word placements that have been minted
WordPlacement[] public wordPlacements;
// Basic constructor to start in paused state
constructor() ERC721("ASCIIWall", "ASC") {
}
// pause the minting process
function pause() public onlyOwner {
}
// unpause the minting process
function unpause() public onlyOwner {
}
// modify the description in case we want to add more context or something down the road
function setDescription(string memory desc) public onlyOwner {
}
// leave an option for ourselves modify the style a bit
function setBaseStyle(string memory style) public onlyOwner {
}
// basic minting function
function safeMint(address to, string memory hexColor, string memory message, uint256 line, uint256 offset) public payable {
require(offset >= 0, "The offset must be zero or positive");
require(line >= 0, "The line number must be zero or positive");
require(offset + bytes(message).length <= MAX_LINE_LENGTH, "Message with offset is too long");
require(<FILL_ME>)
require(isValidMessage(message), "The message contains an invalid character (&'\"#<>)");
require(line < MAX_LINE_COUNT, "The line number is too high");
require(this.totalSupply() < MAX_TOKEN_COUNT, "The supply has been exhausted.");
require(msg.value >= TOKEN_COST, "Value below price");
require(address(msg.sender).balance > TOKEN_COST, "Not enough ETH!");
address payable p = payable(DEPOSIT_ADDRESS);
p.transfer(TOKEN_COST);
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, tokenId);
wordPlacements.push(WordPlacement({color: hexColor, message: message, line: line, offset: offset}));
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
// color validation. Needs to be in the format like #123ABC
function isValidColor(string memory color) public pure returns(bool) {
}
// Message validation. Need to make sure that there are no characters that are going to break the SVG
function isValidMessage(string memory message) public pure returns(bool) {
}
// draw the svg image for the token
function renderForIndex(uint256 idx) public view returns (string memory) {
}
// return the encoded payload for the token
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| isValidColor(hexColor),"The color needs to be a valid HEX string like #012ABC" | 348,123 | isValidColor(hexColor) |
"The message contains an invalid character (&'\"#<>)" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./Base64.sol";
/* _ ____ ____ ___ ___ */
/* / \ / ___| / ___|_ _|_ _| */
/* / _ \ \___ \| | | | | | */
/* / ___ \ ___) | |___ | | | | */
/* /_/ \_\____/ \____|___|___| */
/* __ __ _ _ */
/* \ \ / /_ _| | | */
/* \ \ /\ / / _` | | | */
/* \ V V / (_| | | | */
/* \_/\_/ \__,_|_|_| */
// https://twitter.com/praetorian/
/* ASCII Canvas Size 40x18 */
/* 0123456789012345678901234567890123456789 */
/* 0 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 1 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 2 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 3 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 4 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 5 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 6 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 7 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 8 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 9 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 10 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 11 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 12 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 13 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 14 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 15 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 16 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 17 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
// This is a contract that allows minters to add a small bit of text
// to a shared canvas/wall. The imagery and data is completely stored
// on the blockchain. My assumption is, if the contract was called too
// many times, the image will be completely unreadable which is
// alright by me. A few inspirations:
// http://www.milliondollarhomepage.com/
// https://en.wikipedia.org/wiki/Place_(Reddit)
// https://en.wikipedia.org/wiki/Latrinalia
//
// Example Call
// wall.safeMint("0xB5be4AefB1E996831781ADf936b1457805c617B2", "#FF0000", "@praetorian", 17, 29, {value: "20000000000000000"});
//
// - to: the address we're going to give the token to
// - hexColor: a string that represents the color of the text that you're going to add to the wall
// - message: the text of the message that you're going to add
// - line: the line that you're going to put your text. Should be a number from 0 to 17
// - offset: if you want to push your text over to the right side, you can offset it a certain number of spaces
// - the cost right now is 0.02 ETH.
//
// I'm not planning to create a discord, social media, or roadmap for
// this project. Just try it out if you're interested. Find me on
// twitter if you want to talk.
//
// If each minter uses the full size of the line, each mint will add
// about 80 bytes to the size of the SVG. If we want to keep the size
// of the final SVG under 100KB we need to limit the number of mints
// to about 1280 (/ (* 1024 100) 80)
contract ASCIIWall is ERC721, ERC721Enumerable, Pausable, Ownable {
// Internal state tracking for the token id counter
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
// The max number of lines that the canvas supports
uint256 public constant MAX_LINE_COUNT = 18;
// The max number of characters that are supportred on each line
uint256 public constant MAX_LINE_LENGTH = 40;
// The amount of space between each line
uint256 public constant TEXT_LINE_HEIGHT = 32;
// The amount of space (ideally) between each character
uint256 public constant TEXT_CHARACTER_WIDTH = 16;
// The max number of tokens that can be minted
uint256 public constant MAX_TOKEN_COUNT = 1280;
// The cost of each minte
uint256 public constant TOKEN_COST = 20000000000000000;
// The address to deposit
address public constant DEPOSIT_ADDRESS = 0xB5be4AefB1E996831781ADf936b1457805c617B2;
// The description of the project
string public projectDescription = "ASCIIWall is a blockchain-based shared canvas. Anyone can write on it. It's like latrinalia, but in the blockchain. Each mint captures the current state of the wall. Future mints can overwrite and augment the wall.";
// The base style of the image
string public baseStyle = "text { font-family: monospace; font-size: 2em; letter-spacing: 0.38px; }";
// Each mint will create a WordPlacement which is then used to render the final image
struct WordPlacement {
string color;
string message;
uint256 line;
uint256 offset;
}
// The collection of word placements that have been minted
WordPlacement[] public wordPlacements;
// Basic constructor to start in paused state
constructor() ERC721("ASCIIWall", "ASC") {
}
// pause the minting process
function pause() public onlyOwner {
}
// unpause the minting process
function unpause() public onlyOwner {
}
// modify the description in case we want to add more context or something down the road
function setDescription(string memory desc) public onlyOwner {
}
// leave an option for ourselves modify the style a bit
function setBaseStyle(string memory style) public onlyOwner {
}
// basic minting function
function safeMint(address to, string memory hexColor, string memory message, uint256 line, uint256 offset) public payable {
require(offset >= 0, "The offset must be zero or positive");
require(line >= 0, "The line number must be zero or positive");
require(offset + bytes(message).length <= MAX_LINE_LENGTH, "Message with offset is too long");
require(isValidColor(hexColor), "The color needs to be a valid HEX string like #012ABC");
require(<FILL_ME>)
require(line < MAX_LINE_COUNT, "The line number is too high");
require(this.totalSupply() < MAX_TOKEN_COUNT, "The supply has been exhausted.");
require(msg.value >= TOKEN_COST, "Value below price");
require(address(msg.sender).balance > TOKEN_COST, "Not enough ETH!");
address payable p = payable(DEPOSIT_ADDRESS);
p.transfer(TOKEN_COST);
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, tokenId);
wordPlacements.push(WordPlacement({color: hexColor, message: message, line: line, offset: offset}));
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
// color validation. Needs to be in the format like #123ABC
function isValidColor(string memory color) public pure returns(bool) {
}
// Message validation. Need to make sure that there are no characters that are going to break the SVG
function isValidMessage(string memory message) public pure returns(bool) {
}
// draw the svg image for the token
function renderForIndex(uint256 idx) public view returns (string memory) {
}
// return the encoded payload for the token
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| isValidMessage(message),"The message contains an invalid character (&'\"#<>)" | 348,123 | isValidMessage(message) |
"The supply has been exhausted." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./Base64.sol";
/* _ ____ ____ ___ ___ */
/* / \ / ___| / ___|_ _|_ _| */
/* / _ \ \___ \| | | | | | */
/* / ___ \ ___) | |___ | | | | */
/* /_/ \_\____/ \____|___|___| */
/* __ __ _ _ */
/* \ \ / /_ _| | | */
/* \ \ /\ / / _` | | | */
/* \ V V / (_| | | | */
/* \_/\_/ \__,_|_|_| */
// https://twitter.com/praetorian/
/* ASCII Canvas Size 40x18 */
/* 0123456789012345678901234567890123456789 */
/* 0 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 1 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 2 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 3 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 4 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 5 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 6 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 7 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 8 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 9 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 10 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 11 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 12 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 13 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 14 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 15 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 16 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 17 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
// This is a contract that allows minters to add a small bit of text
// to a shared canvas/wall. The imagery and data is completely stored
// on the blockchain. My assumption is, if the contract was called too
// many times, the image will be completely unreadable which is
// alright by me. A few inspirations:
// http://www.milliondollarhomepage.com/
// https://en.wikipedia.org/wiki/Place_(Reddit)
// https://en.wikipedia.org/wiki/Latrinalia
//
// Example Call
// wall.safeMint("0xB5be4AefB1E996831781ADf936b1457805c617B2", "#FF0000", "@praetorian", 17, 29, {value: "20000000000000000"});
//
// - to: the address we're going to give the token to
// - hexColor: a string that represents the color of the text that you're going to add to the wall
// - message: the text of the message that you're going to add
// - line: the line that you're going to put your text. Should be a number from 0 to 17
// - offset: if you want to push your text over to the right side, you can offset it a certain number of spaces
// - the cost right now is 0.02 ETH.
//
// I'm not planning to create a discord, social media, or roadmap for
// this project. Just try it out if you're interested. Find me on
// twitter if you want to talk.
//
// If each minter uses the full size of the line, each mint will add
// about 80 bytes to the size of the SVG. If we want to keep the size
// of the final SVG under 100KB we need to limit the number of mints
// to about 1280 (/ (* 1024 100) 80)
contract ASCIIWall is ERC721, ERC721Enumerable, Pausable, Ownable {
// Internal state tracking for the token id counter
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
// The max number of lines that the canvas supports
uint256 public constant MAX_LINE_COUNT = 18;
// The max number of characters that are supportred on each line
uint256 public constant MAX_LINE_LENGTH = 40;
// The amount of space between each line
uint256 public constant TEXT_LINE_HEIGHT = 32;
// The amount of space (ideally) between each character
uint256 public constant TEXT_CHARACTER_WIDTH = 16;
// The max number of tokens that can be minted
uint256 public constant MAX_TOKEN_COUNT = 1280;
// The cost of each minte
uint256 public constant TOKEN_COST = 20000000000000000;
// The address to deposit
address public constant DEPOSIT_ADDRESS = 0xB5be4AefB1E996831781ADf936b1457805c617B2;
// The description of the project
string public projectDescription = "ASCIIWall is a blockchain-based shared canvas. Anyone can write on it. It's like latrinalia, but in the blockchain. Each mint captures the current state of the wall. Future mints can overwrite and augment the wall.";
// The base style of the image
string public baseStyle = "text { font-family: monospace; font-size: 2em; letter-spacing: 0.38px; }";
// Each mint will create a WordPlacement which is then used to render the final image
struct WordPlacement {
string color;
string message;
uint256 line;
uint256 offset;
}
// The collection of word placements that have been minted
WordPlacement[] public wordPlacements;
// Basic constructor to start in paused state
constructor() ERC721("ASCIIWall", "ASC") {
}
// pause the minting process
function pause() public onlyOwner {
}
// unpause the minting process
function unpause() public onlyOwner {
}
// modify the description in case we want to add more context or something down the road
function setDescription(string memory desc) public onlyOwner {
}
// leave an option for ourselves modify the style a bit
function setBaseStyle(string memory style) public onlyOwner {
}
// basic minting function
function safeMint(address to, string memory hexColor, string memory message, uint256 line, uint256 offset) public payable {
require(offset >= 0, "The offset must be zero or positive");
require(line >= 0, "The line number must be zero or positive");
require(offset + bytes(message).length <= MAX_LINE_LENGTH, "Message with offset is too long");
require(isValidColor(hexColor), "The color needs to be a valid HEX string like #012ABC");
require(isValidMessage(message), "The message contains an invalid character (&'\"#<>)");
require(line < MAX_LINE_COUNT, "The line number is too high");
require(<FILL_ME>)
require(msg.value >= TOKEN_COST, "Value below price");
require(address(msg.sender).balance > TOKEN_COST, "Not enough ETH!");
address payable p = payable(DEPOSIT_ADDRESS);
p.transfer(TOKEN_COST);
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, tokenId);
wordPlacements.push(WordPlacement({color: hexColor, message: message, line: line, offset: offset}));
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
// color validation. Needs to be in the format like #123ABC
function isValidColor(string memory color) public pure returns(bool) {
}
// Message validation. Need to make sure that there are no characters that are going to break the SVG
function isValidMessage(string memory message) public pure returns(bool) {
}
// draw the svg image for the token
function renderForIndex(uint256 idx) public view returns (string memory) {
}
// return the encoded payload for the token
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| this.totalSupply()<MAX_TOKEN_COUNT,"The supply has been exhausted." | 348,123 | this.totalSupply()<MAX_TOKEN_COUNT |
"Not enough ETH!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./Base64.sol";
/* _ ____ ____ ___ ___ */
/* / \ / ___| / ___|_ _|_ _| */
/* / _ \ \___ \| | | | | | */
/* / ___ \ ___) | |___ | | | | */
/* /_/ \_\____/ \____|___|___| */
/* __ __ _ _ */
/* \ \ / /_ _| | | */
/* \ \ /\ / / _` | | | */
/* \ V V / (_| | | | */
/* \_/\_/ \__,_|_|_| */
// https://twitter.com/praetorian/
/* ASCII Canvas Size 40x18 */
/* 0123456789012345678901234567890123456789 */
/* 0 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 1 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 2 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 3 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 4 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 5 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 6 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 7 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 8 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 9 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 10 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 11 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 12 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 13 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 14 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 15 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 16 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
/* 17 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */
// This is a contract that allows minters to add a small bit of text
// to a shared canvas/wall. The imagery and data is completely stored
// on the blockchain. My assumption is, if the contract was called too
// many times, the image will be completely unreadable which is
// alright by me. A few inspirations:
// http://www.milliondollarhomepage.com/
// https://en.wikipedia.org/wiki/Place_(Reddit)
// https://en.wikipedia.org/wiki/Latrinalia
//
// Example Call
// wall.safeMint("0xB5be4AefB1E996831781ADf936b1457805c617B2", "#FF0000", "@praetorian", 17, 29, {value: "20000000000000000"});
//
// - to: the address we're going to give the token to
// - hexColor: a string that represents the color of the text that you're going to add to the wall
// - message: the text of the message that you're going to add
// - line: the line that you're going to put your text. Should be a number from 0 to 17
// - offset: if you want to push your text over to the right side, you can offset it a certain number of spaces
// - the cost right now is 0.02 ETH.
//
// I'm not planning to create a discord, social media, or roadmap for
// this project. Just try it out if you're interested. Find me on
// twitter if you want to talk.
//
// If each minter uses the full size of the line, each mint will add
// about 80 bytes to the size of the SVG. If we want to keep the size
// of the final SVG under 100KB we need to limit the number of mints
// to about 1280 (/ (* 1024 100) 80)
contract ASCIIWall is ERC721, ERC721Enumerable, Pausable, Ownable {
// Internal state tracking for the token id counter
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
// The max number of lines that the canvas supports
uint256 public constant MAX_LINE_COUNT = 18;
// The max number of characters that are supportred on each line
uint256 public constant MAX_LINE_LENGTH = 40;
// The amount of space between each line
uint256 public constant TEXT_LINE_HEIGHT = 32;
// The amount of space (ideally) between each character
uint256 public constant TEXT_CHARACTER_WIDTH = 16;
// The max number of tokens that can be minted
uint256 public constant MAX_TOKEN_COUNT = 1280;
// The cost of each minte
uint256 public constant TOKEN_COST = 20000000000000000;
// The address to deposit
address public constant DEPOSIT_ADDRESS = 0xB5be4AefB1E996831781ADf936b1457805c617B2;
// The description of the project
string public projectDescription = "ASCIIWall is a blockchain-based shared canvas. Anyone can write on it. It's like latrinalia, but in the blockchain. Each mint captures the current state of the wall. Future mints can overwrite and augment the wall.";
// The base style of the image
string public baseStyle = "text { font-family: monospace; font-size: 2em; letter-spacing: 0.38px; }";
// Each mint will create a WordPlacement which is then used to render the final image
struct WordPlacement {
string color;
string message;
uint256 line;
uint256 offset;
}
// The collection of word placements that have been minted
WordPlacement[] public wordPlacements;
// Basic constructor to start in paused state
constructor() ERC721("ASCIIWall", "ASC") {
}
// pause the minting process
function pause() public onlyOwner {
}
// unpause the minting process
function unpause() public onlyOwner {
}
// modify the description in case we want to add more context or something down the road
function setDescription(string memory desc) public onlyOwner {
}
// leave an option for ourselves modify the style a bit
function setBaseStyle(string memory style) public onlyOwner {
}
// basic minting function
function safeMint(address to, string memory hexColor, string memory message, uint256 line, uint256 offset) public payable {
require(offset >= 0, "The offset must be zero or positive");
require(line >= 0, "The line number must be zero or positive");
require(offset + bytes(message).length <= MAX_LINE_LENGTH, "Message with offset is too long");
require(isValidColor(hexColor), "The color needs to be a valid HEX string like #012ABC");
require(isValidMessage(message), "The message contains an invalid character (&'\"#<>)");
require(line < MAX_LINE_COUNT, "The line number is too high");
require(this.totalSupply() < MAX_TOKEN_COUNT, "The supply has been exhausted.");
require(msg.value >= TOKEN_COST, "Value below price");
require(<FILL_ME>)
address payable p = payable(DEPOSIT_ADDRESS);
p.transfer(TOKEN_COST);
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, tokenId);
wordPlacements.push(WordPlacement({color: hexColor, message: message, line: line, offset: offset}));
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
// color validation. Needs to be in the format like #123ABC
function isValidColor(string memory color) public pure returns(bool) {
}
// Message validation. Need to make sure that there are no characters that are going to break the SVG
function isValidMessage(string memory message) public pure returns(bool) {
}
// draw the svg image for the token
function renderForIndex(uint256 idx) public view returns (string memory) {
}
// return the encoded payload for the token
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| address(msg.sender).balance>TOKEN_COST,"Not enough ETH!" | 348,123 | address(msg.sender).balance>TOKEN_COST |
null | contract TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public;
}
contract IERC20Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 totalSupply);
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract OrmeCash is IERC20Token {
string public name = "OrmeCash";
string public symbol = "OMC";
uint8 public decimals = 18;
uint256 public tokenFrozenUntilBlock;
address public owner;
uint public mintingCap = 2000000000 * 10**18;
uint256 supply = 0;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowances;
mapping (address => bool) restrictedAddresses;
event Mint(address indexed _to, uint256 _value);
event Burn(address indexed _from, uint256 _value);
event TokenFrozen(uint256 _frozenUntilBlock);
modifier onlyOwner {
}
function OrmeCash() public {
}
function totalSupply() constant public returns (uint256 totalSupply) {
}
function balanceOf(address _owner) constant public returns (uint256 balance) {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require (block.number >= tokenFrozenUntilBlock);
require(<FILL_ME>)
require (balances[msg.sender] >= _value);
require (balances[_to] + _value > balances[_to]);
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
}
function mintTokens(address _to, uint256 _amount) onlyOwner public {
}
function burnTokens(uint _amount) public {
}
function freezeTransfersUntil(uint256 _frozenUntilBlock) onlyOwner public {
}
function editRestrictedAddress(address _newRestrictedAddress) onlyOwner public {
}
function isRestrictedAddress(address _querryAddress) constant public returns (bool answer){
}
function transferOwnership(address newOwner) onlyOwner public {
}
function killContract() onlyOwner public {
}
}
| !restrictedAddresses[_to] | 348,143 | !restrictedAddresses[_to] |
"Daily deposit limit reached! See you soon" | pragma solidity ^0.4.25;
contract Eth5iov_2 {
address public advertising;
address public admin;
address private owner;
uint constant public statusFreeEth = 10 finney;
uint constant public statusBasic = 50 finney;
uint constant public statusVIP = 5 ether;
uint constant public statusSVIP = 25 ether;
uint constant public dailyPercent = 188;
uint constant public dailyFreeMembers = 200;
uint constant public denominator = 10000;
uint public numerator = 100;
uint public dayDepositLimit = 555 ether;
uint public freeFund;
uint public freeFundUses;
uint public round = 0;
address[] public addresses;
mapping(address => Investor) public investors;
bool public resTrigger = true;
uint constant period = 5;// 86400;
uint dayDeposit;
uint roundStartDate;
uint daysFromRoundStart;
uint deposit;
uint creationDate;
enum Status { TEST, BASIC, VIP, SVIP }
struct Investor {
uint id;
uint round;
uint deposit;
uint deposits;
uint investDate;
uint lastPaymentDate;
address referrer;
Status status;
bool refPayed;
}
event TestDrive(address addr, uint date);
event Invest(address addr, uint amount, address referrer);
event WelcomeVIPinvestor(address addr);
event WelcomeSuperVIPinvestor(address addr);
event Payout(address addr, uint amount, string eventType, address from);
event roundStartStarted(uint round, uint date);
modifier onlyOwner {
}
constructor() public {
}
function addInvestorsFrom_v1(address[] addr, uint[] amount, bool[] isSuper) onlyOwner public {
}
function waiver() private {
}
function() payable public {
if (msg.sender == owner) {
return;
}
require(resTrigger == false, "Contract is paused. Please wait for the next round.");
if (0 == msg.value) {
payout();
return;
}
require(msg.value >= statusBasic || msg.value == statusFreeEth, "Too small amount, minimum 0.05 ether");
if (daysFromRoundStart < daysFrom(roundStartDate)) {
dayDeposit = 0;
freeFundUses = 0;
daysFromRoundStart = daysFrom(roundStartDate);
}
require(<FILL_ME>)
dayDeposit += msg.value;
Investor storage user = investors[msg.sender];
if ((user.id == 0) || (user.round < round)) {
msg.sender.transfer(0 wei);
addresses.push(msg.sender);
user.id = addresses.length;
user.deposit = 0;
user.deposits = 0;
user.lastPaymentDate = now;
user.investDate = now;
user.round = round;
// referrer
address referrer = bytesToAddress(msg.data);
if (investors[referrer].id > 0 && referrer != msg.sender
&& investors[referrer].round == round) {
user.referrer = referrer;
}
}
// save investor
user.deposit += msg.value;
user.deposits += 1;
deposit += msg.value;
emit Invest(msg.sender, msg.value, user.referrer);
// sequential deposit cash-back on 30+
if ((user.deposits > 1) && (user.status != Status.TEST) && (daysFrom(user.investDate) > 30)) {
uint cashBack = msg.value / denominator * numerator * 10;
if (msg.sender.send(cashBack)) {
emit Payout(user.referrer, cashBack, "Cash-back after 30 days", msg.sender);
}
}
Status newStatus;
if (msg.value >= statusSVIP) {
emit WelcomeSuperVIPinvestor(msg.sender);
newStatus = Status.SVIP;
} else if (msg.value >= statusVIP) {
emit WelcomeVIPinvestor(msg.sender);
newStatus = Status.VIP;
} else if (msg.value >= statusBasic) {
newStatus = Status.BASIC;
} else if (msg.value == statusFreeEth) {
if (user.deposits == 1) {
require(dailyFreeMembers > freeFundUses, "Max free fund uses today, See you soon!");
freeFundUses += 1;
msg.sender.transfer(msg.value);
emit Payout(msg.sender,statusFreeEth,"Free eth cash-back",0);
}
newStatus = Status.TEST;
}
if (newStatus > user.status) {
user.status = newStatus;
}
// proccess fees and referrers
if (newStatus != Status.TEST) {
admin.transfer(msg.value / denominator * numerator * 5); // administration fee
advertising.transfer(msg.value / denominator * numerator * 10); // advertising fee
freeFund += msg.value / denominator * numerator; // test-drive fee fund
}
user.lastPaymentDate = now;
}
function payout() private {
}
function sendFromfreeFund(uint amount, address user) private returns (bool) {
}
// views
function getInvestorCount() public view returns (uint) {
}
function getInvestorDividendsAmount(address addr) public view returns (uint) {
}
// configuration
function setNumerator(uint newNumerator) onlyOwner public {
}
function setDayDepositLimit(uint newDayDepositLimit) onlyOwner public {
}
function roundStart() onlyOwner public {
}
// util
function daysFrom(uint date) private view returns (uint) {
}
function bytesToAddress(bytes bys) private pure returns (address addr) {
}
}
| msg.value+dayDeposit<=dayDepositLimit,"Daily deposit limit reached! See you soon" | 348,153 | msg.value+dayDeposit<=dayDepositLimit |
"Wait at least 24 hours." | pragma solidity ^0.4.25;
contract Eth5iov_2 {
address public advertising;
address public admin;
address private owner;
uint constant public statusFreeEth = 10 finney;
uint constant public statusBasic = 50 finney;
uint constant public statusVIP = 5 ether;
uint constant public statusSVIP = 25 ether;
uint constant public dailyPercent = 188;
uint constant public dailyFreeMembers = 200;
uint constant public denominator = 10000;
uint public numerator = 100;
uint public dayDepositLimit = 555 ether;
uint public freeFund;
uint public freeFundUses;
uint public round = 0;
address[] public addresses;
mapping(address => Investor) public investors;
bool public resTrigger = true;
uint constant period = 5;// 86400;
uint dayDeposit;
uint roundStartDate;
uint daysFromRoundStart;
uint deposit;
uint creationDate;
enum Status { TEST, BASIC, VIP, SVIP }
struct Investor {
uint id;
uint round;
uint deposit;
uint deposits;
uint investDate;
uint lastPaymentDate;
address referrer;
Status status;
bool refPayed;
}
event TestDrive(address addr, uint date);
event Invest(address addr, uint amount, address referrer);
event WelcomeVIPinvestor(address addr);
event WelcomeSuperVIPinvestor(address addr);
event Payout(address addr, uint amount, string eventType, address from);
event roundStartStarted(uint round, uint date);
modifier onlyOwner {
}
constructor() public {
}
function addInvestorsFrom_v1(address[] addr, uint[] amount, bool[] isSuper) onlyOwner public {
}
function waiver() private {
}
function() payable public {
}
function payout() private {
Investor storage user = investors[msg.sender];
require(user.id > 0, "Investor not found.");
require(user.round == round, "Your round is over.");
require(<FILL_ME>)
uint amount = getInvestorDividendsAmount(msg.sender);
if (address(this).balance < amount) {
resTrigger = true;
return;
}
if ((user.referrer > 0x0) && !user.refPayed && (user.status != Status.TEST)) {
user.refPayed = true;
Investor storage ref = investors[user.referrer];
if (ref.id > 0 && ref.round == round) {
uint bonusAmount = user.deposit / denominator * numerator * 5;
uint refBonusAmount = user.deposit / denominator * numerator * 5 * uint(ref.status);
if (user.referrer.send(refBonusAmount)) {
emit Payout(user.referrer, refBonusAmount, "Cash back refferal", msg.sender);
}
if (user.deposits == 1) { // cashback only for the first deposit
if (msg.sender.send(bonusAmount)) {
emit Payout(msg.sender, bonusAmount, "ref-cash-back", 0);
}
}
}
}
if (user.status == Status.TEST) {
uint daysFromInvest = daysFrom(user.investDate);
require(daysFromInvest <= 55, "Your test drive is over!");
if (sendFromfreeFund(amount, msg.sender)) {
emit Payout(msg.sender, statusFreeEth, "test-drive-self-payout", 0);
}
} else {
msg.sender.transfer(amount);
emit Payout(msg.sender, amount, "self-payout", 0);
}
user.lastPaymentDate = now;
}
function sendFromfreeFund(uint amount, address user) private returns (bool) {
}
// views
function getInvestorCount() public view returns (uint) {
}
function getInvestorDividendsAmount(address addr) public view returns (uint) {
}
// configuration
function setNumerator(uint newNumerator) onlyOwner public {
}
function setDayDepositLimit(uint newDayDepositLimit) onlyOwner public {
}
function roundStart() onlyOwner public {
}
// util
function daysFrom(uint date) private view returns (uint) {
}
function bytesToAddress(bytes bys) private pure returns (address addr) {
}
}
| daysFrom(user.lastPaymentDate)>=1,"Wait at least 24 hours." | 348,153 | daysFrom(user.lastPaymentDate)>=1 |
"Failure to send Liquidity Tokens to User" | pragma solidity ^0.5.0;
// Interface for ETH_sETH_Addliquidity
interface UniSwap_Zap_Contract{
function LetsInvest() external payable;
}
// Objectives
// - ServiceProvider's users should be able to send ETH to the UniSwap_ZAP contracts and get the UniTokens and the residual ERC20 tokens
// - ServiceProvider should have the ability to charge a commission, should is choose to do so
// - ServiceProvider should be able to provide a commission rate in basis points
// - ServiceProvider WILL receive its commission from the incomimg UniTokens
// - ServiceProvider WILL have to withdraw its commission tokens separately
contract ServiceProvider_UniSwap_Zap is Ownable, ReentrancyGuard {
using SafeMath for uint;
UniSwap_Zap_Contract public UniSwap_Zap_ContractAddress;
IERC20 public sETH_TokenContractAddress;
IERC20 public UniSwapsETHExchangeContractAddress;
address internal ServiceProviderAddress;
uint public balance = address(this).balance;
uint private TotalServiceChargeTokens;
uint private serviceChargeInBasisPoints = 0;
event TransferredToUser_liquidityTokens_residualsETH(uint, uint);
event ServiceChargeTokensTransferred(uint);
constructor (
UniSwap_Zap_Contract _UniSwap_Zap_ContractAddress,
IERC20 _sETH_TokenContractAddress,
IERC20 _UniSwapsETHExchangeContractAddress,
address _ServiceProviderAddress)
public {
}
// - in relation to the emergency functioning of this contract
bool private stopped = false;
// circuit breaker modifiers
modifier stopInEmergency { }
function toggleContractActive() public onlyOwner {
}
// should we ever want to change the address of ZapContractAddress
function set_UniSwap_Zap_ContractAddress(UniSwap_Zap_Contract _new_UniSwap_Zap_ContractAddress) public onlyOwner {
}
// should we ever want to change the address of the sETH_TOKEN_ADDRESS Contract
function set_sETH_TokenContractAddress (IERC20 _new_sETH_TokenContractAddress) public onlyOwner {
}
// should we ever want to change the address of the _UniSwap sETHExchange Contract Address
function set_UniSwapsETHExchangeContractAddress (IERC20 _new_UniSwapsETHExchangeContractAddress) public onlyOwner {
}
// to get the ServiceProviderAddress, only the Owner can call this fx
function get_ServiceProviderAddress() public view onlyOwner returns (address) {
}
// to set the ServiceProviderAddress, only the Owner can call this fx
function set_ServiceProviderAddress (address _new_ServiceProviderAddress) public onlyOwner {
}
// to find out the serviceChargeRate, only the Owner can call this fx
function get_serviceChargeRate () public view onlyOwner returns (uint) {
}
// should the ServiceProvider ever want to change the Service Charge rate, only the Owner can call this fx
function set_serviceChargeRate (uint _new_serviceChargeInBasisPoints) public onlyOwner {
}
function LetsInvest() public payable stopInEmergency nonReentrant returns (bool) {
UniSwap_Zap_ContractAddress.LetsInvest.value(msg.value)();
// finding out the UniTokens received and the residual sETH Tokens Received
uint sETHLiquidityTokens = UniSwapsETHExchangeContractAddress.balanceOf(address(this));
uint residualsETHHoldings = sETH_TokenContractAddress.balanceOf(address(this));
// Adjusting for ServiceCharge
uint ServiceChargeTokens = SafeMath.div(SafeMath.mul(sETHLiquidityTokens,serviceChargeInBasisPoints),10000);
TotalServiceChargeTokens = TotalServiceChargeTokens + ServiceChargeTokens;
// Sending Back the Balance LiquityTokens and residual sETH Tokens to user
uint UserLiquidityTokens = SafeMath.sub(sETHLiquidityTokens,ServiceChargeTokens);
require(<FILL_ME>)
require(sETH_TokenContractAddress.transfer(msg.sender, residualsETHHoldings), "Failure to send residual sETH holdings");
emit TransferredToUser_liquidityTokens_residualsETH(UserLiquidityTokens, residualsETHHoldings);
return true;
}
// to find out the totalServiceChargeTokens, only the Owner can call this fx
function get_TotalServiceChargeTokens() public view onlyOwner returns (uint) {
}
function withdrawServiceChargeTokens(uint _amountInUnits) public onlyOwner {
}
// Should there be a need to withdraw any other ERC20 token
function withdrawAnyOtherERC20Token(IERC20 _targetContractAddress) public onlyOwner {
}
// incase of half-way error
function withdrawsETH() public onlyOwner {
}
function withdrawsETHLiquityTokens() public onlyOwner {
}
// fx in relation to ETH held by the contract sent by the owner
// - this function lets you deposit ETH into this wallet
function depositETH() public payable onlyOwner {
}
// - fallback function let you / anyone send ETH to this wallet without the need to call any function
function() external payable {
}
// - to withdraw any ETH balance sitting in the contract
function withdraw() public onlyOwner {
}
}
| UniSwapsETHExchangeContractAddress.transfer(msg.sender,UserLiquidityTokens),"Failure to send Liquidity Tokens to User" | 348,177 | UniSwapsETHExchangeContractAddress.transfer(msg.sender,UserLiquidityTokens) |
"Failure to send residual sETH holdings" | pragma solidity ^0.5.0;
// Interface for ETH_sETH_Addliquidity
interface UniSwap_Zap_Contract{
function LetsInvest() external payable;
}
// Objectives
// - ServiceProvider's users should be able to send ETH to the UniSwap_ZAP contracts and get the UniTokens and the residual ERC20 tokens
// - ServiceProvider should have the ability to charge a commission, should is choose to do so
// - ServiceProvider should be able to provide a commission rate in basis points
// - ServiceProvider WILL receive its commission from the incomimg UniTokens
// - ServiceProvider WILL have to withdraw its commission tokens separately
contract ServiceProvider_UniSwap_Zap is Ownable, ReentrancyGuard {
using SafeMath for uint;
UniSwap_Zap_Contract public UniSwap_Zap_ContractAddress;
IERC20 public sETH_TokenContractAddress;
IERC20 public UniSwapsETHExchangeContractAddress;
address internal ServiceProviderAddress;
uint public balance = address(this).balance;
uint private TotalServiceChargeTokens;
uint private serviceChargeInBasisPoints = 0;
event TransferredToUser_liquidityTokens_residualsETH(uint, uint);
event ServiceChargeTokensTransferred(uint);
constructor (
UniSwap_Zap_Contract _UniSwap_Zap_ContractAddress,
IERC20 _sETH_TokenContractAddress,
IERC20 _UniSwapsETHExchangeContractAddress,
address _ServiceProviderAddress)
public {
}
// - in relation to the emergency functioning of this contract
bool private stopped = false;
// circuit breaker modifiers
modifier stopInEmergency { }
function toggleContractActive() public onlyOwner {
}
// should we ever want to change the address of ZapContractAddress
function set_UniSwap_Zap_ContractAddress(UniSwap_Zap_Contract _new_UniSwap_Zap_ContractAddress) public onlyOwner {
}
// should we ever want to change the address of the sETH_TOKEN_ADDRESS Contract
function set_sETH_TokenContractAddress (IERC20 _new_sETH_TokenContractAddress) public onlyOwner {
}
// should we ever want to change the address of the _UniSwap sETHExchange Contract Address
function set_UniSwapsETHExchangeContractAddress (IERC20 _new_UniSwapsETHExchangeContractAddress) public onlyOwner {
}
// to get the ServiceProviderAddress, only the Owner can call this fx
function get_ServiceProviderAddress() public view onlyOwner returns (address) {
}
// to set the ServiceProviderAddress, only the Owner can call this fx
function set_ServiceProviderAddress (address _new_ServiceProviderAddress) public onlyOwner {
}
// to find out the serviceChargeRate, only the Owner can call this fx
function get_serviceChargeRate () public view onlyOwner returns (uint) {
}
// should the ServiceProvider ever want to change the Service Charge rate, only the Owner can call this fx
function set_serviceChargeRate (uint _new_serviceChargeInBasisPoints) public onlyOwner {
}
function LetsInvest() public payable stopInEmergency nonReentrant returns (bool) {
UniSwap_Zap_ContractAddress.LetsInvest.value(msg.value)();
// finding out the UniTokens received and the residual sETH Tokens Received
uint sETHLiquidityTokens = UniSwapsETHExchangeContractAddress.balanceOf(address(this));
uint residualsETHHoldings = sETH_TokenContractAddress.balanceOf(address(this));
// Adjusting for ServiceCharge
uint ServiceChargeTokens = SafeMath.div(SafeMath.mul(sETHLiquidityTokens,serviceChargeInBasisPoints),10000);
TotalServiceChargeTokens = TotalServiceChargeTokens + ServiceChargeTokens;
// Sending Back the Balance LiquityTokens and residual sETH Tokens to user
uint UserLiquidityTokens = SafeMath.sub(sETHLiquidityTokens,ServiceChargeTokens);
require(UniSwapsETHExchangeContractAddress.transfer(msg.sender, UserLiquidityTokens), "Failure to send Liquidity Tokens to User");
require(<FILL_ME>)
emit TransferredToUser_liquidityTokens_residualsETH(UserLiquidityTokens, residualsETHHoldings);
return true;
}
// to find out the totalServiceChargeTokens, only the Owner can call this fx
function get_TotalServiceChargeTokens() public view onlyOwner returns (uint) {
}
function withdrawServiceChargeTokens(uint _amountInUnits) public onlyOwner {
}
// Should there be a need to withdraw any other ERC20 token
function withdrawAnyOtherERC20Token(IERC20 _targetContractAddress) public onlyOwner {
}
// incase of half-way error
function withdrawsETH() public onlyOwner {
}
function withdrawsETHLiquityTokens() public onlyOwner {
}
// fx in relation to ETH held by the contract sent by the owner
// - this function lets you deposit ETH into this wallet
function depositETH() public payable onlyOwner {
}
// - fallback function let you / anyone send ETH to this wallet without the need to call any function
function() external payable {
}
// - to withdraw any ETH balance sitting in the contract
function withdraw() public onlyOwner {
}
}
| sETH_TokenContractAddress.transfer(msg.sender,residualsETHHoldings),"Failure to send residual sETH holdings" | 348,177 | sETH_TokenContractAddress.transfer(msg.sender,residualsETHHoldings) |
"Failure to send ServiceChargeTokens" | pragma solidity ^0.5.0;
// Interface for ETH_sETH_Addliquidity
interface UniSwap_Zap_Contract{
function LetsInvest() external payable;
}
// Objectives
// - ServiceProvider's users should be able to send ETH to the UniSwap_ZAP contracts and get the UniTokens and the residual ERC20 tokens
// - ServiceProvider should have the ability to charge a commission, should is choose to do so
// - ServiceProvider should be able to provide a commission rate in basis points
// - ServiceProvider WILL receive its commission from the incomimg UniTokens
// - ServiceProvider WILL have to withdraw its commission tokens separately
contract ServiceProvider_UniSwap_Zap is Ownable, ReentrancyGuard {
using SafeMath for uint;
UniSwap_Zap_Contract public UniSwap_Zap_ContractAddress;
IERC20 public sETH_TokenContractAddress;
IERC20 public UniSwapsETHExchangeContractAddress;
address internal ServiceProviderAddress;
uint public balance = address(this).balance;
uint private TotalServiceChargeTokens;
uint private serviceChargeInBasisPoints = 0;
event TransferredToUser_liquidityTokens_residualsETH(uint, uint);
event ServiceChargeTokensTransferred(uint);
constructor (
UniSwap_Zap_Contract _UniSwap_Zap_ContractAddress,
IERC20 _sETH_TokenContractAddress,
IERC20 _UniSwapsETHExchangeContractAddress,
address _ServiceProviderAddress)
public {
}
// - in relation to the emergency functioning of this contract
bool private stopped = false;
// circuit breaker modifiers
modifier stopInEmergency { }
function toggleContractActive() public onlyOwner {
}
// should we ever want to change the address of ZapContractAddress
function set_UniSwap_Zap_ContractAddress(UniSwap_Zap_Contract _new_UniSwap_Zap_ContractAddress) public onlyOwner {
}
// should we ever want to change the address of the sETH_TOKEN_ADDRESS Contract
function set_sETH_TokenContractAddress (IERC20 _new_sETH_TokenContractAddress) public onlyOwner {
}
// should we ever want to change the address of the _UniSwap sETHExchange Contract Address
function set_UniSwapsETHExchangeContractAddress (IERC20 _new_UniSwapsETHExchangeContractAddress) public onlyOwner {
}
// to get the ServiceProviderAddress, only the Owner can call this fx
function get_ServiceProviderAddress() public view onlyOwner returns (address) {
}
// to set the ServiceProviderAddress, only the Owner can call this fx
function set_ServiceProviderAddress (address _new_ServiceProviderAddress) public onlyOwner {
}
// to find out the serviceChargeRate, only the Owner can call this fx
function get_serviceChargeRate () public view onlyOwner returns (uint) {
}
// should the ServiceProvider ever want to change the Service Charge rate, only the Owner can call this fx
function set_serviceChargeRate (uint _new_serviceChargeInBasisPoints) public onlyOwner {
}
function LetsInvest() public payable stopInEmergency nonReentrant returns (bool) {
}
// to find out the totalServiceChargeTokens, only the Owner can call this fx
function get_TotalServiceChargeTokens() public view onlyOwner returns (uint) {
}
function withdrawServiceChargeTokens(uint _amountInUnits) public onlyOwner {
require(_amountInUnits <= TotalServiceChargeTokens, "You are asking for more than what you have earned");
TotalServiceChargeTokens = SafeMath.sub(TotalServiceChargeTokens,_amountInUnits);
require(<FILL_ME>)
emit ServiceChargeTokensTransferred(_amountInUnits);
}
// Should there be a need to withdraw any other ERC20 token
function withdrawAnyOtherERC20Token(IERC20 _targetContractAddress) public onlyOwner {
}
// incase of half-way error
function withdrawsETH() public onlyOwner {
}
function withdrawsETHLiquityTokens() public onlyOwner {
}
// fx in relation to ETH held by the contract sent by the owner
// - this function lets you deposit ETH into this wallet
function depositETH() public payable onlyOwner {
}
// - fallback function let you / anyone send ETH to this wallet without the need to call any function
function() external payable {
}
// - to withdraw any ETH balance sitting in the contract
function withdraw() public onlyOwner {
}
}
| UniSwapsETHExchangeContractAddress.transfer(ServiceProviderAddress,_amountInUnits),"Failure to send ServiceChargeTokens" | 348,177 | UniSwapsETHExchangeContractAddress.transfer(ServiceProviderAddress,_amountInUnits) |
"Whitelist: caller is not on the whitelist" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/*
___ _ _
| _ )_ _ _ _ _ _ _ _ | | | |
| _ \ || | ' \| ' \ || | |_| |_|
|___/\_,_|_||_|_||_\_, | (_) (_)
|__/
*
* MIT License
* ===========
*
* Copyright (c) 2020 BunnyFinance
*
* 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
*/
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
contract Whitelist is OwnableUpgradeable {
mapping (address => bool) private _whitelist;
bool private _disable; // default - false means whitelist feature is working on. if true no more use of whitelist
event Whitelisted(address indexed _address, bool whitelist);
event EnableWhitelist();
event DisableWhitelist();
modifier onlyWhitelisted {
require(<FILL_ME>)
_;
}
function __Whitelist_init() internal initializer {
}
function isWhitelist(address _address) public view returns(bool) {
}
function setWhitelist(address _address, bool _on) external onlyOwner {
}
function disableWhitelist(bool disable) external onlyOwner {
}
uint256[49] private __gap;
}
| _disable||_whitelist[msg.sender],"Whitelist: caller is not on the whitelist" | 348,190 | _disable||_whitelist[msg.sender] |
"RevokerRole: caller does not have the Revoker role" | pragma solidity 0.5.8;
contract RevokerRole is OwnerRole {
event RevokerAdded(address indexed addedRevoker, address indexed addedBy);
event RevokerRemoved(address indexed removedRevoker, address indexed removedBy);
Roles.Role private _revokers;
modifier onlyRevoker() {
require(<FILL_ME>)
_;
}
function isRevoker(address account) public view returns (bool) {
}
function addRevoker(address account) public onlyOwner {
}
function removeRevoker(address account) public onlyOwner {
}
function _addRevoker(address account) internal {
}
function _removeRevoker(address account) internal {
}
}
| isRevoker(msg.sender),"RevokerRole: caller does not have the Revoker role" | 348,204 | isRevoker(msg.sender) |
"failed to mint" | //HEXPLAY.sol
//
//
pragma solidity 0.6.4;
import "./SafeMath.sol";
import "./IERC20.sol";
import "./HEX.sol";
import "./Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Token {
function symbol()
external
view
returns (string memory);
function totalSupply()
external
view
returns (uint256);
function balanceOf (address account)
external
view
returns (uint256);
function transfer (address recipient, uint256 amount)
external
returns (bool);
}
////////////////////////////////////////////////
////////////////////EVENTS/////////////////////
//////////////////////////////////////////////
contract TokenEvents {
//when founder tokens are locked
event FounderLock (
uint hxbAmt,
uint timestamp
);
//when founder tokens are unlocked
event FounderUnlock (
uint hxbAmt,
uint timestamp
);
}
//////////////////////////////////////
//////////HEXPLAY TOKEN CONTRACT////////
////////////////////////////////////
contract HEXPLAY is IERC20, TokenEvents {
using SafeMath for uint256;
using SafeERC20 for HEXPLAY;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
//hex contract setup
address internal hexAddress = 0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39;
HEX internal hexInterface = HEX(hexAddress);
//founder lock
uint public unlockLvl = 0;
uint public founderLockStartTimestamp = 0;
uint public founderLockDayLength = 1825;//5 years (10% released every sixmonths)
uint public founderLockedTokens = 0;
uint private allFounderLocked = 0;
//tokenomics
uint256 internal constant _maxSupply = 600000000000000;
uint256 internal _totalSupply;
string public constant name = "hexplay";
string public constant symbol = "HXP";
uint public constant decimals = 8;
address payable internal _p1 = 0x6c28dc6529ba78fA3a0FEf408F2c982b074E41A5;
address payable internal _p2 = 0xcC5dAbe96779EBe121DA246a6cD45FA8fa4Af208;
address payable internal _p3 = 0xc70DAfC298B5de4DA424EB80DC2743173f944A9f;
address payable internal _p4 = _p1;
bool private sync;
//protects against potential reentrancy
modifier synchronized {
}
constructor() public {
//mint tokens
require(<FILL_ME>)//20% of max supply
_mint(_p1, _maxSupply.mul(80).div(100));//mint liquid HXP
}
//fallback for eth sent to contract - auto distribute as donation
receive() external payable{
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply unless mintBLock is true
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
}
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);//from address(0) for minting
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
//mint HXP to founders (only ever called in constructor)
function mintFounderTokens(uint tokens)
internal
synchronized
returns(bool)
{
}
function unlock()
public
synchronized
{
}
///////////////////////////////
////////VIEW ONLY//////////////
///////////////////////////////
function donate() public payable {
}
//distribute any token in contract via address
function distributeToken(address tokenAddress) public {
}
}
| mintFounderTokens(_maxSupply.mul(20).div(100)),"failed to mint" | 348,247 | mintFounderTokens(_maxSupply.mul(20).div(100)) |
"tokens cannot be unlocked yet" | //HEXPLAY.sol
//
//
pragma solidity 0.6.4;
import "./SafeMath.sol";
import "./IERC20.sol";
import "./HEX.sol";
import "./Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Token {
function symbol()
external
view
returns (string memory);
function totalSupply()
external
view
returns (uint256);
function balanceOf (address account)
external
view
returns (uint256);
function transfer (address recipient, uint256 amount)
external
returns (bool);
}
////////////////////////////////////////////////
////////////////////EVENTS/////////////////////
//////////////////////////////////////////////
contract TokenEvents {
//when founder tokens are locked
event FounderLock (
uint hxbAmt,
uint timestamp
);
//when founder tokens are unlocked
event FounderUnlock (
uint hxbAmt,
uint timestamp
);
}
//////////////////////////////////////
//////////HEXPLAY TOKEN CONTRACT////////
////////////////////////////////////
contract HEXPLAY is IERC20, TokenEvents {
using SafeMath for uint256;
using SafeERC20 for HEXPLAY;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
//hex contract setup
address internal hexAddress = 0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39;
HEX internal hexInterface = HEX(hexAddress);
//founder lock
uint public unlockLvl = 0;
uint public founderLockStartTimestamp = 0;
uint public founderLockDayLength = 1825;//5 years (10% released every sixmonths)
uint public founderLockedTokens = 0;
uint private allFounderLocked = 0;
//tokenomics
uint256 internal constant _maxSupply = 600000000000000;
uint256 internal _totalSupply;
string public constant name = "hexplay";
string public constant symbol = "HXP";
uint public constant decimals = 8;
address payable internal _p1 = 0x6c28dc6529ba78fA3a0FEf408F2c982b074E41A5;
address payable internal _p2 = 0xcC5dAbe96779EBe121DA246a6cD45FA8fa4Af208;
address payable internal _p3 = 0xc70DAfC298B5de4DA424EB80DC2743173f944A9f;
address payable internal _p4 = _p1;
bool private sync;
//protects against potential reentrancy
modifier synchronized {
}
constructor() public {
}
//fallback for eth sent to contract - auto distribute as donation
receive() external payable{
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply unless mintBLock is true
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
}
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);//from address(0) for minting
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
//mint HXP to founders (only ever called in constructor)
function mintFounderTokens(uint tokens)
internal
synchronized
returns(bool)
{
}
function unlock()
public
synchronized
{
uint sixMonths = founderLockDayLength/10;
uint daySeconds = 86400;
require(unlockLvl < 10, "token unlock complete");
require(<FILL_ME>)//must be at least over 6 months
uint value = allFounderLocked.div(10);
uint share = value.mul(25).div(100);//25%
if(founderLockStartTimestamp.add((sixMonths).mul(daySeconds)) <= now && unlockLvl == 0){
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(2)).mul(daySeconds)) <= now && unlockLvl == 1){
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(3)).mul(daySeconds)) <= now && unlockLvl == 2){
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(4)).mul(daySeconds)) <= now && unlockLvl == 3){
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(5)).mul(daySeconds)) <= now && unlockLvl == 4){
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(6)).mul(daySeconds)) <= now && unlockLvl == 5){
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(7)).mul(daySeconds)) <= now && unlockLvl == 6){
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(8)).mul(daySeconds)) <= now && unlockLvl == 7)
{
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(9)).mul(daySeconds)) <= now && unlockLvl == 8){
unlockLvl++;
founderLockedTokens = founderLockedTokens.sub(value);
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else if(founderLockStartTimestamp.add((sixMonths.mul(10)).mul(daySeconds)) <= now && unlockLvl == 9){
unlockLvl++;
if(founderLockedTokens >= value){
founderLockedTokens = founderLockedTokens.sub(value);
}
else{
value = founderLockedTokens;
founderLockedTokens = 0;
}
transfer(_p1, share);
transfer(_p2, share);
transfer(_p3, share);
transfer(_p4, share);
}
else{
revert();
}
emit FounderUnlock(value, now);
}
///////////////////////////////
////////VIEW ONLY//////////////
///////////////////////////////
function donate() public payable {
}
//distribute any token in contract via address
function distributeToken(address tokenAddress) public {
}
}
| founderLockStartTimestamp.add(sixMonths.mul(daySeconds))<=now,"tokens cannot be unlocked yet" | 348,247 | founderLockStartTimestamp.add(sixMonths.mul(daySeconds))<=now |
null | //HEXPLAY.sol
//
//
pragma solidity 0.6.4;
import "./SafeMath.sol";
import "./IERC20.sol";
import "./HEX.sol";
import "./Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Token {
function symbol()
external
view
returns (string memory);
function totalSupply()
external
view
returns (uint256);
function balanceOf (address account)
external
view
returns (uint256);
function transfer (address recipient, uint256 amount)
external
returns (bool);
}
////////////////////////////////////////////////
////////////////////EVENTS/////////////////////
//////////////////////////////////////////////
contract TokenEvents {
//when founder tokens are locked
event FounderLock (
uint hxbAmt,
uint timestamp
);
//when founder tokens are unlocked
event FounderUnlock (
uint hxbAmt,
uint timestamp
);
}
//////////////////////////////////////
//////////HEXPLAY TOKEN CONTRACT////////
////////////////////////////////////
contract HEXPLAY is IERC20, TokenEvents {
using SafeMath for uint256;
using SafeERC20 for HEXPLAY;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
//hex contract setup
address internal hexAddress = 0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39;
HEX internal hexInterface = HEX(hexAddress);
//founder lock
uint public unlockLvl = 0;
uint public founderLockStartTimestamp = 0;
uint public founderLockDayLength = 1825;//5 years (10% released every sixmonths)
uint public founderLockedTokens = 0;
uint private allFounderLocked = 0;
//tokenomics
uint256 internal constant _maxSupply = 600000000000000;
uint256 internal _totalSupply;
string public constant name = "hexplay";
string public constant symbol = "HXP";
uint public constant decimals = 8;
address payable internal _p1 = 0x6c28dc6529ba78fA3a0FEf408F2c982b074E41A5;
address payable internal _p2 = 0xcC5dAbe96779EBe121DA246a6cD45FA8fa4Af208;
address payable internal _p3 = 0xc70DAfC298B5de4DA424EB80DC2743173f944A9f;
address payable internal _p4 = _p1;
bool private sync;
//protects against potential reentrancy
modifier synchronized {
}
constructor() public {
}
//fallback for eth sent to contract - auto distribute as donation
receive() external payable{
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply unless mintBLock is true
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
}
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);//from address(0) for minting
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
//mint HXP to founders (only ever called in constructor)
function mintFounderTokens(uint tokens)
internal
synchronized
returns(bool)
{
}
function unlock()
public
synchronized
{
}
///////////////////////////////
////////VIEW ONLY//////////////
///////////////////////////////
function donate() public payable {
}
//distribute any token in contract via address
function distributeToken(address tokenAddress) public {
require(tokenAddress != address(this), "invalid token");
require(tokenAddress != address(0), "address cannot be 0x");
Token _token = Token(tokenAddress);
//get balance
uint256 balance = _token.balanceOf(address(this));
require(balance > 99, "value too low to distribute");
//distribute
uint256 share = balance.mul(25).div(100);//25%
require(<FILL_ME>)
require(_token.transfer(_p2, share));
require(_token.transfer(_p3, share));
require(_token.transfer(_p4, share));
}
}
| _token.transfer(_p1,share) | 348,247 | _token.transfer(_p1,share) |
null | //HEXPLAY.sol
//
//
pragma solidity 0.6.4;
import "./SafeMath.sol";
import "./IERC20.sol";
import "./HEX.sol";
import "./Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Token {
function symbol()
external
view
returns (string memory);
function totalSupply()
external
view
returns (uint256);
function balanceOf (address account)
external
view
returns (uint256);
function transfer (address recipient, uint256 amount)
external
returns (bool);
}
////////////////////////////////////////////////
////////////////////EVENTS/////////////////////
//////////////////////////////////////////////
contract TokenEvents {
//when founder tokens are locked
event FounderLock (
uint hxbAmt,
uint timestamp
);
//when founder tokens are unlocked
event FounderUnlock (
uint hxbAmt,
uint timestamp
);
}
//////////////////////////////////////
//////////HEXPLAY TOKEN CONTRACT////////
////////////////////////////////////
contract HEXPLAY is IERC20, TokenEvents {
using SafeMath for uint256;
using SafeERC20 for HEXPLAY;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
//hex contract setup
address internal hexAddress = 0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39;
HEX internal hexInterface = HEX(hexAddress);
//founder lock
uint public unlockLvl = 0;
uint public founderLockStartTimestamp = 0;
uint public founderLockDayLength = 1825;//5 years (10% released every sixmonths)
uint public founderLockedTokens = 0;
uint private allFounderLocked = 0;
//tokenomics
uint256 internal constant _maxSupply = 600000000000000;
uint256 internal _totalSupply;
string public constant name = "hexplay";
string public constant symbol = "HXP";
uint public constant decimals = 8;
address payable internal _p1 = 0x6c28dc6529ba78fA3a0FEf408F2c982b074E41A5;
address payable internal _p2 = 0xcC5dAbe96779EBe121DA246a6cD45FA8fa4Af208;
address payable internal _p3 = 0xc70DAfC298B5de4DA424EB80DC2743173f944A9f;
address payable internal _p4 = _p1;
bool private sync;
//protects against potential reentrancy
modifier synchronized {
}
constructor() public {
}
//fallback for eth sent to contract - auto distribute as donation
receive() external payable{
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply unless mintBLock is true
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
}
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);//from address(0) for minting
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
//mint HXP to founders (only ever called in constructor)
function mintFounderTokens(uint tokens)
internal
synchronized
returns(bool)
{
}
function unlock()
public
synchronized
{
}
///////////////////////////////
////////VIEW ONLY//////////////
///////////////////////////////
function donate() public payable {
}
//distribute any token in contract via address
function distributeToken(address tokenAddress) public {
require(tokenAddress != address(this), "invalid token");
require(tokenAddress != address(0), "address cannot be 0x");
Token _token = Token(tokenAddress);
//get balance
uint256 balance = _token.balanceOf(address(this));
require(balance > 99, "value too low to distribute");
//distribute
uint256 share = balance.mul(25).div(100);//25%
require(_token.transfer(_p1, share));
require(<FILL_ME>)
require(_token.transfer(_p3, share));
require(_token.transfer(_p4, share));
}
}
| _token.transfer(_p2,share) | 348,247 | _token.transfer(_p2,share) |
null | //HEXPLAY.sol
//
//
pragma solidity 0.6.4;
import "./SafeMath.sol";
import "./IERC20.sol";
import "./HEX.sol";
import "./Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Token {
function symbol()
external
view
returns (string memory);
function totalSupply()
external
view
returns (uint256);
function balanceOf (address account)
external
view
returns (uint256);
function transfer (address recipient, uint256 amount)
external
returns (bool);
}
////////////////////////////////////////////////
////////////////////EVENTS/////////////////////
//////////////////////////////////////////////
contract TokenEvents {
//when founder tokens are locked
event FounderLock (
uint hxbAmt,
uint timestamp
);
//when founder tokens are unlocked
event FounderUnlock (
uint hxbAmt,
uint timestamp
);
}
//////////////////////////////////////
//////////HEXPLAY TOKEN CONTRACT////////
////////////////////////////////////
contract HEXPLAY is IERC20, TokenEvents {
using SafeMath for uint256;
using SafeERC20 for HEXPLAY;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
//hex contract setup
address internal hexAddress = 0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39;
HEX internal hexInterface = HEX(hexAddress);
//founder lock
uint public unlockLvl = 0;
uint public founderLockStartTimestamp = 0;
uint public founderLockDayLength = 1825;//5 years (10% released every sixmonths)
uint public founderLockedTokens = 0;
uint private allFounderLocked = 0;
//tokenomics
uint256 internal constant _maxSupply = 600000000000000;
uint256 internal _totalSupply;
string public constant name = "hexplay";
string public constant symbol = "HXP";
uint public constant decimals = 8;
address payable internal _p1 = 0x6c28dc6529ba78fA3a0FEf408F2c982b074E41A5;
address payable internal _p2 = 0xcC5dAbe96779EBe121DA246a6cD45FA8fa4Af208;
address payable internal _p3 = 0xc70DAfC298B5de4DA424EB80DC2743173f944A9f;
address payable internal _p4 = _p1;
bool private sync;
//protects against potential reentrancy
modifier synchronized {
}
constructor() public {
}
//fallback for eth sent to contract - auto distribute as donation
receive() external payable{
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply unless mintBLock is true
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
}
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);//from address(0) for minting
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
//mint HXP to founders (only ever called in constructor)
function mintFounderTokens(uint tokens)
internal
synchronized
returns(bool)
{
}
function unlock()
public
synchronized
{
}
///////////////////////////////
////////VIEW ONLY//////////////
///////////////////////////////
function donate() public payable {
}
//distribute any token in contract via address
function distributeToken(address tokenAddress) public {
require(tokenAddress != address(this), "invalid token");
require(tokenAddress != address(0), "address cannot be 0x");
Token _token = Token(tokenAddress);
//get balance
uint256 balance = _token.balanceOf(address(this));
require(balance > 99, "value too low to distribute");
//distribute
uint256 share = balance.mul(25).div(100);//25%
require(_token.transfer(_p1, share));
require(_token.transfer(_p2, share));
require(<FILL_ME>)
require(_token.transfer(_p4, share));
}
}
| _token.transfer(_p3,share) | 348,247 | _token.transfer(_p3,share) |
null | //HEXPLAY.sol
//
//
pragma solidity 0.6.4;
import "./SafeMath.sol";
import "./IERC20.sol";
import "./HEX.sol";
import "./Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Token {
function symbol()
external
view
returns (string memory);
function totalSupply()
external
view
returns (uint256);
function balanceOf (address account)
external
view
returns (uint256);
function transfer (address recipient, uint256 amount)
external
returns (bool);
}
////////////////////////////////////////////////
////////////////////EVENTS/////////////////////
//////////////////////////////////////////////
contract TokenEvents {
//when founder tokens are locked
event FounderLock (
uint hxbAmt,
uint timestamp
);
//when founder tokens are unlocked
event FounderUnlock (
uint hxbAmt,
uint timestamp
);
}
//////////////////////////////////////
//////////HEXPLAY TOKEN CONTRACT////////
////////////////////////////////////
contract HEXPLAY is IERC20, TokenEvents {
using SafeMath for uint256;
using SafeERC20 for HEXPLAY;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
//hex contract setup
address internal hexAddress = 0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39;
HEX internal hexInterface = HEX(hexAddress);
//founder lock
uint public unlockLvl = 0;
uint public founderLockStartTimestamp = 0;
uint public founderLockDayLength = 1825;//5 years (10% released every sixmonths)
uint public founderLockedTokens = 0;
uint private allFounderLocked = 0;
//tokenomics
uint256 internal constant _maxSupply = 600000000000000;
uint256 internal _totalSupply;
string public constant name = "hexplay";
string public constant symbol = "HXP";
uint public constant decimals = 8;
address payable internal _p1 = 0x6c28dc6529ba78fA3a0FEf408F2c982b074E41A5;
address payable internal _p2 = 0xcC5dAbe96779EBe121DA246a6cD45FA8fa4Af208;
address payable internal _p3 = 0xc70DAfC298B5de4DA424EB80DC2743173f944A9f;
address payable internal _p4 = _p1;
bool private sync;
//protects against potential reentrancy
modifier synchronized {
}
constructor() public {
}
//fallback for eth sent to contract - auto distribute as donation
receive() external payable{
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply unless mintBLock is true
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
}
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);//from address(0) for minting
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
//mint HXP to founders (only ever called in constructor)
function mintFounderTokens(uint tokens)
internal
synchronized
returns(bool)
{
}
function unlock()
public
synchronized
{
}
///////////////////////////////
////////VIEW ONLY//////////////
///////////////////////////////
function donate() public payable {
}
//distribute any token in contract via address
function distributeToken(address tokenAddress) public {
require(tokenAddress != address(this), "invalid token");
require(tokenAddress != address(0), "address cannot be 0x");
Token _token = Token(tokenAddress);
//get balance
uint256 balance = _token.balanceOf(address(this));
require(balance > 99, "value too low to distribute");
//distribute
uint256 share = balance.mul(25).div(100);//25%
require(_token.transfer(_p1, share));
require(_token.transfer(_p2, share));
require(_token.transfer(_p3, share));
require(<FILL_ME>)
}
}
| _token.transfer(_p4,share) | 348,247 | _token.transfer(_p4,share) |
'Settlement turns over' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import 'base64-sol/base64.sol';
//
//βββββββββ βββββββββ βββ βββ ββ βββββββββ βββββββββββ βββββββββ βββββββ βββ βββββββββ
//βββ βββ βββ βββ βββββββββββ βββββββββββ βββ βββ βββ βββββββββββββββ βββ βββ βββββββββ βββββββββββ βββ βββ
//βββ ββ βββ ββ ββββββββ ββββββββ βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ ββββββββ βββ ββ
//βββ βββββββ βββ β βββ β βββ βββββββ βββ βββ βββ βββββββ βββ βββ βββ β βββ
//ββββββββββββ ββββββββ βββ βββ βββ ββββββββ βββ βββ βββ ββββββββ βββ βββ βββ ββββββββββββ
//βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ βββ βββ
//ββ βββ βββ βββ βββ βββ ββββ β βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ ββ βββ
//ββββββββββ ββββββββββ ββββββ ββββββ βββββββββ ββββββββββ ββ βββ ββ ββββββββββ ββ ββ ββββββ ββββββββββ
//β
// @author zeth
// @notice This contract is heavily inspired by Dom Hofmann's Loot Project with game design from Sid Meirs Civilisation, DND, Settlers of Catan & Age of Empires.
// Settlements allows for the creation of settlements of which users have 5 turns to create their perfect civ.
// Randomise will pseduo randomly assign a settlement a new set of attributes & increase their turn count.
// An allocation of 100 settlements are reserved for owner & future expansion packs
contract Settlements is ERC721, ERC721Enumerable, ReentrancyGuard, Ownable {
constructor() ERC721("Settlements", "STL") {}
struct Attributes {
uint8 size;
uint8 spirit;
uint8 age;
uint8 resource;
uint8 morale;
uint8 government;
uint8 turns;
}
string[] private _sizes = ['Camp', 'Hamlet', 'Village', 'Town', 'District', 'Precinct', 'Capitol', 'State'];
string[] private _spirits = ['Earth', 'Fire', 'Water', 'Air', 'Astral'];
string[] private _ages = ['Ancient', 'Classical', 'Medieval', 'Renaissance', 'Industrial', 'Modern', 'Information', 'Future'];
string[] private _resources = ['Iron', 'Gold', 'Silver', 'Wood', 'Wool', 'Water', 'Grass', 'Grain'];
string[] private _morales = ['Expectant', 'Enlightened', 'Dismissive', 'Unhappy', 'Happy', 'Undecided', 'Warring', 'Scared', 'Unruly', 'Anarchist'];
string[] private _governments = ['Democracy', 'Communism', 'Socialism', 'Oligarchy', 'Aristocracy', 'Monarchy', 'Theocracy', 'Colonialism', 'Dictatorship'];
string[] private _realms = ['Genesis', 'Valhalla', 'Keskella', 'Shadow', 'Plains', 'Ends'];
mapping(uint256 => Attributes) private attrIndex;
function indexFor(string memory input, uint256 length) internal pure returns (uint256){
}
function _getRandomSeed(uint256 tokenId, string memory seedFor) internal view returns (string memory) {
}
function generateAttribute(string memory salt, string[] memory items) internal pure returns (uint8){
}
function _makeParts(uint256 tokenId) internal view returns (string[15] memory){
}
function _makeAttributeParts(string[15] memory parts) internal pure returns (string[15] memory){
}
function tokenURI(uint256 tokenId) virtual override public view returns (string memory) {
}
function randomiseAttributes(uint256 tokenId, uint8 turn) internal {
}
function randomise(uint256 tokenId) public nonReentrant {
require(<FILL_ME>)
randomiseAttributes(tokenId, uint8(SafeMath.add(attrIndex[tokenId].turns, 1)));
}
function settle(uint256 tokenId) public nonReentrant {
}
function settleForOwner(uint256 tokenId) public nonReentrant onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
}
| _exists(tokenId)&&msg.sender==ownerOf(tokenId)&&attrIndex[tokenId].turns<5,'Settlement turns over' | 348,256 | _exists(tokenId)&&msg.sender==ownerOf(tokenId)&&attrIndex[tokenId].turns<5 |
"Settlement id is invalid" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import 'base64-sol/base64.sol';
//
//βββββββββ βββββββββ βββ βββ ββ βββββββββ βββββββββββ βββββββββ βββββββ βββ βββββββββ
//βββ βββ βββ βββ βββββββββββ βββββββββββ βββ βββ βββ βββββββββββββββ βββ βββ βββββββββ βββββββββββ βββ βββ
//βββ ββ βββ ββ ββββββββ ββββββββ βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ ββββββββ βββ ββ
//βββ βββββββ βββ β βββ β βββ βββββββ βββ βββ βββ βββββββ βββ βββ βββ β βββ
//ββββββββββββ ββββββββ βββ βββ βββ ββββββββ βββ βββ βββ ββββββββ βββ βββ βββ ββββββββββββ
//βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ βββ βββ
//ββ βββ βββ βββ βββ βββ ββββ β βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ ββ βββ
//ββββββββββ ββββββββββ ββββββ ββββββ βββββββββ ββββββββββ ββ βββ ββ ββββββββββ ββ ββ ββββββ ββββββββββ
//β
// @author zeth
// @notice This contract is heavily inspired by Dom Hofmann's Loot Project with game design from Sid Meirs Civilisation, DND, Settlers of Catan & Age of Empires.
// Settlements allows for the creation of settlements of which users have 5 turns to create their perfect civ.
// Randomise will pseduo randomly assign a settlement a new set of attributes & increase their turn count.
// An allocation of 100 settlements are reserved for owner & future expansion packs
contract Settlements is ERC721, ERC721Enumerable, ReentrancyGuard, Ownable {
constructor() ERC721("Settlements", "STL") {}
struct Attributes {
uint8 size;
uint8 spirit;
uint8 age;
uint8 resource;
uint8 morale;
uint8 government;
uint8 turns;
}
string[] private _sizes = ['Camp', 'Hamlet', 'Village', 'Town', 'District', 'Precinct', 'Capitol', 'State'];
string[] private _spirits = ['Earth', 'Fire', 'Water', 'Air', 'Astral'];
string[] private _ages = ['Ancient', 'Classical', 'Medieval', 'Renaissance', 'Industrial', 'Modern', 'Information', 'Future'];
string[] private _resources = ['Iron', 'Gold', 'Silver', 'Wood', 'Wool', 'Water', 'Grass', 'Grain'];
string[] private _morales = ['Expectant', 'Enlightened', 'Dismissive', 'Unhappy', 'Happy', 'Undecided', 'Warring', 'Scared', 'Unruly', 'Anarchist'];
string[] private _governments = ['Democracy', 'Communism', 'Socialism', 'Oligarchy', 'Aristocracy', 'Monarchy', 'Theocracy', 'Colonialism', 'Dictatorship'];
string[] private _realms = ['Genesis', 'Valhalla', 'Keskella', 'Shadow', 'Plains', 'Ends'];
mapping(uint256 => Attributes) private attrIndex;
function indexFor(string memory input, uint256 length) internal pure returns (uint256){
}
function _getRandomSeed(uint256 tokenId, string memory seedFor) internal view returns (string memory) {
}
function generateAttribute(string memory salt, string[] memory items) internal pure returns (uint8){
}
function _makeParts(uint256 tokenId) internal view returns (string[15] memory){
}
function _makeAttributeParts(string[15] memory parts) internal pure returns (string[15] memory){
}
function tokenURI(uint256 tokenId) virtual override public view returns (string memory) {
}
function randomiseAttributes(uint256 tokenId, uint8 turn) internal {
}
function randomise(uint256 tokenId) public nonReentrant {
}
function settle(uint256 tokenId) public nonReentrant {
require(<FILL_ME>)
randomiseAttributes(tokenId, 0);
_safeMint(msg.sender, tokenId);
}
function settleForOwner(uint256 tokenId) public nonReentrant onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
}
| !_exists(tokenId)&&tokenId>0&&tokenId<9901,"Settlement id is invalid" | 348,256 | !_exists(tokenId)&&tokenId>0&&tokenId<9901 |
"Settlement id is invalid" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import 'base64-sol/base64.sol';
//
//βββββββββ βββββββββ βββ βββ ββ βββββββββ βββββββββββ βββββββββ βββββββ βββ βββββββββ
//βββ βββ βββ βββ βββββββββββ βββββββββββ βββ βββ βββ βββββββββββββββ βββ βββ βββββββββ βββββββββββ βββ βββ
//βββ ββ βββ ββ ββββββββ ββββββββ βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ ββββββββ βββ ββ
//βββ βββββββ βββ β βββ β βββ βββββββ βββ βββ βββ βββββββ βββ βββ βββ β βββ
//ββββββββββββ ββββββββ βββ βββ βββ ββββββββ βββ βββ βββ ββββββββ βββ βββ βββ ββββββββββββ
//βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ βββ βββ ββ βββ βββ βββ βββ
//ββ βββ βββ βββ βββ βββ ββββ β βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ ββ βββ
//ββββββββββ ββββββββββ ββββββ ββββββ βββββββββ ββββββββββ ββ βββ ββ ββββββββββ ββ ββ ββββββ ββββββββββ
//β
// @author zeth
// @notice This contract is heavily inspired by Dom Hofmann's Loot Project with game design from Sid Meirs Civilisation, DND, Settlers of Catan & Age of Empires.
// Settlements allows for the creation of settlements of which users have 5 turns to create their perfect civ.
// Randomise will pseduo randomly assign a settlement a new set of attributes & increase their turn count.
// An allocation of 100 settlements are reserved for owner & future expansion packs
contract Settlements is ERC721, ERC721Enumerable, ReentrancyGuard, Ownable {
constructor() ERC721("Settlements", "STL") {}
struct Attributes {
uint8 size;
uint8 spirit;
uint8 age;
uint8 resource;
uint8 morale;
uint8 government;
uint8 turns;
}
string[] private _sizes = ['Camp', 'Hamlet', 'Village', 'Town', 'District', 'Precinct', 'Capitol', 'State'];
string[] private _spirits = ['Earth', 'Fire', 'Water', 'Air', 'Astral'];
string[] private _ages = ['Ancient', 'Classical', 'Medieval', 'Renaissance', 'Industrial', 'Modern', 'Information', 'Future'];
string[] private _resources = ['Iron', 'Gold', 'Silver', 'Wood', 'Wool', 'Water', 'Grass', 'Grain'];
string[] private _morales = ['Expectant', 'Enlightened', 'Dismissive', 'Unhappy', 'Happy', 'Undecided', 'Warring', 'Scared', 'Unruly', 'Anarchist'];
string[] private _governments = ['Democracy', 'Communism', 'Socialism', 'Oligarchy', 'Aristocracy', 'Monarchy', 'Theocracy', 'Colonialism', 'Dictatorship'];
string[] private _realms = ['Genesis', 'Valhalla', 'Keskella', 'Shadow', 'Plains', 'Ends'];
mapping(uint256 => Attributes) private attrIndex;
function indexFor(string memory input, uint256 length) internal pure returns (uint256){
}
function _getRandomSeed(uint256 tokenId, string memory seedFor) internal view returns (string memory) {
}
function generateAttribute(string memory salt, string[] memory items) internal pure returns (uint8){
}
function _makeParts(uint256 tokenId) internal view returns (string[15] memory){
}
function _makeAttributeParts(string[15] memory parts) internal pure returns (string[15] memory){
}
function tokenURI(uint256 tokenId) virtual override public view returns (string memory) {
}
function randomiseAttributes(uint256 tokenId, uint8 turn) internal {
}
function randomise(uint256 tokenId) public nonReentrant {
}
function settle(uint256 tokenId) public nonReentrant {
}
function settleForOwner(uint256 tokenId) public nonReentrant onlyOwner {
require(<FILL_ME>)
randomiseAttributes(tokenId, 0);
_safeMint(msg.sender, tokenId);
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
}
| !_exists(tokenId)&&tokenId>9900&&tokenId<10001,"Settlement id is invalid" | 348,256 | !_exists(tokenId)&&tokenId>9900&&tokenId<10001 |
"caller is not whitelisted" | //SPDX-License-Identifier: Unlicense
// Telegram: https://t.me/KenshinFloki
// Twiiter: https://twitter.com/KenShinFloki
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interface/IV2Factory.sol";
import "./interface/IV2Router.sol";
contract KENSHINFLOKI is Ownable, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name = "KENSHINFLOKI";
string private _symbol = "KENFLOKI";
address public devAddress = 0x4edD3eC0918a220658CBE4253c77fD9d40D14F08;
IV2Router02 constant routerV2 = IV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
IV2Factory constant factoryV2 = IV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f);
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private _isBlacklisted;
mapping(address => bool) private _isWhitelisted;
modifier onlyWhitelist() {
require(<FILL_ME>)
_;
}
uint256 constant feeTax = 50;
constructor() {
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function isExcludedFromFee(address account) public view returns(bool) {
}
function excludeFromFee(address account) public onlyWhitelist {
}
function includeInFee(address account) public onlyWhitelist {
}
function setDevAddress(address _devAddress) public onlyWhitelist {
}
function modifyWhitelist(address[] calldata wallet, bool trueFalse)
external
onlyWhitelist
{
}
function antiBot(address[] calldata wallet, bool trueFalse)
external
onlyWhitelist
{
}
}
| _isWhitelisted[_msgSender()],"caller is not whitelisted" | 348,289 | _isWhitelisted[_msgSender()] |
null | pragma solidity ^0.4.24;
contract Finnance_MM {
mapping (address => uint256) public balanceOf;
string public name = "Finnance_MM";
string public symbol = "FNM";
uint8 public decimals = 18;
uint256 public totalSupply = 560000 * (uint256(10) ** decimals);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() public {
}
function transfer(address to, uint256 value) public returns (bool success) {
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
}
function burn(uint256 amount) external {
require(amount != 0);
require(<FILL_ME>)
totalSupply -= amount * uint256(10) ** decimals;
balanceOf[msg.sender] -= amount * uint256(10) ** decimals;
emit Transfer(msg.sender, address(0), amount * uint256(10) ** decimals);
}
}
| amount*uint256(10)**decimals<=balanceOf[msg.sender] | 348,362 | amount*uint256(10)**decimals<=balanceOf[msg.sender] |
'Already initiated' | pragma solidity 0.5.12;
pragma experimental ABIEncoderV2;
import "../Ownable.sol";
import "../MinterRole.sol";
import "../ERC1155.sol";
import "../WhitelistAdminRole.sol";
import "../ERC1155Metadata.sol";
import "../ERC1155MintBurn.sol";
import "../Strings.sol";
import "../ProxyRegistry.sol";
/**
* @title ERC1155Tradable
* ERC1155Tradable - ERC1155 contract that whitelists an operator address,
* has create and mint functionality, and supports useful standards from OpenZeppelin,
like _exists(), name(), symbol(), and totalSupply()
*/
contract ERC1155Minter is ERC1155, ERC1155MintBurn, ERC1155Metadata, Ownable, MinterRole, WhitelistAdminRole {
using Strings for string;
struct Participant {
uint128 nftId;
uint64 x;
uint64 y;
address participant;
}
Participant [] internal _participants;
mapping(uint256 => address) public creators;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => uint256) public tokenMaxSupply;
// Contract name
string public name;
// Contract symbol
string public symbol;
function init(string memory _name, string memory _symbol) public onlyOwner {
require(<FILL_ME>)
name = _name;
symbol = _symbol;
_addMinter(_msgSender());
_addWhitelistAdmin(_msgSender());
_setBaseMetadataURI("https://lambo.hcore.finance/spot-the-ball-win/#home");
}
function removeWhitelistAdmin(address account) public onlyOwner {
}
function removeMinter(address account) public onlyOwner {
}
/**
* @dev Returns the total quantity for a token ID
* @param _id uint256 ID of the token to query
* @return amount of token in existence
*/
function totalSupply(uint256 _id) public view returns (uint256) {
}
/**
* @dev Returns the max quantity for a token ID
* @param _id uint256 ID of the token to query
* @return amount of token in existence
*/
function maxSupply(uint256 _id) public view returns (uint256) {
}
/**
* @dev Will update the base URL of token's URI
* @param _newBaseMetadataURI New base URL of token's URI
*/
function setBaseMetadataURI(string memory _newBaseMetadataURI) public onlyWhitelistAdmin {
}
/**
* @dev Creates a new token type and assigns _initialSupply to an address
* @param _maxSupply max supply allowed
* @param _initialSupply Optional amount to supply the first owner
* @param _id attemptId
* @param _data Optional data to pass if receiver is contract
* @return The newly created token ID
*/
function create(
address _creator,
uint256 _maxSupply,
uint256 _initialSupply,
uint256 _id,
uint64 _x,
uint64 _y,
bytes calldata _data
) external onlyMinter returns (uint256) {
}
function getParticipantsCount() public view returns (uint) {
}
function getParticipantById(uint _id) public view returns (uint128, uint64, uint64, address) {
}
/**
* @dev Returns whether the specified token exists by checking to see if it has a creator
* @param _id uint256 ID of the token to query the existence of
* @return bool whether the token exists
*/
function _exists(uint256 _id) internal view returns (bool) {
}
}
| (bytes(name)).length==0,'Already initiated' | 348,369 | (bytes(name)).length==0 |
"Id already used" | pragma solidity 0.5.12;
pragma experimental ABIEncoderV2;
import "../Ownable.sol";
import "../MinterRole.sol";
import "../ERC1155.sol";
import "../WhitelistAdminRole.sol";
import "../ERC1155Metadata.sol";
import "../ERC1155MintBurn.sol";
import "../Strings.sol";
import "../ProxyRegistry.sol";
/**
* @title ERC1155Tradable
* ERC1155Tradable - ERC1155 contract that whitelists an operator address,
* has create and mint functionality, and supports useful standards from OpenZeppelin,
like _exists(), name(), symbol(), and totalSupply()
*/
contract ERC1155Minter is ERC1155, ERC1155MintBurn, ERC1155Metadata, Ownable, MinterRole, WhitelistAdminRole {
using Strings for string;
struct Participant {
uint128 nftId;
uint64 x;
uint64 y;
address participant;
}
Participant [] internal _participants;
mapping(uint256 => address) public creators;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => uint256) public tokenMaxSupply;
// Contract name
string public name;
// Contract symbol
string public symbol;
function init(string memory _name, string memory _symbol) public onlyOwner {
}
function removeWhitelistAdmin(address account) public onlyOwner {
}
function removeMinter(address account) public onlyOwner {
}
/**
* @dev Returns the total quantity for a token ID
* @param _id uint256 ID of the token to query
* @return amount of token in existence
*/
function totalSupply(uint256 _id) public view returns (uint256) {
}
/**
* @dev Returns the max quantity for a token ID
* @param _id uint256 ID of the token to query
* @return amount of token in existence
*/
function maxSupply(uint256 _id) public view returns (uint256) {
}
/**
* @dev Will update the base URL of token's URI
* @param _newBaseMetadataURI New base URL of token's URI
*/
function setBaseMetadataURI(string memory _newBaseMetadataURI) public onlyWhitelistAdmin {
}
/**
* @dev Creates a new token type and assigns _initialSupply to an address
* @param _maxSupply max supply allowed
* @param _initialSupply Optional amount to supply the first owner
* @param _id attemptId
* @param _data Optional data to pass if receiver is contract
* @return The newly created token ID
*/
function create(
address _creator,
uint256 _maxSupply,
uint256 _initialSupply,
uint256 _id,
uint64 _x,
uint64 _y,
bytes calldata _data
) external onlyMinter returns (uint256) {
require(<FILL_ME>)
require(_initialSupply <= _maxSupply, "Initial supply cannot be more than max supply");
creators[_id] = _creator;
if (_initialSupply != 0) _mint(_creator, _id, _initialSupply, _data);
tokenSupply[_id] = _initialSupply;
tokenMaxSupply[_id] = _maxSupply;
_participants.push(Participant(uint128(_id), _x, _y, _creator));
return _id;
}
function getParticipantsCount() public view returns (uint) {
}
function getParticipantById(uint _id) public view returns (uint128, uint64, uint64, address) {
}
/**
* @dev Returns whether the specified token exists by checking to see if it has a creator
* @param _id uint256 ID of the token to query the existence of
* @return bool whether the token exists
*/
function _exists(uint256 _id) internal view returns (bool) {
}
}
| !_exists(_id),"Id already used" | 348,369 | !_exists(_id) |
"unsupported router" | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./BaseSwap.sol";
import "../libraries/BytesLib.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@kyber.network/utils-sc/contracts/IERC20Ext.sol";
import "@uniswap/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "@uniswap/v3-periphery/contracts/interfaces/IMulticall.sol";
import "@uniswap/v3-periphery/contracts/libraries/PoolAddress.sol";
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol";
import "@uniswap/v3-core/contracts/libraries/BitMath.sol";
import "@uniswap/v3-core/contracts/libraries/TickMath.sol";
import "@uniswap/v3-core/contracts/libraries/SwapMath.sol";
import "@uniswap/v3-core/contracts/libraries/LiquidityMath.sol";
interface ISwapRouterInternal is ISwapRouter, IMulticall, IPeripheryImmutableState {}
library TickBitmap {
function position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) {
}
function nextInitializedTickWithinOneWord(
IUniswapV3Pool pool,
int24 tick,
int24 tickSpacing,
bool lte
) internal view returns (int24 next, bool initialized) {
}
}
/// General swap for uniswap v3 and its clones
contract UniSwapV3 is BaseSwap {
using SafeERC20 for IERC20Ext;
using Address for address;
using EnumerableSet for EnumerableSet.AddressSet;
using BytesLib for bytes;
using SafeCast for uint256;
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using TickBitmap for IUniswapV3Pool;
EnumerableSet.AddressSet private uniRouters;
event UpdatedUniRouters(ISwapRouterInternal[] routers, bool isSupported);
constructor(address _admin, ISwapRouterInternal[] memory routers) BaseSwap(_admin) {
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the current liquidity in range
uint128 liquidity;
}
function getAllUniRouters() external view returns (address[] memory addresses) {
}
function updateUniRouters(ISwapRouterInternal[] calldata routers, bool isSupported)
external
onlyAdmin
{
}
/// @dev get expected return and conversion rate if using a Uni router
function getExpectedReturn(GetExpectedReturnParams calldata params)
external
view
override
onlyProxyContract
returns (uint256 destAmount)
{
}
/// @dev get expected return and conversion rate if using a Uni router
function getExpectedReturnWithImpact(GetExpectedReturnParams calldata params)
external
view
override
onlyProxyContract
returns (uint256 destAmount, uint256 priceImpact)
{
}
function getExpectedIn(GetExpectedInParams calldata params)
external
view
override
onlyProxyContract
returns (uint256 srcAmount)
{
}
function getExpectedInWithImpact(GetExpectedInParams calldata params)
external
view
override
onlyProxyContract
returns (uint256 srcAmount, uint256 priceImpact)
{
}
/// @dev swap token via a supported UniSwap router
/// @notice for some tokens that are paying fee, for example: DGX
/// contract will trade with received src token amount (after minus fee)
/// for UniSwap, fee will be taken in src token
function swap(SwapParams calldata params)
external
payable
override
onlyProxyContract
returns (uint256 destAmount)
{
}
function swapExactInput(
ISwapRouterInternal router,
uint256 srcAmount,
uint256 minDestAmount,
address[] calldata tradePath,
uint24[] memory fees,
address recipient
) internal {
}
function swapExactInputSingle(
ISwapRouterInternal router,
uint256 srcAmount,
uint256 minDestAmount,
address[] memory tradePath,
uint24[] memory fees,
address recipient
) internal {
}
/// @param extraArgs expecting <[20B] address router><[3B] uint24 poolFee1><[3B] uint24 poolFee2>...
function parseExtraArgs(uint256 feeLength, bytes calldata extraArgs)
internal
view
returns (ISwapRouterInternal router, uint24[] memory fees)
{
fees = new uint24[](feeLength);
router = ISwapRouterInternal(extraArgs.toAddress(0));
for (uint256 i = 0; i < feeLength; i++) {
fees[i] = extraArgs.toUint24(20 + i * 3);
}
require(router != ISwapRouterInternal(0), "invalid address");
require(<FILL_ME>)
}
function getAmountOut(
ISwapRouterInternal router,
uint256 amountIn,
address tokenIn,
address tokenOut,
uint24 fee
) private view returns (uint256 amountOut) {
}
function getAmountIn(
ISwapRouterInternal router,
uint256 amountOut,
address tokenIn,
address tokenOut,
uint24 fee
) private view returns (uint256 amountIn) {
}
function getAmount(
ISwapRouterInternal router,
int256 amountSpecified,
address tokenIn,
address tokenOut,
uint24 fee
) private view returns (uint256 amountOut) {
}
function getQuote(
ISwapRouterInternal router,
uint256 quote,
address tokenIn,
address tokenOut,
uint24 fee
) internal view returns (uint256 quoteOut) {
}
function safeWrapToken(address token, address wrappedToken) internal pure returns (address) {
}
}
| uniRouters.contains(address(router)),"unsupported router" | 348,405 | uniRouters.contains(address(router)) |
"VGGENPASS: Can't mint more than 1" | // SPDX-License-Identifier: Unlicensed
// _ ________
// | | / / ____/
// | | / / / __
// | |/ / /_/ /
// |___/\____/
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract VoyagersGenesisPass is ERC1155Burnable, ReentrancyGuard, Ownable {
using SafeMath for uint256;
string private baseURI;
uint256 public constant GEN_PASS_FEE = 0.08 ether;
uint256 public constant PUBLIC_PASS_FEE = 0.11 ether;
uint256 public constant OG_TIME_LIMIT = 6 hours;
string public constant name = "VoyagersGame Genesis Pass";
string public constant symbol = "VGGP";
address public VAULT = 0x9AFd3a2AAC444123b33f1fcD5f26F9B63E9EA53d;
uint16[] public supplyCaps = [0, 2222];
bytes32 public ogMerkleRoot;
uint256 public startTimestamp;
bool public paused = false;
mapping(uint8 => uint256) public supplies;
mapping(address => uint256) public amountPerWallets;
event SetStartTimestamp(uint256 indexed _timestamp);
event ClaimGenPassNFT(address indexed _user);
constructor(
string memory _baseURI,
uint256 _startTimestamp,
bytes32 _ogMerkleRoot
) ERC1155(_baseURI) {
}
function claim(bytes32[] calldata merkleProof)
external
payable
nonReentrant
{
require(
block.timestamp >= startTimestamp,
"VGGENPASS: Not started yet"
);
require(
paused == false,
"VGGENPASS: Minting Paused"
);
uint256 timePeriod = block.timestamp - startTimestamp;
if (timePeriod <= OG_TIME_LIMIT) {
require(
msg.value >= GEN_PASS_FEE,
"VGGENPASS: Not enough fee"
);
bytes32 node = keccak256(abi.encodePacked(msg.sender));
bool isOGVerified = MerkleProof.verify(merkleProof, ogMerkleRoot, node);
require(isOGVerified, "VGGENPASS: You are not whitelisted, please wait for public mint");
require(<FILL_ME>)
amountPerWallets[msg.sender] += 1;
_mint(msg.sender, 1, 1, "");
emit ClaimGenPassNFT(msg.sender);
} else if (timePeriod >= OG_TIME_LIMIT) {
require(
msg.value >= PUBLIC_PASS_FEE,
"VGGENPASS: Not enough fee"
);
require(
amountPerWallets[msg.sender] + 1 <= 1,
"VGGENPASS: Can't mint more than 1"
);
amountPerWallets[msg.sender] += 1;
_mint(msg.sender, 1, 1, "");
emit ClaimGenPassNFT(msg.sender);
}
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal override {
}
function uri(uint256 typeId) public view override returns (string memory) {
}
function pause(bool _paused) external onlyOwner {
}
function setBaseUri(string memory _baseURI) external onlyOwner {
}
function setOgMerkleRoot(bytes32 _ogMerkleRoot) external onlyOwner {
}
function setStartTimestamp(uint256 _startTimestamp) external onlyOwner {
}
function withdrawAll() external onlyOwner {
}
function withdraw(uint256 _amount) external onlyOwner {
}
}
| amountPerWallets[msg.sender]+1<=1,"VGGENPASS: Can't mint more than 1" | 348,451 | amountPerWallets[msg.sender]+1<=1 |
"VGGENPASS: Suppy limit was hit" | // SPDX-License-Identifier: Unlicensed
// _ ________
// | | / / ____/
// | | / / / __
// | |/ / /_/ /
// |___/\____/
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract VoyagersGenesisPass is ERC1155Burnable, ReentrancyGuard, Ownable {
using SafeMath for uint256;
string private baseURI;
uint256 public constant GEN_PASS_FEE = 0.08 ether;
uint256 public constant PUBLIC_PASS_FEE = 0.11 ether;
uint256 public constant OG_TIME_LIMIT = 6 hours;
string public constant name = "VoyagersGame Genesis Pass";
string public constant symbol = "VGGP";
address public VAULT = 0x9AFd3a2AAC444123b33f1fcD5f26F9B63E9EA53d;
uint16[] public supplyCaps = [0, 2222];
bytes32 public ogMerkleRoot;
uint256 public startTimestamp;
bool public paused = false;
mapping(uint8 => uint256) public supplies;
mapping(address => uint256) public amountPerWallets;
event SetStartTimestamp(uint256 indexed _timestamp);
event ClaimGenPassNFT(address indexed _user);
constructor(
string memory _baseURI,
uint256 _startTimestamp,
bytes32 _ogMerkleRoot
) ERC1155(_baseURI) {
}
function claim(bytes32[] calldata merkleProof)
external
payable
nonReentrant
{
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal override {
require(<FILL_ME>)
supplies[uint8(id)] += amount;
super._mint(to, id, amount, data);
}
function uri(uint256 typeId) public view override returns (string memory) {
}
function pause(bool _paused) external onlyOwner {
}
function setBaseUri(string memory _baseURI) external onlyOwner {
}
function setOgMerkleRoot(bytes32 _ogMerkleRoot) external onlyOwner {
}
function setStartTimestamp(uint256 _startTimestamp) external onlyOwner {
}
function withdrawAll() external onlyOwner {
}
function withdraw(uint256 _amount) external onlyOwner {
}
}
| supplies[uint8(id)]<supplyCaps[uint8(id)],"VGGENPASS: Suppy limit was hit" | 348,451 | supplies[uint8(id)]<supplyCaps[uint8(id)] |
"VGGENPASS: No vault" | // SPDX-License-Identifier: Unlicensed
// _ ________
// | | / / ____/
// | | / / / __
// | |/ / /_/ /
// |___/\____/
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract VoyagersGenesisPass is ERC1155Burnable, ReentrancyGuard, Ownable {
using SafeMath for uint256;
string private baseURI;
uint256 public constant GEN_PASS_FEE = 0.08 ether;
uint256 public constant PUBLIC_PASS_FEE = 0.11 ether;
uint256 public constant OG_TIME_LIMIT = 6 hours;
string public constant name = "VoyagersGame Genesis Pass";
string public constant symbol = "VGGP";
address public VAULT = 0x9AFd3a2AAC444123b33f1fcD5f26F9B63E9EA53d;
uint16[] public supplyCaps = [0, 2222];
bytes32 public ogMerkleRoot;
uint256 public startTimestamp;
bool public paused = false;
mapping(uint8 => uint256) public supplies;
mapping(address => uint256) public amountPerWallets;
event SetStartTimestamp(uint256 indexed _timestamp);
event ClaimGenPassNFT(address indexed _user);
constructor(
string memory _baseURI,
uint256 _startTimestamp,
bytes32 _ogMerkleRoot
) ERC1155(_baseURI) {
}
function claim(bytes32[] calldata merkleProof)
external
payable
nonReentrant
{
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal override {
}
function uri(uint256 typeId) public view override returns (string memory) {
}
function pause(bool _paused) external onlyOwner {
}
function setBaseUri(string memory _baseURI) external onlyOwner {
}
function setOgMerkleRoot(bytes32 _ogMerkleRoot) external onlyOwner {
}
function setStartTimestamp(uint256 _startTimestamp) external onlyOwner {
}
function withdrawAll() external onlyOwner {
}
function withdraw(uint256 _amount) external onlyOwner {
require(<FILL_ME>)
require(payable(VAULT).send(_amount), "VGGENPASS: Withdraw failed");
}
}
| address(VAULT)!=address(0),"VGGENPASS: No vault" | 348,451 | address(VAULT)!=address(0) |
"VGGENPASS: Withdraw failed" | // SPDX-License-Identifier: Unlicensed
// _ ________
// | | / / ____/
// | | / / / __
// | |/ / /_/ /
// |___/\____/
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract VoyagersGenesisPass is ERC1155Burnable, ReentrancyGuard, Ownable {
using SafeMath for uint256;
string private baseURI;
uint256 public constant GEN_PASS_FEE = 0.08 ether;
uint256 public constant PUBLIC_PASS_FEE = 0.11 ether;
uint256 public constant OG_TIME_LIMIT = 6 hours;
string public constant name = "VoyagersGame Genesis Pass";
string public constant symbol = "VGGP";
address public VAULT = 0x9AFd3a2AAC444123b33f1fcD5f26F9B63E9EA53d;
uint16[] public supplyCaps = [0, 2222];
bytes32 public ogMerkleRoot;
uint256 public startTimestamp;
bool public paused = false;
mapping(uint8 => uint256) public supplies;
mapping(address => uint256) public amountPerWallets;
event SetStartTimestamp(uint256 indexed _timestamp);
event ClaimGenPassNFT(address indexed _user);
constructor(
string memory _baseURI,
uint256 _startTimestamp,
bytes32 _ogMerkleRoot
) ERC1155(_baseURI) {
}
function claim(bytes32[] calldata merkleProof)
external
payable
nonReentrant
{
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal override {
}
function uri(uint256 typeId) public view override returns (string memory) {
}
function pause(bool _paused) external onlyOwner {
}
function setBaseUri(string memory _baseURI) external onlyOwner {
}
function setOgMerkleRoot(bytes32 _ogMerkleRoot) external onlyOwner {
}
function setStartTimestamp(uint256 _startTimestamp) external onlyOwner {
}
function withdrawAll() external onlyOwner {
}
function withdraw(uint256 _amount) external onlyOwner {
require(address(VAULT) != address(0), "VGGENPASS: No vault");
require(<FILL_ME>)
}
}
| payable(VAULT).send(_amount),"VGGENPASS: Withdraw failed" | 348,451 | payable(VAULT).send(_amount) |
null | // SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License
pragma solidity ^0.6.10;
import "./_Pausable.sol";
import "./_Groups.sol";
/**
* @dev User groups for Prime Token.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
contract TokenGroups is Pausable {
uint8 public constant ADMIN = 1;
uint8 public constant ATTORNEY = 2;
uint8 public constant BUNDLER = 3;
uint8 public constant WHITELIST = 4;
uint8 public constant FROZEN = 5;
uint8 public constant BW_ADMIN = 6;
uint8 public constant SWAPPER = 7;
uint8 public constant DELEGATE = 8;
using Groups for Groups.GroupMap;
Groups.GroupMap groups;
event AddedToGroup(uint8 indexed groupId, address indexed account);
event RemovedFromGroup(uint8 indexed groupId, address indexed account);
event BwAddedAttorney(address indexed account);
event BwRemovedAttorney(address indexed account);
event BwRemovedAdmin(address indexed account);
modifier onlyAdminOrAttorney() {
require(<FILL_ME>)
_;
}
// ATTORNEY
// dapp https://app.blockwell.ai/0tezcv
function _addAttorney(address account) internal {
}
function addAttorney(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to add an attorney to the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwAddAttorney(address account) public onlyBwAdmin {
}
// dapp https://app.blockwell.ai/7qtyz4
function removeAttorney(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to remove an attorney from the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwRemoveAttorney(address account) public onlyBwAdmin {
}
function isAttorney(address account) public view returns (bool) {
}
// ADMIN
function _addAdmin(address account) internal {
}
// dapp https://app.blockwell.ai/mtzj2e
function addAdmin(address account) public whenNotPaused onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/40pc9e
function removeAdmin(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to remove an admin from the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwRemoveAdmin(address account) public onlyBwAdmin {
}
function isAdmin(address account) public view returns (bool) {
}
// BUNDLER
// dapp https://app.blockwell.ai/i8sxu0
function addBundler(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/z72enu
function removeBundler(address account) public onlyAdminOrAttorney {
}
function isBundler(address account) public view returns (bool) {
}
modifier onlyBundler() {
}
// SWAPPER
// dapp https://app.blockwell.ai/amcwpf
function addSwapper(address account) public onlyAdminOrAttorney {
}
function _addSwapper(address account) internal {
}
function removeSwapper(address account) public onlyAdminOrAttorney {
}
function isSwapper(address account) public view returns (bool) {
}
modifier onlySwapper() {
}
// WHITELIST
// dapp https://app.blockwell.ai/y4c4n2
function addToWhitelist(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/n4408a
function removeFromWhitelist(address account) public onlyAdminOrAttorney {
}
function isWhitelisted(address account) public view returns (bool) {
}
// BW_ADMIN
function _addBwAdmin(address account) internal {
}
function addBwAdmin(address account) public onlyBwAdmin {
}
function renounceBwAdmin() public {
}
function isBwAdmin(address account) public view returns (bool) {
}
modifier onlyBwAdmin() {
}
// FROZEN
function _freeze(address account) internal {
}
// dapp https://app.blockwell.ai/0ldfpw
function freeze(address account) public onlyAdminOrAttorney {
}
function _unfreeze(address account) internal {
}
// dapp https://app.blockwell.ai/qcwqg6
function unfreeze(address account) public onlyAdminOrAttorney {
}
/**
* @dev Freeze multiple accounts with a single transaction.
*
* dapp https://app.blockwell.ai/t0rw3c
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function multiFreeze(address[] calldata account) public onlyAdminOrAttorney {
}
/**
* @dev Unfreeze multiple accounts with a single transaction.
*
* dapp https://app.blockwell.ai/7updhm
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function multiUnfreeze(address[] calldata account) public onlyAdminOrAttorney {
}
function isFrozen(address account) public view returns (bool) {
}
modifier isNotFrozen() {
}
// DELEGATE
// dapp https://app.blockwell.ai/cpyysz
function addDelegate(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/a0j2al
function removeDelegate(address account) public onlyAdminOrAttorney {
}
function isDelegate(address account) public view returns (bool) {
}
// Internal functions
function _add(uint8 groupId, address account) internal {
}
function _remove(uint8 groupId, address account) internal {
}
function _contains(uint8 groupId, address account) internal view returns (bool) {
}
}
| isAdmin(msg.sender)||isAttorney(msg.sender) | 348,495 | isAdmin(msg.sender)||isAttorney(msg.sender) |
null | // SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License
pragma solidity ^0.6.10;
import "./_Pausable.sol";
import "./_Groups.sol";
/**
* @dev User groups for Prime Token.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
contract TokenGroups is Pausable {
uint8 public constant ADMIN = 1;
uint8 public constant ATTORNEY = 2;
uint8 public constant BUNDLER = 3;
uint8 public constant WHITELIST = 4;
uint8 public constant FROZEN = 5;
uint8 public constant BW_ADMIN = 6;
uint8 public constant SWAPPER = 7;
uint8 public constant DELEGATE = 8;
using Groups for Groups.GroupMap;
Groups.GroupMap groups;
event AddedToGroup(uint8 indexed groupId, address indexed account);
event RemovedFromGroup(uint8 indexed groupId, address indexed account);
event BwAddedAttorney(address indexed account);
event BwRemovedAttorney(address indexed account);
event BwRemovedAdmin(address indexed account);
modifier onlyAdminOrAttorney() {
}
// ATTORNEY
// dapp https://app.blockwell.ai/0tezcv
function _addAttorney(address account) internal {
}
function addAttorney(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to add an attorney to the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwAddAttorney(address account) public onlyBwAdmin {
}
// dapp https://app.blockwell.ai/7qtyz4
function removeAttorney(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to remove an attorney from the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwRemoveAttorney(address account) public onlyBwAdmin {
}
function isAttorney(address account) public view returns (bool) {
}
// ADMIN
function _addAdmin(address account) internal {
}
// dapp https://app.blockwell.ai/mtzj2e
function addAdmin(address account) public whenNotPaused onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/40pc9e
function removeAdmin(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to remove an admin from the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwRemoveAdmin(address account) public onlyBwAdmin {
}
function isAdmin(address account) public view returns (bool) {
}
// BUNDLER
// dapp https://app.blockwell.ai/i8sxu0
function addBundler(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/z72enu
function removeBundler(address account) public onlyAdminOrAttorney {
}
function isBundler(address account) public view returns (bool) {
}
modifier onlyBundler() {
require(<FILL_ME>)
_;
}
// SWAPPER
// dapp https://app.blockwell.ai/amcwpf
function addSwapper(address account) public onlyAdminOrAttorney {
}
function _addSwapper(address account) internal {
}
function removeSwapper(address account) public onlyAdminOrAttorney {
}
function isSwapper(address account) public view returns (bool) {
}
modifier onlySwapper() {
}
// WHITELIST
// dapp https://app.blockwell.ai/y4c4n2
function addToWhitelist(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/n4408a
function removeFromWhitelist(address account) public onlyAdminOrAttorney {
}
function isWhitelisted(address account) public view returns (bool) {
}
// BW_ADMIN
function _addBwAdmin(address account) internal {
}
function addBwAdmin(address account) public onlyBwAdmin {
}
function renounceBwAdmin() public {
}
function isBwAdmin(address account) public view returns (bool) {
}
modifier onlyBwAdmin() {
}
// FROZEN
function _freeze(address account) internal {
}
// dapp https://app.blockwell.ai/0ldfpw
function freeze(address account) public onlyAdminOrAttorney {
}
function _unfreeze(address account) internal {
}
// dapp https://app.blockwell.ai/qcwqg6
function unfreeze(address account) public onlyAdminOrAttorney {
}
/**
* @dev Freeze multiple accounts with a single transaction.
*
* dapp https://app.blockwell.ai/t0rw3c
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function multiFreeze(address[] calldata account) public onlyAdminOrAttorney {
}
/**
* @dev Unfreeze multiple accounts with a single transaction.
*
* dapp https://app.blockwell.ai/7updhm
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function multiUnfreeze(address[] calldata account) public onlyAdminOrAttorney {
}
function isFrozen(address account) public view returns (bool) {
}
modifier isNotFrozen() {
}
// DELEGATE
// dapp https://app.blockwell.ai/cpyysz
function addDelegate(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/a0j2al
function removeDelegate(address account) public onlyAdminOrAttorney {
}
function isDelegate(address account) public view returns (bool) {
}
// Internal functions
function _add(uint8 groupId, address account) internal {
}
function _remove(uint8 groupId, address account) internal {
}
function _contains(uint8 groupId, address account) internal view returns (bool) {
}
}
| isBundler(msg.sender) | 348,495 | isBundler(msg.sender) |
null | // SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License
pragma solidity ^0.6.10;
import "./_Pausable.sol";
import "./_Groups.sol";
/**
* @dev User groups for Prime Token.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
contract TokenGroups is Pausable {
uint8 public constant ADMIN = 1;
uint8 public constant ATTORNEY = 2;
uint8 public constant BUNDLER = 3;
uint8 public constant WHITELIST = 4;
uint8 public constant FROZEN = 5;
uint8 public constant BW_ADMIN = 6;
uint8 public constant SWAPPER = 7;
uint8 public constant DELEGATE = 8;
using Groups for Groups.GroupMap;
Groups.GroupMap groups;
event AddedToGroup(uint8 indexed groupId, address indexed account);
event RemovedFromGroup(uint8 indexed groupId, address indexed account);
event BwAddedAttorney(address indexed account);
event BwRemovedAttorney(address indexed account);
event BwRemovedAdmin(address indexed account);
modifier onlyAdminOrAttorney() {
}
// ATTORNEY
// dapp https://app.blockwell.ai/0tezcv
function _addAttorney(address account) internal {
}
function addAttorney(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to add an attorney to the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwAddAttorney(address account) public onlyBwAdmin {
}
// dapp https://app.blockwell.ai/7qtyz4
function removeAttorney(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to remove an attorney from the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwRemoveAttorney(address account) public onlyBwAdmin {
}
function isAttorney(address account) public view returns (bool) {
}
// ADMIN
function _addAdmin(address account) internal {
}
// dapp https://app.blockwell.ai/mtzj2e
function addAdmin(address account) public whenNotPaused onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/40pc9e
function removeAdmin(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to remove an admin from the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwRemoveAdmin(address account) public onlyBwAdmin {
}
function isAdmin(address account) public view returns (bool) {
}
// BUNDLER
// dapp https://app.blockwell.ai/i8sxu0
function addBundler(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/z72enu
function removeBundler(address account) public onlyAdminOrAttorney {
}
function isBundler(address account) public view returns (bool) {
}
modifier onlyBundler() {
}
// SWAPPER
// dapp https://app.blockwell.ai/amcwpf
function addSwapper(address account) public onlyAdminOrAttorney {
}
function _addSwapper(address account) internal {
}
function removeSwapper(address account) public onlyAdminOrAttorney {
}
function isSwapper(address account) public view returns (bool) {
}
modifier onlySwapper() {
require(<FILL_ME>)
_;
}
// WHITELIST
// dapp https://app.blockwell.ai/y4c4n2
function addToWhitelist(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/n4408a
function removeFromWhitelist(address account) public onlyAdminOrAttorney {
}
function isWhitelisted(address account) public view returns (bool) {
}
// BW_ADMIN
function _addBwAdmin(address account) internal {
}
function addBwAdmin(address account) public onlyBwAdmin {
}
function renounceBwAdmin() public {
}
function isBwAdmin(address account) public view returns (bool) {
}
modifier onlyBwAdmin() {
}
// FROZEN
function _freeze(address account) internal {
}
// dapp https://app.blockwell.ai/0ldfpw
function freeze(address account) public onlyAdminOrAttorney {
}
function _unfreeze(address account) internal {
}
// dapp https://app.blockwell.ai/qcwqg6
function unfreeze(address account) public onlyAdminOrAttorney {
}
/**
* @dev Freeze multiple accounts with a single transaction.
*
* dapp https://app.blockwell.ai/t0rw3c
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function multiFreeze(address[] calldata account) public onlyAdminOrAttorney {
}
/**
* @dev Unfreeze multiple accounts with a single transaction.
*
* dapp https://app.blockwell.ai/7updhm
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function multiUnfreeze(address[] calldata account) public onlyAdminOrAttorney {
}
function isFrozen(address account) public view returns (bool) {
}
modifier isNotFrozen() {
}
// DELEGATE
// dapp https://app.blockwell.ai/cpyysz
function addDelegate(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/a0j2al
function removeDelegate(address account) public onlyAdminOrAttorney {
}
function isDelegate(address account) public view returns (bool) {
}
// Internal functions
function _add(uint8 groupId, address account) internal {
}
function _remove(uint8 groupId, address account) internal {
}
function _contains(uint8 groupId, address account) internal view returns (bool) {
}
}
| isSwapper(msg.sender) | 348,495 | isSwapper(msg.sender) |
null | // SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License
pragma solidity ^0.6.10;
import "./_Pausable.sol";
import "./_Groups.sol";
/**
* @dev User groups for Prime Token.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
contract TokenGroups is Pausable {
uint8 public constant ADMIN = 1;
uint8 public constant ATTORNEY = 2;
uint8 public constant BUNDLER = 3;
uint8 public constant WHITELIST = 4;
uint8 public constant FROZEN = 5;
uint8 public constant BW_ADMIN = 6;
uint8 public constant SWAPPER = 7;
uint8 public constant DELEGATE = 8;
using Groups for Groups.GroupMap;
Groups.GroupMap groups;
event AddedToGroup(uint8 indexed groupId, address indexed account);
event RemovedFromGroup(uint8 indexed groupId, address indexed account);
event BwAddedAttorney(address indexed account);
event BwRemovedAttorney(address indexed account);
event BwRemovedAdmin(address indexed account);
modifier onlyAdminOrAttorney() {
}
// ATTORNEY
// dapp https://app.blockwell.ai/0tezcv
function _addAttorney(address account) internal {
}
function addAttorney(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to add an attorney to the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwAddAttorney(address account) public onlyBwAdmin {
}
// dapp https://app.blockwell.ai/7qtyz4
function removeAttorney(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to remove an attorney from the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwRemoveAttorney(address account) public onlyBwAdmin {
}
function isAttorney(address account) public view returns (bool) {
}
// ADMIN
function _addAdmin(address account) internal {
}
// dapp https://app.blockwell.ai/mtzj2e
function addAdmin(address account) public whenNotPaused onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/40pc9e
function removeAdmin(address account) public whenNotPaused onlyAdminOrAttorney {
}
/**
* @dev Allows BW admins to remove an admin from the contract in emergency cases.
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function bwRemoveAdmin(address account) public onlyBwAdmin {
}
function isAdmin(address account) public view returns (bool) {
}
// BUNDLER
// dapp https://app.blockwell.ai/i8sxu0
function addBundler(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/z72enu
function removeBundler(address account) public onlyAdminOrAttorney {
}
function isBundler(address account) public view returns (bool) {
}
modifier onlyBundler() {
}
// SWAPPER
// dapp https://app.blockwell.ai/amcwpf
function addSwapper(address account) public onlyAdminOrAttorney {
}
function _addSwapper(address account) internal {
}
function removeSwapper(address account) public onlyAdminOrAttorney {
}
function isSwapper(address account) public view returns (bool) {
}
modifier onlySwapper() {
}
// WHITELIST
// dapp https://app.blockwell.ai/y4c4n2
function addToWhitelist(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/n4408a
function removeFromWhitelist(address account) public onlyAdminOrAttorney {
}
function isWhitelisted(address account) public view returns (bool) {
}
// BW_ADMIN
function _addBwAdmin(address account) internal {
}
function addBwAdmin(address account) public onlyBwAdmin {
}
function renounceBwAdmin() public {
}
function isBwAdmin(address account) public view returns (bool) {
}
modifier onlyBwAdmin() {
require(<FILL_ME>)
_;
}
// FROZEN
function _freeze(address account) internal {
}
// dapp https://app.blockwell.ai/0ldfpw
function freeze(address account) public onlyAdminOrAttorney {
}
function _unfreeze(address account) internal {
}
// dapp https://app.blockwell.ai/qcwqg6
function unfreeze(address account) public onlyAdminOrAttorney {
}
/**
* @dev Freeze multiple accounts with a single transaction.
*
* dapp https://app.blockwell.ai/t0rw3c
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function multiFreeze(address[] calldata account) public onlyAdminOrAttorney {
}
/**
* @dev Unfreeze multiple accounts with a single transaction.
*
* dapp https://app.blockwell.ai/7updhm
*
* Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)
*/
function multiUnfreeze(address[] calldata account) public onlyAdminOrAttorney {
}
function isFrozen(address account) public view returns (bool) {
}
modifier isNotFrozen() {
}
// DELEGATE
// dapp https://app.blockwell.ai/cpyysz
function addDelegate(address account) public onlyAdminOrAttorney {
}
// dapp https://app.blockwell.ai/a0j2al
function removeDelegate(address account) public onlyAdminOrAttorney {
}
function isDelegate(address account) public view returns (bool) {
}
// Internal functions
function _add(uint8 groupId, address account) internal {
}
function _remove(uint8 groupId, address account) internal {
}
function _contains(uint8 groupId, address account) internal view returns (bool) {
}
}
| isBwAdmin(msg.sender) | 348,495 | isBwAdmin(msg.sender) |
null | pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @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() internal {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title Authorizable
* @dev The Authorizable contract has authorized addresses, and provides basic authorization control
* functions, this simplifies the implementation of "multiple user permissions".
*/
contract Authorizable is Ownable {
mapping(address => bool) public authorized;
event AuthorizationSet(address indexed addressAuthorized, bool indexed authorization);
/**
* @dev The Authorizable constructor sets the first `authorized` of the contract to the sender
* account.
*/
function Authorizable() public {
}
/**
* @dev Throws if called by any account other than the authorized.
*/
modifier onlyAuthorized() {
}
/**
* @dev Allows the current owner to set an authorization.
* @param addressAuthorized The address to change authorization.
*/
function setAuthorized(address addressAuthorized, bool authorization) onlyOwner public {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant 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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token from an address to another specified address
* @param _sender The address to transfer from.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transferFunction(address _sender, address _to, uint256 _value) internal returns (bool) {
}
/**
* @dev transfer token for a specified address (BasicToken transfer method)
*/
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 constant returns (uint256 balance) {
}
}
contract ERC223TokenCompatible is BasicToken {
using SafeMath for uint256;
event Transfer(address indexed from, address indexed to, uint256 value, bytes indexed data);
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint256 _value, bytes _data, string _custom_fallback) public returns (bool success) {
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
}
}
/**
* @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 constant returns (uint256 remaining) {
}
/**
* 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
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
}
}
/**
* @title Startable
* @dev Base contract which allows owner to implement an start mechanism without ever being stopped more.
*/
contract Startable is Ownable, Authorizable {
event Start();
bool public started = false;
/**
* @dev Modifier to make a function callable only when the contract is started.
*/
modifier whenStarted() {
}
/**
* @dev called by the owner to start, go to normal state
*/
function start() onlyOwner public {
}
}
/**
* @title Startable token
*
* @dev StandardToken modified with startable transfers.
**/
contract StartToken is Startable, ERC223TokenCompatible, StandardToken {
function transfer(address _to, uint256 _value) public whenStarted returns (bool) {
}
function transfer(address _to, uint256 _value, bytes _data) public whenStarted returns (bool) {
}
function transfer(address _to, uint256 _value, bytes _data, string _custom_fallback) public whenStarted returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenStarted returns (bool) {
}
function approve(address _spender, uint256 _value) public whenStarted returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public whenStarted returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenStarted returns (bool success) {
}
}
contract HumanStandardToken is StandardToken, StartToken {
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
approve(_spender, _value);
require(<FILL_ME>)
return true;
}
}
contract BurnToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Function to burn tokens.
* @param _burner The address of token holder.
* @param _value The amount of token to be burned.
*/
function burnFunction(address _burner, uint256 _value) internal returns (bool) {
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public returns(bool) {
}
/**
* @dev Burns tokens from one address
* @param _from address The address which you want to burn tokens from
* @param _value uint256 the amount of tokens to be burned
*/
function burnFrom(address _from, uint256 _value) public returns (bool) {
}
}
contract OriginToken is Authorizable, BasicToken, BurnToken {
/**
* @dev transfer token from tx.orgin to a specified address (onlyAuthorized contract)
*/
function originTransfer(address _to, uint256 _value) onlyAuthorized public returns (bool) {
}
/**
* @dev Burns a specific amount of tokens from tx.orgin. (onlyAuthorized contract)
* @param _value The amount of token to be burned.
*/
function originBurn(uint256 _value) onlyAuthorized public returns(bool) {
}
}
contract Token is ERC223TokenCompatible, StandardToken, StartToken, HumanStandardToken, BurnToken, OriginToken {
uint8 public decimals = 18;
string public name = "MasterXriba";
string public symbol = "XRA";
uint256 public initialSupply;
function Token() public {
}
}
| _spender.call(bytes4(keccak256("receiveApproval(address,uint256,bytes)")),msg.sender,_value,_extraData) | 348,622 | _spender.call(bytes4(keccak256("receiveApproval(address,uint256,bytes)")),msg.sender,_value,_extraData) |
"ALREADY EXISTS" | pragma solidity 0.5.17;
contract MigrateLockup is LegacyLockup {
constructor(address _config) public LegacyLockup(_config) {}
function __initStakeOnProperty(
address _property,
address _user,
uint256 _cInterestPrice
) public onlyOwner {
require(<FILL_ME>)
setStorageLastStakedInterestPrice(_property, _user, _cInterestPrice);
}
function __initLastStakeOnProperty(
address _property,
uint256 _cHoldersAmountPerProperty,
uint256 _cHoldersPrice
) public onlyOwner {
}
function __initLastStake(
uint256 _cReward,
uint256 _cInterestPrice,
uint256 _cHoldersPrice
) public onlyOwner {
}
}
| getStorageLastStakedInterestPrice(_property,_user)!=_cInterestPrice,"ALREADY EXISTS" | 348,627 | getStorageLastStakedInterestPrice(_property,_user)!=_cInterestPrice |
"ALREADY EXISTS" | pragma solidity 0.5.17;
contract MigrateLockup is LegacyLockup {
constructor(address _config) public LegacyLockup(_config) {}
function __initStakeOnProperty(
address _property,
address _user,
uint256 _cInterestPrice
) public onlyOwner {
}
function __initLastStakeOnProperty(
address _property,
uint256 _cHoldersAmountPerProperty,
uint256 _cHoldersPrice
) public onlyOwner {
require(<FILL_ME>)
setStorageLastCumulativeHoldersRewardAmountPerProperty(
_property,
_cHoldersAmountPerProperty
);
setStorageLastCumulativeHoldersRewardPricePerProperty(
_property,
_cHoldersPrice
);
}
function __initLastStake(
uint256 _cReward,
uint256 _cInterestPrice,
uint256 _cHoldersPrice
) public onlyOwner {
}
}
| getStorageLastCumulativeHoldersRewardAmountPerProperty(_property)!=_cHoldersAmountPerProperty||getStorageLastCumulativeHoldersRewardPricePerProperty(_property)!=_cHoldersPrice,"ALREADY EXISTS" | 348,627 | getStorageLastCumulativeHoldersRewardAmountPerProperty(_property)!=_cHoldersAmountPerProperty||getStorageLastCumulativeHoldersRewardPricePerProperty(_property)!=_cHoldersPrice |
"ALREADY EXISTS" | pragma solidity 0.5.17;
contract MigrateLockup is LegacyLockup {
constructor(address _config) public LegacyLockup(_config) {}
function __initStakeOnProperty(
address _property,
address _user,
uint256 _cInterestPrice
) public onlyOwner {
}
function __initLastStakeOnProperty(
address _property,
uint256 _cHoldersAmountPerProperty,
uint256 _cHoldersPrice
) public onlyOwner {
}
function __initLastStake(
uint256 _cReward,
uint256 _cInterestPrice,
uint256 _cHoldersPrice
) public onlyOwner {
require(<FILL_ME>)
setStorageLastStakesChangedCumulativeReward(_cReward);
setStorageLastCumulativeHoldersRewardPrice(_cHoldersPrice);
setStorageLastCumulativeInterestPrice(_cInterestPrice);
}
}
| getStorageLastStakesChangedCumulativeReward()!=_cReward||getStorageLastCumulativeHoldersRewardPrice()!=_cHoldersPrice||getStorageLastCumulativeInterestPrice()!=_cInterestPrice,"ALREADY EXISTS" | 348,627 | getStorageLastStakesChangedCumulativeReward()!=_cReward||getStorageLastCumulativeHoldersRewardPrice()!=_cHoldersPrice||getStorageLastCumulativeInterestPrice()!=_cInterestPrice |
null | pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EDSToken is ERC20Interface, Owned, SafeMath {
string public name = "EduShare";
string public symbol = "EDS";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
bool public isLocked;
address[] private vaultList;
mapping(address => uint) vaultAmount;
mapping(address => uint) vaultReleaseTime;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function EDSToken(address multisig, uint tokens) public {
}
modifier isNotLocked {
}
function setIsLocked(bool _isLocked) public onlyOwner{
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
function () external payable {
}
// ------------------------------------------------------------------------
// INCREASE token supply
// ------------------------------------------------------------------------
function mint(address to, uint value) public onlyOwner returns (bool) {
}
function _burn(address account, uint256 amount) internal {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burn(uint amount) public {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burnFrom(address from, uint amount) public {
require(<FILL_ME>)
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], amount);
_burn(from, amount);
}
function tokenToVault(address to, uint amount, uint releastTime) public onlyOwner {
}
function releaseToken() public {
}
function releateTokenTo(address to) public onlyOwner {
}
function _removeFromVault(address addr) internal {
}
function getVaultAmountFrom(address from) public view onlyOwner returns (uint amount) {
}
function getVaultAmount() public view returns (uint amount) {
}
function getVaultReleaseTimeFrom(address from) public view onlyOwner returns (uint releaseTime) {
}
function getVaultReleaseTime() public view returns (uint releaseTime) {
}
function getVaultList() public view onlyOwner returns (address[] list) {
}
}
| allowance(from,msg.sender)>=amount | 348,691 | allowance(from,msg.sender)>=amount |
null | pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EDSToken is ERC20Interface, Owned, SafeMath {
string public name = "EduShare";
string public symbol = "EDS";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
bool public isLocked;
address[] private vaultList;
mapping(address => uint) vaultAmount;
mapping(address => uint) vaultReleaseTime;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function EDSToken(address multisig, uint tokens) public {
}
modifier isNotLocked {
}
function setIsLocked(bool _isLocked) public onlyOwner{
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
function () external payable {
}
// ------------------------------------------------------------------------
// INCREASE token supply
// ------------------------------------------------------------------------
function mint(address to, uint value) public onlyOwner returns (bool) {
}
function _burn(address account, uint256 amount) internal {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burn(uint amount) public {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burnFrom(address from, uint amount) public {
}
function tokenToVault(address to, uint amount, uint releastTime) public onlyOwner {
}
function releaseToken() public {
require(<FILL_ME>)
require(block.timestamp >= vaultReleaseTime[msg.sender]);
require(balances[address(this)] >= vaultAmount[msg.sender]);
balances[msg.sender] = safeAdd(balances[msg.sender], vaultAmount[msg.sender]);
balances[address(this)] = safeSub(balances[address(this)], vaultAmount[msg.sender]);
vaultAmount[msg.sender] = 0;
_removeFromVault(msg.sender);
}
function releateTokenTo(address to) public onlyOwner {
}
function _removeFromVault(address addr) internal {
}
function getVaultAmountFrom(address from) public view onlyOwner returns (uint amount) {
}
function getVaultAmount() public view returns (uint amount) {
}
function getVaultReleaseTimeFrom(address from) public view onlyOwner returns (uint releaseTime) {
}
function getVaultReleaseTime() public view returns (uint releaseTime) {
}
function getVaultList() public view onlyOwner returns (address[] list) {
}
}
| vaultAmount[msg.sender]>0 | 348,691 | vaultAmount[msg.sender]>0 |
null | pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EDSToken is ERC20Interface, Owned, SafeMath {
string public name = "EduShare";
string public symbol = "EDS";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
bool public isLocked;
address[] private vaultList;
mapping(address => uint) vaultAmount;
mapping(address => uint) vaultReleaseTime;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function EDSToken(address multisig, uint tokens) public {
}
modifier isNotLocked {
}
function setIsLocked(bool _isLocked) public onlyOwner{
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
function () external payable {
}
// ------------------------------------------------------------------------
// INCREASE token supply
// ------------------------------------------------------------------------
function mint(address to, uint value) public onlyOwner returns (bool) {
}
function _burn(address account, uint256 amount) internal {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burn(uint amount) public {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burnFrom(address from, uint amount) public {
}
function tokenToVault(address to, uint amount, uint releastTime) public onlyOwner {
}
function releaseToken() public {
require(vaultAmount[msg.sender] > 0);
require(block.timestamp >= vaultReleaseTime[msg.sender]);
require(<FILL_ME>)
balances[msg.sender] = safeAdd(balances[msg.sender], vaultAmount[msg.sender]);
balances[address(this)] = safeSub(balances[address(this)], vaultAmount[msg.sender]);
vaultAmount[msg.sender] = 0;
_removeFromVault(msg.sender);
}
function releateTokenTo(address to) public onlyOwner {
}
function _removeFromVault(address addr) internal {
}
function getVaultAmountFrom(address from) public view onlyOwner returns (uint amount) {
}
function getVaultAmount() public view returns (uint amount) {
}
function getVaultReleaseTimeFrom(address from) public view onlyOwner returns (uint releaseTime) {
}
function getVaultReleaseTime() public view returns (uint releaseTime) {
}
function getVaultList() public view onlyOwner returns (address[] list) {
}
}
| balances[address(this)]>=vaultAmount[msg.sender] | 348,691 | balances[address(this)]>=vaultAmount[msg.sender] |
null | pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EDSToken is ERC20Interface, Owned, SafeMath {
string public name = "EduShare";
string public symbol = "EDS";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
bool public isLocked;
address[] private vaultList;
mapping(address => uint) vaultAmount;
mapping(address => uint) vaultReleaseTime;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function EDSToken(address multisig, uint tokens) public {
}
modifier isNotLocked {
}
function setIsLocked(bool _isLocked) public onlyOwner{
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
function () external payable {
}
// ------------------------------------------------------------------------
// INCREASE token supply
// ------------------------------------------------------------------------
function mint(address to, uint value) public onlyOwner returns (bool) {
}
function _burn(address account, uint256 amount) internal {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burn(uint amount) public {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burnFrom(address from, uint amount) public {
}
function tokenToVault(address to, uint amount, uint releastTime) public onlyOwner {
}
function releaseToken() public {
}
function releateTokenTo(address to) public onlyOwner {
require(<FILL_ME>)
require(block.timestamp >= vaultReleaseTime[to]);
require(balances[address(this)] >= vaultAmount[to]);
balances[to] = safeAdd(balances[to], vaultAmount[to]);
balances[address(this)] = safeSub(balances[address(this)], vaultAmount[to]);
vaultAmount[to] = 0;
_removeFromVault(to);
}
function _removeFromVault(address addr) internal {
}
function getVaultAmountFrom(address from) public view onlyOwner returns (uint amount) {
}
function getVaultAmount() public view returns (uint amount) {
}
function getVaultReleaseTimeFrom(address from) public view onlyOwner returns (uint releaseTime) {
}
function getVaultReleaseTime() public view returns (uint releaseTime) {
}
function getVaultList() public view onlyOwner returns (address[] list) {
}
}
| vaultAmount[to]>0 | 348,691 | vaultAmount[to]>0 |
null | pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract EDSToken is ERC20Interface, Owned, SafeMath {
string public name = "EduShare";
string public symbol = "EDS";
uint8 public decimals = 18;
uint public _totalSupply;
uint public startDate;
bool public isLocked;
address[] private vaultList;
mapping(address => uint) vaultAmount;
mapping(address => uint) vaultReleaseTime;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function EDSToken(address multisig, uint tokens) public {
}
modifier isNotLocked {
}
function setIsLocked(bool _isLocked) public onlyOwner{
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public isNotLocked returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
function () external payable {
}
// ------------------------------------------------------------------------
// INCREASE token supply
// ------------------------------------------------------------------------
function mint(address to, uint value) public onlyOwner returns (bool) {
}
function _burn(address account, uint256 amount) internal {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burn(uint amount) public {
}
// ------------------------------------------------------------------------
// DECREASE token supply
// ------------------------------------------------------------------------
function burnFrom(address from, uint amount) public {
}
function tokenToVault(address to, uint amount, uint releastTime) public onlyOwner {
}
function releaseToken() public {
}
function releateTokenTo(address to) public onlyOwner {
require(vaultAmount[to] > 0);
require(block.timestamp >= vaultReleaseTime[to]);
require(<FILL_ME>)
balances[to] = safeAdd(balances[to], vaultAmount[to]);
balances[address(this)] = safeSub(balances[address(this)], vaultAmount[to]);
vaultAmount[to] = 0;
_removeFromVault(to);
}
function _removeFromVault(address addr) internal {
}
function getVaultAmountFrom(address from) public view onlyOwner returns (uint amount) {
}
function getVaultAmount() public view returns (uint amount) {
}
function getVaultReleaseTimeFrom(address from) public view onlyOwner returns (uint releaseTime) {
}
function getVaultReleaseTime() public view returns (uint releaseTime) {
}
function getVaultList() public view onlyOwner returns (address[] list) {
}
}
| balances[address(this)]>=vaultAmount[to] | 348,691 | balances[address(this)]>=vaultAmount[to] |
"buy previous level first" | pragma solidity >=0.4.22 <0.6.0;
contract DonatePlan {
struct User {
uint id;
address referrer;
uint partnersCount;
mapping(uint8 => bool) activeLevels;
mapping(uint8 => Matrix) matrix;
}
struct Matrix {
address currentReferrer;
address[] referrals;
bool blocked;
uint reinvestCount;
}
uint8 public constant LAST_LEVEL = 9;
mapping(address => User) public users;
mapping(uint => address) public idToAddress;
mapping(uint => address) public userIds;
mapping(address => uint) public balances;
uint public lastUserId = 2;
address private owner;
mapping(uint8 => uint) public levelPrice;
event Registration(address indexed user, address indexed referrer, uint indexed userId, uint referrerId);
event Reinvest(address indexed user, address indexed currentReferrer, address indexed caller, uint8 level);
event Upgrade(address indexed user, address indexed referrer, uint8 level);
event NewUserPlace(address indexed user, address indexed referrer, uint8 level, uint8 place);
event MissedEthReceive(address indexed receiver, address indexed from, uint8 level);
event SentExtraEthDividends(address indexed from, address indexed receiver, uint8 level);
event SentExtraCoinDividends(address indexed from, address indexed receiver, uint price, uint8 level);
constructor(address ownerAddress) public {
}
function drawBalance() external payable {
}
function() external payable {
}
function registrationExternal(address referrerAddress) external payable {
}
function registration(address userAddress, address referrerAddress) private {
}
function buyNewLevel(uint8 level) external payable {
require(isUserExists(msg.sender), "user is not exists. Register first.");
require(msg.value == levelPrice[level], "invalid price");
require(level > 1 && level <= LAST_LEVEL, "invalid level");
require(<FILL_ME>)
require(!users[msg.sender].activeLevels[level], "level already activated");
if (users[msg.sender].matrix[level-1].blocked) {
users[msg.sender].matrix[level-1].blocked = false;
}
address freeReferrer = findFreeReferrer(msg.sender, level);
users[msg.sender].matrix[level].currentReferrer = freeReferrer;
users[msg.sender].activeLevels[level] = true;
updateReferrer(msg.sender, freeReferrer, level);
emit Upgrade(msg.sender, freeReferrer, level);
}
function updateReferrer(address userAddress, address referrerAddress, uint8 level) private {
}
function findFreeReferrer(address userAddress, uint8 level) public view returns(address) {
}
function usersactiveLevels(address userAddress, uint8 level) public view returns(bool) {
}
function usersMatrix(address userAddress, uint8 level) public view returns(address, address[] memory, bool) {
}
function isUserExists(address user) public view returns (bool) {
}
function findEthReceiver(address userAddress, address _from, uint8 level) private returns(address, bool) {
}
function sendETHDividends(address userAddress, address _from, uint8 level) private {
}
function bytesToAddress(bytes memory bys) private pure returns (address addr) {
}
}
| users[msg.sender].activeLevels[level-1],"buy previous level first" | 348,716 | users[msg.sender].activeLevels[level-1] |
"level already activated" | pragma solidity >=0.4.22 <0.6.0;
contract DonatePlan {
struct User {
uint id;
address referrer;
uint partnersCount;
mapping(uint8 => bool) activeLevels;
mapping(uint8 => Matrix) matrix;
}
struct Matrix {
address currentReferrer;
address[] referrals;
bool blocked;
uint reinvestCount;
}
uint8 public constant LAST_LEVEL = 9;
mapping(address => User) public users;
mapping(uint => address) public idToAddress;
mapping(uint => address) public userIds;
mapping(address => uint) public balances;
uint public lastUserId = 2;
address private owner;
mapping(uint8 => uint) public levelPrice;
event Registration(address indexed user, address indexed referrer, uint indexed userId, uint referrerId);
event Reinvest(address indexed user, address indexed currentReferrer, address indexed caller, uint8 level);
event Upgrade(address indexed user, address indexed referrer, uint8 level);
event NewUserPlace(address indexed user, address indexed referrer, uint8 level, uint8 place);
event MissedEthReceive(address indexed receiver, address indexed from, uint8 level);
event SentExtraEthDividends(address indexed from, address indexed receiver, uint8 level);
event SentExtraCoinDividends(address indexed from, address indexed receiver, uint price, uint8 level);
constructor(address ownerAddress) public {
}
function drawBalance() external payable {
}
function() external payable {
}
function registrationExternal(address referrerAddress) external payable {
}
function registration(address userAddress, address referrerAddress) private {
}
function buyNewLevel(uint8 level) external payable {
require(isUserExists(msg.sender), "user is not exists. Register first.");
require(msg.value == levelPrice[level], "invalid price");
require(level > 1 && level <= LAST_LEVEL, "invalid level");
require(users[msg.sender].activeLevels[level-1], "buy previous level first");
require(<FILL_ME>)
if (users[msg.sender].matrix[level-1].blocked) {
users[msg.sender].matrix[level-1].blocked = false;
}
address freeReferrer = findFreeReferrer(msg.sender, level);
users[msg.sender].matrix[level].currentReferrer = freeReferrer;
users[msg.sender].activeLevels[level] = true;
updateReferrer(msg.sender, freeReferrer, level);
emit Upgrade(msg.sender, freeReferrer, level);
}
function updateReferrer(address userAddress, address referrerAddress, uint8 level) private {
}
function findFreeReferrer(address userAddress, uint8 level) public view returns(address) {
}
function usersactiveLevels(address userAddress, uint8 level) public view returns(bool) {
}
function usersMatrix(address userAddress, uint8 level) public view returns(address, address[] memory, bool) {
}
function isUserExists(address user) public view returns (bool) {
}
function findEthReceiver(address userAddress, address _from, uint8 level) private returns(address, bool) {
}
function sendETHDividends(address userAddress, address _from, uint8 level) private {
}
function bytesToAddress(bytes memory bys) private pure returns (address addr) {
}
}
| !users[msg.sender].activeLevels[level],"level already activated" | 348,716 | !users[msg.sender].activeLevels[level] |
"Redeem: insufficient amount of MintPasses" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import "./IMetaHero.sol";
import "./MetaHeroGeneGenerator.sol";
/*
* @title ERC721 token for MetaHero, redeemable through burning MintPass tokens
*
* @author Niftydude
*/
contract MetaHero is IMetaHero, ERC721Enumerable, ERC721Pausable, ERC721Burnable, Ownable {
using MetaHeroGeneGenerator for MetaHeroGeneGenerator.Gene;
using Strings for uint256;
uint256 constant MAX_REDEEM = 40;
uint256 public windowOpen;
string private baseTokenURI;
string private ipfsURI;
string public arweaveAssets;
uint256 private ipfsAt;
MintPassContract public mintPassContract;
mapping (uint256 => uint256) internal _genes;
MetaHeroGeneGenerator.Gene internal geneGenerator;
event Redeemed(address indexed account, uint256 amount);
/**
* @notice Constructor to create MetaHero contract
*
* @param _symbol the token symbol
* @param _windowOpen UNIX timestamp for redeem start
* @param _baseTokenURI the respective base URI
* @param _mintPassToken contract address of MintPass token to be burned
*/
constructor (
string memory _name,
string memory _symbol,
uint256 _windowOpen,
string memory _baseTokenURI,
address _mintPassToken,
string memory _arweaveAssets
) ERC721(_name, _symbol) {
}
/**
* @notice Change the base URI for returning metadata
*
* @param _baseTokenURI the respective base URI
*/
function setBaseURI(string memory _baseTokenURI) external override onlyOwner {
}
/**
* @notice Change the base URI for returning metadata
*
* @param _ipfsURI the respective ipfs base URI
*/
function setIpfsURI(string memory _ipfsURI) external override onlyOwner {
}
/**
* @notice Change last ipfs token index
*
* @param at the token index
*/
function endIpfsUriAt(uint256 at) external onlyOwner {
}
/**
* @notice Pause redeems until unpause is called
*/
function pause() external override onlyOwner {
}
/**
* @notice Unpause redeems until pause is called
*/
function unpause() external override onlyOwner {
}
/**
* @notice Set pointer to arweave assets
*
* @param _arweaveAssets pointer to images on Arweave network
*/
function setArweaveAssets(string memory _arweaveAssets) external onlyOwner {
}
/**
* @notice Configure time to enable redeem functionality
*
* @param _windowOpen UNIX timestamp for redeem start
*/
function setRedeemStart(uint256 _windowOpen) external override onlyOwner {
}
/**
* @notice Redeem specified amount of MintPass tokens for MetaHero
*
* @param amount the amount of MintPasses to redeem
*/
function redeem(uint256 amount) external override {
require(msg.sender == tx.origin, "Redeem: not allowed from contract");
require(!paused(), "Redeem: paused");
require(amount <= MAX_REDEEM, "Redeem: Max amount exceeded");
require(block.timestamp > windowOpen || msg.sender == owner(), "Redeem: Not started yet");
require(<FILL_ME>)
mintPassContract.burnFromRedeem(msg.sender, 0, amount);
for(uint256 i = 0; i < amount; i++) {
uint256 tokenId = totalSupply() + 1;
_genes[tokenId] = geneGenerator.random();
_mint(msg.sender, tokenId);
}
emit Redeemed(msg.sender, amount);
}
/**
* @notice returns the gene combination for a given MetaHero
*
* @param tokenId the MetaHero id to return genes for
*/
function geneOf(uint256 tokenId) public view virtual override returns (uint256 gene) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721, ERC721Enumerable) returns (bool) {
}
function _baseURI(uint256 tokenId) internal view returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Enumerable, ERC721Pausable) {
}
}
interface MintPassContract {
function burnFromRedeem(address account, uint256 id, uint256 amount) external;
function balanceOf(address account, uint256 id) external view returns (uint256);
}
| mintPassContract.balanceOf(msg.sender,0)>=amount,"Redeem: insufficient amount of MintPasses" | 348,801 | mintPassContract.balanceOf(msg.sender,0)>=amount |
null | pragma solidity ^0.4.16;
library Math {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract Token {
/// total amount of tokens
uint256 public totalSupply;
uint256 public decimals;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract Cloud is Token {
using Math for uint256;
bool trading=false;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function transfer(address _to, uint256 _value) canTrade returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) canTrade returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
}
/* Checks if tokens can be transferred from one account to another. Trading to be enabled after initial token release */
modifier canTrade {
}
function setTrade(bool allow) onlyOwner {
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
/* Public variables of the token */
event Invested(address investor, uint256 tokens);
uint256 public employeeShare=8;
// Wallets - 4 employee
address[4] employeeWallets = [0x9caeD53A6C6E91546946dD866dFD66c0aaB9f347,0xf1Df495BE71d1E5EdEbCb39D85D5F6b620aaAF47,0xa3C38bc8dD6e26eCc0D64d5B25f5ce855bb57Cd5,0x4d67a23b62399eDec07ad9c0f748D89655F0a0CB];
string public name;
string public symbol;
address public owner;
uint256 public tokensReleased=0;
bool canRelease=false;
/* Initializes contract with initial supply tokens to the owner of the contract */
function Cloud(
uint256 _initialAmount,
uint256 _decimalUnits,
string _tokenName,
string _tokenSymbol,
address ownerWallet
) {
}
/* Freezing tokens */
function freezeAccount(address target, bool freeze) onlyOwner{
}
/* Authenticating owner */
modifier onlyOwner {
}
/* Allow and restrict of release of tokens */
function releaseTokens(bool allow) onlyOwner {
}
/// @param receiver The address of the account which will receive the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the token transfer was successful or not was successful or not
function invest(address receiver, uint256 _value) onlyOwner returns (bool success) {
require(canRelease);
require(_value > 0);
uint256 numTokens = _value;
uint256 employeeTokens = 0;
uint256 employeeTokenShare=0;
// divide employee tokens by 4 shares
employeeTokens = numTokens.mul(employeeShare).div(100);
employeeTokenShare = employeeTokens.div(employeeWallets.length);
//split tokens for different wallets of employees and company
approve(owner,employeeTokens.add(numTokens));
for(uint i = 0; i < employeeWallets.length; i++)
{
require(<FILL_ME>)
}
require(transferFrom(owner, receiver, numTokens));
tokensReleased = tokensReleased.add(numTokens).add(employeeTokens.mul(4));
Invested(receiver,numTokens);
return true;
}
}
| transferFrom(owner,employeeWallets[i],employeeTokenShare) | 348,806 | transferFrom(owner,employeeWallets[i],employeeTokenShare) |
null | pragma solidity ^0.4.16;
library Math {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract Token {
/// total amount of tokens
uint256 public totalSupply;
uint256 public decimals;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract Cloud is Token {
using Math for uint256;
bool trading=false;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function transfer(address _to, uint256 _value) canTrade returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) canTrade returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
}
/* Checks if tokens can be transferred from one account to another. Trading to be enabled after initial token release */
modifier canTrade {
}
function setTrade(bool allow) onlyOwner {
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
/* Public variables of the token */
event Invested(address investor, uint256 tokens);
uint256 public employeeShare=8;
// Wallets - 4 employee
address[4] employeeWallets = [0x9caeD53A6C6E91546946dD866dFD66c0aaB9f347,0xf1Df495BE71d1E5EdEbCb39D85D5F6b620aaAF47,0xa3C38bc8dD6e26eCc0D64d5B25f5ce855bb57Cd5,0x4d67a23b62399eDec07ad9c0f748D89655F0a0CB];
string public name;
string public symbol;
address public owner;
uint256 public tokensReleased=0;
bool canRelease=false;
/* Initializes contract with initial supply tokens to the owner of the contract */
function Cloud(
uint256 _initialAmount,
uint256 _decimalUnits,
string _tokenName,
string _tokenSymbol,
address ownerWallet
) {
}
/* Freezing tokens */
function freezeAccount(address target, bool freeze) onlyOwner{
}
/* Authenticating owner */
modifier onlyOwner {
}
/* Allow and restrict of release of tokens */
function releaseTokens(bool allow) onlyOwner {
}
/// @param receiver The address of the account which will receive the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the token transfer was successful or not was successful or not
function invest(address receiver, uint256 _value) onlyOwner returns (bool success) {
require(canRelease);
require(_value > 0);
uint256 numTokens = _value;
uint256 employeeTokens = 0;
uint256 employeeTokenShare=0;
// divide employee tokens by 4 shares
employeeTokens = numTokens.mul(employeeShare).div(100);
employeeTokenShare = employeeTokens.div(employeeWallets.length);
//split tokens for different wallets of employees and company
approve(owner,employeeTokens.add(numTokens));
for(uint i = 0; i < employeeWallets.length; i++)
{
require(transferFrom(owner, employeeWallets[i], employeeTokenShare));
}
require(<FILL_ME>)
tokensReleased = tokensReleased.add(numTokens).add(employeeTokens.mul(4));
Invested(receiver,numTokens);
return true;
}
}
| transferFrom(owner,receiver,numTokens) | 348,806 | transferFrom(owner,receiver,numTokens) |
"Max supply exceeded!" | pragma solidity >=0.7.0 <0.9.0;
contract Zizis is ERC721, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private supply;
string public uriPrefix = "";
string public uriSuffix = ".json";
string public hiddenMetadataUri;
uint256 public cost = 0.03 ether;
uint256 public whitelistCost = 0.00 ether;
uint256 public maxSupply = 10800;
uint256 public wlSupply = 1080;
uint256 public maxMintAmountPerTx = 18;
uint256 public nftPerAddressLimit = 18;
bool public paused = true;
bool public whitelistPaused = true;
bool public artBlootPaused = true;
bool public revealed = false;
bool public onlyWhitelisted = true;
address[] public whitelistedAddresses;
address public artBlootContract;
mapping(address => uint256) public addressMintedBalance;
constructor() ERC721("ZiZis by Zanolino", "ZIZI") {
}
modifier mintCompliance(uint256 _mintAmount) {
}
modifier mintComplianceWL(uint256 _mintAmount) {
require(_mintAmount > 0 && _mintAmount <= maxMintAmountPerTx, "Invalid mint amount!");
require(<FILL_ME>)
_;
}
function totalSupply() public view returns (uint256) {
}
function publicMint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
}
function whitelistMint(uint256 _mintAmount) public payable mintComplianceWL(_mintAmount) {
}
function artBlootMint(uint256 _mintAmount) public payable mintComplianceWL(_mintAmount) {
}
function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner {
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setRevealed(bool _state) public onlyOwner {
}
function setArtBlootAddress(address _newArtBlootContract) public onlyOwner {
}
function setCost(uint256 _cost) public onlyOwner {
}
function setWLCost(uint256 _cost) public onlyOwner {
}
function setMaxSupply(uint256 _updateMaxSupply) public onlyOwner {
}
function setWhitelistSupply(uint256 _whitelistSupply) public onlyOwner {
}
function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner {
}
function setNftPerAddressLimit(uint256 _nftPerAddressLimit) public onlyOwner {
}
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
}
function setPaused(bool _state) public onlyOwner {
}
function setWLPaused(bool _state) public onlyOwner {
}
function artBlootMintPaused(bool _state) public onlyOwner {
}
function isWhitelisted(address _user) public view returns (bool) {
}
function whitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function _mintLoop(address _receiver, uint256 _mintAmount) internal {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| supply.current()+_mintAmount<=wlSupply,"Max supply exceeded!" | 348,863 | supply.current()+_mintAmount<=wlSupply |
"The contract is paused!" | pragma solidity >=0.7.0 <0.9.0;
contract Zizis is ERC721, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private supply;
string public uriPrefix = "";
string public uriSuffix = ".json";
string public hiddenMetadataUri;
uint256 public cost = 0.03 ether;
uint256 public whitelistCost = 0.00 ether;
uint256 public maxSupply = 10800;
uint256 public wlSupply = 1080;
uint256 public maxMintAmountPerTx = 18;
uint256 public nftPerAddressLimit = 18;
bool public paused = true;
bool public whitelistPaused = true;
bool public artBlootPaused = true;
bool public revealed = false;
bool public onlyWhitelisted = true;
address[] public whitelistedAddresses;
address public artBlootContract;
mapping(address => uint256) public addressMintedBalance;
constructor() ERC721("ZiZis by Zanolino", "ZIZI") {
}
modifier mintCompliance(uint256 _mintAmount) {
}
modifier mintComplianceWL(uint256 _mintAmount) {
}
function totalSupply() public view returns (uint256) {
}
function publicMint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
}
function whitelistMint(uint256 _mintAmount) public payable mintComplianceWL(_mintAmount) {
require(<FILL_ME>)
require(isWhitelisted(msg.sender), "user is not whitelisted");
uint256 ownerMintedCount = addressMintedBalance[msg.sender];
require(ownerMintedCount + _mintAmount <= nftPerAddressLimit, "max NFT per address exceeded");
require(msg.value >= whitelistCost * _mintAmount, "Insufficient funds!");
_mintLoop(msg.sender, _mintAmount);
}
function artBlootMint(uint256 _mintAmount) public payable mintComplianceWL(_mintAmount) {
}
function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner {
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setRevealed(bool _state) public onlyOwner {
}
function setArtBlootAddress(address _newArtBlootContract) public onlyOwner {
}
function setCost(uint256 _cost) public onlyOwner {
}
function setWLCost(uint256 _cost) public onlyOwner {
}
function setMaxSupply(uint256 _updateMaxSupply) public onlyOwner {
}
function setWhitelistSupply(uint256 _whitelistSupply) public onlyOwner {
}
function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner {
}
function setNftPerAddressLimit(uint256 _nftPerAddressLimit) public onlyOwner {
}
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
}
function setPaused(bool _state) public onlyOwner {
}
function setWLPaused(bool _state) public onlyOwner {
}
function artBlootMintPaused(bool _state) public onlyOwner {
}
function isWhitelisted(address _user) public view returns (bool) {
}
function whitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function _mintLoop(address _receiver, uint256 _mintAmount) internal {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| !whitelistPaused,"The contract is paused!" | 348,863 | !whitelistPaused |
"The contract is paused!" | pragma solidity >=0.7.0 <0.9.0;
contract Zizis is ERC721, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private supply;
string public uriPrefix = "";
string public uriSuffix = ".json";
string public hiddenMetadataUri;
uint256 public cost = 0.03 ether;
uint256 public whitelistCost = 0.00 ether;
uint256 public maxSupply = 10800;
uint256 public wlSupply = 1080;
uint256 public maxMintAmountPerTx = 18;
uint256 public nftPerAddressLimit = 18;
bool public paused = true;
bool public whitelistPaused = true;
bool public artBlootPaused = true;
bool public revealed = false;
bool public onlyWhitelisted = true;
address[] public whitelistedAddresses;
address public artBlootContract;
mapping(address => uint256) public addressMintedBalance;
constructor() ERC721("ZiZis by Zanolino", "ZIZI") {
}
modifier mintCompliance(uint256 _mintAmount) {
}
modifier mintComplianceWL(uint256 _mintAmount) {
}
function totalSupply() public view returns (uint256) {
}
function publicMint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
}
function whitelistMint(uint256 _mintAmount) public payable mintComplianceWL(_mintAmount) {
}
function artBlootMint(uint256 _mintAmount) public payable mintComplianceWL(_mintAmount) {
require(<FILL_ME>)
IERC721 token = IERC721(artBlootContract);
uint256 ownerAmount = token.balanceOf(msg.sender);
require(ownerAmount >= 1, "You do not own artBloots");
uint256 ownerMintedCount = addressMintedBalance[msg.sender];
require(ownerMintedCount + _mintAmount <= nftPerAddressLimit, "max NFT per address exceeded");
require(msg.value >= whitelistCost * _mintAmount, "Insufficient funds!");
_mintLoop(msg.sender, _mintAmount);
}
function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner {
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setRevealed(bool _state) public onlyOwner {
}
function setArtBlootAddress(address _newArtBlootContract) public onlyOwner {
}
function setCost(uint256 _cost) public onlyOwner {
}
function setWLCost(uint256 _cost) public onlyOwner {
}
function setMaxSupply(uint256 _updateMaxSupply) public onlyOwner {
}
function setWhitelistSupply(uint256 _whitelistSupply) public onlyOwner {
}
function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner {
}
function setNftPerAddressLimit(uint256 _nftPerAddressLimit) public onlyOwner {
}
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
}
function setPaused(bool _state) public onlyOwner {
}
function setWLPaused(bool _state) public onlyOwner {
}
function artBlootMintPaused(bool _state) public onlyOwner {
}
function isWhitelisted(address _user) public view returns (bool) {
}
function whitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function _mintLoop(address _receiver, uint256 _mintAmount) internal {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| !artBlootPaused,"The contract is paused!" | 348,863 | !artBlootPaused |
"There is low token balance in contract" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract Ownable {
address payable public _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address payable newOwner) public onlyOwner {
}
}
interface Token {
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
}
contract ICO is Ownable, ReentrancyGuard{
using SafeMath for uint;
struct User {
uint256 bnb_paid;
uint40 deposit_time;
uint256 total_deposits;
}
uint8[] public ref_bonuses;
address public tokenAddr;
uint256 public tokenPriceBnb;
uint256 public claimDate;
uint256 public startDate;
uint256 public endDate;
uint256 public bnbCollected;
uint256 public tokenDecimal = 18;
uint256 public bnbDecimal = 18;
mapping(address => User) public users;
event TokenTransfer(address beneficiary, uint amount);
event Upline(address indexed addr, address indexed upline);
mapping (address => uint256) public balances;
mapping(address => uint256) public tokenExchanged;
constructor(address _tokenAddr, uint256 tokenPrice, uint256 _claimDate, uint256 _startDate, uint256 _endDate) {
}
receive() payable external {
}
function ExchangeBNBforTokenMannual() public payable nonReentrant{
}
function claimToken () external nonReentrant{
require(block.timestamp > claimDate,"Claim Date Not Reached");
uint256 tokens = tokenExchanged[msg.sender];
address userAdd = msg.sender;
tokenExchanged[msg.sender] = 0;
require(<FILL_ME>)
require(Token(tokenAddr).transfer(userAdd, tokens),"Transfer Failed");
}
function updateTokenPrice(uint256 newTokenValue) public onlyOwner {
}
function updateTokenDecimal(uint256 newDecimal) public onlyOwner {
}
function updateTokenAddress(address newTokenAddr) public onlyOwner {
}
function updateClaimDate(uint256 newValue) public onlyOwner {
}
function withdrawTokens(address _tokenAddr, address beneficiary) external onlyOwner nonReentrant{
}
function withdrawCrypto(address payable beneficiary) external onlyOwner nonReentrant {
}
function tokenBalance() public view returns (uint256){
}
function bnbBalance() public view returns (uint256){
}
}
| Token(tokenAddr).balanceOf(address(this))>=tokens,"There is low token balance in contract" | 348,872 | Token(tokenAddr).balanceOf(address(this))>=tokens |
"Transfer Failed" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract Ownable {
address payable public _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address payable newOwner) public onlyOwner {
}
}
interface Token {
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
}
contract ICO is Ownable, ReentrancyGuard{
using SafeMath for uint;
struct User {
uint256 bnb_paid;
uint40 deposit_time;
uint256 total_deposits;
}
uint8[] public ref_bonuses;
address public tokenAddr;
uint256 public tokenPriceBnb;
uint256 public claimDate;
uint256 public startDate;
uint256 public endDate;
uint256 public bnbCollected;
uint256 public tokenDecimal = 18;
uint256 public bnbDecimal = 18;
mapping(address => User) public users;
event TokenTransfer(address beneficiary, uint amount);
event Upline(address indexed addr, address indexed upline);
mapping (address => uint256) public balances;
mapping(address => uint256) public tokenExchanged;
constructor(address _tokenAddr, uint256 tokenPrice, uint256 _claimDate, uint256 _startDate, uint256 _endDate) {
}
receive() payable external {
}
function ExchangeBNBforTokenMannual() public payable nonReentrant{
}
function claimToken () external nonReentrant{
require(block.timestamp > claimDate,"Claim Date Not Reached");
uint256 tokens = tokenExchanged[msg.sender];
address userAdd = msg.sender;
tokenExchanged[msg.sender] = 0;
require(Token(tokenAddr).balanceOf(address(this)) >= tokens, "There is low token balance in contract");
require(<FILL_ME>)
}
function updateTokenPrice(uint256 newTokenValue) public onlyOwner {
}
function updateTokenDecimal(uint256 newDecimal) public onlyOwner {
}
function updateTokenAddress(address newTokenAddr) public onlyOwner {
}
function updateClaimDate(uint256 newValue) public onlyOwner {
}
function withdrawTokens(address _tokenAddr, address beneficiary) external onlyOwner nonReentrant{
}
function withdrawCrypto(address payable beneficiary) external onlyOwner nonReentrant {
}
function tokenBalance() public view returns (uint256){
}
function bnbBalance() public view returns (uint256){
}
}
| Token(tokenAddr).transfer(userAdd,tokens),"Transfer Failed" | 348,872 | Token(tokenAddr).transfer(userAdd,tokens) |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract Ownable {
address payable public _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address payable newOwner) public onlyOwner {
}
}
interface Token {
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
}
contract ICO is Ownable, ReentrancyGuard{
using SafeMath for uint;
struct User {
uint256 bnb_paid;
uint40 deposit_time;
uint256 total_deposits;
}
uint8[] public ref_bonuses;
address public tokenAddr;
uint256 public tokenPriceBnb;
uint256 public claimDate;
uint256 public startDate;
uint256 public endDate;
uint256 public bnbCollected;
uint256 public tokenDecimal = 18;
uint256 public bnbDecimal = 18;
mapping(address => User) public users;
event TokenTransfer(address beneficiary, uint amount);
event Upline(address indexed addr, address indexed upline);
mapping (address => uint256) public balances;
mapping(address => uint256) public tokenExchanged;
constructor(address _tokenAddr, uint256 tokenPrice, uint256 _claimDate, uint256 _startDate, uint256 _endDate) {
}
receive() payable external {
}
function ExchangeBNBforTokenMannual() public payable nonReentrant{
}
function claimToken () external nonReentrant{
}
function updateTokenPrice(uint256 newTokenValue) public onlyOwner {
}
function updateTokenDecimal(uint256 newDecimal) public onlyOwner {
}
function updateTokenAddress(address newTokenAddr) public onlyOwner {
}
function updateClaimDate(uint256 newValue) public onlyOwner {
}
function withdrawTokens(address _tokenAddr, address beneficiary) external onlyOwner nonReentrant{
require(<FILL_ME>)
}
function withdrawCrypto(address payable beneficiary) external onlyOwner nonReentrant {
}
function tokenBalance() public view returns (uint256){
}
function bnbBalance() public view returns (uint256){
}
}
| Token(_tokenAddr).transfer(beneficiary,Token(_tokenAddr).balanceOf(address(this))) | 348,872 | Token(_tokenAddr).transfer(beneficiary,Token(_tokenAddr).balanceOf(address(this))) |
"Max limit exceeded" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract KillerKangarooz is ERC721, Ownable {
using Strings for uint256;
uint256 public tokenCount;
string private baseURI;
uint256 public publicSalePrice = 0.04 ether;
uint256 public whitelistPrice = 0.02 ether;
bool public whitelistSaleIsActive = false;
bool public publicSaleIsActive = false;
bytes32 public whitelistMerkleRoot;
mapping(address => bool) private hasMintedWhitelist;
address communityWallet = 0x4668C3142ae6cB78BD677a1e5d27053C90881008;
constructor() ERC721("Killer Kangarooz", "KK") {
}
function _verify(
bytes32[] memory proof,
bytes32 merkleRoot
) internal view returns (bool) {
}
function mint(uint256 amount)
external
payable
{
require(publicSaleIsActive, "Public sale is not active");
require(msg.value == publicSalePrice * amount, "Incorrect ETH value sent");
require(amount < 11, "Cannot mint more than 10");
require(<FILL_ME>)
for (uint256 i; i < amount; i++) {
tokenCount++;
_safeMint(msg.sender, tokenCount);
}
}
function mintWhitelist(uint256 amount, bytes32[] calldata proof)
external
payable
{
}
function setPublicSaleIsActive(bool _state) public onlyOwner {
}
function setWhitelistSaleIsActive(bool _state) public onlyOwner {
}
function setWhitelistMerkleRoot(bytes32 merkleRoot) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
}
| tokenCount+amount<=5000,"Max limit exceeded" | 348,873 | tokenCount+amount<=5000 |
"User has already minted" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract KillerKangarooz is ERC721, Ownable {
using Strings for uint256;
uint256 public tokenCount;
string private baseURI;
uint256 public publicSalePrice = 0.04 ether;
uint256 public whitelistPrice = 0.02 ether;
bool public whitelistSaleIsActive = false;
bool public publicSaleIsActive = false;
bytes32 public whitelistMerkleRoot;
mapping(address => bool) private hasMintedWhitelist;
address communityWallet = 0x4668C3142ae6cB78BD677a1e5d27053C90881008;
constructor() ERC721("Killer Kangarooz", "KK") {
}
function _verify(
bytes32[] memory proof,
bytes32 merkleRoot
) internal view returns (bool) {
}
function mint(uint256 amount)
external
payable
{
}
function mintWhitelist(uint256 amount, bytes32[] calldata proof)
external
payable
{
require(whitelistSaleIsActive, "Whitelist sale is not active");
require(<FILL_ME>)
require(msg.value == whitelistPrice * amount, "Incorrect ETH value sent");
require(amount < 6, "Cannot mint more than 5");
require(tokenCount + amount <= 5000, "Max limit exceeded");
require(_verify(proof, whitelistMerkleRoot), "Invalid proof");
hasMintedWhitelist[msg.sender] = true;
for (uint256 i; i < amount; i++) {
tokenCount++;
_safeMint(msg.sender, tokenCount);
}
}
function setPublicSaleIsActive(bool _state) public onlyOwner {
}
function setWhitelistSaleIsActive(bool _state) public onlyOwner {
}
function setWhitelistMerkleRoot(bytes32 merkleRoot) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
}
| !hasMintedWhitelist[msg.sender],"User has already minted" | 348,873 | !hasMintedWhitelist[msg.sender] |
"Invalid proof" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract KillerKangarooz is ERC721, Ownable {
using Strings for uint256;
uint256 public tokenCount;
string private baseURI;
uint256 public publicSalePrice = 0.04 ether;
uint256 public whitelistPrice = 0.02 ether;
bool public whitelistSaleIsActive = false;
bool public publicSaleIsActive = false;
bytes32 public whitelistMerkleRoot;
mapping(address => bool) private hasMintedWhitelist;
address communityWallet = 0x4668C3142ae6cB78BD677a1e5d27053C90881008;
constructor() ERC721("Killer Kangarooz", "KK") {
}
function _verify(
bytes32[] memory proof,
bytes32 merkleRoot
) internal view returns (bool) {
}
function mint(uint256 amount)
external
payable
{
}
function mintWhitelist(uint256 amount, bytes32[] calldata proof)
external
payable
{
require(whitelistSaleIsActive, "Whitelist sale is not active");
require(!hasMintedWhitelist[msg.sender], "User has already minted");
require(msg.value == whitelistPrice * amount, "Incorrect ETH value sent");
require(amount < 6, "Cannot mint more than 5");
require(tokenCount + amount <= 5000, "Max limit exceeded");
require(<FILL_ME>)
hasMintedWhitelist[msg.sender] = true;
for (uint256 i; i < amount; i++) {
tokenCount++;
_safeMint(msg.sender, tokenCount);
}
}
function setPublicSaleIsActive(bool _state) public onlyOwner {
}
function setWhitelistSaleIsActive(bool _state) public onlyOwner {
}
function setWhitelistMerkleRoot(bytes32 merkleRoot) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
}
| _verify(proof,whitelistMerkleRoot),"Invalid proof" | 348,873 | _verify(proof,whitelistMerkleRoot) |
"Max supply reached" | // SPDX-License-Identifier: MIT
// Creator: @jessefriedland
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
/**
* @dev Extension of ERC1155 that adds tracking of total and max supply per id.
*
* Useful for scenarios where Fungible and Non-fungible tokens have to be
* clearly identified.
*/
abstract contract ERC1155MaxSupply is ERC1155 {
struct Supply {
uint80 totalSupply;
uint80 maxSupply;
uint80 numberBurned;
bool retired;
}
string public _name;
string public _symbol;
mapping(uint256 => Supply) private _supplyInfo;
constructor(string memory name_, string memory symbol_) {
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual override {
require(<FILL_ME>)
super._mint(to, id, amount, data);
}
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
}
/**
* @dev Total amount of tokens in with a given id.
*/
function totalSupply(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Total amount of tokens minted for a given id.
*/
function totalMinted(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Max supply for a given id.
*/
function maxSupply(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Is a given id retired?
*/
function retired(uint256 id) public view virtual returns (bool) {
}
/**
* @dev Indicates whether any token exist with a given id, or not.
*/
function exists(uint256 id) public view virtual returns (bool) {
}
function _setMaxSupply(
uint256 id,
uint256 supply,
bool _retired
) internal virtual {
}
function _retire(uint256 id) internal virtual {
}
/**
* @dev Returns the token collection name.
*/
function name() public view virtual returns (string memory) {
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual returns (string memory) {
}
/**
* @dev See {ERC1155-_beforeTokenTransfer}.
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
}
}
| totalMinted(id)+amount<=maxSupply(id),"Max supply reached" | 349,053 | totalMinted(id)+amount<=maxSupply(id) |
"Max supply reached" | // SPDX-License-Identifier: MIT
// Creator: @jessefriedland
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
/**
* @dev Extension of ERC1155 that adds tracking of total and max supply per id.
*
* Useful for scenarios where Fungible and Non-fungible tokens have to be
* clearly identified.
*/
abstract contract ERC1155MaxSupply is ERC1155 {
struct Supply {
uint80 totalSupply;
uint80 maxSupply;
uint80 numberBurned;
bool retired;
}
string public _name;
string public _symbol;
mapping(uint256 => Supply) private _supplyInfo;
constructor(string memory name_, string memory symbol_) {
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual override {
}
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
for (uint256 i = 0; i < ids.length; i++) {
require(<FILL_ME>)
}
super._mintBatch(to, ids, amounts, data);
}
/**
* @dev Total amount of tokens in with a given id.
*/
function totalSupply(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Total amount of tokens minted for a given id.
*/
function totalMinted(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Max supply for a given id.
*/
function maxSupply(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Is a given id retired?
*/
function retired(uint256 id) public view virtual returns (bool) {
}
/**
* @dev Indicates whether any token exist with a given id, or not.
*/
function exists(uint256 id) public view virtual returns (bool) {
}
function _setMaxSupply(
uint256 id,
uint256 supply,
bool _retired
) internal virtual {
}
function _retire(uint256 id) internal virtual {
}
/**
* @dev Returns the token collection name.
*/
function name() public view virtual returns (string memory) {
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual returns (string memory) {
}
/**
* @dev See {ERC1155-_beforeTokenTransfer}.
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
}
}
| totalMinted(ids[i])+amounts[i]<=maxSupply(ids[i]),"Max supply reached" | 349,053 | totalMinted(ids[i])+amounts[i]<=maxSupply(ids[i]) |
"ERC1155: Cannot adjust the max supply" | // SPDX-License-Identifier: MIT
// Creator: @jessefriedland
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
/**
* @dev Extension of ERC1155 that adds tracking of total and max supply per id.
*
* Useful for scenarios where Fungible and Non-fungible tokens have to be
* clearly identified.
*/
abstract contract ERC1155MaxSupply is ERC1155 {
struct Supply {
uint80 totalSupply;
uint80 maxSupply;
uint80 numberBurned;
bool retired;
}
string public _name;
string public _symbol;
mapping(uint256 => Supply) private _supplyInfo;
constructor(string memory name_, string memory symbol_) {
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual override {
}
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
}
/**
* @dev Total amount of tokens in with a given id.
*/
function totalSupply(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Total amount of tokens minted for a given id.
*/
function totalMinted(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Max supply for a given id.
*/
function maxSupply(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Is a given id retired?
*/
function retired(uint256 id) public view virtual returns (bool) {
}
/**
* @dev Indicates whether any token exist with a given id, or not.
*/
function exists(uint256 id) public view virtual returns (bool) {
}
function _setMaxSupply(
uint256 id,
uint256 supply,
bool _retired
) internal virtual {
require(<FILL_ME>)
require(supply > _supplyInfo[id].maxSupply, "ERC1155: Cannot lower the max supply");
_supplyInfo[id].maxSupply = uint80(supply);
_supplyInfo[id].retired = _retired;
}
function _retire(uint256 id) internal virtual {
}
/**
* @dev Returns the token collection name.
*/
function name() public view virtual returns (string memory) {
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual returns (string memory) {
}
/**
* @dev See {ERC1155-_beforeTokenTransfer}.
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
}
}
| !exists(id)||!_supplyInfo[id].retired,"ERC1155: Cannot adjust the max supply" | 349,053 | !exists(id)||!_supplyInfo[id].retired |
"ERC1155: Cannot retire" | // SPDX-License-Identifier: MIT
// Creator: @jessefriedland
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
/**
* @dev Extension of ERC1155 that adds tracking of total and max supply per id.
*
* Useful for scenarios where Fungible and Non-fungible tokens have to be
* clearly identified.
*/
abstract contract ERC1155MaxSupply is ERC1155 {
struct Supply {
uint80 totalSupply;
uint80 maxSupply;
uint80 numberBurned;
bool retired;
}
string public _name;
string public _symbol;
mapping(uint256 => Supply) private _supplyInfo;
constructor(string memory name_, string memory symbol_) {
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual override {
}
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
}
/**
* @dev Total amount of tokens in with a given id.
*/
function totalSupply(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Total amount of tokens minted for a given id.
*/
function totalMinted(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Max supply for a given id.
*/
function maxSupply(uint256 id) public view virtual returns (uint256) {
}
/**
* @dev Is a given id retired?
*/
function retired(uint256 id) public view virtual returns (bool) {
}
/**
* @dev Indicates whether any token exist with a given id, or not.
*/
function exists(uint256 id) public view virtual returns (bool) {
}
function _setMaxSupply(
uint256 id,
uint256 supply,
bool _retired
) internal virtual {
}
function _retire(uint256 id) internal virtual {
require(<FILL_ME>)
_supplyInfo[id].retired = true;
}
/**
* @dev Returns the token collection name.
*/
function name() public view virtual returns (string memory) {
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual returns (string memory) {
}
/**
* @dev See {ERC1155-_beforeTokenTransfer}.
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
}
}
| _supplyInfo[id].maxSupply>0&&!_supplyInfo[id].retired,"ERC1155: Cannot retire" | 349,053 | _supplyInfo[id].maxSupply>0&&!_supplyInfo[id].retired |
null | pragma solidity ^0.4.21;
/* Functions from Kitten Coin main contract to be used by sale contract */
contract KittenCoin {
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
}
contract Token {
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function Ownable() {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
contract KittenSelfDrop2 is Ownable {
KittenCoin public kittenContract;
uint8 public dropNumber;
uint256 public kittensDroppedToTheWorld;
uint256 public kittensRemainingToDrop;
uint256 public holderAmount;
uint256 public basicReward;
uint256 public holderReward;
mapping (uint8 => uint256[]) donatorReward;
uint8 donatorRewardLevels;
uint8 public totalDropTransactions;
mapping (address => uint8) participants;
// Initialize the cutest contract in the world
function KittenSelfDrop2 () {
}
// Drop some wonderful cutest Kitten Coins to sender every time contract is called without function
function() payable {
require(<FILL_ME>)
uint256 tokensIssued = basicReward;
// Send extra Kitten Coins bonus if participant is donating Ether
if (msg.value > donatorReward[0][0])
tokensIssued += donatorBonus(msg.value);
// Send extra Kitten Coins bonus if participant holds at least holderAmount
if (kittenContract.balanceOf(msg.sender) >= holderAmount)
tokensIssued += holderReward;
// Check if number of Kitten Coins to issue is higher than coins remaining for airdrop (last transaction of airdrop)
if (tokensIssued > kittensRemainingToDrop)
tokensIssued = kittensRemainingToDrop;
// Give away these so cute Kitten Coins to contributor
kittenContract.transfer(msg.sender, tokensIssued);
participants[msg.sender] = dropNumber;
kittensRemainingToDrop -= tokensIssued;
kittensDroppedToTheWorld += tokensIssued;
totalDropTransactions += 1;
}
function participant(address part) public constant returns (uint8 participationCount) {
}
// Increase the airdrop count to allow sweet humans asking for more beautiful Kitten Coins
function setDropNumber(uint8 dropN) public onlyOwner {
}
// Define amount of Kitten Coins to hold in order to get holder reward
function setHolderAmount(uint256 amount) public onlyOwner {
}
// Define how many wonderful Kitten Coins will be issued for participating the selfdrop : basic and holder reward
function setRewards(uint256 basic, uint256 holder) public onlyOwner {
}
// Define how many wonderful Kitten Coins will be issued for donators participating the selfdrop
function setDonatorReward(uint8 index, uint256[] values, uint8 levels) public onlyOwner {
}
// Sends all ETH contributions to lovely kitten owner
function withdrawAll() public onlyOwner {
}
// Sends all remaining Kitten Coins to owner, just in case of emergency
function withdrawKittenCoins() public onlyOwner {
}
// Sends all other tokens that would have been sent to owner (why people do that? We don't meow)
function withdrawToken(address token) public onlyOwner {
}
// Update number of Kitten Coins remaining for drop, just in case it is needed
function updateKittenCoinsRemainingToDrop() public {
}
// Defines donator bonus to receive
function donatorBonus(uint256 amount) public returns (uint256) {
}
}
| participants[msg.sender]<dropNumber&&kittensRemainingToDrop>basicReward | 349,164 | participants[msg.sender]<dropNumber&&kittensRemainingToDrop>basicReward |
"OneSwapRouter: INSUFFICIENT_OUTPUT_AMOUNT" | pragma solidity 0.6.12;
contract OneSwapRouter is IOneSwapRouter {
using SafeMath256 for uint;
address public immutable override factory;
modifier ensure(uint deadline) {
}
constructor(address _factory) public {
}
function _addLiquidity(address pair, uint amountStockDesired, uint amountMoneyDesired,
uint amountStockMin, uint amountMoneyMin) private view returns (uint amountStock, uint amountMoney) {
}
function addLiquidity(address stock, address money, bool isOnlySwap, uint amountStockDesired,
uint amountMoneyDesired, uint amountStockMin, uint amountMoneyMin, address to, uint deadline) external
payable override ensure(deadline) returns (uint amountStock, uint amountMoney, uint liquidity) {
}
function _removeLiquidity(address pair, uint liquidity, uint amountStockMin,
uint amountMoneyMin, address to) private returns (uint amountStock, uint amountMoney) {
}
function removeLiquidity(address pair, uint liquidity, uint amountStockMin, uint amountMoneyMin,
address to, uint deadline) external override ensure(deadline) returns (uint amountStock, uint amountMoney) {
}
function _swap(address input, uint amountIn, address[] memory path, address _to) internal virtual returns (uint[] memory amounts) {
}
function swapToken(address token, uint amountIn, uint amountOutMin, address[] calldata path,
address to, uint deadline) external payable override ensure(deadline) returns (uint[] memory amounts) {
if (token != address(0)) { require(msg.value == 0, 'OneSwapRouter: NOT_ENTER_ETH_VALUE'); }
require(path.length >= 1, "OneSwapRouter: INVALID_PATH");
// ensure pair exist
_getTokensFromPair(path[0]);
_safeTransferFrom(token, msg.sender, path[0], amountIn);
amounts = _swap(token, amountIn, path, to);
require(<FILL_ME>)
}
function limitOrder(bool isBuy, address pair, uint prevKey, uint price, uint32 id,
uint stockAmount, uint deadline) external payable override ensure(deadline) {
}
// todo. add encoded bytes interface for limitOrder.
function _safeTransferFrom(address token, address from, address to, uint value) internal {
}
function _safeTransferETH(address to, uint value) internal {
}
function _quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
}
function _getTokensFromPair(address pair) internal view returns(address stock, address money) {
}
}
| amounts[path.length]>=amountOutMin,"OneSwapRouter: INSUFFICIENT_OUTPUT_AMOUNT" | 349,198 | amounts[path.length]>=amountOutMin |
null | pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
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 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 SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @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 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)
{
}
}
/**
* admin manager
*/
contract AdminManager {
event ChangeOwner(address _oldOwner, address _newOwner);
event SetAdmin(address _address, bool _isAdmin);
//constract's owner
address public owner;
//constract's admins. permission less than owner
mapping(address=>bool) public admins;
/**
* constructor
*/
constructor() public {
}
/**
* modifier for some action only owner can do
*/
modifier onlyOwner() {
}
/**
* modifier for some action only admin or owner can do
*/
modifier onlyAdmins() {
}
/**
* change this constract's owner
*/
function changeOwner(address _newOwner) public onlyOwner {
}
/**
* add or delete admin
*/
function setAdmin(address _address, bool _isAdmin) public onlyOwner {
}
}
/**
* pausable token
*/
contract PausableToken is StandardToken, AdminManager {
event SetPause(bool isPause);
bool public paused = true;
/**
* modifier for pause constract. not contains admin and owner
*/
modifier whenNotPaused() {
}
/**
* @dev called by the owner to set new pause flags
* pausedPublic can't be false while pausedOwnerAdmin is true
*/
function setPause(bool _isPause) onlyAdmins public {
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
}
}
/**
* lockadble token
*/
contract LockableToken is PausableToken {
/**
* lock data struct
*/
struct LockData {
uint256 balance;
uint256 releaseTimeS;
}
event SetLock(address _address, uint256 _lockValue, uint256 _releaseTimeS);
mapping (address => LockData) public locks;
/**
* if active balance is not enought. deny transaction
*/
modifier whenNotLocked(address _from, uint256 _value) {
require(<FILL_ME>)
_;
}
/**
* active balance of address
*/
function activeBalanceOf(address _owner) public view returns (uint256) {
}
/**
* lock one address
* one address only be locked at the same time.
* because the gas reson, so not support multi lock of one address
*
* @param _lockValue how many tokens locked
* @param _releaseTimeS the lock release unix time
*/
function setLock(address _address, uint256 _lockValue, uint256 _releaseTimeS) onlyAdmins public {
}
function transfer(address _to, uint256 _value) public whenNotLocked(msg.sender, _value) returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotLocked(_from, _value) returns (bool) {
}
}
contract EnjoyGameToken is LockableToken {
event Burn(address indexed _burner, uint256 _value);
string public constant name = "EnjoyGameToken";
string public constant symbol = "EGT";
uint8 public constant decimals = 6;
/**
* constructor
*/
constructor() public {
}
/**
* transfer and lock this value
* only called by admins (limit when setLock)
*/
function transferAndLock(address _to, uint256 _value, uint256 _releaseTimeS) public returns (bool) {
}
}
| activeBalanceOf(_from)>=_value | 349,268 | activeBalanceOf(_from)>=_value |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.