comment
stringlengths 1
211
β | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"Buyer not whitelisted for presale" | pragma solidity ^0.8.4;
contract BD is ERC721Enumerable, Ownable {
uint256 public tokenPricePresale = 0.06 ether;
uint256 public tokenPricePublicSale = 0.08 ether;
uint256 public constant giftUniquesStart = 0;
uint256 public giftUniquesMinted = 0;
uint256 public constant giftUniquesTotal = 17;
uint256 public constant giftRegularsStart = giftUniquesStart + giftUniquesTotal;
uint256 public giftRegularsMinted = 0;
uint256 public constant giftRegularsTotal = 50;
uint256 public constant forPurchaseStart = giftRegularsStart + giftRegularsTotal;
uint256 public forPurchaseMinted = 0;
uint256 public constant forPurchaseTotal = 5555 + 20 - giftUniquesTotal - giftRegularsTotal;
uint256 public maxTokensPerMint = 10;
uint256 public maxTokensPerWhitelistedAddress = 2;
bool public hasPresaleStarted = false;
bool public hasPublicSaleStarted = false;
string public tokenBaseURI = "ipfs://QmfUnzwB6h2Nbx4gD8kh8pnPAc5BmrnuYeP4hVxrZUV8es/";
mapping(address => bool) public presaleWhitelist;
mapping(address => uint256) public presaleWhitelistPurchased;
constructor() ERC721("Buff Doge NFT", "BD") {
}
function setTokenPricePresale(uint256 val) external onlyOwner {
}
function setTokenPricePublicSale(uint256 val) external onlyOwner {
}
function tokenPrice() public view returns (uint256) {
}
function setMaxTokensPerMint(uint256 val) external onlyOwner {
}
function setMaxTokensPerWhitelistedAddress(uint256 val) external onlyOwner {
}
function setPresale(bool val) external onlyOwner {
}
function setPublicSale(bool val) external onlyOwner {
}
function addToPresaleWhitelist(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleWhitelist(address[] calldata entries) external onlyOwner {
}
function giftUnique(address[] calldata receivers) external onlyOwner {
}
function giftRegular(address[] calldata receivers) external onlyOwner {
}
function mint(uint256 amount) external payable {
require(msg.value >= tokenPrice() * amount, "Incorrect ETH");
require(hasPresaleStarted, "Cannot mint before presale");
require(<FILL_ME>)
require(amount <= maxTokensPerMint, "Cannot mint more than the max tokens per mint");
require(forPurchaseMinted + amount <= forPurchaseTotal, "No tokens left for minting");
require(hasPublicSaleStarted || (presaleWhitelistPurchased[msg.sender] + amount <= maxTokensPerWhitelistedAddress),
"Cannot mint more than the max tokens per whitelisted address");
for(uint256 i = 0; i < amount; i++) {
_safeMint(msg.sender, 1 + forPurchaseStart + forPurchaseMinted + i);
}
if (!hasPublicSaleStarted) {
presaleWhitelistPurchased[msg.sender] += amount;
}
forPurchaseMinted += amount;
}
function _baseURI() internal view override(ERC721) returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function withdraw() external onlyOwner {
}
}
| hasPublicSaleStarted||presaleWhitelist[msg.sender],"Buyer not whitelisted for presale" | 383,319 | hasPublicSaleStarted||presaleWhitelist[msg.sender] |
"No tokens left for minting" | pragma solidity ^0.8.4;
contract BD is ERC721Enumerable, Ownable {
uint256 public tokenPricePresale = 0.06 ether;
uint256 public tokenPricePublicSale = 0.08 ether;
uint256 public constant giftUniquesStart = 0;
uint256 public giftUniquesMinted = 0;
uint256 public constant giftUniquesTotal = 17;
uint256 public constant giftRegularsStart = giftUniquesStart + giftUniquesTotal;
uint256 public giftRegularsMinted = 0;
uint256 public constant giftRegularsTotal = 50;
uint256 public constant forPurchaseStart = giftRegularsStart + giftRegularsTotal;
uint256 public forPurchaseMinted = 0;
uint256 public constant forPurchaseTotal = 5555 + 20 - giftUniquesTotal - giftRegularsTotal;
uint256 public maxTokensPerMint = 10;
uint256 public maxTokensPerWhitelistedAddress = 2;
bool public hasPresaleStarted = false;
bool public hasPublicSaleStarted = false;
string public tokenBaseURI = "ipfs://QmfUnzwB6h2Nbx4gD8kh8pnPAc5BmrnuYeP4hVxrZUV8es/";
mapping(address => bool) public presaleWhitelist;
mapping(address => uint256) public presaleWhitelistPurchased;
constructor() ERC721("Buff Doge NFT", "BD") {
}
function setTokenPricePresale(uint256 val) external onlyOwner {
}
function setTokenPricePublicSale(uint256 val) external onlyOwner {
}
function tokenPrice() public view returns (uint256) {
}
function setMaxTokensPerMint(uint256 val) external onlyOwner {
}
function setMaxTokensPerWhitelistedAddress(uint256 val) external onlyOwner {
}
function setPresale(bool val) external onlyOwner {
}
function setPublicSale(bool val) external onlyOwner {
}
function addToPresaleWhitelist(address[] calldata entries) external onlyOwner {
}
function removeFromPresaleWhitelist(address[] calldata entries) external onlyOwner {
}
function giftUnique(address[] calldata receivers) external onlyOwner {
}
function giftRegular(address[] calldata receivers) external onlyOwner {
}
function mint(uint256 amount) external payable {
require(msg.value >= tokenPrice() * amount, "Incorrect ETH");
require(hasPresaleStarted, "Cannot mint before presale");
require(hasPublicSaleStarted || presaleWhitelist[msg.sender], "Buyer not whitelisted for presale");
require(amount <= maxTokensPerMint, "Cannot mint more than the max tokens per mint");
require(<FILL_ME>)
require(hasPublicSaleStarted || (presaleWhitelistPurchased[msg.sender] + amount <= maxTokensPerWhitelistedAddress),
"Cannot mint more than the max tokens per whitelisted address");
for(uint256 i = 0; i < amount; i++) {
_safeMint(msg.sender, 1 + forPurchaseStart + forPurchaseMinted + i);
}
if (!hasPublicSaleStarted) {
presaleWhitelistPurchased[msg.sender] += amount;
}
forPurchaseMinted += amount;
}
function _baseURI() internal view override(ERC721) returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function withdraw() external onlyOwner {
}
}
| forPurchaseMinted+amount<=forPurchaseTotal,"No tokens left for minting" | 383,319 | forPurchaseMinted+amount<=forPurchaseTotal |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "./VaccineSelling.sol";
import "@openzeppelin/[email protected]/token/ERC721/IERC721.sol";
abstract contract VaccineApply is VaccineSelling {
uint8[] _vaccinesStrength = [0, 25, 50, 100];
uint8[] _vaccinesProbability = [0, 25, 50, 100];
event VaccineApplied(uint256 vaccineId, uint256 porkId, uint8 vaccinationProgress);
address pork1984Address;
mapping(uint256 => uint8) _vaccinationProgress;
uint8 constant maxVaccinationProgress = 100;
constructor(address _pork1984Address) {
}
function getMaxVaccinationProgress() public pure returns(uint8) {
}
function isFullyVaccinated(uint256 porkId) public view returns(bool) {
}
function vaccinationProgress(uint256 porkId) public view returns(uint8) {
}
function mutatePork(uint256 vaccineId, uint256 porkId) public {
_burn(msg.sender, vaccineId, 1);
IERC721 pork1984 = IERC721(pork1984Address);
require(<FILL_ME>)
_mutatePorkWithChance(vaccineId, porkId, _vaccinesProbability[vaccineId]);
}
function _mutatePorkWithChance(uint256 vaccineId, uint256 porkId, uint8 chanceOfMutation) private {
}
function _mutatePork(uint256 porkId) private {
}
function _stackVaccineOnPork(uint256 porkId, uint256 vaccineId) private {
}
}
| pork1984.ownerOf(porkId)==msg.sender | 383,494 | pork1984.ownerOf(porkId)==msg.sender |
"This pork has already become a mutant" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "./VaccineSelling.sol";
import "@openzeppelin/[email protected]/token/ERC721/IERC721.sol";
abstract contract VaccineApply is VaccineSelling {
uint8[] _vaccinesStrength = [0, 25, 50, 100];
uint8[] _vaccinesProbability = [0, 25, 50, 100];
event VaccineApplied(uint256 vaccineId, uint256 porkId, uint8 vaccinationProgress);
address pork1984Address;
mapping(uint256 => uint8) _vaccinationProgress;
uint8 constant maxVaccinationProgress = 100;
constructor(address _pork1984Address) {
}
function getMaxVaccinationProgress() public pure returns(uint8) {
}
function isFullyVaccinated(uint256 porkId) public view returns(bool) {
}
function vaccinationProgress(uint256 porkId) public view returns(uint8) {
}
function mutatePork(uint256 vaccineId, uint256 porkId) public {
}
function _mutatePorkWithChance(uint256 vaccineId, uint256 porkId, uint8 chanceOfMutation) private {
require(<FILL_ME>)
uint8 randomNumber = uint8(_getRandomInteger(porkId) % 100);
if (randomNumber >= chanceOfMutation) {
_stackVaccineOnPork(porkId, vaccineId);
} else {
_mutatePork(porkId);
}
emit VaccineApplied(vaccineId, porkId, _vaccinationProgress[porkId]);
}
function _mutatePork(uint256 porkId) private {
}
function _stackVaccineOnPork(uint256 porkId, uint256 vaccineId) private {
}
}
| !isFullyVaccinated(porkId),"This pork has already become a mutant" | 383,494 | !isFullyVaccinated(porkId) |
"over allocation" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract SkyrimRefund is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
uint256 public immutable rate;
IERC20 public immutable input;
IERC20 public immutable output;
bytes32 public merkleRoot;
bool public paused;
mapping(address => uint256) public deposits;
uint256 public totalDeposits;
uint256 public totalUsers;
event SetMerkleRoot(bytes32 merkleRoot);
event SetPaused(bool paused);
event Swap(address indexed user, uint256 amount);
constructor(uint256 _rate, address _input, address _output, bytes32 _merkleRoot) Ownable() {
}
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
}
function setPaused(bool _paused) external onlyOwner {
}
function deposit(uint256 amount, uint256 allocation, bytes32[] calldata merkleProof) external nonReentrant {
require(!paused, "paused");
require(amount > 0, "need amount > 0");
bytes32 node = keccak256(abi.encodePacked(msg.sender, allocation));
require(MerkleProof.verify(merkleProof, merkleRoot, node), "invalid proof");
if (deposits[msg.sender] == 0) {
totalUsers++;
}
totalDeposits += amount;
deposits[msg.sender] += amount;
require(<FILL_ME>)
IERC20(input).safeTransferFrom(msg.sender, address(this), amount);
IERC20(output).safeTransfer(msg.sender, amount * rate / 1e12);
emit Swap(msg.sender, amount);
}
function withdrawToken(address token, uint amount) external onlyOwner {
}
}
| deposits[msg.sender]<=allocation,"over allocation" | 383,502 | deposits[msg.sender]<=allocation |
"NOT_ALLOWED_TO_MINT_MORE_THAN_2" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ERC721A.sol";
contract WabiSabi is Ownable, ERC721A, ReentrancyGuard {
string public baseURI;
uint256 public teamWS = 70; // launch
uint256 public constant price = 0.075 ether;
uint8 public maxWLMint = 1;
uint8 public maxMintPerAccount = 2;
uint256 public maxPresaleSupply = 4200; // launch
uint256 public maxWSsupply = 5678; // launch
bool public isPublicActive = false;
bool public isPresaleBActive = false;
bool public isPresaleAActive = false;
uint256 public mintedPresale = 0;
uint256 public maxMintsPerTx = 5;
// WS mint
mapping (address => uint256) public mintedWSforPresaleA;
// S mint
mapping (address => uint256) public mintedWSforPresaleB;
mapping(address => uint256) addressBlockBought;
bytes32 private presaleAMerkleRoot;
bytes32 private presaleBMerkleRoot;
constructor(
bytes32 presaleARoot,
bytes32 presaleBRoot
)
ERC721A("Wabi Sabi Collective", "WabiSabi", 50, 5678) {
} // launch
modifier isSecured(uint8 mintType) {
}
/**
* Presale mint function
*/
function ogListMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(1) {
require(msg.value == price * numberOfTokens, "INSUFFICIENT_PAYMENT");
require(msg.value > 0, "Mint must be greater than 0."); // test check
require(<FILL_ME>)
require(mintedPresale + numberOfTokens <= maxPresaleSupply, "EXCEEDS_MAX_PRESALE_SUPPLY" );
require(totalSupply() + numberOfTokens <= maxWSsupply, "EXCEEDS_MAX_SUPPLY" );
require(MerkleProof.verify(proof, presaleAMerkleRoot, keccak256(abi.encodePacked(msg.sender))), "INVALID_WHITELIST_PROOF");
addressBlockBought[msg.sender] = block.timestamp;
mintedWSforPresaleA[msg.sender] += numberOfTokens;
mintedPresale += numberOfTokens;
_safeMint( msg.sender, numberOfTokens);
}
function whitelistMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(2) {
}
function mintTeamWS(uint256 numberOfTokens) external onlyOwner {
}
// Public Mint Functions
function mintPublic(uint256 numberOfTokens) external payable isSecured(3) {
}
function tokenIdOfOwner(address _owner) external view returns(uint256[] memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
// SETTER FUNCTIONS
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setMerkleOGRoot(bytes32 presaleRoot) external onlyOwner {
}
function setMerkleRoot(bytes32 presaleRoot) external onlyOwner {
}
// TOGGLES
function togglePublicMintActive() external onlyOwner {
}
function togglePresaleAActive() external onlyOwner {
}
// function togglePresaleBActive() external onlyOwner {
// isPresaleBActive = !isPresaleBActive;
// }
/**
* Withdraw Ether
*/
function withdraw() external onlyOwner {
}
}
| mintedWSforPresaleA[msg.sender]+numberOfTokens<=maxMintPerAccount,"NOT_ALLOWED_TO_MINT_MORE_THAN_2" | 383,529 | mintedWSforPresaleA[msg.sender]+numberOfTokens<=maxMintPerAccount |
"EXCEEDS_MAX_PRESALE_SUPPLY" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ERC721A.sol";
contract WabiSabi is Ownable, ERC721A, ReentrancyGuard {
string public baseURI;
uint256 public teamWS = 70; // launch
uint256 public constant price = 0.075 ether;
uint8 public maxWLMint = 1;
uint8 public maxMintPerAccount = 2;
uint256 public maxPresaleSupply = 4200; // launch
uint256 public maxWSsupply = 5678; // launch
bool public isPublicActive = false;
bool public isPresaleBActive = false;
bool public isPresaleAActive = false;
uint256 public mintedPresale = 0;
uint256 public maxMintsPerTx = 5;
// WS mint
mapping (address => uint256) public mintedWSforPresaleA;
// S mint
mapping (address => uint256) public mintedWSforPresaleB;
mapping(address => uint256) addressBlockBought;
bytes32 private presaleAMerkleRoot;
bytes32 private presaleBMerkleRoot;
constructor(
bytes32 presaleARoot,
bytes32 presaleBRoot
)
ERC721A("Wabi Sabi Collective", "WabiSabi", 50, 5678) {
} // launch
modifier isSecured(uint8 mintType) {
}
/**
* Presale mint function
*/
function ogListMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(1) {
require(msg.value == price * numberOfTokens, "INSUFFICIENT_PAYMENT");
require(msg.value > 0, "Mint must be greater than 0."); // test check
require(mintedWSforPresaleA[msg.sender] + numberOfTokens <= maxMintPerAccount, "NOT_ALLOWED_TO_MINT_MORE_THAN_2" );
require(<FILL_ME>)
require(totalSupply() + numberOfTokens <= maxWSsupply, "EXCEEDS_MAX_SUPPLY" );
require(MerkleProof.verify(proof, presaleAMerkleRoot, keccak256(abi.encodePacked(msg.sender))), "INVALID_WHITELIST_PROOF");
addressBlockBought[msg.sender] = block.timestamp;
mintedWSforPresaleA[msg.sender] += numberOfTokens;
mintedPresale += numberOfTokens;
_safeMint( msg.sender, numberOfTokens);
}
function whitelistMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(2) {
}
function mintTeamWS(uint256 numberOfTokens) external onlyOwner {
}
// Public Mint Functions
function mintPublic(uint256 numberOfTokens) external payable isSecured(3) {
}
function tokenIdOfOwner(address _owner) external view returns(uint256[] memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
// SETTER FUNCTIONS
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setMerkleOGRoot(bytes32 presaleRoot) external onlyOwner {
}
function setMerkleRoot(bytes32 presaleRoot) external onlyOwner {
}
// TOGGLES
function togglePublicMintActive() external onlyOwner {
}
function togglePresaleAActive() external onlyOwner {
}
// function togglePresaleBActive() external onlyOwner {
// isPresaleBActive = !isPresaleBActive;
// }
/**
* Withdraw Ether
*/
function withdraw() external onlyOwner {
}
}
| mintedPresale+numberOfTokens<=maxPresaleSupply,"EXCEEDS_MAX_PRESALE_SUPPLY" | 383,529 | mintedPresale+numberOfTokens<=maxPresaleSupply |
"EXCEEDS_MAX_SUPPLY" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ERC721A.sol";
contract WabiSabi is Ownable, ERC721A, ReentrancyGuard {
string public baseURI;
uint256 public teamWS = 70; // launch
uint256 public constant price = 0.075 ether;
uint8 public maxWLMint = 1;
uint8 public maxMintPerAccount = 2;
uint256 public maxPresaleSupply = 4200; // launch
uint256 public maxWSsupply = 5678; // launch
bool public isPublicActive = false;
bool public isPresaleBActive = false;
bool public isPresaleAActive = false;
uint256 public mintedPresale = 0;
uint256 public maxMintsPerTx = 5;
// WS mint
mapping (address => uint256) public mintedWSforPresaleA;
// S mint
mapping (address => uint256) public mintedWSforPresaleB;
mapping(address => uint256) addressBlockBought;
bytes32 private presaleAMerkleRoot;
bytes32 private presaleBMerkleRoot;
constructor(
bytes32 presaleARoot,
bytes32 presaleBRoot
)
ERC721A("Wabi Sabi Collective", "WabiSabi", 50, 5678) {
} // launch
modifier isSecured(uint8 mintType) {
}
/**
* Presale mint function
*/
function ogListMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(1) {
require(msg.value == price * numberOfTokens, "INSUFFICIENT_PAYMENT");
require(msg.value > 0, "Mint must be greater than 0."); // test check
require(mintedWSforPresaleA[msg.sender] + numberOfTokens <= maxMintPerAccount, "NOT_ALLOWED_TO_MINT_MORE_THAN_2" );
require(mintedPresale + numberOfTokens <= maxPresaleSupply, "EXCEEDS_MAX_PRESALE_SUPPLY" );
require(<FILL_ME>)
require(MerkleProof.verify(proof, presaleAMerkleRoot, keccak256(abi.encodePacked(msg.sender))), "INVALID_WHITELIST_PROOF");
addressBlockBought[msg.sender] = block.timestamp;
mintedWSforPresaleA[msg.sender] += numberOfTokens;
mintedPresale += numberOfTokens;
_safeMint( msg.sender, numberOfTokens);
}
function whitelistMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(2) {
}
function mintTeamWS(uint256 numberOfTokens) external onlyOwner {
}
// Public Mint Functions
function mintPublic(uint256 numberOfTokens) external payable isSecured(3) {
}
function tokenIdOfOwner(address _owner) external view returns(uint256[] memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
// SETTER FUNCTIONS
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setMerkleOGRoot(bytes32 presaleRoot) external onlyOwner {
}
function setMerkleRoot(bytes32 presaleRoot) external onlyOwner {
}
// TOGGLES
function togglePublicMintActive() external onlyOwner {
}
function togglePresaleAActive() external onlyOwner {
}
// function togglePresaleBActive() external onlyOwner {
// isPresaleBActive = !isPresaleBActive;
// }
/**
* Withdraw Ether
*/
function withdraw() external onlyOwner {
}
}
| totalSupply()+numberOfTokens<=maxWSsupply,"EXCEEDS_MAX_SUPPLY" | 383,529 | totalSupply()+numberOfTokens<=maxWSsupply |
"INVALID_WHITELIST_PROOF" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ERC721A.sol";
contract WabiSabi is Ownable, ERC721A, ReentrancyGuard {
string public baseURI;
uint256 public teamWS = 70; // launch
uint256 public constant price = 0.075 ether;
uint8 public maxWLMint = 1;
uint8 public maxMintPerAccount = 2;
uint256 public maxPresaleSupply = 4200; // launch
uint256 public maxWSsupply = 5678; // launch
bool public isPublicActive = false;
bool public isPresaleBActive = false;
bool public isPresaleAActive = false;
uint256 public mintedPresale = 0;
uint256 public maxMintsPerTx = 5;
// WS mint
mapping (address => uint256) public mintedWSforPresaleA;
// S mint
mapping (address => uint256) public mintedWSforPresaleB;
mapping(address => uint256) addressBlockBought;
bytes32 private presaleAMerkleRoot;
bytes32 private presaleBMerkleRoot;
constructor(
bytes32 presaleARoot,
bytes32 presaleBRoot
)
ERC721A("Wabi Sabi Collective", "WabiSabi", 50, 5678) {
} // launch
modifier isSecured(uint8 mintType) {
}
/**
* Presale mint function
*/
function ogListMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(1) {
require(msg.value == price * numberOfTokens, "INSUFFICIENT_PAYMENT");
require(msg.value > 0, "Mint must be greater than 0."); // test check
require(mintedWSforPresaleA[msg.sender] + numberOfTokens <= maxMintPerAccount, "NOT_ALLOWED_TO_MINT_MORE_THAN_2" );
require(mintedPresale + numberOfTokens <= maxPresaleSupply, "EXCEEDS_MAX_PRESALE_SUPPLY" );
require(totalSupply() + numberOfTokens <= maxWSsupply, "EXCEEDS_MAX_SUPPLY" );
require(<FILL_ME>)
addressBlockBought[msg.sender] = block.timestamp;
mintedWSforPresaleA[msg.sender] += numberOfTokens;
mintedPresale += numberOfTokens;
_safeMint( msg.sender, numberOfTokens);
}
function whitelistMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(2) {
}
function mintTeamWS(uint256 numberOfTokens) external onlyOwner {
}
// Public Mint Functions
function mintPublic(uint256 numberOfTokens) external payable isSecured(3) {
}
function tokenIdOfOwner(address _owner) external view returns(uint256[] memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
// SETTER FUNCTIONS
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setMerkleOGRoot(bytes32 presaleRoot) external onlyOwner {
}
function setMerkleRoot(bytes32 presaleRoot) external onlyOwner {
}
// TOGGLES
function togglePublicMintActive() external onlyOwner {
}
function togglePresaleAActive() external onlyOwner {
}
// function togglePresaleBActive() external onlyOwner {
// isPresaleBActive = !isPresaleBActive;
// }
/**
* Withdraw Ether
*/
function withdraw() external onlyOwner {
}
}
| MerkleProof.verify(proof,presaleAMerkleRoot,keccak256(abi.encodePacked(msg.sender))),"INVALID_WHITELIST_PROOF" | 383,529 | MerkleProof.verify(proof,presaleAMerkleRoot,keccak256(abi.encodePacked(msg.sender))) |
"EXCEEDS_MAX_PRESALEB_MINT" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ERC721A.sol";
contract WabiSabi is Ownable, ERC721A, ReentrancyGuard {
string public baseURI;
uint256 public teamWS = 70; // launch
uint256 public constant price = 0.075 ether;
uint8 public maxWLMint = 1;
uint8 public maxMintPerAccount = 2;
uint256 public maxPresaleSupply = 4200; // launch
uint256 public maxWSsupply = 5678; // launch
bool public isPublicActive = false;
bool public isPresaleBActive = false;
bool public isPresaleAActive = false;
uint256 public mintedPresale = 0;
uint256 public maxMintsPerTx = 5;
// WS mint
mapping (address => uint256) public mintedWSforPresaleA;
// S mint
mapping (address => uint256) public mintedWSforPresaleB;
mapping(address => uint256) addressBlockBought;
bytes32 private presaleAMerkleRoot;
bytes32 private presaleBMerkleRoot;
constructor(
bytes32 presaleARoot,
bytes32 presaleBRoot
)
ERC721A("Wabi Sabi Collective", "WabiSabi", 50, 5678) {
} // launch
modifier isSecured(uint8 mintType) {
}
/**
* Presale mint function
*/
function ogListMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(1) {
}
function whitelistMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(2) {
require(msg.value == price * numberOfTokens, "INSUFFICIENT_PAYMENT");
require(msg.value > 0, "Mint must be greater than 0."); // test check
require(<FILL_ME>)
require(mintedPresale + numberOfTokens <= maxPresaleSupply, "EXCEEDS_MAX_PRESALE_SUPPLY" );
require(totalSupply() + numberOfTokens <= maxWSsupply, "EXCEEDS_MAX_SUPPLY" );
require(MerkleProof.verify(proof, presaleBMerkleRoot, keccak256(abi.encodePacked(msg.sender))), "INVALID_WHITELIST_PROOF");
addressBlockBought[msg.sender] = block.timestamp;
mintedWSforPresaleB[msg.sender] += numberOfTokens;
mintedPresale += numberOfTokens;
_safeMint( msg.sender, numberOfTokens);
}
function mintTeamWS(uint256 numberOfTokens) external onlyOwner {
}
// Public Mint Functions
function mintPublic(uint256 numberOfTokens) external payable isSecured(3) {
}
function tokenIdOfOwner(address _owner) external view returns(uint256[] memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
// SETTER FUNCTIONS
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setMerkleOGRoot(bytes32 presaleRoot) external onlyOwner {
}
function setMerkleRoot(bytes32 presaleRoot) external onlyOwner {
}
// TOGGLES
function togglePublicMintActive() external onlyOwner {
}
function togglePresaleAActive() external onlyOwner {
}
// function togglePresaleBActive() external onlyOwner {
// isPresaleBActive = !isPresaleBActive;
// }
/**
* Withdraw Ether
*/
function withdraw() external onlyOwner {
}
}
| mintedWSforPresaleB[msg.sender]+numberOfTokens<=maxWLMint,"EXCEEDS_MAX_PRESALEB_MINT" | 383,529 | mintedWSforPresaleB[msg.sender]+numberOfTokens<=maxWLMint |
"INVALID_WHITELIST_PROOF" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ERC721A.sol";
contract WabiSabi is Ownable, ERC721A, ReentrancyGuard {
string public baseURI;
uint256 public teamWS = 70; // launch
uint256 public constant price = 0.075 ether;
uint8 public maxWLMint = 1;
uint8 public maxMintPerAccount = 2;
uint256 public maxPresaleSupply = 4200; // launch
uint256 public maxWSsupply = 5678; // launch
bool public isPublicActive = false;
bool public isPresaleBActive = false;
bool public isPresaleAActive = false;
uint256 public mintedPresale = 0;
uint256 public maxMintsPerTx = 5;
// WS mint
mapping (address => uint256) public mintedWSforPresaleA;
// S mint
mapping (address => uint256) public mintedWSforPresaleB;
mapping(address => uint256) addressBlockBought;
bytes32 private presaleAMerkleRoot;
bytes32 private presaleBMerkleRoot;
constructor(
bytes32 presaleARoot,
bytes32 presaleBRoot
)
ERC721A("Wabi Sabi Collective", "WabiSabi", 50, 5678) {
} // launch
modifier isSecured(uint8 mintType) {
}
/**
* Presale mint function
*/
function ogListMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(1) {
}
function whitelistMint(bytes32[] calldata proof, uint256 numberOfTokens) external payable isSecured(2) {
require(msg.value == price * numberOfTokens, "INSUFFICIENT_PAYMENT");
require(msg.value > 0, "Mint must be greater than 0."); // test check
require(mintedWSforPresaleB[msg.sender] + numberOfTokens <= maxWLMint, "EXCEEDS_MAX_PRESALEB_MINT" );
require(mintedPresale + numberOfTokens <= maxPresaleSupply, "EXCEEDS_MAX_PRESALE_SUPPLY" );
require(totalSupply() + numberOfTokens <= maxWSsupply, "EXCEEDS_MAX_SUPPLY" );
require(<FILL_ME>)
addressBlockBought[msg.sender] = block.timestamp;
mintedWSforPresaleB[msg.sender] += numberOfTokens;
mintedPresale += numberOfTokens;
_safeMint( msg.sender, numberOfTokens);
}
function mintTeamWS(uint256 numberOfTokens) external onlyOwner {
}
// Public Mint Functions
function mintPublic(uint256 numberOfTokens) external payable isSecured(3) {
}
function tokenIdOfOwner(address _owner) external view returns(uint256[] memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
// SETTER FUNCTIONS
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setMerkleOGRoot(bytes32 presaleRoot) external onlyOwner {
}
function setMerkleRoot(bytes32 presaleRoot) external onlyOwner {
}
// TOGGLES
function togglePublicMintActive() external onlyOwner {
}
function togglePresaleAActive() external onlyOwner {
}
// function togglePresaleBActive() external onlyOwner {
// isPresaleBActive = !isPresaleBActive;
// }
/**
* Withdraw Ether
*/
function withdraw() external onlyOwner {
}
}
| MerkleProof.verify(proof,presaleBMerkleRoot,keccak256(abi.encodePacked(msg.sender))),"INVALID_WHITELIST_PROOF" | 383,529 | MerkleProof.verify(proof,presaleBMerkleRoot,keccak256(abi.encodePacked(msg.sender))) |
null | pragma solidity ^0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @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 constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public
{
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @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);
event setNewBlockEvent(string SecretKey_Pre, string Name_New, string TxHash_Pre, string DigestCode_New, string Image_New, string Note_New);
}
contract COLLATERAL {
function decimals() pure returns (uint) {}
function CreditRate() pure returns (uint256) {}
function credit(uint256 _value) public {}
function repayment(uint256 _amount) public returns (bool) {}
}
contract StandardToken is Token {
COLLATERAL dc;
address public collateral_contract;
uint public constant decimals = 8;
function transfer(address _to, uint256 _value) returns(bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) 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) {
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
}
/**
* @title Debitable token
* @dev ERC20 Token, with debitable token creation
*/
contract DebitableToken is StandardToken, Ownable {
event Debit(address collateral_contract, uint256 amount);
event Deposit(address indexed _to_debitor, uint256 _value);
event DebitFinished();
using SafeMath for uint256;
bool public debitingFinished = false;
modifier canDebit() {
require(<FILL_ME>)
_;
}
modifier hasDebitPermission() {
}
/**
* @dev Function to debit tokens
* @param _to The address that will receive the drawdown tokens.
* @param _amount The amount of tokens to debit.
* @return A boolean that indicates if the operation was successful.
*/
function debit(
address _to,
uint256 _amount
)
public
hasDebitPermission
canDebit
returns (bool)
{
}
/**
* @dev To stop debiting tokens.
* @return True if the operation was successful.
*/
function finishDebit() public onlyOwner canDebit returns (bool) {
}
}
/**
* @title Repaymentable Token
* @dev Debitor that can be repay to creditor.
*/
contract RepaymentToken is StandardToken, Ownable {
using SafeMath for uint256;
event Repayment(address collateral_contract, uint256 value);
event Withdraw(address debitor, uint256 value);
modifier hasRepayPermission() {
}
function repayment( uint256 _value )
hasRepayPermission
public
{
}
}
contract FightingBaby is DebitableToken, RepaymentToken {
constructor() public {
}
function connectContract(address _collateral_address ) public onlyOwner {
}
function getCreditRate() public view returns (uint256 result) {
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name = "FightingBaby";
string public symbol = "FB";
uint256 public constant INITIAL_SUPPLY = 0 * (10 ** uint256(decimals));
string public Image_root = "https://swarm.chainbacon.com/bzz:/405c3b9185841172d6ae03a810a5977450e17f28c5041c271f163af4ffb4e770/";
string public Note_root = "https://swarm.chainbacon.com/bzz:/614f5d35c7f07bd74a16a6f7beef0de375b03ad0d9c7c448dbd6afe53801176b/";
string public Document_root = "none";
string public DigestCode_root = "4b309bba7095fa26302b8083636aa7ac6f8945df8d1a27e9d80314d55cec5df5";
function getIssuer() public pure returns(string) { }
string public TxHash_root = "genesis";
string public ContractSource = "";
string public CodeVersion = "v0.1";
string public SecretKey_Pre = "";
string public Name_New = "";
string public TxHash_Pre = "";
string public DigestCode_New = "";
string public Image_New = "";
string public Note_New = "";
uint256 public DebitRate = 100 * (10 ** uint256(decimals));
function getName() public view returns(string) { }
function getDigestCodeRoot() public view returns(string) { }
function getTxHashRoot() public view returns(string) { }
function getImageRoot() public view returns(string) { }
function getNoteRoot() public view returns(string) { }
function getCodeVersion() public view returns(string) { }
function getContractSource() public view returns(string) { }
function getSecretKeyPre() public view returns(string) { }
function getNameNew() public view returns(string) { }
function getTxHashPre() public view returns(string) { }
function getDigestCodeNew() public view returns(string) { }
function getImageNew() public view returns(string) { }
function getNoteNew() public view returns(string) { }
function updateDebitRate(uint256 _rate) public onlyOwner returns (uint256) {
}
function setNewBlock(string _SecretKey_Pre, string _Name_New, string _TxHash_Pre, string _DigestCode_New, string _Image_New, string _Note_New ) returns (bool success) {
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
}
}
| !debitingFinished | 383,644 | !debitingFinished |
"Purchase would exceed max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
//
//βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ
//
//
//
//
//βββββββ ββ βββββββ βββββββ ββββββ ββ βββββββ βββββββ βββββββ βββ ββ ββ ββββββ ββ ββ ββββββββ βββββββ
//ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββββ ββ ββ ββ ββ ββ ββ ββ
//βββββββ ββ βββββ βββββ ββββββ ββ βββββ βββββββ βββββββ ββ ββ ββ ββ ββ βββ βββββββ ββ βββββββ
// ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ
//βββββββ βββββββ βββββββ βββββββ ββ βββββββ βββββββ βββββββ βββββββ ββ ββββ ββ ββββββ ββ ββ ββ βββββββ
//
//
//
//
//βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ
contract SleeplessNightsNFT is ERC721Enumerable, Ownable, Pausable {
using SafeMath for uint256;
uint public constant NFT_PRICE = 30000000000000000; // 0.03 ETH
uint public constant MAX_NFT_PURCHASE = 5;
uint public MAX_SUPPLY = 10000;
uint public ACTUAL_SUPPLY = 1700;
string private base;
constructor(string memory name, string memory symbol, string memory baseURI) ERC721(name, symbol) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setMaxTokenSupply(uint256 newSupply) public onlyOwner {
}
function mint(uint numberOfTokensMax5) public payable whenNotPaused {
require(numberOfTokensMax5 > 0, "Number of tokens can not be less than or equal to 0");
require(<FILL_ME>)
require(numberOfTokensMax5 <= MAX_NFT_PURCHASE,"Can only mint up to 10 per purchase");
require(NFT_PRICE.mul(numberOfTokensMax5) == msg.value, "Sent ether value is incorrect");
for (uint i = 0; i < numberOfTokensMax5; i++) {
uint mintIndex = totalSupply();
_safeMint(msg.sender, mintIndex);
}
}
function magicMint(uint256 numTokens) external onlyOwner {
}
}
| totalSupply().add(numberOfTokensMax5)<=ACTUAL_SUPPLY,"Purchase would exceed max supply" | 383,687 | totalSupply().add(numberOfTokensMax5)<=ACTUAL_SUPPLY |
"Sent ether value is incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
//
//βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ
//
//
//
//
//βββββββ ββ βββββββ βββββββ ββββββ ββ βββββββ βββββββ βββββββ βββ ββ ββ ββββββ ββ ββ ββββββββ βββββββ
//ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββββ ββ ββ ββ ββ ββ ββ ββ
//βββββββ ββ βββββ βββββ ββββββ ββ βββββ βββββββ βββββββ ββ ββ ββ ββ ββ βββ βββββββ ββ βββββββ
// ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ
//βββββββ βββββββ βββββββ βββββββ ββ βββββββ βββββββ βββββββ βββββββ ββ ββββ ββ ββββββ ββ ββ ββ βββββββ
//
//
//
//
//βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ
contract SleeplessNightsNFT is ERC721Enumerable, Ownable, Pausable {
using SafeMath for uint256;
uint public constant NFT_PRICE = 30000000000000000; // 0.03 ETH
uint public constant MAX_NFT_PURCHASE = 5;
uint public MAX_SUPPLY = 10000;
uint public ACTUAL_SUPPLY = 1700;
string private base;
constructor(string memory name, string memory symbol, string memory baseURI) ERC721(name, symbol) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setMaxTokenSupply(uint256 newSupply) public onlyOwner {
}
function mint(uint numberOfTokensMax5) public payable whenNotPaused {
require(numberOfTokensMax5 > 0, "Number of tokens can not be less than or equal to 0");
require(totalSupply().add(numberOfTokensMax5) <= ACTUAL_SUPPLY, "Purchase would exceed max supply");
require(numberOfTokensMax5 <= MAX_NFT_PURCHASE,"Can only mint up to 10 per purchase");
require(<FILL_ME>)
for (uint i = 0; i < numberOfTokensMax5; i++) {
uint mintIndex = totalSupply();
_safeMint(msg.sender, mintIndex);
}
}
function magicMint(uint256 numTokens) external onlyOwner {
}
}
| NFT_PRICE.mul(numberOfTokensMax5)==msg.value,"Sent ether value is incorrect" | 383,687 | NFT_PRICE.mul(numberOfTokensMax5)==msg.value |
"Exceeds maximum token supply." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
//
//βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ
//
//
//
//
//βββββββ ββ βββββββ βββββββ ββββββ ββ βββββββ βββββββ βββββββ βββ ββ ββ ββββββ ββ ββ ββββββββ βββββββ
//ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββββ ββ ββ ββ ββ ββ ββ ββ
//βββββββ ββ βββββ βββββ ββββββ ββ βββββ βββββββ βββββββ ββ ββ ββ ββ ββ βββ βββββββ ββ βββββββ
// ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ
//βββββββ βββββββ βββββββ βββββββ ββ βββββββ βββββββ βββββββ βββββββ ββ ββββ ββ ββββββ ββ ββ ββ βββββββ
//
//
//
//
//βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ βββββ
contract SleeplessNightsNFT is ERC721Enumerable, Ownable, Pausable {
using SafeMath for uint256;
uint public constant NFT_PRICE = 30000000000000000; // 0.03 ETH
uint public constant MAX_NFT_PURCHASE = 5;
uint public MAX_SUPPLY = 10000;
uint public ACTUAL_SUPPLY = 1700;
string private base;
constructor(string memory name, string memory symbol, string memory baseURI) ERC721(name, symbol) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setMaxTokenSupply(uint256 newSupply) public onlyOwner {
}
function mint(uint numberOfTokensMax5) public payable whenNotPaused {
}
function magicMint(uint256 numTokens) external onlyOwner {
require(<FILL_ME>)
require(numTokens > 0 && numTokens <= 100, "Machine can dispense a minimum of 1, maximum of 100 tokens");
for (uint i = 0; i < numTokens; i++) {
uint mintIndex = totalSupply();
_safeMint(msg.sender, mintIndex);
}
}
}
| SafeMath.add(totalSupply(),numTokens)<=ACTUAL_SUPPLY,"Exceeds maximum token supply." | 383,687 | SafeMath.add(totalSupply(),numTokens)<=ACTUAL_SUPPLY |
null | pragma solidity ^0.4.24;
/**
* @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 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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
}
/**
* @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 onlyPayloadSize(2 * 32) returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood:
https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* 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) external onlyPayloadSize(2 * 32) returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) external onlyPayloadSize(2 * 32) returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value) public onlyPayloadSize(3 * 32) 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 onlyPayloadSize(2 * 32) 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) {
}
}
contract Owners {
mapping (address => bool) public owners;
uint public ownersCount;
uint public minOwnersRequired = 2;
event OwnerAdded(address indexed owner);
event OwnerRemoved(address indexed owner);
/**
* @dev initializes contract
* @param withDeployer bool indicates whether deployer is part of owners
*/
constructor(bool withDeployer) public {
}
/**
* @dev adds owner, can only by done by owners only
* @param _address address the address to be added
*/
function addOwner(address _address) public ownerOnly {
}
/**
* @dev removes owner, can only by done by owners only
* @param _address address the address to be removed
*/
function removeOwner(address _address) public ownerOnly notOwnerItself(_address) minOwners {
require(<FILL_ME>)
owners[_address] = false;
ownersCount--;
emit OwnerRemoved(_address);
}
/**
* @dev checks if sender is owner
*/
modifier ownerOnly {
}
modifier notOwnerItself(address _owner) {
}
modifier minOwners {
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Owners(true) {
event Mint(address indexed to, uint256 amount);
event MintFinished();
event MintStarted();
bool public mintingFinished = false;
modifier canMint() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) external ownerOnly canMint onlyPayloadSize(2 * 32) returns (bool) {
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public ownerOnly canMint returns (bool) {
}
/**
* @dev Function to start minting new tokens.
* @return True if the operation was successful.
*/
function startMinting() public ownerOnly returns (bool) {
}
function internalMint(address _to, uint256 _amount) internal returns (bool) {
}
}
contract REIDAOMintableToken is MintableToken {
uint public decimals = 8;
bool public tradingStarted = false;
/**
* @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, uint _value) public canTrade returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public canTrade returns (bool) {
}
/**
* @dev modifier that throws if trading has not started yet
*/
modifier canTrade() {
}
/**
* @dev Allows the owner to enable the trading. Done only once.
*/
function startTrading() public ownerOnly {
}
}
contract REIDAOMintableLockableToken is REIDAOMintableToken {
struct TokenLock {
uint256 value;
uint lockedUntil;
}
mapping (address => TokenLock[]) public locks;
/**
* @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, uint _value) public canTransfer(msg.sender, _value) returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint _value) public canTransfer(msg.sender, _value) returns (bool) {
}
/**
* @dev Allows authorized callers to lock `_value` tokens belong to `_to` until timestamp `_lockUntil`.
* This function can be called independently of transferAndLockTokens(), hence the double checking of timestamp.
* @param _to address The address to be locked.
* @param _value uint The amout of tokens to be locked.
* @param _lockUntil uint The UNIX timestamp tokens are locked until.
*/
function lockTokens(address _to, uint256 _value, uint256 _lockUntil) public ownerOnly {
}
/**
* @dev Allows authorized callers to mint `_value` tokens for `_to`, and lock them until timestamp `_lockUntil`.
* @param _to address The address to which tokens to be minted and locked.
* @param _value uint The amout of tokens to be minted and locked.
* @param _lockUntil uint The UNIX timestamp tokens are locked until.
*/
function mintAndLockTokens(address _to, uint256 _value, uint256 _lockUntil) public ownerOnly {
}
/**
* @dev Checks the amount of transferable tokens belongs to `_holder`.
* @param _holder address The address to be checked.
*/
function transferableTokens(address _holder) public constant returns (uint256) {
}
/**
* @dev Retrieves the amount of locked tokens `_holder` has.
* @param _holder address The address to be checked.
*/
function getLockedTokens(address _holder) public constant returns (uint256) {
}
/**
* @dev Retrieves the number of token locks `_holder` has.
* @param _holder address The address the token locks belongs to.
* @return A uint256 representing the total number of locks.
*/
function getTokenLocksCount(address _holder) internal constant returns (uint256 index) {
}
/**
* @dev Modifier that throws if `_value` amount of tokens can't be transferred.
* @param _sender address the address of the sender
* @param _value uint the amount of tokens intended to be transferred
*/
modifier canTransfer(address _sender, uint256 _value) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
}
}
contract REIDAOBurnableToken is BurnableToken {
mapping (address => bool) public hostedWallets;
/**
* @dev burns tokens, can only be done by hosted wallets
* @param _value uint256 the amount of tokens to be burned
*/
function burn(uint256 _value) public hostedWalletsOnly {
}
/**
* @dev adds hosted wallet
* @param _wallet address the address to be added
*/
function addHostedWallet(address _wallet) public {
}
/**
* @dev removes hosted wallet
* @param _wallet address the address to be removed
*/
function removeHostedWallet(address _wallet) public {
}
/**
* @dev checks if sender is hosted wallets
*/
modifier hostedWalletsOnly {
}
}
contract REIDAOMintableBurnableLockableToken is REIDAOMintableLockableToken, REIDAOBurnableToken {
/**
* @dev adds hosted wallet, can only be done by owners.
* @param _wallet address the address to be added
*/
function addHostedWallet(address _wallet) public ownerOnly {
}
/**
* @dev removes hosted wallet, can only be done by owners.
* @param _wallet address the address to be removed
*/
function removeHostedWallet(address _wallet) public ownerOnly {
}
/**
* @dev burns tokens, can only be done by hosted wallets
* @param _value uint256 the amount of tokens to be burned
*/
function burn(uint256 _value) public canTransfer(msg.sender, _value) {
}
}
contract Point is REIDAOMintableBurnableLockableToken {
string public name = "Crowdvilla Point";
string public symbol = "CROWD";
}
| owners[_address]==true | 383,747 | owners[_address]==true |
null | pragma solidity ^0.4.24;
/**
* @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 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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
}
/**
* @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 onlyPayloadSize(2 * 32) returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood:
https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* 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) external onlyPayloadSize(2 * 32) returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) external onlyPayloadSize(2 * 32) returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value) public onlyPayloadSize(3 * 32) 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 onlyPayloadSize(2 * 32) 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) {
}
}
contract Owners {
mapping (address => bool) public owners;
uint public ownersCount;
uint public minOwnersRequired = 2;
event OwnerAdded(address indexed owner);
event OwnerRemoved(address indexed owner);
/**
* @dev initializes contract
* @param withDeployer bool indicates whether deployer is part of owners
*/
constructor(bool withDeployer) public {
}
/**
* @dev adds owner, can only by done by owners only
* @param _address address the address to be added
*/
function addOwner(address _address) public ownerOnly {
}
/**
* @dev removes owner, can only by done by owners only
* @param _address address the address to be removed
*/
function removeOwner(address _address) public ownerOnly notOwnerItself(_address) minOwners {
}
/**
* @dev checks if sender is owner
*/
modifier ownerOnly {
}
modifier notOwnerItself(address _owner) {
}
modifier minOwners {
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Owners(true) {
event Mint(address indexed to, uint256 amount);
event MintFinished();
event MintStarted();
bool public mintingFinished = false;
modifier canMint() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) external ownerOnly canMint onlyPayloadSize(2 * 32) returns (bool) {
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public ownerOnly canMint returns (bool) {
}
/**
* @dev Function to start minting new tokens.
* @return True if the operation was successful.
*/
function startMinting() public ownerOnly returns (bool) {
}
function internalMint(address _to, uint256 _amount) internal returns (bool) {
}
}
contract REIDAOMintableToken is MintableToken {
uint public decimals = 8;
bool public tradingStarted = false;
/**
* @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, uint _value) public canTrade returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public canTrade returns (bool) {
}
/**
* @dev modifier that throws if trading has not started yet
*/
modifier canTrade() {
}
/**
* @dev Allows the owner to enable the trading. Done only once.
*/
function startTrading() public ownerOnly {
}
}
contract REIDAOMintableLockableToken is REIDAOMintableToken {
struct TokenLock {
uint256 value;
uint lockedUntil;
}
mapping (address => TokenLock[]) public locks;
/**
* @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, uint _value) public canTransfer(msg.sender, _value) returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint _value) public canTransfer(msg.sender, _value) returns (bool) {
}
/**
* @dev Allows authorized callers to lock `_value` tokens belong to `_to` until timestamp `_lockUntil`.
* This function can be called independently of transferAndLockTokens(), hence the double checking of timestamp.
* @param _to address The address to be locked.
* @param _value uint The amout of tokens to be locked.
* @param _lockUntil uint The UNIX timestamp tokens are locked until.
*/
function lockTokens(address _to, uint256 _value, uint256 _lockUntil) public ownerOnly {
}
/**
* @dev Allows authorized callers to mint `_value` tokens for `_to`, and lock them until timestamp `_lockUntil`.
* @param _to address The address to which tokens to be minted and locked.
* @param _value uint The amout of tokens to be minted and locked.
* @param _lockUntil uint The UNIX timestamp tokens are locked until.
*/
function mintAndLockTokens(address _to, uint256 _value, uint256 _lockUntil) public ownerOnly {
}
/**
* @dev Checks the amount of transferable tokens belongs to `_holder`.
* @param _holder address The address to be checked.
*/
function transferableTokens(address _holder) public constant returns (uint256) {
}
/**
* @dev Retrieves the amount of locked tokens `_holder` has.
* @param _holder address The address to be checked.
*/
function getLockedTokens(address _holder) public constant returns (uint256) {
}
/**
* @dev Retrieves the number of token locks `_holder` has.
* @param _holder address The address the token locks belongs to.
* @return A uint256 representing the total number of locks.
*/
function getTokenLocksCount(address _holder) internal constant returns (uint256 index) {
}
/**
* @dev Modifier that throws if `_value` amount of tokens can't be transferred.
* @param _sender address the address of the sender
* @param _value uint the amount of tokens intended to be transferred
*/
modifier canTransfer(address _sender, uint256 _value) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
}
}
contract REIDAOBurnableToken is BurnableToken {
mapping (address => bool) public hostedWallets;
/**
* @dev burns tokens, can only be done by hosted wallets
* @param _value uint256 the amount of tokens to be burned
*/
function burn(uint256 _value) public hostedWalletsOnly {
}
/**
* @dev adds hosted wallet
* @param _wallet address the address to be added
*/
function addHostedWallet(address _wallet) public {
}
/**
* @dev removes hosted wallet
* @param _wallet address the address to be removed
*/
function removeHostedWallet(address _wallet) public {
}
/**
* @dev checks if sender is hosted wallets
*/
modifier hostedWalletsOnly {
require(<FILL_ME>)
_;
}
}
contract REIDAOMintableBurnableLockableToken is REIDAOMintableLockableToken, REIDAOBurnableToken {
/**
* @dev adds hosted wallet, can only be done by owners.
* @param _wallet address the address to be added
*/
function addHostedWallet(address _wallet) public ownerOnly {
}
/**
* @dev removes hosted wallet, can only be done by owners.
* @param _wallet address the address to be removed
*/
function removeHostedWallet(address _wallet) public ownerOnly {
}
/**
* @dev burns tokens, can only be done by hosted wallets
* @param _value uint256 the amount of tokens to be burned
*/
function burn(uint256 _value) public canTransfer(msg.sender, _value) {
}
}
contract Point is REIDAOMintableBurnableLockableToken {
string public name = "Crowdvilla Point";
string public symbol = "CROWD";
}
| hostedWallets[msg.sender]==true | 383,747 | hostedWallets[msg.sender]==true |
"Reserving would exceed supply." | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
uint supply = totalSupply();
require(<FILL_ME>)
uint i;
for (i = 0; i < amount; i++) {
_safeMint(to, supply + i);
}
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| supply.add(amount)<MAX_TOKENS_PLUS_ONE,"Reserving would exceed supply." | 383,913 | supply.add(amount)<MAX_TOKENS_PLUS_ONE |
"The presale has already begun!" | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
require(<FILL_ME>)
Whitelist[msg.sender] = true;
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| !presaleIsActive,"The presale has already begun!" | 383,913 | !presaleIsActive |
"Purchase would exceed presale limit of 8 Sharks per address." | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint Sharks.");
require(numberOfTokens < maxSharksPlusOne, "Can only mint 5 Sharks at a time.");
require(<FILL_ME>)
require(totalSupply().add(numberOfTokens) < MAX_TOKENS_PLUS_ONE, "Purchase would exceed max supply of Sharks.");
require(sharkPrice.mul(numberOfTokens) == msg.value, "Ether value sent is not correct.");
_mintSharks(numberOfTokens, msg.sender);
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| balanceOf(msg.sender).add(numberOfTokens)<maxOwnedPlusOne,"Purchase would exceed presale limit of 8 Sharks per address." | 383,913 | balanceOf(msg.sender).add(numberOfTokens)<maxOwnedPlusOne |
"Purchase would exceed max supply of Sharks." | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint Sharks.");
require(numberOfTokens < maxSharksPlusOne, "Can only mint 5 Sharks at a time.");
require(balanceOf(msg.sender).add(numberOfTokens) < maxOwnedPlusOne , "Purchase would exceed presale limit of 8 Sharks per address.");
require(<FILL_ME>)
require(sharkPrice.mul(numberOfTokens) == msg.value, "Ether value sent is not correct.");
_mintSharks(numberOfTokens, msg.sender);
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| totalSupply().add(numberOfTokens)<MAX_TOKENS_PLUS_ONE,"Purchase would exceed max supply of Sharks." | 383,913 | totalSupply().add(numberOfTokens)<MAX_TOKENS_PLUS_ONE |
"Ether value sent is not correct." | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint Sharks.");
require(numberOfTokens < maxSharksPlusOne, "Can only mint 5 Sharks at a time.");
require(balanceOf(msg.sender).add(numberOfTokens) < maxOwnedPlusOne , "Purchase would exceed presale limit of 8 Sharks per address.");
require(totalSupply().add(numberOfTokens) < MAX_TOKENS_PLUS_ONE, "Purchase would exceed max supply of Sharks.");
require(<FILL_ME>)
_mintSharks(numberOfTokens, msg.sender);
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| sharkPrice.mul(numberOfTokens)==msg.value,"Ether value sent is not correct." | 383,913 | sharkPrice.mul(numberOfTokens)==msg.value |
"Presale is not active." | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
require(<FILL_ME>)
require(isSenderInWhitelist(), "Your address is not in the whitelist.");
require(balanceOf(msg.sender).add(numberOfTokens) < maxForPresalePlusOne, "Purchase would exceed presale limit of 2 Sharks per address.");
require(totalSupply().add(numberOfTokens) <= MAX_TOKENS, "Purchase would exceed max supply of Sharks.");
require(presaleSharkPrice.mul(numberOfTokens) == msg.value, "Ether value sent is not correct.");
_mintSharks(numberOfTokens, msg.sender);
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| presaleIsActive&&!saleIsActive,"Presale is not active." | 383,913 | presaleIsActive&&!saleIsActive |
"Your address is not in the whitelist." | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
require(presaleIsActive && !saleIsActive, "Presale is not active.");
require(<FILL_ME>)
require(balanceOf(msg.sender).add(numberOfTokens) < maxForPresalePlusOne, "Purchase would exceed presale limit of 2 Sharks per address.");
require(totalSupply().add(numberOfTokens) <= MAX_TOKENS, "Purchase would exceed max supply of Sharks.");
require(presaleSharkPrice.mul(numberOfTokens) == msg.value, "Ether value sent is not correct.");
_mintSharks(numberOfTokens, msg.sender);
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| isSenderInWhitelist(),"Your address is not in the whitelist." | 383,913 | isSenderInWhitelist() |
"Purchase would exceed presale limit of 2 Sharks per address." | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
require(presaleIsActive && !saleIsActive, "Presale is not active.");
require(isSenderInWhitelist(), "Your address is not in the whitelist.");
require(<FILL_ME>)
require(totalSupply().add(numberOfTokens) <= MAX_TOKENS, "Purchase would exceed max supply of Sharks.");
require(presaleSharkPrice.mul(numberOfTokens) == msg.value, "Ether value sent is not correct.");
_mintSharks(numberOfTokens, msg.sender);
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| balanceOf(msg.sender).add(numberOfTokens)<maxForPresalePlusOne,"Purchase would exceed presale limit of 2 Sharks per address." | 383,913 | balanceOf(msg.sender).add(numberOfTokens)<maxForPresalePlusOne |
"Ether value sent is not correct." | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title Shark Society contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract SharkSociety is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
string public PROVENANCE;
uint256 public constant MAX_TOKENS = 5000;
uint256 public constant MAX_TOKENS_PLUS_ONE = 5001;
uint256 public sharkPrice = 0.04 ether;
uint256 public presaleSharkPrice = 0.03 ether;
uint public constant maxSharksPlusOne = 6;
uint public constant maxOwnedPlusOne = 9;
uint public constant maxForPresalePlusOne = 3;
bool public saleIsActive = false;
// Metadata base URI
string public metadataBaseURI;
// Whitelist and Presale
mapping(address => bool) Whitelist;
bool public presaleIsActive = false;
/**
@param name - Name of ERC721 as used in openzeppelin
@param symbol - Symbol of ERC721 as used in openzeppelin
@param provenance - The sha256 string of concatenated sha256 of all images in their natural order - AKA Provenance.
@param baseUri - Base URI for token metadata
*/
constructor(string memory name,
string memory symbol,
string memory provenance,
string memory baseUri) ERC721(name, symbol) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
/**
* Reserve Sharks for future marketing and the team
*/
function reserveSharks(uint256 amount, address to) public onlyOwner {
}
/*
* Set provenance hash - just in case there is an error
* Provenance hash is set in the contract construction time,
* ideally there is no reason to ever call it.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Pause sale if active, activate if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* @dev Pause presale if active, activate if paused
*/
function flipPresaleState() public onlyOwner {
}
/**
* @dev Adds addresses to the whitelist
*/
function addToWhitelist(address[] calldata addrs) external onlyOwner {
}
/**
* @dev Removes addresses from the whitelist
*/
function removeFromWhitelist(address[] calldata addrs) external onlyOwner {
}
function registerForPresale() external {
}
/**
* @dev Checks if an address is in the whitelist
*/
function isAddressInWhitelist(address addr) public view returns (bool) {
}
/**
* @dev Checks if the sender's address is in the whitelist
*/
function isSenderInWhitelist() public view returns (bool) {
}
/**
* @dev Sets the mint price
*/
function setPrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the mint price
*/
function setPresalePrice(uint256 price) external onlyOwner {
}
/**
* @dev Sets the Base URI for computing {tokenURI}.
*/
function setMetadataBaseURI(string memory newURI) public onlyOwner {
}
/**
* @dev Returns the tokenURI if exists.
* See {IERC721Metadata-tokenURI} for more details.
*/
function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Overrides empty string returned by base class.
* Unused because we override {tokenURI}.
* Included for completeness-sake.
*/
function _baseURI() internal view override(ERC721) returns (string memory) {
}
/**
* @dev Returns the base URI. Public facing method.
* Included for completeness-sake and folks that want just the base.
*/
function baseURI() public view returns (string memory) {
}
/**
* @dev Actual function that performs minting
*/
function _mintSharks(uint numberOfTokens, address sender) internal {
}
/**
* @dev Mints Sharks
* Ether value sent must exactly match.
*/
function mintSharks(uint numberOfTokens) public payable {
}
/**
* @dev Mints Sharks during the presale.
* Ether value sent must exactly match -
* and only addresses in {Whitelist} are allowed to participate in the presale.
*/
function presaleMintSharks(uint numberOfTokens) public payable {
require(presaleIsActive && !saleIsActive, "Presale is not active.");
require(isSenderInWhitelist(), "Your address is not in the whitelist.");
require(balanceOf(msg.sender).add(numberOfTokens) < maxForPresalePlusOne, "Purchase would exceed presale limit of 2 Sharks per address.");
require(totalSupply().add(numberOfTokens) <= MAX_TOKENS, "Purchase would exceed max supply of Sharks.");
require(<FILL_ME>)
_mintSharks(numberOfTokens, msg.sender);
}
/**
* @dev Do not allow renouncing ownership
*/
function renounceOwnership() public override(Ownable) onlyOwner {}
}
| presaleSharkPrice.mul(numberOfTokens)==msg.value,"Ether value sent is not correct." | 383,913 | presaleSharkPrice.mul(numberOfTokens)==msg.value |
"staking contract not set" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
interface IBrincStaking {
function totalRewards(address _user) external view returns (uint256);
}
contract StakedBrincGovToken is ERC20, ERC20Burnable, Ownable {
using SafeMath for uint256;
mapping(address => bool) public isMinter;
IBrincStaking public staking;
event Mint(address _to, uint256 amount);
event Burn(address _from, uint256 amount);
event StakingUpdated(address _staking);
event SetMinter(address _minter, bool _isMinter);
constructor() public ERC20("StakedBrincGovToken", "sgBRC") {
}
modifier onlyMinter {
}
/**
* @dev mint will create specified number of tokens to specified address.
* only a minter will be able to call this method.
*
* @param _to address to mint tokens to
* @param _amount amount of tokens to mint
*
*/
/// #if_succeeds {:msg "mint: The sender must be Minter"}
/// isMinter[msg.sender] == true;
/// #if_succeeds {:msg "mint: balance of receiving address is correct after mint"}
/// this.balanceOf(_to) == old(this.balanceOf(_to) + _amount);
function mint(address _to, uint256 _amount) public onlyMinter {
}
/**
* @dev setStaking will set the address of the staking contract.
* only the owner will be able to call this method.
*
* @param _staking address of the staking contract
*
*/
/// #if_succeeds {:msg "setStaking: The sender must be owner"}
/// old(msg.sender == this.owner());
function setStaking(IBrincStaking _staking) public onlyOwner {
}
/**
* @dev setMinter will set and allow the specified address to mint sgBRC tokens.
* only the owner will be able to call this method.
* changing _isMinter to false will revoke minting privileges.
*
* @param _address address of minter
* @param _isMinter bool access
*
*/
/// #if_succeeds {:msg "setMinter: The sender must be owner"}
/// old(msg.sender == this.owner());
function setMinter(address _minter, bool _isMinter) public onlyOwner {
}
/**
* @dev balanceOf is the override method that will show the number of staked tokens + totalrewards.
* the new balanceOf will relect the total sgBRC balance, which will include any accured award that may not have been minted to gBRC yet.
*
* @return balanceOf(address)
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(<FILL_ME>)
return super.balanceOf(owner).add(staking.totalRewards(owner));
}
function _beforeTokenTransfer(
address from,
address to,
uint256
) internal override {
}
}
| address(staking)!=address(0x0),"staking contract not set" | 383,943 | address(staking)!=address(0x0) |
null | pragma solidity 0.4.14;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
}
/**
* @dev revert()s 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 {
}
}
/**
* Math operations with safety checks
*/
library SafeMath {
function mul256(uint256 a, uint256 b) internal returns (uint256) {
}
function div256(uint256 a, uint256 b) internal returns (uint256) {
}
function sub256(uint256 a, uint256 b) internal returns (uint256) {
}
function add256(uint256 a, uint256 b) internal returns (uint256) {
}
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev ERC20 interface with allowances.
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value);
function approve(address spender, uint256 value);
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 Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
}
/**
* @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) onlyPayloadSize(2 * 32) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
* @dev Implemantation of the basic standart token.
*/
contract StandardToken is BasicToken, ERC20 {
mapping (address => mapping (address => uint256)) 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 uint the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) {
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) {
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
}
}
/**
* @title LuckyToken
* @dev The main Lucky token contract
*
*/
contract LuckyToken is StandardToken, Ownable{
string public name = "Lucky888Coin";
string public symbol = "LKY";
uint public decimals = 18;
event TokenBurned(uint256 value);
function LuckyToken() {
}
/**
* @dev Allows the owner to burn the token
* @param _value number of tokens to be burned.
*/
function burn(uint _value) onlyOwner {
}
}
/**
* @title InitialTeuTokenSale
* @dev The Initial TEU token sale contract
*
*/
contract initialTeuTokenSale is Ownable {
using SafeMath for uint256;
event LogPeriodStart(uint period);
event LogCollectionStart(uint period);
event LogContribution(address indexed contributorAddress, uint256 weiAmount, uint period);
event LogCollect(address indexed contributorAddress, uint256 tokenAmount, uint period);
LuckyToken private token;
mapping(uint => address) private walletOfPeriod;
uint256 private minContribution = 0.1 ether;
uint private saleStart;
bool private isTokenCollectable = false;
mapping(uint => uint) private periodStart;
mapping(uint => uint) private periodDeadline;
mapping(uint => uint256) private periodTokenPool;
mapping(uint => mapping (address => uint256)) private contribution;
mapping(uint => uint256) private periodContribution;
mapping(uint => mapping (address => bool)) private collected;
mapping(uint => mapping (address => uint256)) private tokenCollected;
uint public totalPeriod = 0;
uint public currentPeriod = 0;
/**
* @dev Initialise the contract
* @param _tokenAddress address of TEU token
* @param _walletPeriod1 address of period 1 wallet
* @param _walletPeriod2 address of period 2 wallet
* @param _tokenPoolPeriod1 amount of pool of token in period 1
* @param _tokenPoolPeriod2 amount of pool of token in period 2
* @param _saleStartDate start date / time of the token sale
*/
function initTokenSale (address _tokenAddress
, address _walletPeriod1, address _walletPeriod2
, uint256 _tokenPoolPeriod1, uint256 _tokenPoolPeriod2
, uint _saleStartDate) onlyOwner {
}
/**
* @dev Allows the owner to set the starting time.
* @param _saleStartDate the new sales start date / time
*/
function setPeriodStart(uint _saleStartDate) onlyOwner beforeSaleStart private {
}
function addPeriod(uint _periodStart, uint _periodDeadline) onlyOwner beforeSaleEnd private {
}
/**
* @dev Call this method to let the contract to go into next period of sales
*/
function goNextPeriod() onlyOwner public {
}
/**
* @dev Call this method to let the contract to allow token collection after the contribution period
*/
function goTokenCollection() onlyOwner public {
}
/**
* @dev modifier to allow contribution only when the sale is ON
*/
modifier saleIsOn() {
}
/**
* @dev modifier to allow collection only when the collection is ON
*/
modifier collectIsOn() {
require(<FILL_ME>)
_;
}
/**
* @dev modifier to ensure it is before start of first period of sale
*/
modifier beforeSaleStart() {
}
/**
* @dev modifier to ensure it is before the deadline of last sale period
*/
modifier beforeSaleEnd() {
}
/**
* @dev modifier to ensure it is after the deadline of last sale period
*/
modifier afterSaleEnd() {
}
modifier overMinContribution() {
}
/**
* @dev record the contribution of a contribution
*/
function contribute() private saleIsOn overMinContribution {
}
/**
* @dev Allows contributor to collect all token alloted for all period after preiod deadline
*/
function collectToken() public collectIsOn {
}
/**
* @dev Allow owner to transfer out the token in the contract
* @param _to address to transfer to
* @param _amount amount to transfer
*/
function transferTokenOut(address _to, uint256 _amount) public onlyOwner {
}
/**
* @dev Allow owner to transfer out the ether in the contract
* @param _to address to transfer to
* @param _amount amount to transfer
*/
function transferEtherOut(address _to, uint256 _amount) public onlyOwner {
}
/**
* @dev to get the contribution amount of any contributor under different period
* @param _period period to get the contribution amount
* @param _contributor contributor to get the conribution amount
*/
function contributionOf(uint _period, address _contributor) public constant returns (uint256) {
}
/**
* @dev to get the total contribution amount of a given period
* @param _period period to get the contribution amount
*/
function periodContributionOf(uint _period) public constant returns (uint256) {
}
/**
* @dev to check if token is collected by any contributor under different period
* @param _period period to get the collected status
* @param _contributor contributor to get collected status
*/
function isTokenCollected(uint _period, address _contributor) public constant returns (bool) {
}
/**
* @dev to get the amount of token collected by any contributor under different period
* @param _period period to get the amount
* @param _contributor contributor to get amont
*/
function tokenCollectedOf(uint _period, address _contributor) public constant returns (uint256) {
}
/**
* @dev Fallback function which receives ether and create the appropriate number of tokens for the
* msg.sender.
*/
function() external payable {
}
}
| isTokenCollectable&¤tPeriod>0&&now>periodDeadline[currentPeriod]&&(currentPeriod==totalPeriod||now<periodStart[currentPeriod+1]) | 383,985 | isTokenCollectable&¤tPeriod>0&&now>periodDeadline[currentPeriod]&&(currentPeriod==totalPeriod||now<periodStart[currentPeriod+1]) |
"Not whitelisted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract KYOTO is ERC721Enumerable, Ownable {
uint public price;
uint public immutable maxSupply;
uint public supplyCap;
bool public mintingEnabled;
bool public whitelistMintingEnabled;
uint public walletLimit;
address public whitelistSigner;
mapping(address => uint) public mints;
string private _baseURIPrefix;
enum Sale { WHITELIST, PUBLIC }
constructor (
string memory _name,
string memory _symbol,
uint _maxSupply,
uint _supplyCap,
uint _price,
uint _walletLimit,
string memory _uri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view override returns (string memory) {
}
function info(address addr) external view returns (uint256, uint256, uint256, uint256, uint256, bool, bool, uint256, address) {
}
function setBaseURI(string memory newUri) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setWalletLimit(uint256 newWalletLimit) external onlyOwner {
}
function setSupplyCap(uint256 newSupplyCap) external onlyOwner {
}
function setWhitelistSigner(address newWhitelistSigner) external onlyOwner {
}
function toggleMinting() external onlyOwner {
}
function toggleWhitelistMinting() external onlyOwner {
}
function mintReserves(uint256 qty) external onlyOwner checkSupply(qty) {
}
function mintWhitelisted(uint256 qty, bytes memory sig)
external
payable
checkSupply(qty)
saleOpen(Sale.WHITELIST)
onWhitelist(sig)
validateInput(qty)
{
}
function mint(uint256 qty) external payable checkSupply(qty) saleOpen(Sale.PUBLIC) validateInput(qty) {
}
modifier saleOpen(Sale saleType) {
}
modifier onWhitelist(bytes memory sig) {
require(<FILL_ME>)
_;
}
modifier checkSupply(uint256 qty) {
}
modifier validateInput(uint256 qty) {
}
function batchMint(uint256 qty) internal {
}
function isWhitelisted(address addr, bytes memory sig) public view returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| isWhitelisted(_msgSender(),sig),"Not whitelisted" | 384,068 | isWhitelisted(_msgSender(),sig) |
"Supply cap exceeded" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract KYOTO is ERC721Enumerable, Ownable {
uint public price;
uint public immutable maxSupply;
uint public supplyCap;
bool public mintingEnabled;
bool public whitelistMintingEnabled;
uint public walletLimit;
address public whitelistSigner;
mapping(address => uint) public mints;
string private _baseURIPrefix;
enum Sale { WHITELIST, PUBLIC }
constructor (
string memory _name,
string memory _symbol,
uint _maxSupply,
uint _supplyCap,
uint _price,
uint _walletLimit,
string memory _uri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view override returns (string memory) {
}
function info(address addr) external view returns (uint256, uint256, uint256, uint256, uint256, bool, bool, uint256, address) {
}
function setBaseURI(string memory newUri) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setWalletLimit(uint256 newWalletLimit) external onlyOwner {
}
function setSupplyCap(uint256 newSupplyCap) external onlyOwner {
}
function setWhitelistSigner(address newWhitelistSigner) external onlyOwner {
}
function toggleMinting() external onlyOwner {
}
function toggleWhitelistMinting() external onlyOwner {
}
function mintReserves(uint256 qty) external onlyOwner checkSupply(qty) {
}
function mintWhitelisted(uint256 qty, bytes memory sig)
external
payable
checkSupply(qty)
saleOpen(Sale.WHITELIST)
onWhitelist(sig)
validateInput(qty)
{
}
function mint(uint256 qty) external payable checkSupply(qty) saleOpen(Sale.PUBLIC) validateInput(qty) {
}
modifier saleOpen(Sale saleType) {
}
modifier onWhitelist(bytes memory sig) {
}
modifier checkSupply(uint256 qty) {
require(totalSupply() + qty <= maxSupply, "Max supply exceeded");
require(<FILL_ME>)
_;
}
modifier validateInput(uint256 qty) {
}
function batchMint(uint256 qty) internal {
}
function isWhitelisted(address addr, bytes memory sig) public view returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| totalSupply()+qty<=supplyCap,"Supply cap exceeded" | 384,068 | totalSupply()+qty<=supplyCap |
"Wallet limit exceeded" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract KYOTO is ERC721Enumerable, Ownable {
uint public price;
uint public immutable maxSupply;
uint public supplyCap;
bool public mintingEnabled;
bool public whitelistMintingEnabled;
uint public walletLimit;
address public whitelistSigner;
mapping(address => uint) public mints;
string private _baseURIPrefix;
enum Sale { WHITELIST, PUBLIC }
constructor (
string memory _name,
string memory _symbol,
uint _maxSupply,
uint _supplyCap,
uint _price,
uint _walletLimit,
string memory _uri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view override returns (string memory) {
}
function info(address addr) external view returns (uint256, uint256, uint256, uint256, uint256, bool, bool, uint256, address) {
}
function setBaseURI(string memory newUri) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setWalletLimit(uint256 newWalletLimit) external onlyOwner {
}
function setSupplyCap(uint256 newSupplyCap) external onlyOwner {
}
function setWhitelistSigner(address newWhitelistSigner) external onlyOwner {
}
function toggleMinting() external onlyOwner {
}
function toggleWhitelistMinting() external onlyOwner {
}
function mintReserves(uint256 qty) external onlyOwner checkSupply(qty) {
}
function mintWhitelisted(uint256 qty, bytes memory sig)
external
payable
checkSupply(qty)
saleOpen(Sale.WHITELIST)
onWhitelist(sig)
validateInput(qty)
{
}
function mint(uint256 qty) external payable checkSupply(qty) saleOpen(Sale.PUBLIC) validateInput(qty) {
}
modifier saleOpen(Sale saleType) {
}
modifier onWhitelist(bytes memory sig) {
}
modifier checkSupply(uint256 qty) {
}
modifier validateInput(uint256 qty) {
require(qty > 0, "Invalid quantity");
require(<FILL_ME>)
require(price * qty == msg.value, "Incorrect ETH value");
_;
}
function batchMint(uint256 qty) internal {
}
function isWhitelisted(address addr, bytes memory sig) public view returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| mints[_msgSender()]+qty<=walletLimit,"Wallet limit exceeded" | 384,068 | mints[_msgSender()]+qty<=walletLimit |
"Incorrect ETH value" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract KYOTO is ERC721Enumerable, Ownable {
uint public price;
uint public immutable maxSupply;
uint public supplyCap;
bool public mintingEnabled;
bool public whitelistMintingEnabled;
uint public walletLimit;
address public whitelistSigner;
mapping(address => uint) public mints;
string private _baseURIPrefix;
enum Sale { WHITELIST, PUBLIC }
constructor (
string memory _name,
string memory _symbol,
uint _maxSupply,
uint _supplyCap,
uint _price,
uint _walletLimit,
string memory _uri
) ERC721(_name, _symbol) {
}
function _baseURI() internal view override returns (string memory) {
}
function info(address addr) external view returns (uint256, uint256, uint256, uint256, uint256, bool, bool, uint256, address) {
}
function setBaseURI(string memory newUri) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setWalletLimit(uint256 newWalletLimit) external onlyOwner {
}
function setSupplyCap(uint256 newSupplyCap) external onlyOwner {
}
function setWhitelistSigner(address newWhitelistSigner) external onlyOwner {
}
function toggleMinting() external onlyOwner {
}
function toggleWhitelistMinting() external onlyOwner {
}
function mintReserves(uint256 qty) external onlyOwner checkSupply(qty) {
}
function mintWhitelisted(uint256 qty, bytes memory sig)
external
payable
checkSupply(qty)
saleOpen(Sale.WHITELIST)
onWhitelist(sig)
validateInput(qty)
{
}
function mint(uint256 qty) external payable checkSupply(qty) saleOpen(Sale.PUBLIC) validateInput(qty) {
}
modifier saleOpen(Sale saleType) {
}
modifier onWhitelist(bytes memory sig) {
}
modifier checkSupply(uint256 qty) {
}
modifier validateInput(uint256 qty) {
require(qty > 0, "Invalid quantity");
require(mints[_msgSender()] + qty <= walletLimit, "Wallet limit exceeded");
require(<FILL_ME>)
_;
}
function batchMint(uint256 qty) internal {
}
function isWhitelisted(address addr, bytes memory sig) public view returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| price*qty==msg.value,"Incorrect ETH value" | 384,068 | price*qty==msg.value |
null | pragma solidity ^0.4.18;
///EtherDrugs
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <[email protected]> (https://github.com/dete)
contract ERC721 {
function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view returns (address addr);
function takeOwnership(uint256 _tokenId) public;
function totalSupply() public view returns (uint256 total);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function transfer(address _to, uint256 _tokenId) public;
event Transfer(address indexed from, address indexed to, uint256 tokenId);
event Approval(address indexed owner, address indexed approved, uint256 tokenId);
}
contract EtherDrugs is ERC721 {
/*** EVENTS ***/
event Birth(uint256 tokenId, bytes32 name, address owner);
event TokenSold(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address winner, bytes32 name);
event Transfer(address from, address to, uint256 tokenId);
/*** STRUCTS ***/
struct Drug {
bytes32 name;
address owner;
uint256 price;
uint256 last_price;
address approve_transfer_to;
}
/*** CONSTANTS ***/
string public constant NAME = "EtherDrugs";
string public constant SYMBOL = "DRUG";
bool public gameOpen = false;
/*** STORAGE ***/
mapping (address => uint256) private ownerCount;
mapping (uint256 => address) public lastBuyer;
address public ceoAddress;
mapping (uint256 => address) public extra;
uint256 drug_count;
mapping (uint256 => Drug) private drugs;
/*** ACCESS MODIFIERS ***/
modifier onlyCEO() { }
/*** ACCESS MODIFIES ***/
function setCEO(address _newCEO) public onlyCEO {
}
function setLast(uint256 _id, address _newExtra) public onlyCEO {
}
/*** DEFAULT METHODS ***/
function symbol() public pure returns (string) { }
function name() public pure returns (string) { }
function implementsERC721() public pure returns (bool) { }
/*** CONSTRUCTOR ***/
function EtherDrugs() public {
}
/*** INTERFACE METHODS ***/
function createDrug(bytes32 _name, uint256 _price) public onlyCEO {
}
function createPromoDrug(bytes32 _name, address _owner, uint256 _price, uint256 _last_price) public onlyCEO {
}
function openGame() public onlyCEO {
}
function totalSupply() public view returns (uint256 total) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function priceOf(uint256 _drug_id) public view returns (uint256 price) {
}
function getDrug(uint256 _drug_id) public view returns (
uint256 id,
bytes32 drug_name,
address owner,
uint256 price,
uint256 last_price
) {
}
function getDrugs() public view returns (uint256[], bytes32[], address[], uint256[]) {
}
function purchase(uint256 _drug_id) public payable {
}
function payout() public onlyCEO {
}
function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) {
}
/*** ERC-721 compliance. ***/
function approve(address _to, uint256 _drug_id) public {
}
function ownerOf(uint256 _drug_id) public view returns (address owner){
}
function takeOwnership(uint256 _drug_id) public {
address oldOwner = drugs[_drug_id].owner;
require(msg.sender != address(0));
require(<FILL_ME>)
_transfer(oldOwner, msg.sender, _drug_id);
}
function transfer(address _to, uint256 _drug_id) public {
}
function transferFrom(address _from, address _to, uint256 _drug_id) public {
}
/*** PRIVATE METHODS ***/
function _create_drug(bytes32 _name, address _owner, uint256 _price, uint256 _last_price) private {
}
function _transfer(address _from, address _to, uint256 _drug_id) private {
}
}
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) {
}
}
| drugs[_drug_id].approve_transfer_to==msg.sender | 384,074 | drugs[_drug_id].approve_transfer_to==msg.sender |
null | pragma solidity ^0.4.18;
///EtherDrugs
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <[email protected]> (https://github.com/dete)
contract ERC721 {
function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view returns (address addr);
function takeOwnership(uint256 _tokenId) public;
function totalSupply() public view returns (uint256 total);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function transfer(address _to, uint256 _tokenId) public;
event Transfer(address indexed from, address indexed to, uint256 tokenId);
event Approval(address indexed owner, address indexed approved, uint256 tokenId);
}
contract EtherDrugs is ERC721 {
/*** EVENTS ***/
event Birth(uint256 tokenId, bytes32 name, address owner);
event TokenSold(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address winner, bytes32 name);
event Transfer(address from, address to, uint256 tokenId);
/*** STRUCTS ***/
struct Drug {
bytes32 name;
address owner;
uint256 price;
uint256 last_price;
address approve_transfer_to;
}
/*** CONSTANTS ***/
string public constant NAME = "EtherDrugs";
string public constant SYMBOL = "DRUG";
bool public gameOpen = false;
/*** STORAGE ***/
mapping (address => uint256) private ownerCount;
mapping (uint256 => address) public lastBuyer;
address public ceoAddress;
mapping (uint256 => address) public extra;
uint256 drug_count;
mapping (uint256 => Drug) private drugs;
/*** ACCESS MODIFIERS ***/
modifier onlyCEO() { }
/*** ACCESS MODIFIES ***/
function setCEO(address _newCEO) public onlyCEO {
}
function setLast(uint256 _id, address _newExtra) public onlyCEO {
}
/*** DEFAULT METHODS ***/
function symbol() public pure returns (string) { }
function name() public pure returns (string) { }
function implementsERC721() public pure returns (bool) { }
/*** CONSTRUCTOR ***/
function EtherDrugs() public {
}
/*** INTERFACE METHODS ***/
function createDrug(bytes32 _name, uint256 _price) public onlyCEO {
}
function createPromoDrug(bytes32 _name, address _owner, uint256 _price, uint256 _last_price) public onlyCEO {
}
function openGame() public onlyCEO {
}
function totalSupply() public view returns (uint256 total) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function priceOf(uint256 _drug_id) public view returns (uint256 price) {
}
function getDrug(uint256 _drug_id) public view returns (
uint256 id,
bytes32 drug_name,
address owner,
uint256 price,
uint256 last_price
) {
}
function getDrugs() public view returns (uint256[], bytes32[], address[], uint256[]) {
}
function purchase(uint256 _drug_id) public payable {
}
function payout() public onlyCEO {
}
function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) {
}
/*** ERC-721 compliance. ***/
function approve(address _to, uint256 _drug_id) public {
}
function ownerOf(uint256 _drug_id) public view returns (address owner){
}
function takeOwnership(uint256 _drug_id) public {
}
function transfer(address _to, uint256 _drug_id) public {
}
function transferFrom(address _from, address _to, uint256 _drug_id) public {
require(_from == drugs[_drug_id].owner);
require(<FILL_ME>)
require(_to != address(0));
_transfer(_from, _to, _drug_id);
}
/*** PRIVATE METHODS ***/
function _create_drug(bytes32 _name, address _owner, uint256 _price, uint256 _last_price) private {
}
function _transfer(address _from, address _to, uint256 _drug_id) private {
}
}
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) {
}
}
| drugs[_drug_id].approve_transfer_to==_to | 384,074 | drugs[_drug_id].approve_transfer_to==_to |
"OSM/not-passed" | // osm.sol - Oracle Security Module
// Copyright (C) 2019 Maker Foundation
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU 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 General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
contract DSAuthority {
function canCall(
address src, address dst, bytes4 sig
) public view returns (bool);
}
contract DSAuthEvents {
event LogSetAuthority (address indexed authority);
event LogSetOwner (address indexed owner);
}
contract DSAuth is DSAuthEvents {
DSAuthority public authority;
address public owner;
constructor() public {
}
function setOwner(address owner_)
public
auth
{
}
function setAuthority(DSAuthority authority_)
public
auth
{
}
modifier auth {
}
function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
}
}
////// lib/ds-stop/lib/ds-note/src/note.sol
/// note.sol -- the `note' modifier, for logging calls as events
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU 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 General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity >=0.4.23; */
contract DSNote {
event LogNote(
bytes4 indexed sig,
address indexed guy,
bytes32 indexed foo,
bytes32 indexed bar,
uint256 wad,
bytes fax
) anonymous;
modifier note {
}
}
////// lib/ds-value/lib/ds-thing/lib/ds-math/src/math.sol
/// math.sol -- mixin for inline numerical wizardry
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU 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 General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity >0.4.13; */
contract DSMath {
function add(uint x, uint y) internal pure returns (uint z) {
}
function sub(uint x, uint y) internal pure returns (uint z) {
}
function mul(uint x, uint y) internal pure returns (uint z) {
}
function min(uint x, uint y) internal pure returns (uint z) {
}
function max(uint x, uint y) internal pure returns (uint z) {
}
function imin(int x, int y) internal pure returns (int z) {
}
function imax(int x, int y) internal pure returns (int z) {
}
uint constant WAD = 10 ** 18;
uint constant RAY = 10 ** 27;
function wmul(uint x, uint y) internal pure returns (uint z) {
}
function rmul(uint x, uint y) internal pure returns (uint z) {
}
function wdiv(uint x, uint y) internal pure returns (uint z) {
}
function rdiv(uint x, uint y) internal pure returns (uint z) {
}
// This famous algorithm is called "exponentiation by squaring"
// and calculates x^n with x as fixed-point and n as regular unsigned.
//
// It's O(log n), instead of O(n) for naive repeated multiplication.
//
// These facts are why it works:
//
// If n is even, then x^n = (x^2)^(n/2).
// If n is odd, then x^n = x * x^(n-1),
// and applying the equation for even x gives
// x^n = x * (x^2)^((n-1) / 2).
//
// Also, EVM division is flooring and
// floor[(n-1) / 2] = floor[n / 2].
//
function rpow(uint x, uint n) internal pure returns (uint z) {
}
}
////// lib/ds-value/lib/ds-thing/src/thing.sol
// thing.sol - `auth` with handy mixins. your things should be DSThings
// Copyright (C) 2017 DappHub, LLC
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU 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 General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity >=0.4.23; */
/* import 'ds-auth/auth.sol'; */
/* import 'ds-note/note.sol'; */
/* import 'ds-math/math.sol'; */
contract DSThing is DSAuth, DSNote, DSMath {
function S(string memory s) internal pure returns (bytes4) {
}
}
////// lib/ds-value/src/value.sol
/// value.sol - a value is a simple thing, it can be get and set
// Copyright (C) 2017 DappHub, LLC
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU 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 General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity >=0.4.23; */
/* import 'ds-thing/thing.sol'; */
contract DSValue is DSThing {
bool has;
bytes32 val;
function peek() public view returns (bytes32, bool) {
}
function read() public view returns (bytes32) {
}
function poke(bytes32 wut) public note auth {
}
function void() public note auth {
}
}
////// src/osm.sol
/* pragma solidity >=0.5.10; */
/* import "ds-value/value.sol"; */
contract LibNote {
event LogNote(
bytes4 indexed sig,
address indexed usr,
bytes32 indexed arg1,
bytes32 indexed arg2,
bytes data
) anonymous;
modifier note {
}
}
contract OSM is LibNote {
// --- Auth ---
mapping (address => uint) public wards;
function rely(address usr) external note auth { }
function deny(address usr) external note auth { }
modifier auth {
}
// --- Stop ---
uint256 public stopped;
modifier stoppable { }
// --- Math ---
function add(uint64 x, uint64 y) internal pure returns (uint64 z) {
}
address public src;
uint16 constant ONE_HOUR = uint16(3600);
uint16 public hop = ONE_HOUR;
uint64 public zzz;
struct Feed {
uint128 val;
uint128 has;
}
Feed cur;
Feed nxt;
// Whitelisted contracts, set by an auth
mapping (address => uint256) public bud;
modifier toll { }
event LogValue(bytes32 val);
constructor (address src_) public {
}
function stop() external note auth {
}
function start() external note auth {
}
function change(address src_) external note auth {
}
function era() internal view returns (uint) {
}
function prev(uint ts) internal view returns (uint64) {
}
function step(uint16 ts) external auth {
}
function void() external note auth {
}
function pass() public view returns (bool ok) {
}
function poke() external note stoppable {
require(<FILL_ME>)
(bytes32 wut, bool ok) = DSValue(src).peek();
if (ok) {
cur = nxt;
nxt = Feed(uint128(uint(wut)), 1);
zzz = prev(era());
emit LogValue(bytes32(uint(cur.val)));
}
}
function peek() external view toll returns (bytes32,bool) {
}
function peep() external view toll returns (bytes32,bool) {
}
function read() external view toll returns (bytes32) {
}
function kiss(address a) external note auth {
}
function diss(address a) external note auth {
}
function kiss(address[] calldata a) external note auth {
}
function diss(address[] calldata a) external note auth {
}
}
| pass(),"OSM/not-passed" | 384,176 | pass() |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
require(<FILL_ME>)
_;
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| getState()==state | 384,216 | getState()==state |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
require(<FILL_ME>)
require(isAllTokensApproved());
preallocateTokens();
isPreallocated = true;
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| !isPreallocated | 384,216 | !isPreallocated |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
require(!isPreallocated);
require(<FILL_ME>)
preallocateTokens();
isPreallocated = true;
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| isAllTokensApproved() | 384,216 | isAllTokensApproved() |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
require(<FILL_ME>) // Crowdsale needs to track participants for thank you email
require(!requiredSignedAddress); // Crowdsale allows only server-side signed participants
investInternal(msg.sender, 0);
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| !requireCustomerId | 384,216 | !requireCustomerId |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
require(!requireCustomerId); // Crowdsale needs to track participants for thank you email
require(<FILL_ME>) // Crowdsale allows only server-side signed participants
investInternal(msg.sender, 0);
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| !requiredSignedAddress | 384,216 | !requiredSignedAddress |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
finalizeAgent = agent;
require(<FILL_ME>)
require(finalizeAgent.isSane());
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| finalizeAgent.isFinalizeAgent() | 384,216 | finalizeAgent.isFinalizeAgent() |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
finalizeAgent = agent;
require(finalizeAgent.isFinalizeAgent());
require(<FILL_ME>)
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| finalizeAgent.isSane() | 384,216 | finalizeAgent.isSane() |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
State state = getState();
require(<FILL_ME>)
allowRefund = val;
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| paused||state==State.Success||state==State.Failure||state==State.Refunding | 384,216 | paused||state==State.Success||state==State.Failure||state==State.Refunding |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
State state = getState();
if (state == State.PreFunding || state == State.Funding) {
require(paused);
}
pricingStrategy = _pricingStrategy;
require(<FILL_ME>)
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| pricingStrategy.isPricingStrategy() | 384,216 | pricingStrategy.isPricingStrategy() |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
State state = getState();
require(state == State.PreFunding || state == State.Funding);
uint weiAmount = msg.value;
uint tokenAmount = 0;
if (state == State.PreFunding) {
require(<FILL_ME>)
require(weiAmount <= earlyParticipantWhitelist[receiver]);
assert(!pricingStrategy.isPresaleFull(presaleWeiRaised));
}
tokenAmount = pricingStrategy.getAmountOfTokens(weiAmount, weiRaised);
require(tokenAmount > 0);
if (investedAmountOf[receiver] == 0) {
investorCount++;
}
investedAmountOf[receiver] = investedAmountOf[receiver].add(weiAmount);
tokenAmountOf[receiver] = tokenAmountOf[receiver].add(tokenAmount);
weiRaised = weiRaised.add(weiAmount);
tokensSold = tokensSold.add(tokenAmount);
if (state == State.PreFunding) {
presaleWeiRaised = presaleWeiRaised.add(weiAmount);
earlyParticipantWhitelist[receiver] = earlyParticipantWhitelist[receiver].sub(weiAmount);
}
require(!isBreakingCap(tokenAmount));
assignTokens(receiver, tokenAmount);
require(multisigWallet.send(weiAmount));
Invested(receiver, weiAmount, tokenAmount, customerId);
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| earlyParticipantWhitelist[receiver]>0 | 384,216 | earlyParticipantWhitelist[receiver]>0 |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
State state = getState();
require(state == State.PreFunding || state == State.Funding);
uint weiAmount = msg.value;
uint tokenAmount = 0;
if (state == State.PreFunding) {
require(earlyParticipantWhitelist[receiver] > 0);
require(weiAmount <= earlyParticipantWhitelist[receiver]);
assert(!pricingStrategy.isPresaleFull(presaleWeiRaised));
}
tokenAmount = pricingStrategy.getAmountOfTokens(weiAmount, weiRaised);
require(tokenAmount > 0);
if (investedAmountOf[receiver] == 0) {
investorCount++;
}
investedAmountOf[receiver] = investedAmountOf[receiver].add(weiAmount);
tokenAmountOf[receiver] = tokenAmountOf[receiver].add(tokenAmount);
weiRaised = weiRaised.add(weiAmount);
tokensSold = tokensSold.add(tokenAmount);
if (state == State.PreFunding) {
presaleWeiRaised = presaleWeiRaised.add(weiAmount);
earlyParticipantWhitelist[receiver] = earlyParticipantWhitelist[receiver].sub(weiAmount);
}
require(<FILL_ME>)
assignTokens(receiver, tokenAmount);
require(multisigWallet.send(weiAmount));
Invested(receiver, weiAmount, tokenAmount, customerId);
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| !isBreakingCap(tokenAmount) | 384,216 | !isBreakingCap(tokenAmount) |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
State state = getState();
require(state == State.PreFunding || state == State.Funding);
uint weiAmount = msg.value;
uint tokenAmount = 0;
if (state == State.PreFunding) {
require(earlyParticipantWhitelist[receiver] > 0);
require(weiAmount <= earlyParticipantWhitelist[receiver]);
assert(!pricingStrategy.isPresaleFull(presaleWeiRaised));
}
tokenAmount = pricingStrategy.getAmountOfTokens(weiAmount, weiRaised);
require(tokenAmount > 0);
if (investedAmountOf[receiver] == 0) {
investorCount++;
}
investedAmountOf[receiver] = investedAmountOf[receiver].add(weiAmount);
tokenAmountOf[receiver] = tokenAmountOf[receiver].add(tokenAmount);
weiRaised = weiRaised.add(weiAmount);
tokensSold = tokensSold.add(tokenAmount);
if (state == State.PreFunding) {
presaleWeiRaised = presaleWeiRaised.add(weiAmount);
earlyParticipantWhitelist[receiver] = earlyParticipantWhitelist[receiver].sub(weiAmount);
}
require(!isBreakingCap(tokenAmount));
assignTokens(receiver, tokenAmount);
require(<FILL_ME>)
Invested(receiver, weiAmount, tokenAmount, customerId);
}
function assignTokens(address receiver, uint tokenAmount) private {
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| multisigWallet.send(weiAmount) | 384,216 | multisigWallet.send(weiAmount) |
null | /**
* @title Algory Crowdsale
*
* @dev based on TokenMarketNet
*
* Apache License, version 2.0 https://github.com/AlgoryProject/algory-ico/blob/master/LICENSE
*/
contract AlgoryCrowdsale is InvestmentPolicyCrowdsale {
/* Max investment count when we are still allowed to change the multisig address */
uint constant public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMath for uint;
/* The token we are selling */
CrowdsaleToken public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* tokens will be transfered from this address */
address public multisigWallet;
/* The party who holds the full token pool and has approve()'ed tokens for this crowdsale */
address public beneficiary;
/* the UNIX timestamp start date of the presale */
uint public presaleStartsAt;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/** How many wei we have in whitelist declarations*/
uint public whitelistWeiRaised = 0;
/* Calculate incoming funds from presale contracts and addresses */
uint public presaleWeiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* How much wei we have returned back to the contract after a failed crowdfund. */
uint public loadedRefund = 0;
/* How much wei we have given back to investors.*/
uint public weiRefunded = 0;
/* Has this crowdsale been finalized */
bool public finalized = false;
/* Allow investors refund theirs money */
bool public allowRefund = false;
// Has tokens preallocated */
bool private isPreallocated = false;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
/** Addresses and amount in weis that are allowed to invest even before ICO official opens. */
mapping (address => uint) public earlyParticipantWhitelist;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - PreFunding: We have not passed start time yet, allow buy for whitelisted participants
* - Funding: Active crowdsale
* - Success: Passed end time or crowdsale is full (all tokens sold)
* - Finalized: The finalized has been called and successfully executed
* - Refunding: Refunds are loaded on the contract for reclaim.
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Refund was processed for a contributor
event Refund(address investor, uint weiAmount);
// Address early participation whitelist status changed
event Whitelisted(address addr, uint value);
// Crowdsale time boundary has changed
event TimeBoundaryChanged(string timeBoundary, uint timestamp);
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
}
function AlgoryCrowdsale(address _token, address _beneficiary, PricingStrategy _pricingStrategy, address _multisigWallet, uint _presaleStart, uint _start, uint _end) public {
}
function prepareCrowdsale() onlyOwner external {
}
/**
* Allow to send money and get tokens.
*/
function() payable {
}
function setFinalizeAgent(FinalizeAgent agent) onlyOwner external{
}
function setPresaleStartsAt(uint presaleStart) inState(State.Preparing) onlyOwner external {
}
function setStartsAt(uint start) onlyOwner external {
}
function setEndsAt(uint end) onlyOwner external {
}
function loadEarlyParticipantsWhitelist(address[] participantsArray, uint[] valuesArray) onlyOwner external {
}
/**
* Finalize a successful crowdsale.
*/
function finalize() inState(State.Success) onlyOwner whenNotPaused external {
}
function allowRefunding(bool val) onlyOwner external {
}
function loadRefund() inState(State.Failure) external payable {
}
function refund() inState(State.Refunding) external {
}
function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner public {
}
function setMultisigWallet(address wallet) onlyOwner public {
}
function setEarlyParticipantWhitelist(address participant, uint value) onlyOwner public {
}
function getTokensLeft() public constant returns (uint) {
}
function isCrowdsaleFull() public constant returns (bool) {
}
function getState() public constant returns (State) {
}
/**
* Check is crowdsale can be able to transfer all tokens from beneficiary
*/
function isAllTokensApproved() private constant returns (bool) {
}
function isBreakingCap(uint tokenAmount) private constant returns (bool limitBroken) {
}
function investInternal(address receiver, uint128 customerId) whenNotPaused internal{
}
function assignTokens(address receiver, uint tokenAmount) private {
require(<FILL_ME>)
}
/**
* Preallocate tokens for developers, company and bounty
*/
function preallocateTokens() private {
}
}
| token.transferFrom(beneficiary,receiver,tokenAmount) | 384,216 | token.transferFrom(beneficiary,receiver,tokenAmount) |
null | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.11;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ======================= FRAXStablecoin (FRAX) ======================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
// Reviewer(s) / Contributor(s)
// Sam Sun: https://github.com/samczsun
import "../Common/Context.sol";
import "../ERC20/IERC20.sol";
import "../ERC20/ERC20Custom.sol";
import "../ERC20/ERC20.sol";
import "../Math/SafeMath.sol";
import "../Staking/Owned.sol";
import "../FXS/FXS.sol";
import "./Pools/FraxPool.sol";
import "../Oracle/UniswapPairOracle.sol";
import "../Oracle/ChainlinkETHUSDPriceConsumer.sol";
import "../Governance/AccessControl.sol";
contract FRAXStablecoin is ERC20Custom, AccessControl, Owned {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { FRAX, FXS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private fraxEthOracle;
UniswapPairOracle private fxsEthOracle;
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public creator_address;
address public timelock_address; // Governance timelock address
address public controller_address; // Controller contract to dynamically adjust system parameters automatically
address public fxs_address;
address public frax_eth_oracle_address;
address public fxs_eth_oracle_address;
address public weth_address;
address public eth_usd_consumer_address;
uint256 public constant genesis_supply = 2000000e18; // 2M FRAX (only for testing, genesis supply will be 5k on Mainnet). This is to help with establishing the Uniswap pools, as they need liquidity
// The addresses in this array are added by the oracle and these contracts are able to mint frax
address[] public frax_pools_array;
// Mapping is also used for faster verification
mapping(address => bool) public frax_pools;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
uint256 public global_collateral_ratio; // 6 decimals of precision, e.g. 924102 = 0.924102
uint256 public redemption_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public minting_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public frax_step; // Amount to change the collateralization ratio by upon refreshCollateralRatio()
uint256 public refresh_cooldown; // Seconds to wait before being able to run refreshCollateralRatio() again
uint256 public price_target; // The price of FRAX at which the collateral ratio will respond to; this value is only used for the collateral ratio mechanism and not for minting and redeeming which are hardcoded at $1
uint256 public price_band; // The bound above and below the price target at which the refreshCollateralRatio() will not change the collateral ratio
address public DEFAULT_ADMIN_ADDRESS;
bytes32 public constant COLLATERAL_RATIO_PAUSER = keccak256("COLLATERAL_RATIO_PAUSER");
bool public collateral_ratio_paused = false;
/* ========== MODIFIERS ========== */
modifier onlyCollateralRatioPauser() {
require(<FILL_ME>)
_;
}
modifier onlyPools() {
}
modifier onlyByOwnerGovernanceOrController() {
}
modifier onlyByOwnerGovernanceOrPool() {
}
/* ========== CONSTRUCTOR ========== */
constructor(
string memory _name,
string memory _symbol,
address _creator_address,
address _timelock_address
) public Owned(_creator_address){
}
/* ========== VIEWS ========== */
// Choice = 'FRAX' or 'FXS' for now
function oracle_price(PriceChoice choice) internal view returns (uint256) {
}
// Returns X FRAX = 1 USD
function frax_price() public view returns (uint256) {
}
// Returns X FXS = 1 USD
function fxs_price() public view returns (uint256) {
}
function eth_usd_price() public view returns (uint256) {
}
// This is needed to avoid costly repeat calls to different getter functions
// It is cheaper gas-wise to just dump everything and only use some of the info
function frax_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
}
// Iterate through all frax pools and calculate all value of collateral in all pools globally
function globalCollateralValue() public view returns (uint256) {
}
/* ========== PUBLIC FUNCTIONS ========== */
// There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion.
uint256 public last_call_time; // Last time the refreshCollateralRatio function was called
function refreshCollateralRatio() public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
// Used by pools when user redeems
function pool_burn_from(address b_address, uint256 b_amount) public onlyPools {
}
// This function is what other frax pools will call to mint new FRAX
function pool_mint(address m_address, uint256 m_amount) public onlyPools {
}
// Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerGovernanceOrController {
}
// Remove a pool
function removePool(address pool_address) public onlyByOwnerGovernanceOrController {
}
function setRedemptionFee(uint256 red_fee) public onlyByOwnerGovernanceOrController {
}
function setMintingFee(uint256 min_fee) public onlyByOwnerGovernanceOrController {
}
function setFraxStep(uint256 _new_step) public onlyByOwnerGovernanceOrController {
}
function setPriceTarget (uint256 _new_price_target) public onlyByOwnerGovernanceOrController {
}
function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerGovernanceOrController {
}
function setFXSAddress(address _fxs_address) public onlyByOwnerGovernanceOrController {
}
function setETHUSDOracle(address _eth_usd_consumer_address) public onlyByOwnerGovernanceOrController {
}
function setTimelock(address new_timelock) external onlyByOwnerGovernanceOrController {
}
function setController(address _controller_address) external onlyByOwnerGovernanceOrController {
}
function setPriceBand(uint256 _price_band) external onlyByOwnerGovernanceOrController {
}
// Sets the FRAX_ETH Uniswap oracle address
function setFRAXEthOracle(address _frax_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
// Sets the FXS_ETH Uniswap oracle address
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
function toggleCollateralRatio() public onlyCollateralRatioPauser {
}
/* ========== EVENTS ========== */
// Track FRAX burned
event FRAXBurned(address indexed from, address indexed to, uint256 amount);
// Track FRAX minted
event FRAXMinted(address indexed from, address indexed to, uint256 amount);
event CollateralRatioRefreshed(uint256 global_collateral_ratio);
event PoolAdded(address pool_address);
event PoolRemoved(address pool_address);
event RedemptionFeeSet(uint256 red_fee);
event MintingFeeSet(uint256 min_fee);
event FraxStepSet(uint256 new_step);
event PriceTargetSet(uint256 new_price_target);
event RefreshCooldownSet(uint256 new_cooldown);
event FXSAddressSet(address _fxs_address);
event ETHUSDOracleSet(address eth_usd_consumer_address);
event TimelockSet(address new_timelock);
event ControllerSet(address controller_address);
event PriceBandSet(uint256 price_band);
event FRAXETHOracleSet(address frax_oracle_addr, address weth_address);
event FXSEthOracleSet(address fxs_oracle_addr, address weth_address);
event CollateralRatioToggled(bool collateral_ratio_paused);
}
| hasRole(COLLATERAL_RATIO_PAUSER,msg.sender) | 384,361 | hasRole(COLLATERAL_RATIO_PAUSER,msg.sender) |
"Only frax pools can call this function" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.11;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ======================= FRAXStablecoin (FRAX) ======================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
// Reviewer(s) / Contributor(s)
// Sam Sun: https://github.com/samczsun
import "../Common/Context.sol";
import "../ERC20/IERC20.sol";
import "../ERC20/ERC20Custom.sol";
import "../ERC20/ERC20.sol";
import "../Math/SafeMath.sol";
import "../Staking/Owned.sol";
import "../FXS/FXS.sol";
import "./Pools/FraxPool.sol";
import "../Oracle/UniswapPairOracle.sol";
import "../Oracle/ChainlinkETHUSDPriceConsumer.sol";
import "../Governance/AccessControl.sol";
contract FRAXStablecoin is ERC20Custom, AccessControl, Owned {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { FRAX, FXS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private fraxEthOracle;
UniswapPairOracle private fxsEthOracle;
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public creator_address;
address public timelock_address; // Governance timelock address
address public controller_address; // Controller contract to dynamically adjust system parameters automatically
address public fxs_address;
address public frax_eth_oracle_address;
address public fxs_eth_oracle_address;
address public weth_address;
address public eth_usd_consumer_address;
uint256 public constant genesis_supply = 2000000e18; // 2M FRAX (only for testing, genesis supply will be 5k on Mainnet). This is to help with establishing the Uniswap pools, as they need liquidity
// The addresses in this array are added by the oracle and these contracts are able to mint frax
address[] public frax_pools_array;
// Mapping is also used for faster verification
mapping(address => bool) public frax_pools;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
uint256 public global_collateral_ratio; // 6 decimals of precision, e.g. 924102 = 0.924102
uint256 public redemption_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public minting_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public frax_step; // Amount to change the collateralization ratio by upon refreshCollateralRatio()
uint256 public refresh_cooldown; // Seconds to wait before being able to run refreshCollateralRatio() again
uint256 public price_target; // The price of FRAX at which the collateral ratio will respond to; this value is only used for the collateral ratio mechanism and not for minting and redeeming which are hardcoded at $1
uint256 public price_band; // The bound above and below the price target at which the refreshCollateralRatio() will not change the collateral ratio
address public DEFAULT_ADMIN_ADDRESS;
bytes32 public constant COLLATERAL_RATIO_PAUSER = keccak256("COLLATERAL_RATIO_PAUSER");
bool public collateral_ratio_paused = false;
/* ========== MODIFIERS ========== */
modifier onlyCollateralRatioPauser() {
}
modifier onlyPools() {
require(<FILL_ME>)
_;
}
modifier onlyByOwnerGovernanceOrController() {
}
modifier onlyByOwnerGovernanceOrPool() {
}
/* ========== CONSTRUCTOR ========== */
constructor(
string memory _name,
string memory _symbol,
address _creator_address,
address _timelock_address
) public Owned(_creator_address){
}
/* ========== VIEWS ========== */
// Choice = 'FRAX' or 'FXS' for now
function oracle_price(PriceChoice choice) internal view returns (uint256) {
}
// Returns X FRAX = 1 USD
function frax_price() public view returns (uint256) {
}
// Returns X FXS = 1 USD
function fxs_price() public view returns (uint256) {
}
function eth_usd_price() public view returns (uint256) {
}
// This is needed to avoid costly repeat calls to different getter functions
// It is cheaper gas-wise to just dump everything and only use some of the info
function frax_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
}
// Iterate through all frax pools and calculate all value of collateral in all pools globally
function globalCollateralValue() public view returns (uint256) {
}
/* ========== PUBLIC FUNCTIONS ========== */
// There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion.
uint256 public last_call_time; // Last time the refreshCollateralRatio function was called
function refreshCollateralRatio() public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
// Used by pools when user redeems
function pool_burn_from(address b_address, uint256 b_amount) public onlyPools {
}
// This function is what other frax pools will call to mint new FRAX
function pool_mint(address m_address, uint256 m_amount) public onlyPools {
}
// Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerGovernanceOrController {
}
// Remove a pool
function removePool(address pool_address) public onlyByOwnerGovernanceOrController {
}
function setRedemptionFee(uint256 red_fee) public onlyByOwnerGovernanceOrController {
}
function setMintingFee(uint256 min_fee) public onlyByOwnerGovernanceOrController {
}
function setFraxStep(uint256 _new_step) public onlyByOwnerGovernanceOrController {
}
function setPriceTarget (uint256 _new_price_target) public onlyByOwnerGovernanceOrController {
}
function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerGovernanceOrController {
}
function setFXSAddress(address _fxs_address) public onlyByOwnerGovernanceOrController {
}
function setETHUSDOracle(address _eth_usd_consumer_address) public onlyByOwnerGovernanceOrController {
}
function setTimelock(address new_timelock) external onlyByOwnerGovernanceOrController {
}
function setController(address _controller_address) external onlyByOwnerGovernanceOrController {
}
function setPriceBand(uint256 _price_band) external onlyByOwnerGovernanceOrController {
}
// Sets the FRAX_ETH Uniswap oracle address
function setFRAXEthOracle(address _frax_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
// Sets the FXS_ETH Uniswap oracle address
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
function toggleCollateralRatio() public onlyCollateralRatioPauser {
}
/* ========== EVENTS ========== */
// Track FRAX burned
event FRAXBurned(address indexed from, address indexed to, uint256 amount);
// Track FRAX minted
event FRAXMinted(address indexed from, address indexed to, uint256 amount);
event CollateralRatioRefreshed(uint256 global_collateral_ratio);
event PoolAdded(address pool_address);
event PoolRemoved(address pool_address);
event RedemptionFeeSet(uint256 red_fee);
event MintingFeeSet(uint256 min_fee);
event FraxStepSet(uint256 new_step);
event PriceTargetSet(uint256 new_price_target);
event RefreshCooldownSet(uint256 new_cooldown);
event FXSAddressSet(address _fxs_address);
event ETHUSDOracleSet(address eth_usd_consumer_address);
event TimelockSet(address new_timelock);
event ControllerSet(address controller_address);
event PriceBandSet(uint256 price_band);
event FRAXETHOracleSet(address frax_oracle_addr, address weth_address);
event FXSEthOracleSet(address fxs_oracle_addr, address weth_address);
event CollateralRatioToggled(bool collateral_ratio_paused);
}
| frax_pools[msg.sender]==true,"Only frax pools can call this function" | 384,361 | frax_pools[msg.sender]==true |
"Must wait for the refresh cooldown since last refresh" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.11;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ======================= FRAXStablecoin (FRAX) ======================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
// Reviewer(s) / Contributor(s)
// Sam Sun: https://github.com/samczsun
import "../Common/Context.sol";
import "../ERC20/IERC20.sol";
import "../ERC20/ERC20Custom.sol";
import "../ERC20/ERC20.sol";
import "../Math/SafeMath.sol";
import "../Staking/Owned.sol";
import "../FXS/FXS.sol";
import "./Pools/FraxPool.sol";
import "../Oracle/UniswapPairOracle.sol";
import "../Oracle/ChainlinkETHUSDPriceConsumer.sol";
import "../Governance/AccessControl.sol";
contract FRAXStablecoin is ERC20Custom, AccessControl, Owned {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { FRAX, FXS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private fraxEthOracle;
UniswapPairOracle private fxsEthOracle;
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public creator_address;
address public timelock_address; // Governance timelock address
address public controller_address; // Controller contract to dynamically adjust system parameters automatically
address public fxs_address;
address public frax_eth_oracle_address;
address public fxs_eth_oracle_address;
address public weth_address;
address public eth_usd_consumer_address;
uint256 public constant genesis_supply = 2000000e18; // 2M FRAX (only for testing, genesis supply will be 5k on Mainnet). This is to help with establishing the Uniswap pools, as they need liquidity
// The addresses in this array are added by the oracle and these contracts are able to mint frax
address[] public frax_pools_array;
// Mapping is also used for faster verification
mapping(address => bool) public frax_pools;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
uint256 public global_collateral_ratio; // 6 decimals of precision, e.g. 924102 = 0.924102
uint256 public redemption_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public minting_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public frax_step; // Amount to change the collateralization ratio by upon refreshCollateralRatio()
uint256 public refresh_cooldown; // Seconds to wait before being able to run refreshCollateralRatio() again
uint256 public price_target; // The price of FRAX at which the collateral ratio will respond to; this value is only used for the collateral ratio mechanism and not for minting and redeeming which are hardcoded at $1
uint256 public price_band; // The bound above and below the price target at which the refreshCollateralRatio() will not change the collateral ratio
address public DEFAULT_ADMIN_ADDRESS;
bytes32 public constant COLLATERAL_RATIO_PAUSER = keccak256("COLLATERAL_RATIO_PAUSER");
bool public collateral_ratio_paused = false;
/* ========== MODIFIERS ========== */
modifier onlyCollateralRatioPauser() {
}
modifier onlyPools() {
}
modifier onlyByOwnerGovernanceOrController() {
}
modifier onlyByOwnerGovernanceOrPool() {
}
/* ========== CONSTRUCTOR ========== */
constructor(
string memory _name,
string memory _symbol,
address _creator_address,
address _timelock_address
) public Owned(_creator_address){
}
/* ========== VIEWS ========== */
// Choice = 'FRAX' or 'FXS' for now
function oracle_price(PriceChoice choice) internal view returns (uint256) {
}
// Returns X FRAX = 1 USD
function frax_price() public view returns (uint256) {
}
// Returns X FXS = 1 USD
function fxs_price() public view returns (uint256) {
}
function eth_usd_price() public view returns (uint256) {
}
// This is needed to avoid costly repeat calls to different getter functions
// It is cheaper gas-wise to just dump everything and only use some of the info
function frax_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
}
// Iterate through all frax pools and calculate all value of collateral in all pools globally
function globalCollateralValue() public view returns (uint256) {
}
/* ========== PUBLIC FUNCTIONS ========== */
// There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion.
uint256 public last_call_time; // Last time the refreshCollateralRatio function was called
function refreshCollateralRatio() public {
require(collateral_ratio_paused == false, "Collateral Ratio has been paused");
uint256 frax_price_cur = frax_price();
require(<FILL_ME>)
// Step increments are 0.25% (upon genesis, changable by setFraxStep())
if (frax_price_cur > price_target.add(price_band)) { //decrease collateral ratio
if(global_collateral_ratio <= frax_step){ //if within a step of 0, go to 0
global_collateral_ratio = 0;
} else {
global_collateral_ratio = global_collateral_ratio.sub(frax_step);
}
} else if (frax_price_cur < price_target.sub(price_band)) { //increase collateral ratio
if(global_collateral_ratio.add(frax_step) >= 1000000){
global_collateral_ratio = 1000000; // cap collateral ratio at 1.000000
} else {
global_collateral_ratio = global_collateral_ratio.add(frax_step);
}
}
last_call_time = block.timestamp; // Set the time of the last expansion
emit CollateralRatioRefreshed(global_collateral_ratio);
}
/* ========== RESTRICTED FUNCTIONS ========== */
// Used by pools when user redeems
function pool_burn_from(address b_address, uint256 b_amount) public onlyPools {
}
// This function is what other frax pools will call to mint new FRAX
function pool_mint(address m_address, uint256 m_amount) public onlyPools {
}
// Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerGovernanceOrController {
}
// Remove a pool
function removePool(address pool_address) public onlyByOwnerGovernanceOrController {
}
function setRedemptionFee(uint256 red_fee) public onlyByOwnerGovernanceOrController {
}
function setMintingFee(uint256 min_fee) public onlyByOwnerGovernanceOrController {
}
function setFraxStep(uint256 _new_step) public onlyByOwnerGovernanceOrController {
}
function setPriceTarget (uint256 _new_price_target) public onlyByOwnerGovernanceOrController {
}
function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerGovernanceOrController {
}
function setFXSAddress(address _fxs_address) public onlyByOwnerGovernanceOrController {
}
function setETHUSDOracle(address _eth_usd_consumer_address) public onlyByOwnerGovernanceOrController {
}
function setTimelock(address new_timelock) external onlyByOwnerGovernanceOrController {
}
function setController(address _controller_address) external onlyByOwnerGovernanceOrController {
}
function setPriceBand(uint256 _price_band) external onlyByOwnerGovernanceOrController {
}
// Sets the FRAX_ETH Uniswap oracle address
function setFRAXEthOracle(address _frax_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
// Sets the FXS_ETH Uniswap oracle address
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
function toggleCollateralRatio() public onlyCollateralRatioPauser {
}
/* ========== EVENTS ========== */
// Track FRAX burned
event FRAXBurned(address indexed from, address indexed to, uint256 amount);
// Track FRAX minted
event FRAXMinted(address indexed from, address indexed to, uint256 amount);
event CollateralRatioRefreshed(uint256 global_collateral_ratio);
event PoolAdded(address pool_address);
event PoolRemoved(address pool_address);
event RedemptionFeeSet(uint256 red_fee);
event MintingFeeSet(uint256 min_fee);
event FraxStepSet(uint256 new_step);
event PriceTargetSet(uint256 new_price_target);
event RefreshCooldownSet(uint256 new_cooldown);
event FXSAddressSet(address _fxs_address);
event ETHUSDOracleSet(address eth_usd_consumer_address);
event TimelockSet(address new_timelock);
event ControllerSet(address controller_address);
event PriceBandSet(uint256 price_band);
event FRAXETHOracleSet(address frax_oracle_addr, address weth_address);
event FXSEthOracleSet(address fxs_oracle_addr, address weth_address);
event CollateralRatioToggled(bool collateral_ratio_paused);
}
| block.timestamp-last_call_time>=refresh_cooldown,"Must wait for the refresh cooldown since last refresh" | 384,361 | block.timestamp-last_call_time>=refresh_cooldown |
"Address already exists" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.11;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ======================= FRAXStablecoin (FRAX) ======================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
// Reviewer(s) / Contributor(s)
// Sam Sun: https://github.com/samczsun
import "../Common/Context.sol";
import "../ERC20/IERC20.sol";
import "../ERC20/ERC20Custom.sol";
import "../ERC20/ERC20.sol";
import "../Math/SafeMath.sol";
import "../Staking/Owned.sol";
import "../FXS/FXS.sol";
import "./Pools/FraxPool.sol";
import "../Oracle/UniswapPairOracle.sol";
import "../Oracle/ChainlinkETHUSDPriceConsumer.sol";
import "../Governance/AccessControl.sol";
contract FRAXStablecoin is ERC20Custom, AccessControl, Owned {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { FRAX, FXS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private fraxEthOracle;
UniswapPairOracle private fxsEthOracle;
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public creator_address;
address public timelock_address; // Governance timelock address
address public controller_address; // Controller contract to dynamically adjust system parameters automatically
address public fxs_address;
address public frax_eth_oracle_address;
address public fxs_eth_oracle_address;
address public weth_address;
address public eth_usd_consumer_address;
uint256 public constant genesis_supply = 2000000e18; // 2M FRAX (only for testing, genesis supply will be 5k on Mainnet). This is to help with establishing the Uniswap pools, as they need liquidity
// The addresses in this array are added by the oracle and these contracts are able to mint frax
address[] public frax_pools_array;
// Mapping is also used for faster verification
mapping(address => bool) public frax_pools;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
uint256 public global_collateral_ratio; // 6 decimals of precision, e.g. 924102 = 0.924102
uint256 public redemption_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public minting_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public frax_step; // Amount to change the collateralization ratio by upon refreshCollateralRatio()
uint256 public refresh_cooldown; // Seconds to wait before being able to run refreshCollateralRatio() again
uint256 public price_target; // The price of FRAX at which the collateral ratio will respond to; this value is only used for the collateral ratio mechanism and not for minting and redeeming which are hardcoded at $1
uint256 public price_band; // The bound above and below the price target at which the refreshCollateralRatio() will not change the collateral ratio
address public DEFAULT_ADMIN_ADDRESS;
bytes32 public constant COLLATERAL_RATIO_PAUSER = keccak256("COLLATERAL_RATIO_PAUSER");
bool public collateral_ratio_paused = false;
/* ========== MODIFIERS ========== */
modifier onlyCollateralRatioPauser() {
}
modifier onlyPools() {
}
modifier onlyByOwnerGovernanceOrController() {
}
modifier onlyByOwnerGovernanceOrPool() {
}
/* ========== CONSTRUCTOR ========== */
constructor(
string memory _name,
string memory _symbol,
address _creator_address,
address _timelock_address
) public Owned(_creator_address){
}
/* ========== VIEWS ========== */
// Choice = 'FRAX' or 'FXS' for now
function oracle_price(PriceChoice choice) internal view returns (uint256) {
}
// Returns X FRAX = 1 USD
function frax_price() public view returns (uint256) {
}
// Returns X FXS = 1 USD
function fxs_price() public view returns (uint256) {
}
function eth_usd_price() public view returns (uint256) {
}
// This is needed to avoid costly repeat calls to different getter functions
// It is cheaper gas-wise to just dump everything and only use some of the info
function frax_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
}
// Iterate through all frax pools and calculate all value of collateral in all pools globally
function globalCollateralValue() public view returns (uint256) {
}
/* ========== PUBLIC FUNCTIONS ========== */
// There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion.
uint256 public last_call_time; // Last time the refreshCollateralRatio function was called
function refreshCollateralRatio() public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
// Used by pools when user redeems
function pool_burn_from(address b_address, uint256 b_amount) public onlyPools {
}
// This function is what other frax pools will call to mint new FRAX
function pool_mint(address m_address, uint256 m_amount) public onlyPools {
}
// Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerGovernanceOrController {
require(pool_address != address(0), "Zero address detected");
require(<FILL_ME>)
frax_pools[pool_address] = true;
frax_pools_array.push(pool_address);
emit PoolAdded(pool_address);
}
// Remove a pool
function removePool(address pool_address) public onlyByOwnerGovernanceOrController {
}
function setRedemptionFee(uint256 red_fee) public onlyByOwnerGovernanceOrController {
}
function setMintingFee(uint256 min_fee) public onlyByOwnerGovernanceOrController {
}
function setFraxStep(uint256 _new_step) public onlyByOwnerGovernanceOrController {
}
function setPriceTarget (uint256 _new_price_target) public onlyByOwnerGovernanceOrController {
}
function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerGovernanceOrController {
}
function setFXSAddress(address _fxs_address) public onlyByOwnerGovernanceOrController {
}
function setETHUSDOracle(address _eth_usd_consumer_address) public onlyByOwnerGovernanceOrController {
}
function setTimelock(address new_timelock) external onlyByOwnerGovernanceOrController {
}
function setController(address _controller_address) external onlyByOwnerGovernanceOrController {
}
function setPriceBand(uint256 _price_band) external onlyByOwnerGovernanceOrController {
}
// Sets the FRAX_ETH Uniswap oracle address
function setFRAXEthOracle(address _frax_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
// Sets the FXS_ETH Uniswap oracle address
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
function toggleCollateralRatio() public onlyCollateralRatioPauser {
}
/* ========== EVENTS ========== */
// Track FRAX burned
event FRAXBurned(address indexed from, address indexed to, uint256 amount);
// Track FRAX minted
event FRAXMinted(address indexed from, address indexed to, uint256 amount);
event CollateralRatioRefreshed(uint256 global_collateral_ratio);
event PoolAdded(address pool_address);
event PoolRemoved(address pool_address);
event RedemptionFeeSet(uint256 red_fee);
event MintingFeeSet(uint256 min_fee);
event FraxStepSet(uint256 new_step);
event PriceTargetSet(uint256 new_price_target);
event RefreshCooldownSet(uint256 new_cooldown);
event FXSAddressSet(address _fxs_address);
event ETHUSDOracleSet(address eth_usd_consumer_address);
event TimelockSet(address new_timelock);
event ControllerSet(address controller_address);
event PriceBandSet(uint256 price_band);
event FRAXETHOracleSet(address frax_oracle_addr, address weth_address);
event FXSEthOracleSet(address fxs_oracle_addr, address weth_address);
event CollateralRatioToggled(bool collateral_ratio_paused);
}
| frax_pools[pool_address]==false,"Address already exists" | 384,361 | frax_pools[pool_address]==false |
"Address nonexistant" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.11;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ======================= FRAXStablecoin (FRAX) ======================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
// Reviewer(s) / Contributor(s)
// Sam Sun: https://github.com/samczsun
import "../Common/Context.sol";
import "../ERC20/IERC20.sol";
import "../ERC20/ERC20Custom.sol";
import "../ERC20/ERC20.sol";
import "../Math/SafeMath.sol";
import "../Staking/Owned.sol";
import "../FXS/FXS.sol";
import "./Pools/FraxPool.sol";
import "../Oracle/UniswapPairOracle.sol";
import "../Oracle/ChainlinkETHUSDPriceConsumer.sol";
import "../Governance/AccessControl.sol";
contract FRAXStablecoin is ERC20Custom, AccessControl, Owned {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { FRAX, FXS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private fraxEthOracle;
UniswapPairOracle private fxsEthOracle;
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public creator_address;
address public timelock_address; // Governance timelock address
address public controller_address; // Controller contract to dynamically adjust system parameters automatically
address public fxs_address;
address public frax_eth_oracle_address;
address public fxs_eth_oracle_address;
address public weth_address;
address public eth_usd_consumer_address;
uint256 public constant genesis_supply = 2000000e18; // 2M FRAX (only for testing, genesis supply will be 5k on Mainnet). This is to help with establishing the Uniswap pools, as they need liquidity
// The addresses in this array are added by the oracle and these contracts are able to mint frax
address[] public frax_pools_array;
// Mapping is also used for faster verification
mapping(address => bool) public frax_pools;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
uint256 public global_collateral_ratio; // 6 decimals of precision, e.g. 924102 = 0.924102
uint256 public redemption_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public minting_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public frax_step; // Amount to change the collateralization ratio by upon refreshCollateralRatio()
uint256 public refresh_cooldown; // Seconds to wait before being able to run refreshCollateralRatio() again
uint256 public price_target; // The price of FRAX at which the collateral ratio will respond to; this value is only used for the collateral ratio mechanism and not for minting and redeeming which are hardcoded at $1
uint256 public price_band; // The bound above and below the price target at which the refreshCollateralRatio() will not change the collateral ratio
address public DEFAULT_ADMIN_ADDRESS;
bytes32 public constant COLLATERAL_RATIO_PAUSER = keccak256("COLLATERAL_RATIO_PAUSER");
bool public collateral_ratio_paused = false;
/* ========== MODIFIERS ========== */
modifier onlyCollateralRatioPauser() {
}
modifier onlyPools() {
}
modifier onlyByOwnerGovernanceOrController() {
}
modifier onlyByOwnerGovernanceOrPool() {
}
/* ========== CONSTRUCTOR ========== */
constructor(
string memory _name,
string memory _symbol,
address _creator_address,
address _timelock_address
) public Owned(_creator_address){
}
/* ========== VIEWS ========== */
// Choice = 'FRAX' or 'FXS' for now
function oracle_price(PriceChoice choice) internal view returns (uint256) {
}
// Returns X FRAX = 1 USD
function frax_price() public view returns (uint256) {
}
// Returns X FXS = 1 USD
function fxs_price() public view returns (uint256) {
}
function eth_usd_price() public view returns (uint256) {
}
// This is needed to avoid costly repeat calls to different getter functions
// It is cheaper gas-wise to just dump everything and only use some of the info
function frax_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
}
// Iterate through all frax pools and calculate all value of collateral in all pools globally
function globalCollateralValue() public view returns (uint256) {
}
/* ========== PUBLIC FUNCTIONS ========== */
// There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion.
uint256 public last_call_time; // Last time the refreshCollateralRatio function was called
function refreshCollateralRatio() public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
// Used by pools when user redeems
function pool_burn_from(address b_address, uint256 b_amount) public onlyPools {
}
// This function is what other frax pools will call to mint new FRAX
function pool_mint(address m_address, uint256 m_amount) public onlyPools {
}
// Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerGovernanceOrController {
}
// Remove a pool
function removePool(address pool_address) public onlyByOwnerGovernanceOrController {
require(pool_address != address(0), "Zero address detected");
require(<FILL_ME>)
// Delete from the mapping
delete frax_pools[pool_address];
// 'Delete' from the array by setting the address to 0x0
for (uint i = 0; i < frax_pools_array.length; i++){
if (frax_pools_array[i] == pool_address) {
frax_pools_array[i] = address(0); // This will leave a null in the array and keep the indices the same
break;
}
}
emit PoolRemoved(pool_address);
}
function setRedemptionFee(uint256 red_fee) public onlyByOwnerGovernanceOrController {
}
function setMintingFee(uint256 min_fee) public onlyByOwnerGovernanceOrController {
}
function setFraxStep(uint256 _new_step) public onlyByOwnerGovernanceOrController {
}
function setPriceTarget (uint256 _new_price_target) public onlyByOwnerGovernanceOrController {
}
function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerGovernanceOrController {
}
function setFXSAddress(address _fxs_address) public onlyByOwnerGovernanceOrController {
}
function setETHUSDOracle(address _eth_usd_consumer_address) public onlyByOwnerGovernanceOrController {
}
function setTimelock(address new_timelock) external onlyByOwnerGovernanceOrController {
}
function setController(address _controller_address) external onlyByOwnerGovernanceOrController {
}
function setPriceBand(uint256 _price_band) external onlyByOwnerGovernanceOrController {
}
// Sets the FRAX_ETH Uniswap oracle address
function setFRAXEthOracle(address _frax_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
// Sets the FXS_ETH Uniswap oracle address
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
function toggleCollateralRatio() public onlyCollateralRatioPauser {
}
/* ========== EVENTS ========== */
// Track FRAX burned
event FRAXBurned(address indexed from, address indexed to, uint256 amount);
// Track FRAX minted
event FRAXMinted(address indexed from, address indexed to, uint256 amount);
event CollateralRatioRefreshed(uint256 global_collateral_ratio);
event PoolAdded(address pool_address);
event PoolRemoved(address pool_address);
event RedemptionFeeSet(uint256 red_fee);
event MintingFeeSet(uint256 min_fee);
event FraxStepSet(uint256 new_step);
event PriceTargetSet(uint256 new_price_target);
event RefreshCooldownSet(uint256 new_cooldown);
event FXSAddressSet(address _fxs_address);
event ETHUSDOracleSet(address eth_usd_consumer_address);
event TimelockSet(address new_timelock);
event ControllerSet(address controller_address);
event PriceBandSet(uint256 price_band);
event FRAXETHOracleSet(address frax_oracle_addr, address weth_address);
event FXSEthOracleSet(address fxs_oracle_addr, address weth_address);
event CollateralRatioToggled(bool collateral_ratio_paused);
}
| frax_pools[pool_address]==true,"Address nonexistant" | 384,361 | frax_pools[pool_address]==true |
"Zero address detected" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.11;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ======================= FRAXStablecoin (FRAX) ======================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
// Reviewer(s) / Contributor(s)
// Sam Sun: https://github.com/samczsun
import "../Common/Context.sol";
import "../ERC20/IERC20.sol";
import "../ERC20/ERC20Custom.sol";
import "../ERC20/ERC20.sol";
import "../Math/SafeMath.sol";
import "../Staking/Owned.sol";
import "../FXS/FXS.sol";
import "./Pools/FraxPool.sol";
import "../Oracle/UniswapPairOracle.sol";
import "../Oracle/ChainlinkETHUSDPriceConsumer.sol";
import "../Governance/AccessControl.sol";
contract FRAXStablecoin is ERC20Custom, AccessControl, Owned {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { FRAX, FXS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private fraxEthOracle;
UniswapPairOracle private fxsEthOracle;
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public creator_address;
address public timelock_address; // Governance timelock address
address public controller_address; // Controller contract to dynamically adjust system parameters automatically
address public fxs_address;
address public frax_eth_oracle_address;
address public fxs_eth_oracle_address;
address public weth_address;
address public eth_usd_consumer_address;
uint256 public constant genesis_supply = 2000000e18; // 2M FRAX (only for testing, genesis supply will be 5k on Mainnet). This is to help with establishing the Uniswap pools, as they need liquidity
// The addresses in this array are added by the oracle and these contracts are able to mint frax
address[] public frax_pools_array;
// Mapping is also used for faster verification
mapping(address => bool) public frax_pools;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
uint256 public global_collateral_ratio; // 6 decimals of precision, e.g. 924102 = 0.924102
uint256 public redemption_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public minting_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public frax_step; // Amount to change the collateralization ratio by upon refreshCollateralRatio()
uint256 public refresh_cooldown; // Seconds to wait before being able to run refreshCollateralRatio() again
uint256 public price_target; // The price of FRAX at which the collateral ratio will respond to; this value is only used for the collateral ratio mechanism and not for minting and redeeming which are hardcoded at $1
uint256 public price_band; // The bound above and below the price target at which the refreshCollateralRatio() will not change the collateral ratio
address public DEFAULT_ADMIN_ADDRESS;
bytes32 public constant COLLATERAL_RATIO_PAUSER = keccak256("COLLATERAL_RATIO_PAUSER");
bool public collateral_ratio_paused = false;
/* ========== MODIFIERS ========== */
modifier onlyCollateralRatioPauser() {
}
modifier onlyPools() {
}
modifier onlyByOwnerGovernanceOrController() {
}
modifier onlyByOwnerGovernanceOrPool() {
}
/* ========== CONSTRUCTOR ========== */
constructor(
string memory _name,
string memory _symbol,
address _creator_address,
address _timelock_address
) public Owned(_creator_address){
}
/* ========== VIEWS ========== */
// Choice = 'FRAX' or 'FXS' for now
function oracle_price(PriceChoice choice) internal view returns (uint256) {
}
// Returns X FRAX = 1 USD
function frax_price() public view returns (uint256) {
}
// Returns X FXS = 1 USD
function fxs_price() public view returns (uint256) {
}
function eth_usd_price() public view returns (uint256) {
}
// This is needed to avoid costly repeat calls to different getter functions
// It is cheaper gas-wise to just dump everything and only use some of the info
function frax_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
}
// Iterate through all frax pools and calculate all value of collateral in all pools globally
function globalCollateralValue() public view returns (uint256) {
}
/* ========== PUBLIC FUNCTIONS ========== */
// There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion.
uint256 public last_call_time; // Last time the refreshCollateralRatio function was called
function refreshCollateralRatio() public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
// Used by pools when user redeems
function pool_burn_from(address b_address, uint256 b_amount) public onlyPools {
}
// This function is what other frax pools will call to mint new FRAX
function pool_mint(address m_address, uint256 m_amount) public onlyPools {
}
// Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerGovernanceOrController {
}
// Remove a pool
function removePool(address pool_address) public onlyByOwnerGovernanceOrController {
}
function setRedemptionFee(uint256 red_fee) public onlyByOwnerGovernanceOrController {
}
function setMintingFee(uint256 min_fee) public onlyByOwnerGovernanceOrController {
}
function setFraxStep(uint256 _new_step) public onlyByOwnerGovernanceOrController {
}
function setPriceTarget (uint256 _new_price_target) public onlyByOwnerGovernanceOrController {
}
function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerGovernanceOrController {
}
function setFXSAddress(address _fxs_address) public onlyByOwnerGovernanceOrController {
}
function setETHUSDOracle(address _eth_usd_consumer_address) public onlyByOwnerGovernanceOrController {
}
function setTimelock(address new_timelock) external onlyByOwnerGovernanceOrController {
}
function setController(address _controller_address) external onlyByOwnerGovernanceOrController {
}
function setPriceBand(uint256 _price_band) external onlyByOwnerGovernanceOrController {
}
// Sets the FRAX_ETH Uniswap oracle address
function setFRAXEthOracle(address _frax_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
require(<FILL_ME>)
frax_eth_oracle_address = _frax_oracle_addr;
fraxEthOracle = UniswapPairOracle(_frax_oracle_addr);
weth_address = _weth_address;
emit FRAXETHOracleSet(_frax_oracle_addr, _weth_address);
}
// Sets the FXS_ETH Uniswap oracle address
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
function toggleCollateralRatio() public onlyCollateralRatioPauser {
}
/* ========== EVENTS ========== */
// Track FRAX burned
event FRAXBurned(address indexed from, address indexed to, uint256 amount);
// Track FRAX minted
event FRAXMinted(address indexed from, address indexed to, uint256 amount);
event CollateralRatioRefreshed(uint256 global_collateral_ratio);
event PoolAdded(address pool_address);
event PoolRemoved(address pool_address);
event RedemptionFeeSet(uint256 red_fee);
event MintingFeeSet(uint256 min_fee);
event FraxStepSet(uint256 new_step);
event PriceTargetSet(uint256 new_price_target);
event RefreshCooldownSet(uint256 new_cooldown);
event FXSAddressSet(address _fxs_address);
event ETHUSDOracleSet(address eth_usd_consumer_address);
event TimelockSet(address new_timelock);
event ControllerSet(address controller_address);
event PriceBandSet(uint256 price_band);
event FRAXETHOracleSet(address frax_oracle_addr, address weth_address);
event FXSEthOracleSet(address fxs_oracle_addr, address weth_address);
event CollateralRatioToggled(bool collateral_ratio_paused);
}
| (_frax_oracle_addr!=address(0))&&(_weth_address!=address(0)),"Zero address detected" | 384,361 | (_frax_oracle_addr!=address(0))&&(_weth_address!=address(0)) |
"Zero address detected" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.11;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ======================= FRAXStablecoin (FRAX) ======================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
// Reviewer(s) / Contributor(s)
// Sam Sun: https://github.com/samczsun
import "../Common/Context.sol";
import "../ERC20/IERC20.sol";
import "../ERC20/ERC20Custom.sol";
import "../ERC20/ERC20.sol";
import "../Math/SafeMath.sol";
import "../Staking/Owned.sol";
import "../FXS/FXS.sol";
import "./Pools/FraxPool.sol";
import "../Oracle/UniswapPairOracle.sol";
import "../Oracle/ChainlinkETHUSDPriceConsumer.sol";
import "../Governance/AccessControl.sol";
contract FRAXStablecoin is ERC20Custom, AccessControl, Owned {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { FRAX, FXS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private fraxEthOracle;
UniswapPairOracle private fxsEthOracle;
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public creator_address;
address public timelock_address; // Governance timelock address
address public controller_address; // Controller contract to dynamically adjust system parameters automatically
address public fxs_address;
address public frax_eth_oracle_address;
address public fxs_eth_oracle_address;
address public weth_address;
address public eth_usd_consumer_address;
uint256 public constant genesis_supply = 2000000e18; // 2M FRAX (only for testing, genesis supply will be 5k on Mainnet). This is to help with establishing the Uniswap pools, as they need liquidity
// The addresses in this array are added by the oracle and these contracts are able to mint frax
address[] public frax_pools_array;
// Mapping is also used for faster verification
mapping(address => bool) public frax_pools;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
uint256 public global_collateral_ratio; // 6 decimals of precision, e.g. 924102 = 0.924102
uint256 public redemption_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public minting_fee; // 6 decimals of precision, divide by 1000000 in calculations for fee
uint256 public frax_step; // Amount to change the collateralization ratio by upon refreshCollateralRatio()
uint256 public refresh_cooldown; // Seconds to wait before being able to run refreshCollateralRatio() again
uint256 public price_target; // The price of FRAX at which the collateral ratio will respond to; this value is only used for the collateral ratio mechanism and not for minting and redeeming which are hardcoded at $1
uint256 public price_band; // The bound above and below the price target at which the refreshCollateralRatio() will not change the collateral ratio
address public DEFAULT_ADMIN_ADDRESS;
bytes32 public constant COLLATERAL_RATIO_PAUSER = keccak256("COLLATERAL_RATIO_PAUSER");
bool public collateral_ratio_paused = false;
/* ========== MODIFIERS ========== */
modifier onlyCollateralRatioPauser() {
}
modifier onlyPools() {
}
modifier onlyByOwnerGovernanceOrController() {
}
modifier onlyByOwnerGovernanceOrPool() {
}
/* ========== CONSTRUCTOR ========== */
constructor(
string memory _name,
string memory _symbol,
address _creator_address,
address _timelock_address
) public Owned(_creator_address){
}
/* ========== VIEWS ========== */
// Choice = 'FRAX' or 'FXS' for now
function oracle_price(PriceChoice choice) internal view returns (uint256) {
}
// Returns X FRAX = 1 USD
function frax_price() public view returns (uint256) {
}
// Returns X FXS = 1 USD
function fxs_price() public view returns (uint256) {
}
function eth_usd_price() public view returns (uint256) {
}
// This is needed to avoid costly repeat calls to different getter functions
// It is cheaper gas-wise to just dump everything and only use some of the info
function frax_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
}
// Iterate through all frax pools and calculate all value of collateral in all pools globally
function globalCollateralValue() public view returns (uint256) {
}
/* ========== PUBLIC FUNCTIONS ========== */
// There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion.
uint256 public last_call_time; // Last time the refreshCollateralRatio function was called
function refreshCollateralRatio() public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
// Used by pools when user redeems
function pool_burn_from(address b_address, uint256 b_amount) public onlyPools {
}
// This function is what other frax pools will call to mint new FRAX
function pool_mint(address m_address, uint256 m_amount) public onlyPools {
}
// Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerGovernanceOrController {
}
// Remove a pool
function removePool(address pool_address) public onlyByOwnerGovernanceOrController {
}
function setRedemptionFee(uint256 red_fee) public onlyByOwnerGovernanceOrController {
}
function setMintingFee(uint256 min_fee) public onlyByOwnerGovernanceOrController {
}
function setFraxStep(uint256 _new_step) public onlyByOwnerGovernanceOrController {
}
function setPriceTarget (uint256 _new_price_target) public onlyByOwnerGovernanceOrController {
}
function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerGovernanceOrController {
}
function setFXSAddress(address _fxs_address) public onlyByOwnerGovernanceOrController {
}
function setETHUSDOracle(address _eth_usd_consumer_address) public onlyByOwnerGovernanceOrController {
}
function setTimelock(address new_timelock) external onlyByOwnerGovernanceOrController {
}
function setController(address _controller_address) external onlyByOwnerGovernanceOrController {
}
function setPriceBand(uint256 _price_band) external onlyByOwnerGovernanceOrController {
}
// Sets the FRAX_ETH Uniswap oracle address
function setFRAXEthOracle(address _frax_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
}
// Sets the FXS_ETH Uniswap oracle address
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController {
require(<FILL_ME>)
fxs_eth_oracle_address = _fxs_oracle_addr;
fxsEthOracle = UniswapPairOracle(_fxs_oracle_addr);
weth_address = _weth_address;
emit FXSEthOracleSet(_fxs_oracle_addr, _weth_address);
}
function toggleCollateralRatio() public onlyCollateralRatioPauser {
}
/* ========== EVENTS ========== */
// Track FRAX burned
event FRAXBurned(address indexed from, address indexed to, uint256 amount);
// Track FRAX minted
event FRAXMinted(address indexed from, address indexed to, uint256 amount);
event CollateralRatioRefreshed(uint256 global_collateral_ratio);
event PoolAdded(address pool_address);
event PoolRemoved(address pool_address);
event RedemptionFeeSet(uint256 red_fee);
event MintingFeeSet(uint256 min_fee);
event FraxStepSet(uint256 new_step);
event PriceTargetSet(uint256 new_price_target);
event RefreshCooldownSet(uint256 new_cooldown);
event FXSAddressSet(address _fxs_address);
event ETHUSDOracleSet(address eth_usd_consumer_address);
event TimelockSet(address new_timelock);
event ControllerSet(address controller_address);
event PriceBandSet(uint256 price_band);
event FRAXETHOracleSet(address frax_oracle_addr, address weth_address);
event FXSEthOracleSet(address fxs_oracle_addr, address weth_address);
event CollateralRatioToggled(bool collateral_ratio_paused);
}
| (_fxs_oracle_addr!=address(0))&&(_weth_address!=address(0)),"Zero address detected" | 384,361 | (_fxs_oracle_addr!=address(0))&&(_weth_address!=address(0)) |
"insufficient funds" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function isOwner() public view returns (bool) {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
function _burnFrom(address account, uint256 amount) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
contract ReentrancyGuard {
uint256 private _guardCounter;
constructor () internal {
}
modifier nonReentrant() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Compound {
function mint ( uint256 mintAmount ) external returns ( uint256 );
function redeem(uint256 redeemTokens) external returns (uint256);
function exchangeRateStored() external view returns (uint);
}
interface Fulcrum {
function mint(address receiver, uint256 amount) external payable returns (uint256 mintAmount);
function burn(address receiver, uint256 burnAmount) external returns (uint256 loanAmountPaid);
function assetBalanceOf(address _owner) external view returns (uint256 balance);
}
interface ILendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
}
interface Aave {
function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external;
}
interface AToken {
function redeem(uint256 amount) external;
}
interface IIEarnManager {
function recommend(address _token) external view returns (
string memory choice,
uint256 capr,
uint256 iapr,
uint256 aapr,
uint256 dapr
);
}
contract Structs {
struct Val {
uint256 value;
}
enum ActionType {
Deposit, // supply tokens
Withdraw // borrow tokens
}
enum AssetDenomination {
Wei // the amount is denominated in wei
}
enum AssetReference {
Delta // the amount is given as a delta from the current value
}
struct AssetAmount {
bool sign; // true if positive
AssetDenomination denomination;
AssetReference ref;
uint256 value;
}
struct ActionArgs {
ActionType actionType;
uint256 accountId;
AssetAmount amount;
uint256 primaryMarketId;
uint256 secondaryMarketId;
address otherAddress;
uint256 otherAccountId;
bytes data;
}
struct Info {
address owner; // The address that owns the account
uint256 number; // A nonce that allows a single address to control many accounts
}
struct Wei {
bool sign; // true if positive
uint256 value;
}
}
contract DyDx is Structs {
function getAccountWei(Info memory account, uint256 marketId) public view returns (Wei memory);
function operate(Info[] memory, ActionArgs[] memory) public;
}
interface LendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
function getLendingPoolCore() external view returns (address);
}
contract ySUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable, Structs {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
uint256 public pool;
address public token;
address public compound;
address public fulcrum;
address public aave;
address public aaveToken;
address public dydx;
uint256 public dToken;
address public apr;
enum Lender {
NONE,
DYDX,
COMPOUND,
AAVE,
FULCRUM
}
Lender public provider = Lender.NONE;
constructor () public ERC20Detailed("iearn SUSD", "ySUSD", 18) {
}
// Ownable setters incase of support in future for these systems
function set_new_APR(address _new_APR) public onlyOwner {
}
function set_new_COMPOUND(address _new_COMPOUND) public onlyOwner {
}
function set_new_DTOKEN(uint256 _new_DTOKEN) public onlyOwner {
}
// Quick swap low gas method for pool swaps
function deposit(uint256 _amount)
external
nonReentrant
{
}
// No rebalance implementation for lower fees and faster swaps
function withdraw(uint256 _shares)
external
nonReentrant
{
}
function() external payable {
}
function recommend() public view returns (Lender) {
}
function supplyDydx(uint256 amount) public returns(uint) {
}
function _withdrawDydx(uint256 amount) internal {
}
function getAave() public view returns (address) {
}
function getAaveCore() public view returns (address) {
}
function approveToken() public {
}
function balance() public view returns (uint256) {
}
function balanceDydx() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceFulcrumInToken() public view returns (uint256) {
}
function balanceFulcrum() public view returns (uint256) {
}
function balanceAave() public view returns (uint256) {
}
function _balance() internal view returns (uint256) {
}
function _balanceDydx() internal view returns (uint256) {
}
function _balanceCompound() internal view returns (uint256) {
}
function _balanceCompoundInToken() internal view returns (uint256) {
}
function _balanceFulcrumInToken() internal view returns (uint256) {
}
function _balanceFulcrum() internal view returns (uint256) {
}
function _balanceAave() internal view returns (uint256) {
}
function _withdrawAll() internal {
}
function _withdrawSomeCompound(uint256 _amount) internal {
}
// 1999999614570950845
function _withdrawSomeFulcrum(uint256 _amount) internal {
}
function _withdrawSome(uint256 _amount) internal {
if (provider == Lender.COMPOUND) {
_withdrawSomeCompound(_amount);
}
if (provider == Lender.AAVE) {
require(<FILL_ME>)
_withdrawAave(_amount);
}
if (provider == Lender.DYDX) {
require(balanceDydx() >= _amount, "insufficient funds");
_withdrawDydx(_amount);
}
if (provider == Lender.FULCRUM) {
_withdrawSomeFulcrum(_amount);
}
}
function rebalance() public {
}
// Internal only rebalance for better gas in redeem
function _rebalance(Lender newProvider) internal {
}
function supplyAave(uint amount) public {
}
function supplyFulcrum(uint amount) public {
}
function supplyCompound(uint amount) public {
}
function _withdrawAave(uint amount) internal {
}
function _withdrawFulcrum(uint amount) internal {
}
function _withdrawCompound(uint amount) internal {
}
function _calcPoolValueInToken() internal view returns (uint) {
}
function calcPoolValueInToken() public view returns (uint) {
}
function getPricePerFullShare() public view returns (uint) {
}
}
| balanceAave()>=_amount,"insufficient funds" | 384,465 | balanceAave()>=_amount |
"insufficient funds" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function isOwner() public view returns (bool) {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
function _burnFrom(address account, uint256 amount) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
contract ReentrancyGuard {
uint256 private _guardCounter;
constructor () internal {
}
modifier nonReentrant() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Compound {
function mint ( uint256 mintAmount ) external returns ( uint256 );
function redeem(uint256 redeemTokens) external returns (uint256);
function exchangeRateStored() external view returns (uint);
}
interface Fulcrum {
function mint(address receiver, uint256 amount) external payable returns (uint256 mintAmount);
function burn(address receiver, uint256 burnAmount) external returns (uint256 loanAmountPaid);
function assetBalanceOf(address _owner) external view returns (uint256 balance);
}
interface ILendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
}
interface Aave {
function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external;
}
interface AToken {
function redeem(uint256 amount) external;
}
interface IIEarnManager {
function recommend(address _token) external view returns (
string memory choice,
uint256 capr,
uint256 iapr,
uint256 aapr,
uint256 dapr
);
}
contract Structs {
struct Val {
uint256 value;
}
enum ActionType {
Deposit, // supply tokens
Withdraw // borrow tokens
}
enum AssetDenomination {
Wei // the amount is denominated in wei
}
enum AssetReference {
Delta // the amount is given as a delta from the current value
}
struct AssetAmount {
bool sign; // true if positive
AssetDenomination denomination;
AssetReference ref;
uint256 value;
}
struct ActionArgs {
ActionType actionType;
uint256 accountId;
AssetAmount amount;
uint256 primaryMarketId;
uint256 secondaryMarketId;
address otherAddress;
uint256 otherAccountId;
bytes data;
}
struct Info {
address owner; // The address that owns the account
uint256 number; // A nonce that allows a single address to control many accounts
}
struct Wei {
bool sign; // true if positive
uint256 value;
}
}
contract DyDx is Structs {
function getAccountWei(Info memory account, uint256 marketId) public view returns (Wei memory);
function operate(Info[] memory, ActionArgs[] memory) public;
}
interface LendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
function getLendingPoolCore() external view returns (address);
}
contract ySUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable, Structs {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
uint256 public pool;
address public token;
address public compound;
address public fulcrum;
address public aave;
address public aaveToken;
address public dydx;
uint256 public dToken;
address public apr;
enum Lender {
NONE,
DYDX,
COMPOUND,
AAVE,
FULCRUM
}
Lender public provider = Lender.NONE;
constructor () public ERC20Detailed("iearn SUSD", "ySUSD", 18) {
}
// Ownable setters incase of support in future for these systems
function set_new_APR(address _new_APR) public onlyOwner {
}
function set_new_COMPOUND(address _new_COMPOUND) public onlyOwner {
}
function set_new_DTOKEN(uint256 _new_DTOKEN) public onlyOwner {
}
// Quick swap low gas method for pool swaps
function deposit(uint256 _amount)
external
nonReentrant
{
}
// No rebalance implementation for lower fees and faster swaps
function withdraw(uint256 _shares)
external
nonReentrant
{
}
function() external payable {
}
function recommend() public view returns (Lender) {
}
function supplyDydx(uint256 amount) public returns(uint) {
}
function _withdrawDydx(uint256 amount) internal {
}
function getAave() public view returns (address) {
}
function getAaveCore() public view returns (address) {
}
function approveToken() public {
}
function balance() public view returns (uint256) {
}
function balanceDydx() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceFulcrumInToken() public view returns (uint256) {
}
function balanceFulcrum() public view returns (uint256) {
}
function balanceAave() public view returns (uint256) {
}
function _balance() internal view returns (uint256) {
}
function _balanceDydx() internal view returns (uint256) {
}
function _balanceCompound() internal view returns (uint256) {
}
function _balanceCompoundInToken() internal view returns (uint256) {
}
function _balanceFulcrumInToken() internal view returns (uint256) {
}
function _balanceFulcrum() internal view returns (uint256) {
}
function _balanceAave() internal view returns (uint256) {
}
function _withdrawAll() internal {
}
function _withdrawSomeCompound(uint256 _amount) internal {
}
// 1999999614570950845
function _withdrawSomeFulcrum(uint256 _amount) internal {
}
function _withdrawSome(uint256 _amount) internal {
if (provider == Lender.COMPOUND) {
_withdrawSomeCompound(_amount);
}
if (provider == Lender.AAVE) {
require(balanceAave() >= _amount, "insufficient funds");
_withdrawAave(_amount);
}
if (provider == Lender.DYDX) {
require(<FILL_ME>)
_withdrawDydx(_amount);
}
if (provider == Lender.FULCRUM) {
_withdrawSomeFulcrum(_amount);
}
}
function rebalance() public {
}
// Internal only rebalance for better gas in redeem
function _rebalance(Lender newProvider) internal {
}
function supplyAave(uint amount) public {
}
function supplyFulcrum(uint amount) public {
}
function supplyCompound(uint amount) public {
}
function _withdrawAave(uint amount) internal {
}
function _withdrawFulcrum(uint amount) internal {
}
function _withdrawCompound(uint amount) internal {
}
function _calcPoolValueInToken() internal view returns (uint) {
}
function calcPoolValueInToken() public view returns (uint) {
}
function getPricePerFullShare() public view returns (uint) {
}
}
| balanceDydx()>=_amount,"insufficient funds" | 384,465 | balanceDydx()>=_amount |
"FULCRUM: supply failed" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function isOwner() public view returns (bool) {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
function _burnFrom(address account, uint256 amount) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
contract ReentrancyGuard {
uint256 private _guardCounter;
constructor () internal {
}
modifier nonReentrant() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Compound {
function mint ( uint256 mintAmount ) external returns ( uint256 );
function redeem(uint256 redeemTokens) external returns (uint256);
function exchangeRateStored() external view returns (uint);
}
interface Fulcrum {
function mint(address receiver, uint256 amount) external payable returns (uint256 mintAmount);
function burn(address receiver, uint256 burnAmount) external returns (uint256 loanAmountPaid);
function assetBalanceOf(address _owner) external view returns (uint256 balance);
}
interface ILendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
}
interface Aave {
function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external;
}
interface AToken {
function redeem(uint256 amount) external;
}
interface IIEarnManager {
function recommend(address _token) external view returns (
string memory choice,
uint256 capr,
uint256 iapr,
uint256 aapr,
uint256 dapr
);
}
contract Structs {
struct Val {
uint256 value;
}
enum ActionType {
Deposit, // supply tokens
Withdraw // borrow tokens
}
enum AssetDenomination {
Wei // the amount is denominated in wei
}
enum AssetReference {
Delta // the amount is given as a delta from the current value
}
struct AssetAmount {
bool sign; // true if positive
AssetDenomination denomination;
AssetReference ref;
uint256 value;
}
struct ActionArgs {
ActionType actionType;
uint256 accountId;
AssetAmount amount;
uint256 primaryMarketId;
uint256 secondaryMarketId;
address otherAddress;
uint256 otherAccountId;
bytes data;
}
struct Info {
address owner; // The address that owns the account
uint256 number; // A nonce that allows a single address to control many accounts
}
struct Wei {
bool sign; // true if positive
uint256 value;
}
}
contract DyDx is Structs {
function getAccountWei(Info memory account, uint256 marketId) public view returns (Wei memory);
function operate(Info[] memory, ActionArgs[] memory) public;
}
interface LendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
function getLendingPoolCore() external view returns (address);
}
contract ySUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable, Structs {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
uint256 public pool;
address public token;
address public compound;
address public fulcrum;
address public aave;
address public aaveToken;
address public dydx;
uint256 public dToken;
address public apr;
enum Lender {
NONE,
DYDX,
COMPOUND,
AAVE,
FULCRUM
}
Lender public provider = Lender.NONE;
constructor () public ERC20Detailed("iearn SUSD", "ySUSD", 18) {
}
// Ownable setters incase of support in future for these systems
function set_new_APR(address _new_APR) public onlyOwner {
}
function set_new_COMPOUND(address _new_COMPOUND) public onlyOwner {
}
function set_new_DTOKEN(uint256 _new_DTOKEN) public onlyOwner {
}
// Quick swap low gas method for pool swaps
function deposit(uint256 _amount)
external
nonReentrant
{
}
// No rebalance implementation for lower fees and faster swaps
function withdraw(uint256 _shares)
external
nonReentrant
{
}
function() external payable {
}
function recommend() public view returns (Lender) {
}
function supplyDydx(uint256 amount) public returns(uint) {
}
function _withdrawDydx(uint256 amount) internal {
}
function getAave() public view returns (address) {
}
function getAaveCore() public view returns (address) {
}
function approveToken() public {
}
function balance() public view returns (uint256) {
}
function balanceDydx() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceFulcrumInToken() public view returns (uint256) {
}
function balanceFulcrum() public view returns (uint256) {
}
function balanceAave() public view returns (uint256) {
}
function _balance() internal view returns (uint256) {
}
function _balanceDydx() internal view returns (uint256) {
}
function _balanceCompound() internal view returns (uint256) {
}
function _balanceCompoundInToken() internal view returns (uint256) {
}
function _balanceFulcrumInToken() internal view returns (uint256) {
}
function _balanceFulcrum() internal view returns (uint256) {
}
function _balanceAave() internal view returns (uint256) {
}
function _withdrawAll() internal {
}
function _withdrawSomeCompound(uint256 _amount) internal {
}
// 1999999614570950845
function _withdrawSomeFulcrum(uint256 _amount) internal {
}
function _withdrawSome(uint256 _amount) internal {
}
function rebalance() public {
}
// Internal only rebalance for better gas in redeem
function _rebalance(Lender newProvider) internal {
}
function supplyAave(uint amount) public {
}
function supplyFulcrum(uint amount) public {
require(<FILL_ME>)
}
function supplyCompound(uint amount) public {
}
function _withdrawAave(uint amount) internal {
}
function _withdrawFulcrum(uint amount) internal {
}
function _withdrawCompound(uint amount) internal {
}
function _calcPoolValueInToken() internal view returns (uint) {
}
function calcPoolValueInToken() public view returns (uint) {
}
function getPricePerFullShare() public view returns (uint) {
}
}
| Fulcrum(fulcrum).mint(address(this),amount)>0,"FULCRUM: supply failed" | 384,465 | Fulcrum(fulcrum).mint(address(this),amount)>0 |
"COMPOUND: supply failed" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function isOwner() public view returns (bool) {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
function _burnFrom(address account, uint256 amount) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
contract ReentrancyGuard {
uint256 private _guardCounter;
constructor () internal {
}
modifier nonReentrant() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Compound {
function mint ( uint256 mintAmount ) external returns ( uint256 );
function redeem(uint256 redeemTokens) external returns (uint256);
function exchangeRateStored() external view returns (uint);
}
interface Fulcrum {
function mint(address receiver, uint256 amount) external payable returns (uint256 mintAmount);
function burn(address receiver, uint256 burnAmount) external returns (uint256 loanAmountPaid);
function assetBalanceOf(address _owner) external view returns (uint256 balance);
}
interface ILendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
}
interface Aave {
function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external;
}
interface AToken {
function redeem(uint256 amount) external;
}
interface IIEarnManager {
function recommend(address _token) external view returns (
string memory choice,
uint256 capr,
uint256 iapr,
uint256 aapr,
uint256 dapr
);
}
contract Structs {
struct Val {
uint256 value;
}
enum ActionType {
Deposit, // supply tokens
Withdraw // borrow tokens
}
enum AssetDenomination {
Wei // the amount is denominated in wei
}
enum AssetReference {
Delta // the amount is given as a delta from the current value
}
struct AssetAmount {
bool sign; // true if positive
AssetDenomination denomination;
AssetReference ref;
uint256 value;
}
struct ActionArgs {
ActionType actionType;
uint256 accountId;
AssetAmount amount;
uint256 primaryMarketId;
uint256 secondaryMarketId;
address otherAddress;
uint256 otherAccountId;
bytes data;
}
struct Info {
address owner; // The address that owns the account
uint256 number; // A nonce that allows a single address to control many accounts
}
struct Wei {
bool sign; // true if positive
uint256 value;
}
}
contract DyDx is Structs {
function getAccountWei(Info memory account, uint256 marketId) public view returns (Wei memory);
function operate(Info[] memory, ActionArgs[] memory) public;
}
interface LendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
function getLendingPoolCore() external view returns (address);
}
contract ySUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable, Structs {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
uint256 public pool;
address public token;
address public compound;
address public fulcrum;
address public aave;
address public aaveToken;
address public dydx;
uint256 public dToken;
address public apr;
enum Lender {
NONE,
DYDX,
COMPOUND,
AAVE,
FULCRUM
}
Lender public provider = Lender.NONE;
constructor () public ERC20Detailed("iearn SUSD", "ySUSD", 18) {
}
// Ownable setters incase of support in future for these systems
function set_new_APR(address _new_APR) public onlyOwner {
}
function set_new_COMPOUND(address _new_COMPOUND) public onlyOwner {
}
function set_new_DTOKEN(uint256 _new_DTOKEN) public onlyOwner {
}
// Quick swap low gas method for pool swaps
function deposit(uint256 _amount)
external
nonReentrant
{
}
// No rebalance implementation for lower fees and faster swaps
function withdraw(uint256 _shares)
external
nonReentrant
{
}
function() external payable {
}
function recommend() public view returns (Lender) {
}
function supplyDydx(uint256 amount) public returns(uint) {
}
function _withdrawDydx(uint256 amount) internal {
}
function getAave() public view returns (address) {
}
function getAaveCore() public view returns (address) {
}
function approveToken() public {
}
function balance() public view returns (uint256) {
}
function balanceDydx() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceFulcrumInToken() public view returns (uint256) {
}
function balanceFulcrum() public view returns (uint256) {
}
function balanceAave() public view returns (uint256) {
}
function _balance() internal view returns (uint256) {
}
function _balanceDydx() internal view returns (uint256) {
}
function _balanceCompound() internal view returns (uint256) {
}
function _balanceCompoundInToken() internal view returns (uint256) {
}
function _balanceFulcrumInToken() internal view returns (uint256) {
}
function _balanceFulcrum() internal view returns (uint256) {
}
function _balanceAave() internal view returns (uint256) {
}
function _withdrawAll() internal {
}
function _withdrawSomeCompound(uint256 _amount) internal {
}
// 1999999614570950845
function _withdrawSomeFulcrum(uint256 _amount) internal {
}
function _withdrawSome(uint256 _amount) internal {
}
function rebalance() public {
}
// Internal only rebalance for better gas in redeem
function _rebalance(Lender newProvider) internal {
}
function supplyAave(uint amount) public {
}
function supplyFulcrum(uint amount) public {
}
function supplyCompound(uint amount) public {
require(<FILL_ME>)
}
function _withdrawAave(uint amount) internal {
}
function _withdrawFulcrum(uint amount) internal {
}
function _withdrawCompound(uint amount) internal {
}
function _calcPoolValueInToken() internal view returns (uint) {
}
function calcPoolValueInToken() public view returns (uint) {
}
function getPricePerFullShare() public view returns (uint) {
}
}
| Compound(compound).mint(amount)==0,"COMPOUND: supply failed" | 384,465 | Compound(compound).mint(amount)==0 |
"FULCRUM: withdraw failed" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function isOwner() public view returns (bool) {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
function _burnFrom(address account, uint256 amount) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
contract ReentrancyGuard {
uint256 private _guardCounter;
constructor () internal {
}
modifier nonReentrant() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Compound {
function mint ( uint256 mintAmount ) external returns ( uint256 );
function redeem(uint256 redeemTokens) external returns (uint256);
function exchangeRateStored() external view returns (uint);
}
interface Fulcrum {
function mint(address receiver, uint256 amount) external payable returns (uint256 mintAmount);
function burn(address receiver, uint256 burnAmount) external returns (uint256 loanAmountPaid);
function assetBalanceOf(address _owner) external view returns (uint256 balance);
}
interface ILendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
}
interface Aave {
function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external;
}
interface AToken {
function redeem(uint256 amount) external;
}
interface IIEarnManager {
function recommend(address _token) external view returns (
string memory choice,
uint256 capr,
uint256 iapr,
uint256 aapr,
uint256 dapr
);
}
contract Structs {
struct Val {
uint256 value;
}
enum ActionType {
Deposit, // supply tokens
Withdraw // borrow tokens
}
enum AssetDenomination {
Wei // the amount is denominated in wei
}
enum AssetReference {
Delta // the amount is given as a delta from the current value
}
struct AssetAmount {
bool sign; // true if positive
AssetDenomination denomination;
AssetReference ref;
uint256 value;
}
struct ActionArgs {
ActionType actionType;
uint256 accountId;
AssetAmount amount;
uint256 primaryMarketId;
uint256 secondaryMarketId;
address otherAddress;
uint256 otherAccountId;
bytes data;
}
struct Info {
address owner; // The address that owns the account
uint256 number; // A nonce that allows a single address to control many accounts
}
struct Wei {
bool sign; // true if positive
uint256 value;
}
}
contract DyDx is Structs {
function getAccountWei(Info memory account, uint256 marketId) public view returns (Wei memory);
function operate(Info[] memory, ActionArgs[] memory) public;
}
interface LendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
function getLendingPoolCore() external view returns (address);
}
contract ySUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable, Structs {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
uint256 public pool;
address public token;
address public compound;
address public fulcrum;
address public aave;
address public aaveToken;
address public dydx;
uint256 public dToken;
address public apr;
enum Lender {
NONE,
DYDX,
COMPOUND,
AAVE,
FULCRUM
}
Lender public provider = Lender.NONE;
constructor () public ERC20Detailed("iearn SUSD", "ySUSD", 18) {
}
// Ownable setters incase of support in future for these systems
function set_new_APR(address _new_APR) public onlyOwner {
}
function set_new_COMPOUND(address _new_COMPOUND) public onlyOwner {
}
function set_new_DTOKEN(uint256 _new_DTOKEN) public onlyOwner {
}
// Quick swap low gas method for pool swaps
function deposit(uint256 _amount)
external
nonReentrant
{
}
// No rebalance implementation for lower fees and faster swaps
function withdraw(uint256 _shares)
external
nonReentrant
{
}
function() external payable {
}
function recommend() public view returns (Lender) {
}
function supplyDydx(uint256 amount) public returns(uint) {
}
function _withdrawDydx(uint256 amount) internal {
}
function getAave() public view returns (address) {
}
function getAaveCore() public view returns (address) {
}
function approveToken() public {
}
function balance() public view returns (uint256) {
}
function balanceDydx() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceFulcrumInToken() public view returns (uint256) {
}
function balanceFulcrum() public view returns (uint256) {
}
function balanceAave() public view returns (uint256) {
}
function _balance() internal view returns (uint256) {
}
function _balanceDydx() internal view returns (uint256) {
}
function _balanceCompound() internal view returns (uint256) {
}
function _balanceCompoundInToken() internal view returns (uint256) {
}
function _balanceFulcrumInToken() internal view returns (uint256) {
}
function _balanceFulcrum() internal view returns (uint256) {
}
function _balanceAave() internal view returns (uint256) {
}
function _withdrawAll() internal {
}
function _withdrawSomeCompound(uint256 _amount) internal {
}
// 1999999614570950845
function _withdrawSomeFulcrum(uint256 _amount) internal {
}
function _withdrawSome(uint256 _amount) internal {
}
function rebalance() public {
}
// Internal only rebalance for better gas in redeem
function _rebalance(Lender newProvider) internal {
}
function supplyAave(uint amount) public {
}
function supplyFulcrum(uint amount) public {
}
function supplyCompound(uint amount) public {
}
function _withdrawAave(uint amount) internal {
}
function _withdrawFulcrum(uint amount) internal {
require(<FILL_ME>)
}
function _withdrawCompound(uint amount) internal {
}
function _calcPoolValueInToken() internal view returns (uint) {
}
function calcPoolValueInToken() public view returns (uint) {
}
function getPricePerFullShare() public view returns (uint) {
}
}
| Fulcrum(fulcrum).burn(address(this),amount)>0,"FULCRUM: withdraw failed" | 384,465 | Fulcrum(fulcrum).burn(address(this),amount)>0 |
"COMPOUND: withdraw failed" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function isOwner() public view returns (bool) {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
function _burnFrom(address account, uint256 amount) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
contract ReentrancyGuard {
uint256 private _guardCounter;
constructor () internal {
}
modifier nonReentrant() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface Compound {
function mint ( uint256 mintAmount ) external returns ( uint256 );
function redeem(uint256 redeemTokens) external returns (uint256);
function exchangeRateStored() external view returns (uint);
}
interface Fulcrum {
function mint(address receiver, uint256 amount) external payable returns (uint256 mintAmount);
function burn(address receiver, uint256 burnAmount) external returns (uint256 loanAmountPaid);
function assetBalanceOf(address _owner) external view returns (uint256 balance);
}
interface ILendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
}
interface Aave {
function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external;
}
interface AToken {
function redeem(uint256 amount) external;
}
interface IIEarnManager {
function recommend(address _token) external view returns (
string memory choice,
uint256 capr,
uint256 iapr,
uint256 aapr,
uint256 dapr
);
}
contract Structs {
struct Val {
uint256 value;
}
enum ActionType {
Deposit, // supply tokens
Withdraw // borrow tokens
}
enum AssetDenomination {
Wei // the amount is denominated in wei
}
enum AssetReference {
Delta // the amount is given as a delta from the current value
}
struct AssetAmount {
bool sign; // true if positive
AssetDenomination denomination;
AssetReference ref;
uint256 value;
}
struct ActionArgs {
ActionType actionType;
uint256 accountId;
AssetAmount amount;
uint256 primaryMarketId;
uint256 secondaryMarketId;
address otherAddress;
uint256 otherAccountId;
bytes data;
}
struct Info {
address owner; // The address that owns the account
uint256 number; // A nonce that allows a single address to control many accounts
}
struct Wei {
bool sign; // true if positive
uint256 value;
}
}
contract DyDx is Structs {
function getAccountWei(Info memory account, uint256 marketId) public view returns (Wei memory);
function operate(Info[] memory, ActionArgs[] memory) public;
}
interface LendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
function getLendingPoolCore() external view returns (address);
}
contract ySUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable, Structs {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
uint256 public pool;
address public token;
address public compound;
address public fulcrum;
address public aave;
address public aaveToken;
address public dydx;
uint256 public dToken;
address public apr;
enum Lender {
NONE,
DYDX,
COMPOUND,
AAVE,
FULCRUM
}
Lender public provider = Lender.NONE;
constructor () public ERC20Detailed("iearn SUSD", "ySUSD", 18) {
}
// Ownable setters incase of support in future for these systems
function set_new_APR(address _new_APR) public onlyOwner {
}
function set_new_COMPOUND(address _new_COMPOUND) public onlyOwner {
}
function set_new_DTOKEN(uint256 _new_DTOKEN) public onlyOwner {
}
// Quick swap low gas method for pool swaps
function deposit(uint256 _amount)
external
nonReentrant
{
}
// No rebalance implementation for lower fees and faster swaps
function withdraw(uint256 _shares)
external
nonReentrant
{
}
function() external payable {
}
function recommend() public view returns (Lender) {
}
function supplyDydx(uint256 amount) public returns(uint) {
}
function _withdrawDydx(uint256 amount) internal {
}
function getAave() public view returns (address) {
}
function getAaveCore() public view returns (address) {
}
function approveToken() public {
}
function balance() public view returns (uint256) {
}
function balanceDydx() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceFulcrumInToken() public view returns (uint256) {
}
function balanceFulcrum() public view returns (uint256) {
}
function balanceAave() public view returns (uint256) {
}
function _balance() internal view returns (uint256) {
}
function _balanceDydx() internal view returns (uint256) {
}
function _balanceCompound() internal view returns (uint256) {
}
function _balanceCompoundInToken() internal view returns (uint256) {
}
function _balanceFulcrumInToken() internal view returns (uint256) {
}
function _balanceFulcrum() internal view returns (uint256) {
}
function _balanceAave() internal view returns (uint256) {
}
function _withdrawAll() internal {
}
function _withdrawSomeCompound(uint256 _amount) internal {
}
// 1999999614570950845
function _withdrawSomeFulcrum(uint256 _amount) internal {
}
function _withdrawSome(uint256 _amount) internal {
}
function rebalance() public {
}
// Internal only rebalance for better gas in redeem
function _rebalance(Lender newProvider) internal {
}
function supplyAave(uint amount) public {
}
function supplyFulcrum(uint amount) public {
}
function supplyCompound(uint amount) public {
}
function _withdrawAave(uint amount) internal {
}
function _withdrawFulcrum(uint amount) internal {
}
function _withdrawCompound(uint amount) internal {
require(<FILL_ME>)
}
function _calcPoolValueInToken() internal view returns (uint) {
}
function calcPoolValueInToken() public view returns (uint) {
}
function getPricePerFullShare() public view returns (uint) {
}
}
| Compound(compound).redeem(amount)==0,"COMPOUND: withdraw failed" | 384,465 | Compound(compound).redeem(amount)==0 |
null | pragma solidity ^0.4.18;
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 Owned {
address public owner;
function Owned() public {
}
function withdraw() public onlyOwner {
}
modifier onlyOwner() {
}
}
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);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Distributor is Owned {
using SafeMath for uint256;
ERC20 public token;
uint256 public eligibleTokens;
mapping(address => uint256) public distributed;
uint256 public totalDistributionAmountInWei;
event Dividend(address holder, uint256 amountDistributed);
function Distributor(address _targetToken, uint256 _eligibleTokens) public payable {
}
function percent(uint numerator, uint denominator, uint precision) internal pure returns (uint quotient) {
}
function distribute(address holder) public onlyOwner returns (uint256 amountDistributed) {
require(<FILL_ME>)
uint256 holderBalance = token.balanceOf(holder);
uint256 portion = percent(holderBalance, eligibleTokens, uint256(4));
amountDistributed = totalDistributionAmountInWei.mul(portion).div(10000);
distributed[holder] = amountDistributed;
Dividend(holder, amountDistributed);
holder.transfer(amountDistributed);
}
}
| distributed[holder]==0 | 384,530 | distributed[holder]==0 |
"Invalid proof." | pragma solidity 0.8.9;
/// SPDX-License-Identifier: UNLICENSED
contract DWCNFTGENESIS is ERC1155, ERC1155Supply, ReentrancyGuard, Ownable {
using Strings for uint256;
bytes32 public DiamondMerkleRoot = 0x54b0746df51cbbb2f9ab043955478c4824f8dccc1cbe3da00fef46609652f248;
bytes32 public CarbonMerkleRoot = 0x33b71d34e9eee3cae1ce39d3fb1956ed9d977692d84fd6ec025a0b39bb3c17ad;
string public baseURI;
string public baseExtension = ".json";
bool public diamondSaleOpen = true;
bool public carbonSaleOpen = false;
mapping (address => bool) public whitelistClaimedDiamond;
mapping (address => bool) public whitelistClaimed;
constructor(string memory _initBaseURI) ERC1155(_initBaseURI)
{
}
modifier onlySender {
}
modifier isDiamondSaleOpen {
}
modifier isCarbonSaleOpen {
}
function setDiamondMerkleRoot(bytes32 incomingBytes) public onlyOwner
{
}
function setCarbonMerkleRoot(bytes32 incomingBytes) public onlyOwner
{
}
function flipToCarbonSale() public onlyOwner
{
}
function diamondSale(bytes32[] calldata _merkleProof) public payable nonReentrant onlySender isDiamondSaleOpen
{
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(<FILL_ME>)
require(whitelistClaimedDiamond[msg.sender] == false);
whitelistClaimedDiamond[msg.sender] = true;
_mint(msg.sender, 1, 1, "");
}
function carbonSale(bytes32[] calldata _merkleProof) public payable nonReentrant onlySender isCarbonSaleOpen
{
}
function withdrawContractEther(address payable recipient) external onlyOwner
{
}
function getBalance() public view returns(uint)
{
}
function _baseURI() internal view virtual returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function uri(uint256 tokenId) public view override virtual returns (string memory)
{
}
function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
internal
override(ERC1155, ERC1155Supply)
{
}
}
| MerkleProof.verify(_merkleProof,DiamondMerkleRoot,leaf),"Invalid proof." | 384,586 | MerkleProof.verify(_merkleProof,DiamondMerkleRoot,leaf) |
null | pragma solidity 0.8.9;
/// SPDX-License-Identifier: UNLICENSED
contract DWCNFTGENESIS is ERC1155, ERC1155Supply, ReentrancyGuard, Ownable {
using Strings for uint256;
bytes32 public DiamondMerkleRoot = 0x54b0746df51cbbb2f9ab043955478c4824f8dccc1cbe3da00fef46609652f248;
bytes32 public CarbonMerkleRoot = 0x33b71d34e9eee3cae1ce39d3fb1956ed9d977692d84fd6ec025a0b39bb3c17ad;
string public baseURI;
string public baseExtension = ".json";
bool public diamondSaleOpen = true;
bool public carbonSaleOpen = false;
mapping (address => bool) public whitelistClaimedDiamond;
mapping (address => bool) public whitelistClaimed;
constructor(string memory _initBaseURI) ERC1155(_initBaseURI)
{
}
modifier onlySender {
}
modifier isDiamondSaleOpen {
}
modifier isCarbonSaleOpen {
}
function setDiamondMerkleRoot(bytes32 incomingBytes) public onlyOwner
{
}
function setCarbonMerkleRoot(bytes32 incomingBytes) public onlyOwner
{
}
function flipToCarbonSale() public onlyOwner
{
}
function diamondSale(bytes32[] calldata _merkleProof) public payable nonReentrant onlySender isDiamondSaleOpen
{
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(MerkleProof.verify(_merkleProof, DiamondMerkleRoot, leaf), "Invalid proof.");
require(<FILL_ME>)
whitelistClaimedDiamond[msg.sender] = true;
_mint(msg.sender, 1, 1, "");
}
function carbonSale(bytes32[] calldata _merkleProof) public payable nonReentrant onlySender isCarbonSaleOpen
{
}
function withdrawContractEther(address payable recipient) external onlyOwner
{
}
function getBalance() public view returns(uint)
{
}
function _baseURI() internal view virtual returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function uri(uint256 tokenId) public view override virtual returns (string memory)
{
}
function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
internal
override(ERC1155, ERC1155Supply)
{
}
}
| whitelistClaimedDiamond[msg.sender]==false | 384,586 | whitelistClaimedDiamond[msg.sender]==false |
"Invalid proof." | pragma solidity 0.8.9;
/// SPDX-License-Identifier: UNLICENSED
contract DWCNFTGENESIS is ERC1155, ERC1155Supply, ReentrancyGuard, Ownable {
using Strings for uint256;
bytes32 public DiamondMerkleRoot = 0x54b0746df51cbbb2f9ab043955478c4824f8dccc1cbe3da00fef46609652f248;
bytes32 public CarbonMerkleRoot = 0x33b71d34e9eee3cae1ce39d3fb1956ed9d977692d84fd6ec025a0b39bb3c17ad;
string public baseURI;
string public baseExtension = ".json";
bool public diamondSaleOpen = true;
bool public carbonSaleOpen = false;
mapping (address => bool) public whitelistClaimedDiamond;
mapping (address => bool) public whitelistClaimed;
constructor(string memory _initBaseURI) ERC1155(_initBaseURI)
{
}
modifier onlySender {
}
modifier isDiamondSaleOpen {
}
modifier isCarbonSaleOpen {
}
function setDiamondMerkleRoot(bytes32 incomingBytes) public onlyOwner
{
}
function setCarbonMerkleRoot(bytes32 incomingBytes) public onlyOwner
{
}
function flipToCarbonSale() public onlyOwner
{
}
function diamondSale(bytes32[] calldata _merkleProof) public payable nonReentrant onlySender isDiamondSaleOpen
{
}
function carbonSale(bytes32[] calldata _merkleProof) public payable nonReentrant onlySender isCarbonSaleOpen
{
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(<FILL_ME>)
require(whitelistClaimed[msg.sender] == false);
whitelistClaimed[msg.sender] = true;
_mint(msg.sender, 2, 1, "");
}
function withdrawContractEther(address payable recipient) external onlyOwner
{
}
function getBalance() public view returns(uint)
{
}
function _baseURI() internal view virtual returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function uri(uint256 tokenId) public view override virtual returns (string memory)
{
}
function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
internal
override(ERC1155, ERC1155Supply)
{
}
}
| MerkleProof.verify(_merkleProof,CarbonMerkleRoot,leaf),"Invalid proof." | 384,586 | MerkleProof.verify(_merkleProof,CarbonMerkleRoot,leaf) |
"invalid address" | pragma solidity 0.5.10;
interface IDistribution {
function supply() external view returns(uint256);
function poolAddress(uint8) external view returns(address);
}
interface IMultipleDistribution {
function initialize(address _tokenAddress) external;
function poolStake() external view returns (uint256);
}
interface IERC677MultiBridgeToken {
function transfer(address _to, uint256 _value) external returns (bool);
function transferDistribution(address _to, uint256 _value) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function balanceOf(address _account) external view returns (uint256);
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/// @dev Distributes STAKE tokens for Private Offering and Advisors Reward.
contract MultipleDistribution is Ownable, IMultipleDistribution {
using SafeMath for uint256;
using Address for address;
/// @dev Emits when `initialize` method has been called.
/// @param token The address of ERC677MultiBridgeToken contract.
/// @param caller The address of the caller.
event Initialized(address token, address caller);
/// @dev Emits when the `Distribution` address has been set.
/// @param distribution `Distribution` contract address.
/// @param caller The address of the caller.
event DistributionAddressSet(address distribution, address caller);
/// @dev Emits when `withdraw` method has been called.
/// @param recipient Recipient address.
/// @param value Transferred value.
event Withdrawn(address recipient, uint256 value);
/// @dev Emits when `burn` method has been called.
/// @param value Burnt value.
event Burnt(uint256 value);
/// @dev Emits when `addParticipants` method has been called.
/// @param participants Participants addresses.
/// @param stakes Participants stakes.
/// @param caller The address of the caller.
event ParticipantsAdded(address[] participants, uint256[] stakes, address caller);
/// @dev Emits when `editParticipant` method has been called.
/// @param participant Participant address.
/// @param oldStake Old participant stake.
/// @param newStake New participant stake.
/// @param caller The address of the caller.
event ParticipantEdited(address participant, uint256 oldStake, uint256 newStake, address caller);
/// @dev Emits when `removeParticipant` method has been called.
/// @param participant Participant address.
/// @param stake Participant stake.
/// @param caller The address of the caller.
event ParticipantRemoved(address participant, uint256 stake, address caller);
/// @dev Emits when `finalizeParticipants` method has been called.
/// @param numberOfParticipants Number of participants.
/// @param caller The address of the caller.
event ParticipantsFinalized(uint256 numberOfParticipants, address caller);
uint256 public TOTAL_STAKE;
uint8 public POOL_NUMBER;
/// @dev The instance of ERC677MultiBridgeToken contract.
IERC677MultiBridgeToken public token;
/// @dev Distribution contract address.
address public distributionAddress;
/// @dev Participants addresses.
address[] public participants;
/// @dev Stake for a specified participant.
mapping (address => uint256) public participantStake;
/// @dev Amount of tokens that have already been withdrawn by a specified participant.
mapping (address => uint256) public paidAmount;
/// @dev Contains max balance (sum of all installments).
uint256 public maxBalance = 0;
/// @dev Boolean variable that indicates whether the contract was initialized.
bool public isInitialized = false;
/// @dev Boolean variable that indicates whether the participant set was finalized.
bool public isFinalized = false;
/// @dev Contains current sum of stakes.
uint256 public sumOfStakes = 0;
/// @dev Checks that the contract is initialized.
modifier initialized() {
}
/// @dev Checks that the participant set is not finalized.
modifier notFinalized() {
}
constructor(uint8 _pool) public {
}
/// @dev Adds participants.
/// @param _participants The addresses of new participants.
/// @param _stakes The amounts of the tokens that belong to each participant.
function addParticipants(
address[] calldata _participants,
uint256[] calldata _stakes
) external onlyOwner notFinalized {
require(_participants.length == _stakes.length, "different arrays sizes");
for (uint256 i = 0; i < _participants.length; i++) {
require(<FILL_ME>)
require(_stakes[i] > 0, "the participant stake must be more than 0");
require(participantStake[_participants[i]] == 0, "participant already added");
participants.push(_participants[i]);
participantStake[_participants[i]] = _stakes[i];
sumOfStakes = sumOfStakes.add(_stakes[i]);
}
require(sumOfStakes <= TOTAL_STAKE, "wrong sum of values");
emit ParticipantsAdded(_participants, _stakes, msg.sender);
}
/// @dev Edits participant stake.
/// @param _participant Participant address.
/// @param _newStake New stake of the participant.
function editParticipant(
address _participant,
uint256 _newStake
) external onlyOwner notFinalized {
}
/// @dev Removes participant.
/// @param _participant Participant address.
function removeParticipant(
address _participant
) external onlyOwner notFinalized {
}
/// @dev Calculates unused stake and disables the following additions/edits.
function finalizeParticipants() external onlyOwner notFinalized {
}
/// @dev Initializes the contract after the token is created.
/// @param _tokenAddress The address of the STAKE token contract.
function initialize(
address _tokenAddress
) external {
}
/// @dev The removed implementation of the ownership renouncing.
function renounceOwnership() public onlyOwner {
}
/// @dev Sets the `Distribution` contract address.
/// @param _distributionAddress The `Distribution` contract address.
function setDistributionAddress(address _distributionAddress) external onlyOwner {
}
/// @dev Transfers a share to participant.
function withdraw() external {
}
/// @dev Transfers unclaimed part to address(0).
function burn() external onlyOwner {
}
/// @dev Updates an internal value of the balance to use it for correct
/// share calculation (see the `_withdraw` function) and prevents transferring
/// tokens to this contract not from the `Distribution` contract.
/// @param _from The address from which the tokens are transferred.
/// @param _value The amount of transferred tokens.
function onTokenTransfer(
address _from,
uint256 _value,
bytes calldata
) external returns (bool) {
}
/// @dev Returns a total amount of tokens.
function poolStake() external view returns (uint256) {
}
/// @dev Returns an array of participants.
function getParticipants() external view returns (address[] memory) {
}
function _withdraw(address _recipient) internal initialized returns(uint256) {
}
}
| _participants[i]!=address(0),"invalid address" | 384,589 | _participants[i]!=address(0) |
"the participant stake must be more than 0" | pragma solidity 0.5.10;
interface IDistribution {
function supply() external view returns(uint256);
function poolAddress(uint8) external view returns(address);
}
interface IMultipleDistribution {
function initialize(address _tokenAddress) external;
function poolStake() external view returns (uint256);
}
interface IERC677MultiBridgeToken {
function transfer(address _to, uint256 _value) external returns (bool);
function transferDistribution(address _to, uint256 _value) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function balanceOf(address _account) external view returns (uint256);
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/// @dev Distributes STAKE tokens for Private Offering and Advisors Reward.
contract MultipleDistribution is Ownable, IMultipleDistribution {
using SafeMath for uint256;
using Address for address;
/// @dev Emits when `initialize` method has been called.
/// @param token The address of ERC677MultiBridgeToken contract.
/// @param caller The address of the caller.
event Initialized(address token, address caller);
/// @dev Emits when the `Distribution` address has been set.
/// @param distribution `Distribution` contract address.
/// @param caller The address of the caller.
event DistributionAddressSet(address distribution, address caller);
/// @dev Emits when `withdraw` method has been called.
/// @param recipient Recipient address.
/// @param value Transferred value.
event Withdrawn(address recipient, uint256 value);
/// @dev Emits when `burn` method has been called.
/// @param value Burnt value.
event Burnt(uint256 value);
/// @dev Emits when `addParticipants` method has been called.
/// @param participants Participants addresses.
/// @param stakes Participants stakes.
/// @param caller The address of the caller.
event ParticipantsAdded(address[] participants, uint256[] stakes, address caller);
/// @dev Emits when `editParticipant` method has been called.
/// @param participant Participant address.
/// @param oldStake Old participant stake.
/// @param newStake New participant stake.
/// @param caller The address of the caller.
event ParticipantEdited(address participant, uint256 oldStake, uint256 newStake, address caller);
/// @dev Emits when `removeParticipant` method has been called.
/// @param participant Participant address.
/// @param stake Participant stake.
/// @param caller The address of the caller.
event ParticipantRemoved(address participant, uint256 stake, address caller);
/// @dev Emits when `finalizeParticipants` method has been called.
/// @param numberOfParticipants Number of participants.
/// @param caller The address of the caller.
event ParticipantsFinalized(uint256 numberOfParticipants, address caller);
uint256 public TOTAL_STAKE;
uint8 public POOL_NUMBER;
/// @dev The instance of ERC677MultiBridgeToken contract.
IERC677MultiBridgeToken public token;
/// @dev Distribution contract address.
address public distributionAddress;
/// @dev Participants addresses.
address[] public participants;
/// @dev Stake for a specified participant.
mapping (address => uint256) public participantStake;
/// @dev Amount of tokens that have already been withdrawn by a specified participant.
mapping (address => uint256) public paidAmount;
/// @dev Contains max balance (sum of all installments).
uint256 public maxBalance = 0;
/// @dev Boolean variable that indicates whether the contract was initialized.
bool public isInitialized = false;
/// @dev Boolean variable that indicates whether the participant set was finalized.
bool public isFinalized = false;
/// @dev Contains current sum of stakes.
uint256 public sumOfStakes = 0;
/// @dev Checks that the contract is initialized.
modifier initialized() {
}
/// @dev Checks that the participant set is not finalized.
modifier notFinalized() {
}
constructor(uint8 _pool) public {
}
/// @dev Adds participants.
/// @param _participants The addresses of new participants.
/// @param _stakes The amounts of the tokens that belong to each participant.
function addParticipants(
address[] calldata _participants,
uint256[] calldata _stakes
) external onlyOwner notFinalized {
require(_participants.length == _stakes.length, "different arrays sizes");
for (uint256 i = 0; i < _participants.length; i++) {
require(_participants[i] != address(0), "invalid address");
require(<FILL_ME>)
require(participantStake[_participants[i]] == 0, "participant already added");
participants.push(_participants[i]);
participantStake[_participants[i]] = _stakes[i];
sumOfStakes = sumOfStakes.add(_stakes[i]);
}
require(sumOfStakes <= TOTAL_STAKE, "wrong sum of values");
emit ParticipantsAdded(_participants, _stakes, msg.sender);
}
/// @dev Edits participant stake.
/// @param _participant Participant address.
/// @param _newStake New stake of the participant.
function editParticipant(
address _participant,
uint256 _newStake
) external onlyOwner notFinalized {
}
/// @dev Removes participant.
/// @param _participant Participant address.
function removeParticipant(
address _participant
) external onlyOwner notFinalized {
}
/// @dev Calculates unused stake and disables the following additions/edits.
function finalizeParticipants() external onlyOwner notFinalized {
}
/// @dev Initializes the contract after the token is created.
/// @param _tokenAddress The address of the STAKE token contract.
function initialize(
address _tokenAddress
) external {
}
/// @dev The removed implementation of the ownership renouncing.
function renounceOwnership() public onlyOwner {
}
/// @dev Sets the `Distribution` contract address.
/// @param _distributionAddress The `Distribution` contract address.
function setDistributionAddress(address _distributionAddress) external onlyOwner {
}
/// @dev Transfers a share to participant.
function withdraw() external {
}
/// @dev Transfers unclaimed part to address(0).
function burn() external onlyOwner {
}
/// @dev Updates an internal value of the balance to use it for correct
/// share calculation (see the `_withdraw` function) and prevents transferring
/// tokens to this contract not from the `Distribution` contract.
/// @param _from The address from which the tokens are transferred.
/// @param _value The amount of transferred tokens.
function onTokenTransfer(
address _from,
uint256 _value,
bytes calldata
) external returns (bool) {
}
/// @dev Returns a total amount of tokens.
function poolStake() external view returns (uint256) {
}
/// @dev Returns an array of participants.
function getParticipants() external view returns (address[] memory) {
}
function _withdraw(address _recipient) internal initialized returns(uint256) {
}
}
| _stakes[i]>0,"the participant stake must be more than 0" | 384,589 | _stakes[i]>0 |
"participant already added" | pragma solidity 0.5.10;
interface IDistribution {
function supply() external view returns(uint256);
function poolAddress(uint8) external view returns(address);
}
interface IMultipleDistribution {
function initialize(address _tokenAddress) external;
function poolStake() external view returns (uint256);
}
interface IERC677MultiBridgeToken {
function transfer(address _to, uint256 _value) external returns (bool);
function transferDistribution(address _to, uint256 _value) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function balanceOf(address _account) external view returns (uint256);
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/// @dev Distributes STAKE tokens for Private Offering and Advisors Reward.
contract MultipleDistribution is Ownable, IMultipleDistribution {
using SafeMath for uint256;
using Address for address;
/// @dev Emits when `initialize` method has been called.
/// @param token The address of ERC677MultiBridgeToken contract.
/// @param caller The address of the caller.
event Initialized(address token, address caller);
/// @dev Emits when the `Distribution` address has been set.
/// @param distribution `Distribution` contract address.
/// @param caller The address of the caller.
event DistributionAddressSet(address distribution, address caller);
/// @dev Emits when `withdraw` method has been called.
/// @param recipient Recipient address.
/// @param value Transferred value.
event Withdrawn(address recipient, uint256 value);
/// @dev Emits when `burn` method has been called.
/// @param value Burnt value.
event Burnt(uint256 value);
/// @dev Emits when `addParticipants` method has been called.
/// @param participants Participants addresses.
/// @param stakes Participants stakes.
/// @param caller The address of the caller.
event ParticipantsAdded(address[] participants, uint256[] stakes, address caller);
/// @dev Emits when `editParticipant` method has been called.
/// @param participant Participant address.
/// @param oldStake Old participant stake.
/// @param newStake New participant stake.
/// @param caller The address of the caller.
event ParticipantEdited(address participant, uint256 oldStake, uint256 newStake, address caller);
/// @dev Emits when `removeParticipant` method has been called.
/// @param participant Participant address.
/// @param stake Participant stake.
/// @param caller The address of the caller.
event ParticipantRemoved(address participant, uint256 stake, address caller);
/// @dev Emits when `finalizeParticipants` method has been called.
/// @param numberOfParticipants Number of participants.
/// @param caller The address of the caller.
event ParticipantsFinalized(uint256 numberOfParticipants, address caller);
uint256 public TOTAL_STAKE;
uint8 public POOL_NUMBER;
/// @dev The instance of ERC677MultiBridgeToken contract.
IERC677MultiBridgeToken public token;
/// @dev Distribution contract address.
address public distributionAddress;
/// @dev Participants addresses.
address[] public participants;
/// @dev Stake for a specified participant.
mapping (address => uint256) public participantStake;
/// @dev Amount of tokens that have already been withdrawn by a specified participant.
mapping (address => uint256) public paidAmount;
/// @dev Contains max balance (sum of all installments).
uint256 public maxBalance = 0;
/// @dev Boolean variable that indicates whether the contract was initialized.
bool public isInitialized = false;
/// @dev Boolean variable that indicates whether the participant set was finalized.
bool public isFinalized = false;
/// @dev Contains current sum of stakes.
uint256 public sumOfStakes = 0;
/// @dev Checks that the contract is initialized.
modifier initialized() {
}
/// @dev Checks that the participant set is not finalized.
modifier notFinalized() {
}
constructor(uint8 _pool) public {
}
/// @dev Adds participants.
/// @param _participants The addresses of new participants.
/// @param _stakes The amounts of the tokens that belong to each participant.
function addParticipants(
address[] calldata _participants,
uint256[] calldata _stakes
) external onlyOwner notFinalized {
require(_participants.length == _stakes.length, "different arrays sizes");
for (uint256 i = 0; i < _participants.length; i++) {
require(_participants[i] != address(0), "invalid address");
require(_stakes[i] > 0, "the participant stake must be more than 0");
require(<FILL_ME>)
participants.push(_participants[i]);
participantStake[_participants[i]] = _stakes[i];
sumOfStakes = sumOfStakes.add(_stakes[i]);
}
require(sumOfStakes <= TOTAL_STAKE, "wrong sum of values");
emit ParticipantsAdded(_participants, _stakes, msg.sender);
}
/// @dev Edits participant stake.
/// @param _participant Participant address.
/// @param _newStake New stake of the participant.
function editParticipant(
address _participant,
uint256 _newStake
) external onlyOwner notFinalized {
}
/// @dev Removes participant.
/// @param _participant Participant address.
function removeParticipant(
address _participant
) external onlyOwner notFinalized {
}
/// @dev Calculates unused stake and disables the following additions/edits.
function finalizeParticipants() external onlyOwner notFinalized {
}
/// @dev Initializes the contract after the token is created.
/// @param _tokenAddress The address of the STAKE token contract.
function initialize(
address _tokenAddress
) external {
}
/// @dev The removed implementation of the ownership renouncing.
function renounceOwnership() public onlyOwner {
}
/// @dev Sets the `Distribution` contract address.
/// @param _distributionAddress The `Distribution` contract address.
function setDistributionAddress(address _distributionAddress) external onlyOwner {
}
/// @dev Transfers a share to participant.
function withdraw() external {
}
/// @dev Transfers unclaimed part to address(0).
function burn() external onlyOwner {
}
/// @dev Updates an internal value of the balance to use it for correct
/// share calculation (see the `_withdraw` function) and prevents transferring
/// tokens to this contract not from the `Distribution` contract.
/// @param _from The address from which the tokens are transferred.
/// @param _value The amount of transferred tokens.
function onTokenTransfer(
address _from,
uint256 _value,
bytes calldata
) external returns (bool) {
}
/// @dev Returns a total amount of tokens.
function poolStake() external view returns (uint256) {
}
/// @dev Returns an array of participants.
function getParticipants() external view returns (address[] memory) {
}
function _withdraw(address _recipient) internal initialized returns(uint256) {
}
}
| participantStake[_participants[i]]==0,"participant already added" | 384,589 | participantStake[_participants[i]]==0 |
"the participant not found" | pragma solidity 0.5.10;
interface IDistribution {
function supply() external view returns(uint256);
function poolAddress(uint8) external view returns(address);
}
interface IMultipleDistribution {
function initialize(address _tokenAddress) external;
function poolStake() external view returns (uint256);
}
interface IERC677MultiBridgeToken {
function transfer(address _to, uint256 _value) external returns (bool);
function transferDistribution(address _to, uint256 _value) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function balanceOf(address _account) external view returns (uint256);
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/// @dev Distributes STAKE tokens for Private Offering and Advisors Reward.
contract MultipleDistribution is Ownable, IMultipleDistribution {
using SafeMath for uint256;
using Address for address;
/// @dev Emits when `initialize` method has been called.
/// @param token The address of ERC677MultiBridgeToken contract.
/// @param caller The address of the caller.
event Initialized(address token, address caller);
/// @dev Emits when the `Distribution` address has been set.
/// @param distribution `Distribution` contract address.
/// @param caller The address of the caller.
event DistributionAddressSet(address distribution, address caller);
/// @dev Emits when `withdraw` method has been called.
/// @param recipient Recipient address.
/// @param value Transferred value.
event Withdrawn(address recipient, uint256 value);
/// @dev Emits when `burn` method has been called.
/// @param value Burnt value.
event Burnt(uint256 value);
/// @dev Emits when `addParticipants` method has been called.
/// @param participants Participants addresses.
/// @param stakes Participants stakes.
/// @param caller The address of the caller.
event ParticipantsAdded(address[] participants, uint256[] stakes, address caller);
/// @dev Emits when `editParticipant` method has been called.
/// @param participant Participant address.
/// @param oldStake Old participant stake.
/// @param newStake New participant stake.
/// @param caller The address of the caller.
event ParticipantEdited(address participant, uint256 oldStake, uint256 newStake, address caller);
/// @dev Emits when `removeParticipant` method has been called.
/// @param participant Participant address.
/// @param stake Participant stake.
/// @param caller The address of the caller.
event ParticipantRemoved(address participant, uint256 stake, address caller);
/// @dev Emits when `finalizeParticipants` method has been called.
/// @param numberOfParticipants Number of participants.
/// @param caller The address of the caller.
event ParticipantsFinalized(uint256 numberOfParticipants, address caller);
uint256 public TOTAL_STAKE;
uint8 public POOL_NUMBER;
/// @dev The instance of ERC677MultiBridgeToken contract.
IERC677MultiBridgeToken public token;
/// @dev Distribution contract address.
address public distributionAddress;
/// @dev Participants addresses.
address[] public participants;
/// @dev Stake for a specified participant.
mapping (address => uint256) public participantStake;
/// @dev Amount of tokens that have already been withdrawn by a specified participant.
mapping (address => uint256) public paidAmount;
/// @dev Contains max balance (sum of all installments).
uint256 public maxBalance = 0;
/// @dev Boolean variable that indicates whether the contract was initialized.
bool public isInitialized = false;
/// @dev Boolean variable that indicates whether the participant set was finalized.
bool public isFinalized = false;
/// @dev Contains current sum of stakes.
uint256 public sumOfStakes = 0;
/// @dev Checks that the contract is initialized.
modifier initialized() {
}
/// @dev Checks that the participant set is not finalized.
modifier notFinalized() {
}
constructor(uint8 _pool) public {
}
/// @dev Adds participants.
/// @param _participants The addresses of new participants.
/// @param _stakes The amounts of the tokens that belong to each participant.
function addParticipants(
address[] calldata _participants,
uint256[] calldata _stakes
) external onlyOwner notFinalized {
}
/// @dev Edits participant stake.
/// @param _participant Participant address.
/// @param _newStake New stake of the participant.
function editParticipant(
address _participant,
uint256 _newStake
) external onlyOwner notFinalized {
}
/// @dev Removes participant.
/// @param _participant Participant address.
function removeParticipant(
address _participant
) external onlyOwner notFinalized {
require(_participant != address(0), "invalid address");
uint256 stake = participantStake[_participant];
require(stake > 0, "the participant doesn't exist");
uint256 index = 0;
uint256 participantsLength = participants.length;
for (uint256 i = 0; i < participantsLength; i++) {
if (participants[i] == _participant) {
index = i;
break;
}
}
require(<FILL_ME>)
sumOfStakes = sumOfStakes.sub(stake);
participantStake[_participant] = 0;
address lastParticipant = participants[participants.length.sub(1)];
participants[index] = lastParticipant;
participants.length = participants.length.sub(1);
emit ParticipantRemoved(_participant, stake, msg.sender);
}
/// @dev Calculates unused stake and disables the following additions/edits.
function finalizeParticipants() external onlyOwner notFinalized {
}
/// @dev Initializes the contract after the token is created.
/// @param _tokenAddress The address of the STAKE token contract.
function initialize(
address _tokenAddress
) external {
}
/// @dev The removed implementation of the ownership renouncing.
function renounceOwnership() public onlyOwner {
}
/// @dev Sets the `Distribution` contract address.
/// @param _distributionAddress The `Distribution` contract address.
function setDistributionAddress(address _distributionAddress) external onlyOwner {
}
/// @dev Transfers a share to participant.
function withdraw() external {
}
/// @dev Transfers unclaimed part to address(0).
function burn() external onlyOwner {
}
/// @dev Updates an internal value of the balance to use it for correct
/// share calculation (see the `_withdraw` function) and prevents transferring
/// tokens to this contract not from the `Distribution` contract.
/// @param _from The address from which the tokens are transferred.
/// @param _value The amount of transferred tokens.
function onTokenTransfer(
address _from,
uint256 _value,
bytes calldata
) external returns (bool) {
}
/// @dev Returns a total amount of tokens.
function poolStake() external view returns (uint256) {
}
/// @dev Returns an array of participants.
function getParticipants() external view returns (address[] memory) {
}
function _withdraw(address _recipient) internal initialized returns(uint256) {
}
}
| participants[index]==_participant,"the participant not found" | 384,589 | participants[index]==_participant |
"wrong address" | pragma solidity 0.5.10;
interface IDistribution {
function supply() external view returns(uint256);
function poolAddress(uint8) external view returns(address);
}
interface IMultipleDistribution {
function initialize(address _tokenAddress) external;
function poolStake() external view returns (uint256);
}
interface IERC677MultiBridgeToken {
function transfer(address _to, uint256 _value) external returns (bool);
function transferDistribution(address _to, uint256 _value) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function balanceOf(address _account) external view returns (uint256);
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/// @dev Distributes STAKE tokens for Private Offering and Advisors Reward.
contract MultipleDistribution is Ownable, IMultipleDistribution {
using SafeMath for uint256;
using Address for address;
/// @dev Emits when `initialize` method has been called.
/// @param token The address of ERC677MultiBridgeToken contract.
/// @param caller The address of the caller.
event Initialized(address token, address caller);
/// @dev Emits when the `Distribution` address has been set.
/// @param distribution `Distribution` contract address.
/// @param caller The address of the caller.
event DistributionAddressSet(address distribution, address caller);
/// @dev Emits when `withdraw` method has been called.
/// @param recipient Recipient address.
/// @param value Transferred value.
event Withdrawn(address recipient, uint256 value);
/// @dev Emits when `burn` method has been called.
/// @param value Burnt value.
event Burnt(uint256 value);
/// @dev Emits when `addParticipants` method has been called.
/// @param participants Participants addresses.
/// @param stakes Participants stakes.
/// @param caller The address of the caller.
event ParticipantsAdded(address[] participants, uint256[] stakes, address caller);
/// @dev Emits when `editParticipant` method has been called.
/// @param participant Participant address.
/// @param oldStake Old participant stake.
/// @param newStake New participant stake.
/// @param caller The address of the caller.
event ParticipantEdited(address participant, uint256 oldStake, uint256 newStake, address caller);
/// @dev Emits when `removeParticipant` method has been called.
/// @param participant Participant address.
/// @param stake Participant stake.
/// @param caller The address of the caller.
event ParticipantRemoved(address participant, uint256 stake, address caller);
/// @dev Emits when `finalizeParticipants` method has been called.
/// @param numberOfParticipants Number of participants.
/// @param caller The address of the caller.
event ParticipantsFinalized(uint256 numberOfParticipants, address caller);
uint256 public TOTAL_STAKE;
uint8 public POOL_NUMBER;
/// @dev The instance of ERC677MultiBridgeToken contract.
IERC677MultiBridgeToken public token;
/// @dev Distribution contract address.
address public distributionAddress;
/// @dev Participants addresses.
address[] public participants;
/// @dev Stake for a specified participant.
mapping (address => uint256) public participantStake;
/// @dev Amount of tokens that have already been withdrawn by a specified participant.
mapping (address => uint256) public paidAmount;
/// @dev Contains max balance (sum of all installments).
uint256 public maxBalance = 0;
/// @dev Boolean variable that indicates whether the contract was initialized.
bool public isInitialized = false;
/// @dev Boolean variable that indicates whether the participant set was finalized.
bool public isFinalized = false;
/// @dev Contains current sum of stakes.
uint256 public sumOfStakes = 0;
/// @dev Checks that the contract is initialized.
modifier initialized() {
}
/// @dev Checks that the participant set is not finalized.
modifier notFinalized() {
}
constructor(uint8 _pool) public {
}
/// @dev Adds participants.
/// @param _participants The addresses of new participants.
/// @param _stakes The amounts of the tokens that belong to each participant.
function addParticipants(
address[] calldata _participants,
uint256[] calldata _stakes
) external onlyOwner notFinalized {
}
/// @dev Edits participant stake.
/// @param _participant Participant address.
/// @param _newStake New stake of the participant.
function editParticipant(
address _participant,
uint256 _newStake
) external onlyOwner notFinalized {
}
/// @dev Removes participant.
/// @param _participant Participant address.
function removeParticipant(
address _participant
) external onlyOwner notFinalized {
}
/// @dev Calculates unused stake and disables the following additions/edits.
function finalizeParticipants() external onlyOwner notFinalized {
}
/// @dev Initializes the contract after the token is created.
/// @param _tokenAddress The address of the STAKE token contract.
function initialize(
address _tokenAddress
) external {
}
/// @dev The removed implementation of the ownership renouncing.
function renounceOwnership() public onlyOwner {
}
/// @dev Sets the `Distribution` contract address.
/// @param _distributionAddress The `Distribution` contract address.
function setDistributionAddress(address _distributionAddress) external onlyOwner {
require(distributionAddress == address(0), "already set");
require(<FILL_ME>)
distributionAddress = _distributionAddress;
emit DistributionAddressSet(distributionAddress, msg.sender);
}
/// @dev Transfers a share to participant.
function withdraw() external {
}
/// @dev Transfers unclaimed part to address(0).
function burn() external onlyOwner {
}
/// @dev Updates an internal value of the balance to use it for correct
/// share calculation (see the `_withdraw` function) and prevents transferring
/// tokens to this contract not from the `Distribution` contract.
/// @param _from The address from which the tokens are transferred.
/// @param _value The amount of transferred tokens.
function onTokenTransfer(
address _from,
uint256 _value,
bytes calldata
) external returns (bool) {
}
/// @dev Returns a total amount of tokens.
function poolStake() external view returns (uint256) {
}
/// @dev Returns an array of participants.
function getParticipants() external view returns (address[] memory) {
}
function _withdraw(address _recipient) internal initialized returns(uint256) {
}
}
| address(this)==IDistribution(_distributionAddress).poolAddress(POOL_NUMBER),"wrong address" | 384,589 | address(this)==IDistribution(_distributionAddress).poolAddress(POOL_NUMBER) |
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) constant returns (uint256);
function transfer(address to, uint256 value) 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) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) 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 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 Owned {
/**
* Contract owner address
*/
address public owner;
/**
* @dev Delegate contract to another person
* @param _owner New owner address
*/
function setOwner(address _owner) onlyOwner
{ }
/**
* @dev Owner check modifier
*/
modifier onlyOwner { }
}
contract RusgasCrowdsale is Owned {
using SafeMath for uint;
event Print(string _name, uint _value);
uint public ETHUSD = 50000; //in cent
address manager;
address public multisig;
address public addressOfERC20Tocken;
ERC20 public token;
uint public startICO = 1522195200;
uint public endICO = 1528847999;
uint public phase1Price = 166666666;
uint public phase2Price = 125000000;
uint public phase3Price = 100000000;
uint public phase4Price = 83333333;
uint public phase5Price = 62500000;
uint public phase6Price = 55555555;
uint public phase7Price = 5000000;
uint public phase8Price = 4000000;
uint public phase9Price = 3000000;
function RusgasCrowdsale(){
}
function tokenBalance() constant returns (uint256) {
}
/* The token address is set when the contract is deployed */
function setAddressOfERC20Tocken(address _addressOfERC20Tocken) onlyOwner {
}
/* ETH/USD price */
function setETHUSD( uint256 _newPrice ) onlyOwner {
}
function transferToken(address _to, uint _value) onlyOwner returns (bool) {
}
function() payable {
}
function doPurchase() payable {
require(now >= startICO && now < endICO);
require(msg.value > 0);
uint sum = msg.value;
uint tokensAmount;
if(now < startICO + (21 days)) {
tokensAmount = sum.mul(ETHUSD).mul(phase1Price).div(1000000000000000000);//.mul(token.decimals);
} else if(now > startICO + (21 days) && now < startICO + (28 days)) {
tokensAmount = sum.mul(ETHUSD).mul(phase2Price).div(1000000000000000000);//.mul(token.decimals);
} else if(now > startICO + (28 days) && now < startICO + (35 days)) {
tokensAmount = sum.mul(ETHUSD).mul(phase3Price).div(1000000000000000000);//.mul(token.decimals);
}else if(now > startICO + (35 days) && now < startICO + (42 days)) {
tokensAmount = sum.mul(ETHUSD).mul(phase4Price).div(1000000000000000000);//.mul(token.decimals);
}else if(now > startICO + (42 days) && now < startICO + (49 days)) {
tokensAmount = sum.mul(ETHUSD).mul(phase5Price).div(1000000000000000000);//.mul(token.decimals);
}else if(now > startICO + (49 days) && now < startICO + (56 days)) {
tokensAmount = sum.mul(ETHUSD).mul(phase6Price).div(1000000000000000000);//.mul(token.decimals);
}else if(now > startICO + (56 days) && now < startICO + (63 days)) {
tokensAmount = sum.mul(ETHUSD).mul(phase7Price).div(1000000000000000000);//.mul(token.decimals);
}else if(now > startICO + (63 days) && now < startICO + (70 days)) {
tokensAmount = sum.mul(ETHUSD).mul(phase8Price).div(1000000000000000000);//.mul(token.decimals);
}
else
{
tokensAmount = sum.mul(ETHUSD).mul(phase9Price).div(1000000000000000000);
}
if(tokenBalance() > tokensAmount){
require(<FILL_ME>)
multisig.transfer(msg.value);
} else {
manager.transfer(msg.value);
}
}
}
| token.transfer(msg.sender,tokensAmount) | 384,591 | token.transfer(msg.sender,tokensAmount) |
"Exceeds maximum 3x3Punks supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "ERC721Enumerable.sol";
import "Ownable.sol";
contract ThreePunks is ERC721Enumerable, Ownable {
using Strings for uint256;
string public _baseTokenURI;
uint256 private _reserved = 333;
uint256 private _supply = 10001;
uint256 private _price = 0.033 ether;
bool public _paused = false;
bool public _onlyWhitelist = true;
address team = 0x802DA0f8c89786E0820962AE38F111BE79666387;
constructor(string memory baseURI) ERC721("3x3Punks", "THREE") {
}
function mint3x3(uint256 num) public payable {
require( !_paused, "Sale paused" );
uint256 supply = totalSupply();
require( num < 10, "Maximum of 9 3x3Punks per mint" );
require(<FILL_ME>)
require( msg.value >= _price * num, "Ether sent is not correct" );
if(_onlyWhitelist==true){
uint256 ownerTokenCount = balanceOf(msg.sender);
require(ownerTokenCount + num < 10, "Maximum of 9 3x3Punks per address");
}
for(uint256 i; i < num; i++){
_safeMint( msg.sender, supply + i );
}
}
function totalMint() public view returns (uint256) {
}
function pause(bool val) public onlyOwner {
}
function setOnlyWhitelist(bool val) public onlyOwner {
}
function walletOfOwner(address _owner) public view returns(uint256[] memory) {
}
function setPrice(uint256 _newPrice) public onlyOwner() {
}
function getPrice() public view returns (uint256){
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function gift(address _to, uint256 _amount) external onlyOwner() {
}
function withdrawAll() public payable onlyOwner {
}
}
| supply+num<_supply-_reserved,"Exceeds maximum 3x3Punks supply" | 384,736 | supply+num<_supply-_reserved |
"Maximum of 9 3x3Punks per address" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "ERC721Enumerable.sol";
import "Ownable.sol";
contract ThreePunks is ERC721Enumerable, Ownable {
using Strings for uint256;
string public _baseTokenURI;
uint256 private _reserved = 333;
uint256 private _supply = 10001;
uint256 private _price = 0.033 ether;
bool public _paused = false;
bool public _onlyWhitelist = true;
address team = 0x802DA0f8c89786E0820962AE38F111BE79666387;
constructor(string memory baseURI) ERC721("3x3Punks", "THREE") {
}
function mint3x3(uint256 num) public payable {
require( !_paused, "Sale paused" );
uint256 supply = totalSupply();
require( num < 10, "Maximum of 9 3x3Punks per mint" );
require( supply + num < _supply - _reserved, "Exceeds maximum 3x3Punks supply" );
require( msg.value >= _price * num, "Ether sent is not correct" );
if(_onlyWhitelist==true){
uint256 ownerTokenCount = balanceOf(msg.sender);
require(<FILL_ME>)
}
for(uint256 i; i < num; i++){
_safeMint( msg.sender, supply + i );
}
}
function totalMint() public view returns (uint256) {
}
function pause(bool val) public onlyOwner {
}
function setOnlyWhitelist(bool val) public onlyOwner {
}
function walletOfOwner(address _owner) public view returns(uint256[] memory) {
}
function setPrice(uint256 _newPrice) public onlyOwner() {
}
function getPrice() public view returns (uint256){
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function gift(address _to, uint256 _amount) external onlyOwner() {
}
function withdrawAll() public payable onlyOwner {
}
}
| ownerTokenCount+num<10,"Maximum of 9 3x3Punks per address" | 384,736 | ownerTokenCount+num<10 |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "ERC721Enumerable.sol";
import "Ownable.sol";
contract ThreePunks is ERC721Enumerable, Ownable {
using Strings for uint256;
string public _baseTokenURI;
uint256 private _reserved = 333;
uint256 private _supply = 10001;
uint256 private _price = 0.033 ether;
bool public _paused = false;
bool public _onlyWhitelist = true;
address team = 0x802DA0f8c89786E0820962AE38F111BE79666387;
constructor(string memory baseURI) ERC721("3x3Punks", "THREE") {
}
function mint3x3(uint256 num) public payable {
}
function totalMint() public view returns (uint256) {
}
function pause(bool val) public onlyOwner {
}
function setOnlyWhitelist(bool val) public onlyOwner {
}
function walletOfOwner(address _owner) public view returns(uint256[] memory) {
}
function setPrice(uint256 _newPrice) public onlyOwner() {
}
function getPrice() public view returns (uint256){
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function gift(address _to, uint256 _amount) external onlyOwner() {
}
function withdrawAll() public payable onlyOwner {
uint256 _income = address(this).balance;
require(<FILL_ME>)
}
}
| payable(team).send(_income) | 384,736 | payable(team).send(_income) |
"LEG : Nothing to claim" | pragma solidity 0.6.12;
// import '@uniswap/v2-periphery/contracts/libraries/IUniswapV2Library.sol';
// import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
// import '@uniswap/v2-core/contracts/UniswapV2Pair.sol';
library COREIUniswapV2Library {
using SafeMath for uint256;
// Copied from https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/libraries/IUniswapV2Library.sol
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) internal returns (uint256 amountOut) {
}
}
interface IERC95 {
function wrapAtomic(address) external;
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function unpauseTransfers() external;
}
interface CERC95 {
function wrapAtomic(address) external;
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function name() external view returns (string memory);
}
interface ICORETransferHandler {
function sync(address) external;
}
contract cLGE is Initializable, OwnableUpgradeSafe, ReentrancyGuardUpgradeSafe {
using SafeMath for uint256;
/// CORE gets deposited straight never sold - refunded if balance is off at end
// Others get sold if needed
// ETH always gets sold into XXX from CORE/XXX
IERC20 public tokenBeingWrapped;
address public coreEthPair;
address public wrappedToken;
address public preWrapEthPair;
address public COREToken;
address public _WETH;
address public wrappedTokenUniswapPair;
address public uniswapFactory;
///////////////////////////////////////
// Note this 3 are not supposed to be actual contributed because of the internal swaps
// But contributed by people, before internal swaps
uint256 public totalETHContributed;
uint256 public totalCOREContributed;
uint256 public totalWrapTokenContributed;
////////////////////////////////////////
////////////////////////////////////////
// Internal balances user to calculate canges
// Note we dont have WETH here because it all goes out
uint256 private wrappedTokenBalance;
uint256 private COREBalance;
////////////////////////////////////////
////////////////////////////////////////
// Variables for calculating LP gotten per each user
// Note all contributions get "flattened" to CORE
// This means we just calculate how much CORE it would buy with the running average
// And use that as the counter
uint256 public totalCOREToRefund; // This is in case there is too much CORE in the contract we refund people who contributed CORE proportionally
// Potential scenario where someone swapped too much ETH/WBTC into CORE causing too much CORE to be in the contract
// and subsequently being not refunded because he didn't contribute CORE but bought CORE for his ETH/WETB
// Was noted and decided that the impact of this is not-significant
uint256 public totalLPCreated;
uint256 private totalUnitsContributed;
uint256 public LPPerUnitContributed; // stored as 1e8 more - this is done for change
////////////////////////////////////////
event Contibution(uint256 COREvalue, address from);
event COREBought(uint256 COREamt, address from);
mapping (address => uint256) public COREContributed; // We take each persons core contributed to calculate units and
// to calculate refund later from totalCoreRefund + CORE total contributed
mapping (address => uint256) public unitsContributed; // unit to keep track how much each person should get of LP
mapping (address => uint256) public unitsClaimed;
mapping (address => bool) public CORERefundClaimed;
mapping (address => address) public pairWithWETHAddressForToken;
mapping (address => uint256) public wrappedTokenContributed; // To calculate units
// Note eth contributed will turn into this and get counted
ICOREGlobals public coreGlobals;
bool public LGEStarted;
uint256 public contractStartTimestamp;
uint256 public LGEDurationDays;
bool public LGEFinished;
function initialize(uint256 daysLong, address _wrappedToken, address _coreGlobals, address _preWrapEthPair) public initializer {
}
function setTokenBeingWrapped(address token, address tokenPairWithWETH) public onlyOwner {
}
/// Starts LGE by admin call
function startLGE() public onlyOwner {
}
function isLGEOver() public view returns (bool) {
}
function claimLP() nonReentrant public {
require(LGEFinished == true, "LGE : Liquidity generation not finished");
require(<FILL_ME>)
IUniswapV2Pair(wrappedTokenUniswapPair)
.transfer(msg.sender, unitsContributed[msg.sender].mul(LPPerUnitContributed).div(1e8));
// LPPerUnitContributed is stored at 1e8 multiplied
unitsClaimed[msg.sender] = unitsContributed[msg.sender];
}
function buyToken(address tokenTarget, uint256 amtToken, address tokenSwapping, uint256 amtTokenSwappingInput, address pair) internal {
}
function updateRunningAverages() internal{
}
function coreETHPairGetter() public view returns (address) {
}
function getPairReserves(address pair) internal view returns (uint256 wethReserves, uint256 tokenReserves) {
}
function finalizeTokenWrapAddress(address _wrappedToken) onlyOwner public {
}
// If LGE doesn't trigger in 24h after its complete its possible to withdraw tokens
// Because then we can assume something went wrong since LGE is a publically callable function
// And otherwise everything is stuck.
function safetyTokenWithdraw(address token) onlyOwner public {
}
function safetyETHWithdraw() onlyOwner public {
}
function addLiquidityAtomic() public {
}
function handleTokenBeingWrappedLiquidityAddition(uint256 amt,uint256 tokenBeingWrappedPer1ETH,uint256 coreTokenPer1ETH) internal returns (uint256 coreUnitsCredit) {
}
function handleWETHLiquidityAddition(uint256 amt,uint256 tokenBeingWrappedPer1ETH,uint256 coreTokenPer1ETH) internal returns (uint256 coreUnitsCredit) {
}
function getHowMuch1WETHBuysOfTokens() public view returns (uint256 tokenBeingWrappedPer1ETH, uint256 coreTokenPer1ETH) {
}
//TEST TASK : Check if liquidity is added via just ending ETH to contract
fallback() external payable {
}
//TEST TASK : Check if liquidity is added via calling this function
function addLiquidityETH() nonReentrant public payable {
}
// TEST TASK : check if this function deposits tokens
function addLiquidityWithTokenWithAllowance(address token, uint256 amount) public nonReentrant {
}
// We burn liquiidyt from WBTC/ETH pair
// And then send it to this ontract
// Wrap atomic will handle both deposits of WETH and wrappedtoken
function unwrapLiquidityTokens() internal {
}
// TODO
mapping(address => PriceAverage) _averagePrices;
struct PriceAverage{
uint8 lastAddedHead;
uint256[20] price;
uint256 cumulativeLast20Blocks;
bool arrayFull;
uint lastBlockOfIncrement; // Just update once per block ( by buy token function )
}
// This is out tokens per 1WETH (1e18 units)
function getAveragePriceLast20Blocks(address token) public view returns (uint256){
}
// NOTE outTokenFor1WETH < lastQuote.mul(150).div(100) check
function updateRunningAveragePrice(address token, bool isRescue) public returns (uint256) {
}
// Because its possible that price of someting legitimately goes +50%
// Then the updateRunningAveragePrice would be stuck until it goes down,
// This allows the admin to "rescue" it by writing a new average
// skiping the +50% check
function rescueRatioLock(address token) public onlyOwner{
}
// Protect form people atomically calling for LGE generation [x]
// Price manipulation protections
// use TWAP [x] custom 20 blocks
// Set max diviation from last trade - not needed [ ]
// re-entrancy protection [x]
// dev tax [x]
function addLiquidityToPairPublic() nonReentrant public{
}
// Safety function that can call public add liquidity before
// This is in case someone manipulates the 20 liquidity addition blocks
// and screws up the ratio
// Allows admins 2 hours to rescue the contract.
function addLiquidityToPairAdmin() nonReentrant onlyOwner public{
}
function getCOREREfund() nonReentrant public {
}
function addLiquidityToPair(bool publicCall) internal {
}
}
| unitsContributed[msg.sender].sub(unitsClaimed[msg.sender])>0,"LEG : Nothing to claim" | 384,747 | unitsContributed[msg.sender].sub(unitsClaimed[msg.sender])>0 |
"LGE is over." | pragma solidity 0.6.12;
// import '@uniswap/v2-periphery/contracts/libraries/IUniswapV2Library.sol';
// import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
// import '@uniswap/v2-core/contracts/UniswapV2Pair.sol';
library COREIUniswapV2Library {
using SafeMath for uint256;
// Copied from https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/libraries/IUniswapV2Library.sol
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) internal returns (uint256 amountOut) {
}
}
interface IERC95 {
function wrapAtomic(address) external;
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function unpauseTransfers() external;
}
interface CERC95 {
function wrapAtomic(address) external;
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function name() external view returns (string memory);
}
interface ICORETransferHandler {
function sync(address) external;
}
contract cLGE is Initializable, OwnableUpgradeSafe, ReentrancyGuardUpgradeSafe {
using SafeMath for uint256;
/// CORE gets deposited straight never sold - refunded if balance is off at end
// Others get sold if needed
// ETH always gets sold into XXX from CORE/XXX
IERC20 public tokenBeingWrapped;
address public coreEthPair;
address public wrappedToken;
address public preWrapEthPair;
address public COREToken;
address public _WETH;
address public wrappedTokenUniswapPair;
address public uniswapFactory;
///////////////////////////////////////
// Note this 3 are not supposed to be actual contributed because of the internal swaps
// But contributed by people, before internal swaps
uint256 public totalETHContributed;
uint256 public totalCOREContributed;
uint256 public totalWrapTokenContributed;
////////////////////////////////////////
////////////////////////////////////////
// Internal balances user to calculate canges
// Note we dont have WETH here because it all goes out
uint256 private wrappedTokenBalance;
uint256 private COREBalance;
////////////////////////////////////////
////////////////////////////////////////
// Variables for calculating LP gotten per each user
// Note all contributions get "flattened" to CORE
// This means we just calculate how much CORE it would buy with the running average
// And use that as the counter
uint256 public totalCOREToRefund; // This is in case there is too much CORE in the contract we refund people who contributed CORE proportionally
// Potential scenario where someone swapped too much ETH/WBTC into CORE causing too much CORE to be in the contract
// and subsequently being not refunded because he didn't contribute CORE but bought CORE for his ETH/WETB
// Was noted and decided that the impact of this is not-significant
uint256 public totalLPCreated;
uint256 private totalUnitsContributed;
uint256 public LPPerUnitContributed; // stored as 1e8 more - this is done for change
////////////////////////////////////////
event Contibution(uint256 COREvalue, address from);
event COREBought(uint256 COREamt, address from);
mapping (address => uint256) public COREContributed; // We take each persons core contributed to calculate units and
// to calculate refund later from totalCoreRefund + CORE total contributed
mapping (address => uint256) public unitsContributed; // unit to keep track how much each person should get of LP
mapping (address => uint256) public unitsClaimed;
mapping (address => bool) public CORERefundClaimed;
mapping (address => address) public pairWithWETHAddressForToken;
mapping (address => uint256) public wrappedTokenContributed; // To calculate units
// Note eth contributed will turn into this and get counted
ICOREGlobals public coreGlobals;
bool public LGEStarted;
uint256 public contractStartTimestamp;
uint256 public LGEDurationDays;
bool public LGEFinished;
function initialize(uint256 daysLong, address _wrappedToken, address _coreGlobals, address _preWrapEthPair) public initializer {
}
function setTokenBeingWrapped(address token, address tokenPairWithWETH) public onlyOwner {
}
/// Starts LGE by admin call
function startLGE() public onlyOwner {
}
function isLGEOver() public view returns (bool) {
}
function claimLP() nonReentrant public {
}
function buyToken(address tokenTarget, uint256 amtToken, address tokenSwapping, uint256 amtTokenSwappingInput, address pair) internal {
}
function updateRunningAverages() internal{
}
function coreETHPairGetter() public view returns (address) {
}
function getPairReserves(address pair) internal view returns (uint256 wethReserves, uint256 tokenReserves) {
}
function finalizeTokenWrapAddress(address _wrappedToken) onlyOwner public {
}
// If LGE doesn't trigger in 24h after its complete its possible to withdraw tokens
// Because then we can assume something went wrong since LGE is a publically callable function
// And otherwise everything is stuck.
function safetyTokenWithdraw(address token) onlyOwner public {
}
function safetyETHWithdraw() onlyOwner public {
}
function addLiquidityAtomic() public {
require(LGEStarted == true, "LGE Didn't start");
require(LGEFinished == false, "LGE : Liquidity generation finished");
require(<FILL_ME>)
// require(token == _WETH || token == COREToken || token == address(tokenBeingWrapped) || token == preWrapEthPair, "Unsupported deposit token");
if(IUniswapV2Pair(preWrapEthPair).balanceOf(address(this)) > 0) {
// Special carveout because unwrap calls this funciton
// Since unwrap will add both WETH and tokenwrapped
unwrapLiquidityTokens();
} else{
( uint256 tokenBeingWrappedPer1ETH, uint256 coreTokenPer1ETH) = getHowMuch1WETHBuysOfTokens();
// Check WETH if there is swap for CORRE or WBTC depending
// Check WBTC and swap for core or not depending on peg
uint256 balWETH = IERC20(_WETH).balanceOf(address(this));
// No need to upate it because we dont retain WETH
uint256 totalCredit; // In core units
// Handling weth
if(balWETH > 0){
totalETHContributed = totalETHContributed.add(balWETH);
totalCredit = handleWETHLiquidityAddition(balWETH,tokenBeingWrappedPer1ETH,coreTokenPer1ETH);
// No other number should be there since it just started a line above
}
// Handling core wrap deposits
// we check change from reserves
uint256 tokenBeingWrappedBalNow = IERC20(tokenBeingWrapped).balanceOf(address(this));
uint256 tokenBeingWrappedBalChange = tokenBeingWrappedBalNow.sub(wrappedTokenBalance);
// If its bigger than 0 we handle
if(tokenBeingWrappedBalChange > 0) {
totalWrapTokenContributed = totalWrapTokenContributed.add(tokenBeingWrappedBalChange);
// We update reserves
wrappedTokenBalance = tokenBeingWrappedBalNow;
// We add wrapped token contributionsto the person this is for stats only
wrappedTokenContributed[msg.sender] = wrappedTokenContributed[msg.sender].add(tokenBeingWrappedBalChange);
// We check how much credit he got that returns from this function
totalCredit = totalCredit.add( handleTokenBeingWrappedLiquidityAddition(tokenBeingWrappedBalChange,tokenBeingWrappedPer1ETH,coreTokenPer1ETH) );
}
// we check core balance against reserves
// Note this is FoT token safe because we check balance of this
// And not accept user input
uint256 COREBalNow = IERC20(COREToken).balanceOf(address(this));
uint256 balCOREChange = COREBalNow.sub(COREBalance);
if(balCOREChange > 0) {
COREContributed[msg.sender] = COREContributed[msg.sender].add(balCOREChange);
totalCOREContributed = totalCOREContributed.add(balCOREChange);
}
// Reset reserves
COREBalance = COREBalNow;
uint256 unitsChange = totalCredit.add(balCOREChange);
// Gives people balances based on core units, if Core is contributed then we just append it to it without special logic
unitsContributed[msg.sender] = unitsContributed[msg.sender].add(unitsChange);
totalUnitsContributed = totalUnitsContributed.add(unitsChange);
emit Contibution(totalCredit, msg.sender);
}
}
function handleTokenBeingWrappedLiquidityAddition(uint256 amt,uint256 tokenBeingWrappedPer1ETH,uint256 coreTokenPer1ETH) internal returns (uint256 coreUnitsCredit) {
}
function handleWETHLiquidityAddition(uint256 amt,uint256 tokenBeingWrappedPer1ETH,uint256 coreTokenPer1ETH) internal returns (uint256 coreUnitsCredit) {
}
function getHowMuch1WETHBuysOfTokens() public view returns (uint256 tokenBeingWrappedPer1ETH, uint256 coreTokenPer1ETH) {
}
//TEST TASK : Check if liquidity is added via just ending ETH to contract
fallback() external payable {
}
//TEST TASK : Check if liquidity is added via calling this function
function addLiquidityETH() nonReentrant public payable {
}
// TEST TASK : check if this function deposits tokens
function addLiquidityWithTokenWithAllowance(address token, uint256 amount) public nonReentrant {
}
// We burn liquiidyt from WBTC/ETH pair
// And then send it to this ontract
// Wrap atomic will handle both deposits of WETH and wrappedtoken
function unwrapLiquidityTokens() internal {
}
// TODO
mapping(address => PriceAverage) _averagePrices;
struct PriceAverage{
uint8 lastAddedHead;
uint256[20] price;
uint256 cumulativeLast20Blocks;
bool arrayFull;
uint lastBlockOfIncrement; // Just update once per block ( by buy token function )
}
// This is out tokens per 1WETH (1e18 units)
function getAveragePriceLast20Blocks(address token) public view returns (uint256){
}
// NOTE outTokenFor1WETH < lastQuote.mul(150).div(100) check
function updateRunningAveragePrice(address token, bool isRescue) public returns (uint256) {
}
// Because its possible that price of someting legitimately goes +50%
// Then the updateRunningAveragePrice would be stuck until it goes down,
// This allows the admin to "rescue" it by writing a new average
// skiping the +50% check
function rescueRatioLock(address token) public onlyOwner{
}
// Protect form people atomically calling for LGE generation [x]
// Price manipulation protections
// use TWAP [x] custom 20 blocks
// Set max diviation from last trade - not needed [ ]
// re-entrancy protection [x]
// dev tax [x]
function addLiquidityToPairPublic() nonReentrant public{
}
// Safety function that can call public add liquidity before
// This is in case someone manipulates the 20 liquidity addition blocks
// and screws up the ratio
// Allows admins 2 hours to rescue the contract.
function addLiquidityToPairAdmin() nonReentrant onlyOwner public{
}
function getCOREREfund() nonReentrant public {
}
function addLiquidityToPair(bool publicCall) internal {
}
}
| isLGEOver()==false,"LGE is over." | 384,747 | isLGEOver()==false |
"You didn't contribute anything" | pragma solidity 0.6.12;
// import '@uniswap/v2-periphery/contracts/libraries/IUniswapV2Library.sol';
// import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
// import '@uniswap/v2-core/contracts/UniswapV2Pair.sol';
library COREIUniswapV2Library {
using SafeMath for uint256;
// Copied from https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/libraries/IUniswapV2Library.sol
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) internal returns (uint256 amountOut) {
}
}
interface IERC95 {
function wrapAtomic(address) external;
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function unpauseTransfers() external;
}
interface CERC95 {
function wrapAtomic(address) external;
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function name() external view returns (string memory);
}
interface ICORETransferHandler {
function sync(address) external;
}
contract cLGE is Initializable, OwnableUpgradeSafe, ReentrancyGuardUpgradeSafe {
using SafeMath for uint256;
/// CORE gets deposited straight never sold - refunded if balance is off at end
// Others get sold if needed
// ETH always gets sold into XXX from CORE/XXX
IERC20 public tokenBeingWrapped;
address public coreEthPair;
address public wrappedToken;
address public preWrapEthPair;
address public COREToken;
address public _WETH;
address public wrappedTokenUniswapPair;
address public uniswapFactory;
///////////////////////////////////////
// Note this 3 are not supposed to be actual contributed because of the internal swaps
// But contributed by people, before internal swaps
uint256 public totalETHContributed;
uint256 public totalCOREContributed;
uint256 public totalWrapTokenContributed;
////////////////////////////////////////
////////////////////////////////////////
// Internal balances user to calculate canges
// Note we dont have WETH here because it all goes out
uint256 private wrappedTokenBalance;
uint256 private COREBalance;
////////////////////////////////////////
////////////////////////////////////////
// Variables for calculating LP gotten per each user
// Note all contributions get "flattened" to CORE
// This means we just calculate how much CORE it would buy with the running average
// And use that as the counter
uint256 public totalCOREToRefund; // This is in case there is too much CORE in the contract we refund people who contributed CORE proportionally
// Potential scenario where someone swapped too much ETH/WBTC into CORE causing too much CORE to be in the contract
// and subsequently being not refunded because he didn't contribute CORE but bought CORE for his ETH/WETB
// Was noted and decided that the impact of this is not-significant
uint256 public totalLPCreated;
uint256 private totalUnitsContributed;
uint256 public LPPerUnitContributed; // stored as 1e8 more - this is done for change
////////////////////////////////////////
event Contibution(uint256 COREvalue, address from);
event COREBought(uint256 COREamt, address from);
mapping (address => uint256) public COREContributed; // We take each persons core contributed to calculate units and
// to calculate refund later from totalCoreRefund + CORE total contributed
mapping (address => uint256) public unitsContributed; // unit to keep track how much each person should get of LP
mapping (address => uint256) public unitsClaimed;
mapping (address => bool) public CORERefundClaimed;
mapping (address => address) public pairWithWETHAddressForToken;
mapping (address => uint256) public wrappedTokenContributed; // To calculate units
// Note eth contributed will turn into this and get counted
ICOREGlobals public coreGlobals;
bool public LGEStarted;
uint256 public contractStartTimestamp;
uint256 public LGEDurationDays;
bool public LGEFinished;
function initialize(uint256 daysLong, address _wrappedToken, address _coreGlobals, address _preWrapEthPair) public initializer {
}
function setTokenBeingWrapped(address token, address tokenPairWithWETH) public onlyOwner {
}
/// Starts LGE by admin call
function startLGE() public onlyOwner {
}
function isLGEOver() public view returns (bool) {
}
function claimLP() nonReentrant public {
}
function buyToken(address tokenTarget, uint256 amtToken, address tokenSwapping, uint256 amtTokenSwappingInput, address pair) internal {
}
function updateRunningAverages() internal{
}
function coreETHPairGetter() public view returns (address) {
}
function getPairReserves(address pair) internal view returns (uint256 wethReserves, uint256 tokenReserves) {
}
function finalizeTokenWrapAddress(address _wrappedToken) onlyOwner public {
}
// If LGE doesn't trigger in 24h after its complete its possible to withdraw tokens
// Because then we can assume something went wrong since LGE is a publically callable function
// And otherwise everything is stuck.
function safetyTokenWithdraw(address token) onlyOwner public {
}
function safetyETHWithdraw() onlyOwner public {
}
function addLiquidityAtomic() public {
}
function handleTokenBeingWrappedLiquidityAddition(uint256 amt,uint256 tokenBeingWrappedPer1ETH,uint256 coreTokenPer1ETH) internal returns (uint256 coreUnitsCredit) {
}
function handleWETHLiquidityAddition(uint256 amt,uint256 tokenBeingWrappedPer1ETH,uint256 coreTokenPer1ETH) internal returns (uint256 coreUnitsCredit) {
}
function getHowMuch1WETHBuysOfTokens() public view returns (uint256 tokenBeingWrappedPer1ETH, uint256 coreTokenPer1ETH) {
}
//TEST TASK : Check if liquidity is added via just ending ETH to contract
fallback() external payable {
}
//TEST TASK : Check if liquidity is added via calling this function
function addLiquidityETH() nonReentrant public payable {
}
// TEST TASK : check if this function deposits tokens
function addLiquidityWithTokenWithAllowance(address token, uint256 amount) public nonReentrant {
}
// We burn liquiidyt from WBTC/ETH pair
// And then send it to this ontract
// Wrap atomic will handle both deposits of WETH and wrappedtoken
function unwrapLiquidityTokens() internal {
}
// TODO
mapping(address => PriceAverage) _averagePrices;
struct PriceAverage{
uint8 lastAddedHead;
uint256[20] price;
uint256 cumulativeLast20Blocks;
bool arrayFull;
uint lastBlockOfIncrement; // Just update once per block ( by buy token function )
}
// This is out tokens per 1WETH (1e18 units)
function getAveragePriceLast20Blocks(address token) public view returns (uint256){
}
// NOTE outTokenFor1WETH < lastQuote.mul(150).div(100) check
function updateRunningAveragePrice(address token, bool isRescue) public returns (uint256) {
}
// Because its possible that price of someting legitimately goes +50%
// Then the updateRunningAveragePrice would be stuck until it goes down,
// This allows the admin to "rescue" it by writing a new average
// skiping the +50% check
function rescueRatioLock(address token) public onlyOwner{
}
// Protect form people atomically calling for LGE generation [x]
// Price manipulation protections
// use TWAP [x] custom 20 blocks
// Set max diviation from last trade - not needed [ ]
// re-entrancy protection [x]
// dev tax [x]
function addLiquidityToPairPublic() nonReentrant public{
}
// Safety function that can call public add liquidity before
// This is in case someone manipulates the 20 liquidity addition blocks
// and screws up the ratio
// Allows admins 2 hours to rescue the contract.
function addLiquidityToPairAdmin() nonReentrant onlyOwner public{
}
function getCOREREfund() nonReentrant public {
require(LGEFinished == true, "LGE not finished");
require(totalCOREToRefund > 0 , "No refunds");
require(<FILL_ME>)
// refund happens just once
require(CORERefundClaimed[msg.sender] == false , "You already claimed");
// To get refund we get the core contributed of this user
// divide it by total core to get the percentage of total this user contributed
// And then multiply that by total core
uint256 COREToRefundToThisPerson = COREContributed[msg.sender].mul(1e12).div(totalCOREContributed).
mul(totalCOREToRefund).div(1e12);
// Let 50% of total core is refunded, total core contributed is 5000
// So refund amount it 2500
// Lets say this user contributed 100, so he needs to get 50 back
// 100*1e12 = 100000000000000
// 100000000000000/5000 is 20000000000
// 20000000000*2500 is 50000000000000
// 50000000000000/1e21 = 50
CORERefundClaimed[msg.sender] = true;
IERC20(COREToken).transfer(msg.sender,COREToRefundToThisPerson);
}
function addLiquidityToPair(bool publicCall) internal {
}
}
| COREContributed[msg.sender]>0,"You didn't contribute anything" | 384,747 | COREContributed[msg.sender]>0 |
"You already claimed" | pragma solidity 0.6.12;
// import '@uniswap/v2-periphery/contracts/libraries/IUniswapV2Library.sol';
// import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
// import '@uniswap/v2-core/contracts/UniswapV2Pair.sol';
library COREIUniswapV2Library {
using SafeMath for uint256;
// Copied from https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/libraries/IUniswapV2Library.sol
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) internal returns (uint256 amountOut) {
}
}
interface IERC95 {
function wrapAtomic(address) external;
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function unpauseTransfers() external;
}
interface CERC95 {
function wrapAtomic(address) external;
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function name() external view returns (string memory);
}
interface ICORETransferHandler {
function sync(address) external;
}
contract cLGE is Initializable, OwnableUpgradeSafe, ReentrancyGuardUpgradeSafe {
using SafeMath for uint256;
/// CORE gets deposited straight never sold - refunded if balance is off at end
// Others get sold if needed
// ETH always gets sold into XXX from CORE/XXX
IERC20 public tokenBeingWrapped;
address public coreEthPair;
address public wrappedToken;
address public preWrapEthPair;
address public COREToken;
address public _WETH;
address public wrappedTokenUniswapPair;
address public uniswapFactory;
///////////////////////////////////////
// Note this 3 are not supposed to be actual contributed because of the internal swaps
// But contributed by people, before internal swaps
uint256 public totalETHContributed;
uint256 public totalCOREContributed;
uint256 public totalWrapTokenContributed;
////////////////////////////////////////
////////////////////////////////////////
// Internal balances user to calculate canges
// Note we dont have WETH here because it all goes out
uint256 private wrappedTokenBalance;
uint256 private COREBalance;
////////////////////////////////////////
////////////////////////////////////////
// Variables for calculating LP gotten per each user
// Note all contributions get "flattened" to CORE
// This means we just calculate how much CORE it would buy with the running average
// And use that as the counter
uint256 public totalCOREToRefund; // This is in case there is too much CORE in the contract we refund people who contributed CORE proportionally
// Potential scenario where someone swapped too much ETH/WBTC into CORE causing too much CORE to be in the contract
// and subsequently being not refunded because he didn't contribute CORE but bought CORE for his ETH/WETB
// Was noted and decided that the impact of this is not-significant
uint256 public totalLPCreated;
uint256 private totalUnitsContributed;
uint256 public LPPerUnitContributed; // stored as 1e8 more - this is done for change
////////////////////////////////////////
event Contibution(uint256 COREvalue, address from);
event COREBought(uint256 COREamt, address from);
mapping (address => uint256) public COREContributed; // We take each persons core contributed to calculate units and
// to calculate refund later from totalCoreRefund + CORE total contributed
mapping (address => uint256) public unitsContributed; // unit to keep track how much each person should get of LP
mapping (address => uint256) public unitsClaimed;
mapping (address => bool) public CORERefundClaimed;
mapping (address => address) public pairWithWETHAddressForToken;
mapping (address => uint256) public wrappedTokenContributed; // To calculate units
// Note eth contributed will turn into this and get counted
ICOREGlobals public coreGlobals;
bool public LGEStarted;
uint256 public contractStartTimestamp;
uint256 public LGEDurationDays;
bool public LGEFinished;
function initialize(uint256 daysLong, address _wrappedToken, address _coreGlobals, address _preWrapEthPair) public initializer {
}
function setTokenBeingWrapped(address token, address tokenPairWithWETH) public onlyOwner {
}
/// Starts LGE by admin call
function startLGE() public onlyOwner {
}
function isLGEOver() public view returns (bool) {
}
function claimLP() nonReentrant public {
}
function buyToken(address tokenTarget, uint256 amtToken, address tokenSwapping, uint256 amtTokenSwappingInput, address pair) internal {
}
function updateRunningAverages() internal{
}
function coreETHPairGetter() public view returns (address) {
}
function getPairReserves(address pair) internal view returns (uint256 wethReserves, uint256 tokenReserves) {
}
function finalizeTokenWrapAddress(address _wrappedToken) onlyOwner public {
}
// If LGE doesn't trigger in 24h after its complete its possible to withdraw tokens
// Because then we can assume something went wrong since LGE is a publically callable function
// And otherwise everything is stuck.
function safetyTokenWithdraw(address token) onlyOwner public {
}
function safetyETHWithdraw() onlyOwner public {
}
function addLiquidityAtomic() public {
}
function handleTokenBeingWrappedLiquidityAddition(uint256 amt,uint256 tokenBeingWrappedPer1ETH,uint256 coreTokenPer1ETH) internal returns (uint256 coreUnitsCredit) {
}
function handleWETHLiquidityAddition(uint256 amt,uint256 tokenBeingWrappedPer1ETH,uint256 coreTokenPer1ETH) internal returns (uint256 coreUnitsCredit) {
}
function getHowMuch1WETHBuysOfTokens() public view returns (uint256 tokenBeingWrappedPer1ETH, uint256 coreTokenPer1ETH) {
}
//TEST TASK : Check if liquidity is added via just ending ETH to contract
fallback() external payable {
}
//TEST TASK : Check if liquidity is added via calling this function
function addLiquidityETH() nonReentrant public payable {
}
// TEST TASK : check if this function deposits tokens
function addLiquidityWithTokenWithAllowance(address token, uint256 amount) public nonReentrant {
}
// We burn liquiidyt from WBTC/ETH pair
// And then send it to this ontract
// Wrap atomic will handle both deposits of WETH and wrappedtoken
function unwrapLiquidityTokens() internal {
}
// TODO
mapping(address => PriceAverage) _averagePrices;
struct PriceAverage{
uint8 lastAddedHead;
uint256[20] price;
uint256 cumulativeLast20Blocks;
bool arrayFull;
uint lastBlockOfIncrement; // Just update once per block ( by buy token function )
}
// This is out tokens per 1WETH (1e18 units)
function getAveragePriceLast20Blocks(address token) public view returns (uint256){
}
// NOTE outTokenFor1WETH < lastQuote.mul(150).div(100) check
function updateRunningAveragePrice(address token, bool isRescue) public returns (uint256) {
}
// Because its possible that price of someting legitimately goes +50%
// Then the updateRunningAveragePrice would be stuck until it goes down,
// This allows the admin to "rescue" it by writing a new average
// skiping the +50% check
function rescueRatioLock(address token) public onlyOwner{
}
// Protect form people atomically calling for LGE generation [x]
// Price manipulation protections
// use TWAP [x] custom 20 blocks
// Set max diviation from last trade - not needed [ ]
// re-entrancy protection [x]
// dev tax [x]
function addLiquidityToPairPublic() nonReentrant public{
}
// Safety function that can call public add liquidity before
// This is in case someone manipulates the 20 liquidity addition blocks
// and screws up the ratio
// Allows admins 2 hours to rescue the contract.
function addLiquidityToPairAdmin() nonReentrant onlyOwner public{
}
function getCOREREfund() nonReentrant public {
require(LGEFinished == true, "LGE not finished");
require(totalCOREToRefund > 0 , "No refunds");
require(COREContributed[msg.sender] > 0, "You didn't contribute anything");
// refund happens just once
require(<FILL_ME>)
// To get refund we get the core contributed of this user
// divide it by total core to get the percentage of total this user contributed
// And then multiply that by total core
uint256 COREToRefundToThisPerson = COREContributed[msg.sender].mul(1e12).div(totalCOREContributed).
mul(totalCOREToRefund).div(1e12);
// Let 50% of total core is refunded, total core contributed is 5000
// So refund amount it 2500
// Lets say this user contributed 100, so he needs to get 50 back
// 100*1e12 = 100000000000000
// 100000000000000/5000 is 20000000000
// 20000000000*2500 is 50000000000000
// 50000000000000/1e21 = 50
CORERefundClaimed[msg.sender] = true;
IERC20(COREToken).transfer(msg.sender,COREToRefundToThisPerson);
}
function addLiquidityToPair(bool publicCall) internal {
}
}
| CORERefundClaimed[msg.sender]==false,"You already claimed" | 384,747 | CORERefundClaimed[msg.sender]==false |
"LibCompound: failed to return funds during migration" | // SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.8.6;
import "./LibCToken.sol";
import "../../LibHidingVault.sol";
/**
* @title Buffer accounting library for KCompound
* @author KeeperDAO
* @dev This library handles existing compound position migration.
* @dev This library implements all the logic for the individual kCompound
* position contracts.
*/
library LibCompound {
using LibCToken for CToken;
// KCOMPOUND_STORAGE_POSITION = keccak256("keeperdao.hiding-vault.compound.storage")
bytes32 constant KCOMPOUND_STORAGE_POSITION = 0x4f39ec42b5bbf77786567b02cbf043f85f0f917cbaa97d8df56931d77a999205;
/**
* State for LibCompound
*/
struct State {
uint256 bufferAmount;
CToken bufferToken;
}
/**
* @notice Load the LibCompound State for the given user
*/
function state() internal pure returns (State storage s) {
}
/**
* @dev this function will be called by the KeeperDAO's LiquidityPool.
* @param _account The address of the compund position owner.
* @param _tokens The amount that is being flash lent.
*/
function migrate(
address _account,
uint256 _tokens,
address[] memory _collateralMarkets,
address[] memory _debtMarkets
) internal {
// Enter markets
enterMarkets(_collateralMarkets);
// Migrate all the cToken Loans.
if (_debtMarkets.length != 0) migrateLoans(_debtMarkets, _account);
// Migrate all the assets from compound.
if (_collateralMarkets.length != 0) migrateFunds(_collateralMarkets, _account);
// repay CETHER
require(<FILL_ME>)
}
/**
* @notice this function borrows required amount of ETH/ERC20 tokens,
* repays the ETH/ERC20 loan (if it exists) on behalf of the
* compound position owner.
*/
function migrateLoans(address[] memory _cTokens, address _account) private {
}
/**
* @notice transfer all the assets from the account.
*/
function migrateFunds(address[] memory _cTokens, address _account) private {
}
/**
* @notice Prempt liquidation for positions underwater if the provided
* buffer is not considered on the Compound Protocol.
*
* @param _liquidator The address of the liquidator.
* @param _cTokenRepaid The repay cToken address.
* @param _repayAmount The amount that should be repaid.
* @param _cTokenCollateral The collateral cToken address.
*/
function preempt(
CToken _cTokenRepaid,
address _liquidator,
uint _repayAmount,
CToken _cTokenCollateral
) internal returns (uint256) {
}
/**
* @notice Allows JITU to underwrite this contract, by providing cTokens.
*
* @param _cToken The address of the token.
* @param _tokens The tokens being transferred.
*/
function underwrite(CToken _cToken, uint256 _tokens) internal {
}
/**
* @notice Allows JITU to reclaim the cTokens it provided.
*/
function reclaim() internal {
}
/**
* @notice Blacklist all the collateral assets.
*/
function blacklistCTokens() internal {
}
/**
* @notice Whitelist all the collateral assets.
*/
function whitelistCTokens() internal {
}
/**
* @notice check whether the position is liquidatable,
* if it is calculate the amount of tokens
* that can be seized.
*
* @param cTokenRepaid the token that is being repaid.
* @param cTokenSeized the token that is being seized.
* @param repayAmount the amount being repaid.
*
* @return the amount of tokens that need to be seized.
*/
function seizeTokenAmount(
address cTokenRepaid,
address cTokenSeized,
uint repayAmount
) internal returns (uint) {
}
/**
* @notice calculates the collateral value of the given cToken amount.
* @dev collateral value means the amount of loan that can be taken without
* falling below the collateral requirement.
*
* @param _cToken the compound token we are calculating the collateral for.
* @param _tokens number of compound tokens.
*
* @return max borrow value for the given compound tokens in USD.
*/
function collateralValueInUSD(CToken _cToken, uint256 _tokens) internal view returns (uint256) {
}
/**
* @notice Calculate the given cToken's underlying token balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance in the given token.
*/
function balanceOfUnderlying(CToken _cToken) internal returns (uint256) {
}
/**
* @notice Calculate the given cToken's balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance of the given token.
*/
function balanceOf(CToken _cToken) internal view returns (uint256) {
}
/**
* @notice mew markets can be entered by calling this function.
*/
function enterMarkets(address[] memory _cTokens) internal {
}
/**
* @notice unhealth of the given account, the position is underwater
* if this value is greater than 100
* @dev if the account is empty, this fn returns an unhealth of 0
*
* @return unhealth of the account
*/
function unhealth() internal view returns (uint256) {
}
/**
* @notice calculate the collateral value of the given cToken
*
* @return collateral value of the given cToken
*/
function collateralValue(CToken cToken) internal view returns (uint256) {
}
/**
* @notice checks whether the given position is underwritten or not
*
* @return underwritten status of the caller
*/
function isUnderwritten() internal view returns (bool) {
}
/**
* @notice checks the owner of this vault
*
* @return address of the owner
*/
function owner() internal view returns (address) {
}
/** Exponential Math */
function mulExp3AndScalarTruncate(uint256 a, uint256 b, uint256 c, uint256 d) internal pure returns (uint256) {
}
function mulExp(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
function mulScalarTruncate(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
}
interface Weth {
function balanceOf(address owner) external view returns (uint);
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address spender, uint256 amount) external returns (bool);
}
interface NFT {
function jitu() external view returns (address);
function ownerOf(uint256 _tokenID) external view returns (address);
}
| CToken(_collateralMarkets[0]).transfer(msg.sender,_tokens),"LibCompound: failed to return funds during migration" | 384,872 | CToken(_collateralMarkets[0]).transfer(msg.sender,_tokens) |
"LibCompound: failed to transfer CETHER" | // SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.8.6;
import "./LibCToken.sol";
import "../../LibHidingVault.sol";
/**
* @title Buffer accounting library for KCompound
* @author KeeperDAO
* @dev This library handles existing compound position migration.
* @dev This library implements all the logic for the individual kCompound
* position contracts.
*/
library LibCompound {
using LibCToken for CToken;
// KCOMPOUND_STORAGE_POSITION = keccak256("keeperdao.hiding-vault.compound.storage")
bytes32 constant KCOMPOUND_STORAGE_POSITION = 0x4f39ec42b5bbf77786567b02cbf043f85f0f917cbaa97d8df56931d77a999205;
/**
* State for LibCompound
*/
struct State {
uint256 bufferAmount;
CToken bufferToken;
}
/**
* @notice Load the LibCompound State for the given user
*/
function state() internal pure returns (State storage s) {
}
/**
* @dev this function will be called by the KeeperDAO's LiquidityPool.
* @param _account The address of the compund position owner.
* @param _tokens The amount that is being flash lent.
*/
function migrate(
address _account,
uint256 _tokens,
address[] memory _collateralMarkets,
address[] memory _debtMarkets
) internal {
}
/**
* @notice this function borrows required amount of ETH/ERC20 tokens,
* repays the ETH/ERC20 loan (if it exists) on behalf of the
* compound position owner.
*/
function migrateLoans(address[] memory _cTokens, address _account) private {
}
/**
* @notice transfer all the assets from the account.
*/
function migrateFunds(address[] memory _cTokens, address _account) private {
for (uint32 i = 0; i < _cTokens.length; i++) {
CToken cToken = CToken(_cTokens[i]);
require(<FILL_ME>)
}
}
/**
* @notice Prempt liquidation for positions underwater if the provided
* buffer is not considered on the Compound Protocol.
*
* @param _liquidator The address of the liquidator.
* @param _cTokenRepaid The repay cToken address.
* @param _repayAmount The amount that should be repaid.
* @param _cTokenCollateral The collateral cToken address.
*/
function preempt(
CToken _cTokenRepaid,
address _liquidator,
uint _repayAmount,
CToken _cTokenCollateral
) internal returns (uint256) {
}
/**
* @notice Allows JITU to underwrite this contract, by providing cTokens.
*
* @param _cToken The address of the token.
* @param _tokens The tokens being transferred.
*/
function underwrite(CToken _cToken, uint256 _tokens) internal {
}
/**
* @notice Allows JITU to reclaim the cTokens it provided.
*/
function reclaim() internal {
}
/**
* @notice Blacklist all the collateral assets.
*/
function blacklistCTokens() internal {
}
/**
* @notice Whitelist all the collateral assets.
*/
function whitelistCTokens() internal {
}
/**
* @notice check whether the position is liquidatable,
* if it is calculate the amount of tokens
* that can be seized.
*
* @param cTokenRepaid the token that is being repaid.
* @param cTokenSeized the token that is being seized.
* @param repayAmount the amount being repaid.
*
* @return the amount of tokens that need to be seized.
*/
function seizeTokenAmount(
address cTokenRepaid,
address cTokenSeized,
uint repayAmount
) internal returns (uint) {
}
/**
* @notice calculates the collateral value of the given cToken amount.
* @dev collateral value means the amount of loan that can be taken without
* falling below the collateral requirement.
*
* @param _cToken the compound token we are calculating the collateral for.
* @param _tokens number of compound tokens.
*
* @return max borrow value for the given compound tokens in USD.
*/
function collateralValueInUSD(CToken _cToken, uint256 _tokens) internal view returns (uint256) {
}
/**
* @notice Calculate the given cToken's underlying token balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance in the given token.
*/
function balanceOfUnderlying(CToken _cToken) internal returns (uint256) {
}
/**
* @notice Calculate the given cToken's balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance of the given token.
*/
function balanceOf(CToken _cToken) internal view returns (uint256) {
}
/**
* @notice mew markets can be entered by calling this function.
*/
function enterMarkets(address[] memory _cTokens) internal {
}
/**
* @notice unhealth of the given account, the position is underwater
* if this value is greater than 100
* @dev if the account is empty, this fn returns an unhealth of 0
*
* @return unhealth of the account
*/
function unhealth() internal view returns (uint256) {
}
/**
* @notice calculate the collateral value of the given cToken
*
* @return collateral value of the given cToken
*/
function collateralValue(CToken cToken) internal view returns (uint256) {
}
/**
* @notice checks whether the given position is underwritten or not
*
* @return underwritten status of the caller
*/
function isUnderwritten() internal view returns (bool) {
}
/**
* @notice checks the owner of this vault
*
* @return address of the owner
*/
function owner() internal view returns (address) {
}
/** Exponential Math */
function mulExp3AndScalarTruncate(uint256 a, uint256 b, uint256 c, uint256 d) internal pure returns (uint256) {
}
function mulExp(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
function mulScalarTruncate(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
}
interface Weth {
function balanceOf(address owner) external view returns (uint);
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address spender, uint256 amount) external returns (bool);
}
interface NFT {
function jitu() external view returns (address);
function ownerOf(uint256 _tokenID) external view returns (address);
}
| cToken.transferFrom(_account,address(this),cToken.balanceOf(_account)),"LibCompound: failed to transfer CETHER" | 384,872 | cToken.transferFrom(_account,address(this),cToken.balanceOf(_account)) |
"LibCompound: failed to transfer cTokens" | // SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.8.6;
import "./LibCToken.sol";
import "../../LibHidingVault.sol";
/**
* @title Buffer accounting library for KCompound
* @author KeeperDAO
* @dev This library handles existing compound position migration.
* @dev This library implements all the logic for the individual kCompound
* position contracts.
*/
library LibCompound {
using LibCToken for CToken;
// KCOMPOUND_STORAGE_POSITION = keccak256("keeperdao.hiding-vault.compound.storage")
bytes32 constant KCOMPOUND_STORAGE_POSITION = 0x4f39ec42b5bbf77786567b02cbf043f85f0f917cbaa97d8df56931d77a999205;
/**
* State for LibCompound
*/
struct State {
uint256 bufferAmount;
CToken bufferToken;
}
/**
* @notice Load the LibCompound State for the given user
*/
function state() internal pure returns (State storage s) {
}
/**
* @dev this function will be called by the KeeperDAO's LiquidityPool.
* @param _account The address of the compund position owner.
* @param _tokens The amount that is being flash lent.
*/
function migrate(
address _account,
uint256 _tokens,
address[] memory _collateralMarkets,
address[] memory _debtMarkets
) internal {
}
/**
* @notice this function borrows required amount of ETH/ERC20 tokens,
* repays the ETH/ERC20 loan (if it exists) on behalf of the
* compound position owner.
*/
function migrateLoans(address[] memory _cTokens, address _account) private {
}
/**
* @notice transfer all the assets from the account.
*/
function migrateFunds(address[] memory _cTokens, address _account) private {
}
/**
* @notice Prempt liquidation for positions underwater if the provided
* buffer is not considered on the Compound Protocol.
*
* @param _liquidator The address of the liquidator.
* @param _cTokenRepaid The repay cToken address.
* @param _repayAmount The amount that should be repaid.
* @param _cTokenCollateral The collateral cToken address.
*/
function preempt(
CToken _cTokenRepaid,
address _liquidator,
uint _repayAmount,
CToken _cTokenCollateral
) internal returns (uint256) {
// Check whether the user's position is liquidatable, and if it is
// return the amount of tokens that can be seized for the given loan,
// token pair.
uint seizeTokens = seizeTokenAmount(
address(_cTokenRepaid),
address(_cTokenCollateral),
_repayAmount
);
// This is a preemptive liquidation, so it would just repay the given loan
// and seize the corresponding amount of tokens.
_cTokenRepaid.pullAndApproveUnderlying(_liquidator, address(_cTokenRepaid), _repayAmount);
_cTokenRepaid.repayBorrow(_repayAmount);
require(<FILL_ME>)
return seizeTokens;
}
/**
* @notice Allows JITU to underwrite this contract, by providing cTokens.
*
* @param _cToken The address of the token.
* @param _tokens The tokens being transferred.
*/
function underwrite(CToken _cToken, uint256 _tokens) internal {
}
/**
* @notice Allows JITU to reclaim the cTokens it provided.
*/
function reclaim() internal {
}
/**
* @notice Blacklist all the collateral assets.
*/
function blacklistCTokens() internal {
}
/**
* @notice Whitelist all the collateral assets.
*/
function whitelistCTokens() internal {
}
/**
* @notice check whether the position is liquidatable,
* if it is calculate the amount of tokens
* that can be seized.
*
* @param cTokenRepaid the token that is being repaid.
* @param cTokenSeized the token that is being seized.
* @param repayAmount the amount being repaid.
*
* @return the amount of tokens that need to be seized.
*/
function seizeTokenAmount(
address cTokenRepaid,
address cTokenSeized,
uint repayAmount
) internal returns (uint) {
}
/**
* @notice calculates the collateral value of the given cToken amount.
* @dev collateral value means the amount of loan that can be taken without
* falling below the collateral requirement.
*
* @param _cToken the compound token we are calculating the collateral for.
* @param _tokens number of compound tokens.
*
* @return max borrow value for the given compound tokens in USD.
*/
function collateralValueInUSD(CToken _cToken, uint256 _tokens) internal view returns (uint256) {
}
/**
* @notice Calculate the given cToken's underlying token balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance in the given token.
*/
function balanceOfUnderlying(CToken _cToken) internal returns (uint256) {
}
/**
* @notice Calculate the given cToken's balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance of the given token.
*/
function balanceOf(CToken _cToken) internal view returns (uint256) {
}
/**
* @notice mew markets can be entered by calling this function.
*/
function enterMarkets(address[] memory _cTokens) internal {
}
/**
* @notice unhealth of the given account, the position is underwater
* if this value is greater than 100
* @dev if the account is empty, this fn returns an unhealth of 0
*
* @return unhealth of the account
*/
function unhealth() internal view returns (uint256) {
}
/**
* @notice calculate the collateral value of the given cToken
*
* @return collateral value of the given cToken
*/
function collateralValue(CToken cToken) internal view returns (uint256) {
}
/**
* @notice checks whether the given position is underwritten or not
*
* @return underwritten status of the caller
*/
function isUnderwritten() internal view returns (bool) {
}
/**
* @notice checks the owner of this vault
*
* @return address of the owner
*/
function owner() internal view returns (address) {
}
/** Exponential Math */
function mulExp3AndScalarTruncate(uint256 a, uint256 b, uint256 c, uint256 d) internal pure returns (uint256) {
}
function mulExp(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
function mulScalarTruncate(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
}
interface Weth {
function balanceOf(address owner) external view returns (uint);
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address spender, uint256 amount) external returns (bool);
}
interface NFT {
function jitu() external view returns (address);
function ownerOf(uint256 _tokenID) external view returns (address);
}
| _cTokenCollateral.transfer(_liquidator,seizeTokens),"LibCompound: failed to transfer cTokens" | 384,872 | _cTokenCollateral.transfer(_liquidator,seizeTokens) |
"LibCompound: underwrite pre-conditions not met" | // SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.8.6;
import "./LibCToken.sol";
import "../../LibHidingVault.sol";
/**
* @title Buffer accounting library for KCompound
* @author KeeperDAO
* @dev This library handles existing compound position migration.
* @dev This library implements all the logic for the individual kCompound
* position contracts.
*/
library LibCompound {
using LibCToken for CToken;
// KCOMPOUND_STORAGE_POSITION = keccak256("keeperdao.hiding-vault.compound.storage")
bytes32 constant KCOMPOUND_STORAGE_POSITION = 0x4f39ec42b5bbf77786567b02cbf043f85f0f917cbaa97d8df56931d77a999205;
/**
* State for LibCompound
*/
struct State {
uint256 bufferAmount;
CToken bufferToken;
}
/**
* @notice Load the LibCompound State for the given user
*/
function state() internal pure returns (State storage s) {
}
/**
* @dev this function will be called by the KeeperDAO's LiquidityPool.
* @param _account The address of the compund position owner.
* @param _tokens The amount that is being flash lent.
*/
function migrate(
address _account,
uint256 _tokens,
address[] memory _collateralMarkets,
address[] memory _debtMarkets
) internal {
}
/**
* @notice this function borrows required amount of ETH/ERC20 tokens,
* repays the ETH/ERC20 loan (if it exists) on behalf of the
* compound position owner.
*/
function migrateLoans(address[] memory _cTokens, address _account) private {
}
/**
* @notice transfer all the assets from the account.
*/
function migrateFunds(address[] memory _cTokens, address _account) private {
}
/**
* @notice Prempt liquidation for positions underwater if the provided
* buffer is not considered on the Compound Protocol.
*
* @param _liquidator The address of the liquidator.
* @param _cTokenRepaid The repay cToken address.
* @param _repayAmount The amount that should be repaid.
* @param _cTokenCollateral The collateral cToken address.
*/
function preempt(
CToken _cTokenRepaid,
address _liquidator,
uint _repayAmount,
CToken _cTokenCollateral
) internal returns (uint256) {
}
/**
* @notice Allows JITU to underwrite this contract, by providing cTokens.
*
* @param _cToken The address of the token.
* @param _tokens The tokens being transferred.
*/
function underwrite(CToken _cToken, uint256 _tokens) internal {
require(<FILL_ME>)
State storage s = state();
s.bufferToken = _cToken;
s.bufferAmount = _tokens;
blacklistCTokens();
}
/**
* @notice Allows JITU to reclaim the cTokens it provided.
*/
function reclaim() internal {
}
/**
* @notice Blacklist all the collateral assets.
*/
function blacklistCTokens() internal {
}
/**
* @notice Whitelist all the collateral assets.
*/
function whitelistCTokens() internal {
}
/**
* @notice check whether the position is liquidatable,
* if it is calculate the amount of tokens
* that can be seized.
*
* @param cTokenRepaid the token that is being repaid.
* @param cTokenSeized the token that is being seized.
* @param repayAmount the amount being repaid.
*
* @return the amount of tokens that need to be seized.
*/
function seizeTokenAmount(
address cTokenRepaid,
address cTokenSeized,
uint repayAmount
) internal returns (uint) {
}
/**
* @notice calculates the collateral value of the given cToken amount.
* @dev collateral value means the amount of loan that can be taken without
* falling below the collateral requirement.
*
* @param _cToken the compound token we are calculating the collateral for.
* @param _tokens number of compound tokens.
*
* @return max borrow value for the given compound tokens in USD.
*/
function collateralValueInUSD(CToken _cToken, uint256 _tokens) internal view returns (uint256) {
}
/**
* @notice Calculate the given cToken's underlying token balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance in the given token.
*/
function balanceOfUnderlying(CToken _cToken) internal returns (uint256) {
}
/**
* @notice Calculate the given cToken's balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance of the given token.
*/
function balanceOf(CToken _cToken) internal view returns (uint256) {
}
/**
* @notice mew markets can be entered by calling this function.
*/
function enterMarkets(address[] memory _cTokens) internal {
}
/**
* @notice unhealth of the given account, the position is underwater
* if this value is greater than 100
* @dev if the account is empty, this fn returns an unhealth of 0
*
* @return unhealth of the account
*/
function unhealth() internal view returns (uint256) {
}
/**
* @notice calculate the collateral value of the given cToken
*
* @return collateral value of the given cToken
*/
function collateralValue(CToken cToken) internal view returns (uint256) {
}
/**
* @notice checks whether the given position is underwritten or not
*
* @return underwritten status of the caller
*/
function isUnderwritten() internal view returns (bool) {
}
/**
* @notice checks the owner of this vault
*
* @return address of the owner
*/
function owner() internal view returns (address) {
}
/** Exponential Math */
function mulExp3AndScalarTruncate(uint256 a, uint256 b, uint256 c, uint256 d) internal pure returns (uint256) {
}
function mulExp(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
function mulScalarTruncate(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
}
interface Weth {
function balanceOf(address owner) external view returns (uint);
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address spender, uint256 amount) external returns (bool);
}
interface NFT {
function jitu() external view returns (address);
function ownerOf(uint256 _tokenID) external view returns (address);
}
| _tokens*3<=_cToken.balanceOf(address(this)),"LibCompound: underwrite pre-conditions not met" | 384,872 | _tokens*3<=_cToken.balanceOf(address(this)) |
"LibCompound: failed to return cTokens" | // SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.8.6;
import "./LibCToken.sol";
import "../../LibHidingVault.sol";
/**
* @title Buffer accounting library for KCompound
* @author KeeperDAO
* @dev This library handles existing compound position migration.
* @dev This library implements all the logic for the individual kCompound
* position contracts.
*/
library LibCompound {
using LibCToken for CToken;
// KCOMPOUND_STORAGE_POSITION = keccak256("keeperdao.hiding-vault.compound.storage")
bytes32 constant KCOMPOUND_STORAGE_POSITION = 0x4f39ec42b5bbf77786567b02cbf043f85f0f917cbaa97d8df56931d77a999205;
/**
* State for LibCompound
*/
struct State {
uint256 bufferAmount;
CToken bufferToken;
}
/**
* @notice Load the LibCompound State for the given user
*/
function state() internal pure returns (State storage s) {
}
/**
* @dev this function will be called by the KeeperDAO's LiquidityPool.
* @param _account The address of the compund position owner.
* @param _tokens The amount that is being flash lent.
*/
function migrate(
address _account,
uint256 _tokens,
address[] memory _collateralMarkets,
address[] memory _debtMarkets
) internal {
}
/**
* @notice this function borrows required amount of ETH/ERC20 tokens,
* repays the ETH/ERC20 loan (if it exists) on behalf of the
* compound position owner.
*/
function migrateLoans(address[] memory _cTokens, address _account) private {
}
/**
* @notice transfer all the assets from the account.
*/
function migrateFunds(address[] memory _cTokens, address _account) private {
}
/**
* @notice Prempt liquidation for positions underwater if the provided
* buffer is not considered on the Compound Protocol.
*
* @param _liquidator The address of the liquidator.
* @param _cTokenRepaid The repay cToken address.
* @param _repayAmount The amount that should be repaid.
* @param _cTokenCollateral The collateral cToken address.
*/
function preempt(
CToken _cTokenRepaid,
address _liquidator,
uint _repayAmount,
CToken _cTokenCollateral
) internal returns (uint256) {
}
/**
* @notice Allows JITU to underwrite this contract, by providing cTokens.
*
* @param _cToken The address of the token.
* @param _tokens The tokens being transferred.
*/
function underwrite(CToken _cToken, uint256 _tokens) internal {
}
/**
* @notice Allows JITU to reclaim the cTokens it provided.
*/
function reclaim() internal {
State storage s = state();
require(<FILL_ME>)
s.bufferToken = CToken(address(0));
s.bufferAmount = 0;
whitelistCTokens();
}
/**
* @notice Blacklist all the collateral assets.
*/
function blacklistCTokens() internal {
}
/**
* @notice Whitelist all the collateral assets.
*/
function whitelistCTokens() internal {
}
/**
* @notice check whether the position is liquidatable,
* if it is calculate the amount of tokens
* that can be seized.
*
* @param cTokenRepaid the token that is being repaid.
* @param cTokenSeized the token that is being seized.
* @param repayAmount the amount being repaid.
*
* @return the amount of tokens that need to be seized.
*/
function seizeTokenAmount(
address cTokenRepaid,
address cTokenSeized,
uint repayAmount
) internal returns (uint) {
}
/**
* @notice calculates the collateral value of the given cToken amount.
* @dev collateral value means the amount of loan that can be taken without
* falling below the collateral requirement.
*
* @param _cToken the compound token we are calculating the collateral for.
* @param _tokens number of compound tokens.
*
* @return max borrow value for the given compound tokens in USD.
*/
function collateralValueInUSD(CToken _cToken, uint256 _tokens) internal view returns (uint256) {
}
/**
* @notice Calculate the given cToken's underlying token balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance in the given token.
*/
function balanceOfUnderlying(CToken _cToken) internal returns (uint256) {
}
/**
* @notice Calculate the given cToken's balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance of the given token.
*/
function balanceOf(CToken _cToken) internal view returns (uint256) {
}
/**
* @notice mew markets can be entered by calling this function.
*/
function enterMarkets(address[] memory _cTokens) internal {
}
/**
* @notice unhealth of the given account, the position is underwater
* if this value is greater than 100
* @dev if the account is empty, this fn returns an unhealth of 0
*
* @return unhealth of the account
*/
function unhealth() internal view returns (uint256) {
}
/**
* @notice calculate the collateral value of the given cToken
*
* @return collateral value of the given cToken
*/
function collateralValue(CToken cToken) internal view returns (uint256) {
}
/**
* @notice checks whether the given position is underwritten or not
*
* @return underwritten status of the caller
*/
function isUnderwritten() internal view returns (bool) {
}
/**
* @notice checks the owner of this vault
*
* @return address of the owner
*/
function owner() internal view returns (address) {
}
/** Exponential Math */
function mulExp3AndScalarTruncate(uint256 a, uint256 b, uint256 c, uint256 d) internal pure returns (uint256) {
}
function mulExp(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
function mulScalarTruncate(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
}
interface Weth {
function balanceOf(address owner) external view returns (uint);
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address spender, uint256 amount) external returns (bool);
}
interface NFT {
function jitu() external view returns (address);
function ownerOf(uint256 _tokenID) external view returns (address);
}
| s.bufferToken.transfer(msg.sender,s.bufferAmount),"LibCompound: failed to return cTokens" | 384,872 | s.bufferToken.transfer(msg.sender,s.bufferAmount) |
"LibCompound: failed to accrue interest on cTokenRepaid" | // SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.8.6;
import "./LibCToken.sol";
import "../../LibHidingVault.sol";
/**
* @title Buffer accounting library for KCompound
* @author KeeperDAO
* @dev This library handles existing compound position migration.
* @dev This library implements all the logic for the individual kCompound
* position contracts.
*/
library LibCompound {
using LibCToken for CToken;
// KCOMPOUND_STORAGE_POSITION = keccak256("keeperdao.hiding-vault.compound.storage")
bytes32 constant KCOMPOUND_STORAGE_POSITION = 0x4f39ec42b5bbf77786567b02cbf043f85f0f917cbaa97d8df56931d77a999205;
/**
* State for LibCompound
*/
struct State {
uint256 bufferAmount;
CToken bufferToken;
}
/**
* @notice Load the LibCompound State for the given user
*/
function state() internal pure returns (State storage s) {
}
/**
* @dev this function will be called by the KeeperDAO's LiquidityPool.
* @param _account The address of the compund position owner.
* @param _tokens The amount that is being flash lent.
*/
function migrate(
address _account,
uint256 _tokens,
address[] memory _collateralMarkets,
address[] memory _debtMarkets
) internal {
}
/**
* @notice this function borrows required amount of ETH/ERC20 tokens,
* repays the ETH/ERC20 loan (if it exists) on behalf of the
* compound position owner.
*/
function migrateLoans(address[] memory _cTokens, address _account) private {
}
/**
* @notice transfer all the assets from the account.
*/
function migrateFunds(address[] memory _cTokens, address _account) private {
}
/**
* @notice Prempt liquidation for positions underwater if the provided
* buffer is not considered on the Compound Protocol.
*
* @param _liquidator The address of the liquidator.
* @param _cTokenRepaid The repay cToken address.
* @param _repayAmount The amount that should be repaid.
* @param _cTokenCollateral The collateral cToken address.
*/
function preempt(
CToken _cTokenRepaid,
address _liquidator,
uint _repayAmount,
CToken _cTokenCollateral
) internal returns (uint256) {
}
/**
* @notice Allows JITU to underwrite this contract, by providing cTokens.
*
* @param _cToken The address of the token.
* @param _tokens The tokens being transferred.
*/
function underwrite(CToken _cToken, uint256 _tokens) internal {
}
/**
* @notice Allows JITU to reclaim the cTokens it provided.
*/
function reclaim() internal {
}
/**
* @notice Blacklist all the collateral assets.
*/
function blacklistCTokens() internal {
}
/**
* @notice Whitelist all the collateral assets.
*/
function whitelistCTokens() internal {
}
/**
* @notice check whether the position is liquidatable,
* if it is calculate the amount of tokens
* that can be seized.
*
* @param cTokenRepaid the token that is being repaid.
* @param cTokenSeized the token that is being seized.
* @param repayAmount the amount being repaid.
*
* @return the amount of tokens that need to be seized.
*/
function seizeTokenAmount(
address cTokenRepaid,
address cTokenSeized,
uint repayAmount
) internal returns (uint) {
State storage s = state();
// accrue interest
require(<FILL_ME>)
require(CToken(cTokenSeized).accrueInterest() == 0, "LibCompound: failed to accrue interest on cTokenSeized");
// The borrower must have shortfall in order to be liquidatable
(uint err, , uint shortfall) = LibCToken.COMPTROLLER.getHypotheticalAccountLiquidity(address(this), address(s.bufferToken), s.bufferAmount, 0);
require(err == 0, "LibCompound: failed to get account liquidity");
require(shortfall != 0, "LibCompound: insufficient shortfall to liquidate");
// The liquidator may not repay more than what is allowed by the closeFactor
uint borrowBalance = CToken(cTokenRepaid).borrowBalanceStored(address(this));
uint maxClose = mulScalarTruncate(LibCToken.COMPTROLLER.closeFactorMantissa(), borrowBalance);
require(repayAmount <= maxClose, "LibCompound: repay amount cannot exceed the max close amount");
// Calculate the amount of tokens that can be seized
(uint errCode2, uint seizeTokens) = LibCToken.COMPTROLLER
.liquidateCalculateSeizeTokens(cTokenRepaid, cTokenSeized, repayAmount);
require(errCode2 == 0, "LibCompound: failed to calculate seize token amount");
// Check that the amount of tokens being seized is less than the user's
// cToken balance
uint256 seizeTokenCollateral = CToken(cTokenSeized).balanceOf(address(this));
if (cTokenSeized == address(s.bufferToken)) {
seizeTokenCollateral = seizeTokenCollateral - s.bufferAmount;
}
require(seizeTokenCollateral >= seizeTokens, "LibCompound: insufficient liquidity");
return seizeTokens;
}
/**
* @notice calculates the collateral value of the given cToken amount.
* @dev collateral value means the amount of loan that can be taken without
* falling below the collateral requirement.
*
* @param _cToken the compound token we are calculating the collateral for.
* @param _tokens number of compound tokens.
*
* @return max borrow value for the given compound tokens in USD.
*/
function collateralValueInUSD(CToken _cToken, uint256 _tokens) internal view returns (uint256) {
}
/**
* @notice Calculate the given cToken's underlying token balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance in the given token.
*/
function balanceOfUnderlying(CToken _cToken) internal returns (uint256) {
}
/**
* @notice Calculate the given cToken's balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance of the given token.
*/
function balanceOf(CToken _cToken) internal view returns (uint256) {
}
/**
* @notice mew markets can be entered by calling this function.
*/
function enterMarkets(address[] memory _cTokens) internal {
}
/**
* @notice unhealth of the given account, the position is underwater
* if this value is greater than 100
* @dev if the account is empty, this fn returns an unhealth of 0
*
* @return unhealth of the account
*/
function unhealth() internal view returns (uint256) {
}
/**
* @notice calculate the collateral value of the given cToken
*
* @return collateral value of the given cToken
*/
function collateralValue(CToken cToken) internal view returns (uint256) {
}
/**
* @notice checks whether the given position is underwritten or not
*
* @return underwritten status of the caller
*/
function isUnderwritten() internal view returns (bool) {
}
/**
* @notice checks the owner of this vault
*
* @return address of the owner
*/
function owner() internal view returns (address) {
}
/** Exponential Math */
function mulExp3AndScalarTruncate(uint256 a, uint256 b, uint256 c, uint256 d) internal pure returns (uint256) {
}
function mulExp(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
function mulScalarTruncate(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
}
interface Weth {
function balanceOf(address owner) external view returns (uint);
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address spender, uint256 amount) external returns (bool);
}
interface NFT {
function jitu() external view returns (address);
function ownerOf(uint256 _tokenID) external view returns (address);
}
| CToken(cTokenRepaid).accrueInterest()==0,"LibCompound: failed to accrue interest on cTokenRepaid" | 384,872 | CToken(cTokenRepaid).accrueInterest()==0 |
"LibCompound: failed to accrue interest on cTokenSeized" | // SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.8.6;
import "./LibCToken.sol";
import "../../LibHidingVault.sol";
/**
* @title Buffer accounting library for KCompound
* @author KeeperDAO
* @dev This library handles existing compound position migration.
* @dev This library implements all the logic for the individual kCompound
* position contracts.
*/
library LibCompound {
using LibCToken for CToken;
// KCOMPOUND_STORAGE_POSITION = keccak256("keeperdao.hiding-vault.compound.storage")
bytes32 constant KCOMPOUND_STORAGE_POSITION = 0x4f39ec42b5bbf77786567b02cbf043f85f0f917cbaa97d8df56931d77a999205;
/**
* State for LibCompound
*/
struct State {
uint256 bufferAmount;
CToken bufferToken;
}
/**
* @notice Load the LibCompound State for the given user
*/
function state() internal pure returns (State storage s) {
}
/**
* @dev this function will be called by the KeeperDAO's LiquidityPool.
* @param _account The address of the compund position owner.
* @param _tokens The amount that is being flash lent.
*/
function migrate(
address _account,
uint256 _tokens,
address[] memory _collateralMarkets,
address[] memory _debtMarkets
) internal {
}
/**
* @notice this function borrows required amount of ETH/ERC20 tokens,
* repays the ETH/ERC20 loan (if it exists) on behalf of the
* compound position owner.
*/
function migrateLoans(address[] memory _cTokens, address _account) private {
}
/**
* @notice transfer all the assets from the account.
*/
function migrateFunds(address[] memory _cTokens, address _account) private {
}
/**
* @notice Prempt liquidation for positions underwater if the provided
* buffer is not considered on the Compound Protocol.
*
* @param _liquidator The address of the liquidator.
* @param _cTokenRepaid The repay cToken address.
* @param _repayAmount The amount that should be repaid.
* @param _cTokenCollateral The collateral cToken address.
*/
function preempt(
CToken _cTokenRepaid,
address _liquidator,
uint _repayAmount,
CToken _cTokenCollateral
) internal returns (uint256) {
}
/**
* @notice Allows JITU to underwrite this contract, by providing cTokens.
*
* @param _cToken The address of the token.
* @param _tokens The tokens being transferred.
*/
function underwrite(CToken _cToken, uint256 _tokens) internal {
}
/**
* @notice Allows JITU to reclaim the cTokens it provided.
*/
function reclaim() internal {
}
/**
* @notice Blacklist all the collateral assets.
*/
function blacklistCTokens() internal {
}
/**
* @notice Whitelist all the collateral assets.
*/
function whitelistCTokens() internal {
}
/**
* @notice check whether the position is liquidatable,
* if it is calculate the amount of tokens
* that can be seized.
*
* @param cTokenRepaid the token that is being repaid.
* @param cTokenSeized the token that is being seized.
* @param repayAmount the amount being repaid.
*
* @return the amount of tokens that need to be seized.
*/
function seizeTokenAmount(
address cTokenRepaid,
address cTokenSeized,
uint repayAmount
) internal returns (uint) {
State storage s = state();
// accrue interest
require(CToken(cTokenRepaid).accrueInterest() == 0, "LibCompound: failed to accrue interest on cTokenRepaid");
require(<FILL_ME>)
// The borrower must have shortfall in order to be liquidatable
(uint err, , uint shortfall) = LibCToken.COMPTROLLER.getHypotheticalAccountLiquidity(address(this), address(s.bufferToken), s.bufferAmount, 0);
require(err == 0, "LibCompound: failed to get account liquidity");
require(shortfall != 0, "LibCompound: insufficient shortfall to liquidate");
// The liquidator may not repay more than what is allowed by the closeFactor
uint borrowBalance = CToken(cTokenRepaid).borrowBalanceStored(address(this));
uint maxClose = mulScalarTruncate(LibCToken.COMPTROLLER.closeFactorMantissa(), borrowBalance);
require(repayAmount <= maxClose, "LibCompound: repay amount cannot exceed the max close amount");
// Calculate the amount of tokens that can be seized
(uint errCode2, uint seizeTokens) = LibCToken.COMPTROLLER
.liquidateCalculateSeizeTokens(cTokenRepaid, cTokenSeized, repayAmount);
require(errCode2 == 0, "LibCompound: failed to calculate seize token amount");
// Check that the amount of tokens being seized is less than the user's
// cToken balance
uint256 seizeTokenCollateral = CToken(cTokenSeized).balanceOf(address(this));
if (cTokenSeized == address(s.bufferToken)) {
seizeTokenCollateral = seizeTokenCollateral - s.bufferAmount;
}
require(seizeTokenCollateral >= seizeTokens, "LibCompound: insufficient liquidity");
return seizeTokens;
}
/**
* @notice calculates the collateral value of the given cToken amount.
* @dev collateral value means the amount of loan that can be taken without
* falling below the collateral requirement.
*
* @param _cToken the compound token we are calculating the collateral for.
* @param _tokens number of compound tokens.
*
* @return max borrow value for the given compound tokens in USD.
*/
function collateralValueInUSD(CToken _cToken, uint256 _tokens) internal view returns (uint256) {
}
/**
* @notice Calculate the given cToken's underlying token balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance in the given token.
*/
function balanceOfUnderlying(CToken _cToken) internal returns (uint256) {
}
/**
* @notice Calculate the given cToken's balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance of the given token.
*/
function balanceOf(CToken _cToken) internal view returns (uint256) {
}
/**
* @notice mew markets can be entered by calling this function.
*/
function enterMarkets(address[] memory _cTokens) internal {
}
/**
* @notice unhealth of the given account, the position is underwater
* if this value is greater than 100
* @dev if the account is empty, this fn returns an unhealth of 0
*
* @return unhealth of the account
*/
function unhealth() internal view returns (uint256) {
}
/**
* @notice calculate the collateral value of the given cToken
*
* @return collateral value of the given cToken
*/
function collateralValue(CToken cToken) internal view returns (uint256) {
}
/**
* @notice checks whether the given position is underwritten or not
*
* @return underwritten status of the caller
*/
function isUnderwritten() internal view returns (bool) {
}
/**
* @notice checks the owner of this vault
*
* @return address of the owner
*/
function owner() internal view returns (address) {
}
/** Exponential Math */
function mulExp3AndScalarTruncate(uint256 a, uint256 b, uint256 c, uint256 d) internal pure returns (uint256) {
}
function mulExp(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
function mulScalarTruncate(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
}
interface Weth {
function balanceOf(address owner) external view returns (uint);
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address spender, uint256 amount) external returns (bool);
}
interface NFT {
function jitu() external view returns (address);
function ownerOf(uint256 _tokenID) external view returns (address);
}
| CToken(cTokenSeized).accrueInterest()==0,"LibCompound: failed to accrue interest on cTokenSeized" | 384,872 | CToken(cTokenSeized).accrueInterest()==0 |
"LibCompound: failed to enter market" | // SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.8.6;
import "./LibCToken.sol";
import "../../LibHidingVault.sol";
/**
* @title Buffer accounting library for KCompound
* @author KeeperDAO
* @dev This library handles existing compound position migration.
* @dev This library implements all the logic for the individual kCompound
* position contracts.
*/
library LibCompound {
using LibCToken for CToken;
// KCOMPOUND_STORAGE_POSITION = keccak256("keeperdao.hiding-vault.compound.storage")
bytes32 constant KCOMPOUND_STORAGE_POSITION = 0x4f39ec42b5bbf77786567b02cbf043f85f0f917cbaa97d8df56931d77a999205;
/**
* State for LibCompound
*/
struct State {
uint256 bufferAmount;
CToken bufferToken;
}
/**
* @notice Load the LibCompound State for the given user
*/
function state() internal pure returns (State storage s) {
}
/**
* @dev this function will be called by the KeeperDAO's LiquidityPool.
* @param _account The address of the compund position owner.
* @param _tokens The amount that is being flash lent.
*/
function migrate(
address _account,
uint256 _tokens,
address[] memory _collateralMarkets,
address[] memory _debtMarkets
) internal {
}
/**
* @notice this function borrows required amount of ETH/ERC20 tokens,
* repays the ETH/ERC20 loan (if it exists) on behalf of the
* compound position owner.
*/
function migrateLoans(address[] memory _cTokens, address _account) private {
}
/**
* @notice transfer all the assets from the account.
*/
function migrateFunds(address[] memory _cTokens, address _account) private {
}
/**
* @notice Prempt liquidation for positions underwater if the provided
* buffer is not considered on the Compound Protocol.
*
* @param _liquidator The address of the liquidator.
* @param _cTokenRepaid The repay cToken address.
* @param _repayAmount The amount that should be repaid.
* @param _cTokenCollateral The collateral cToken address.
*/
function preempt(
CToken _cTokenRepaid,
address _liquidator,
uint _repayAmount,
CToken _cTokenCollateral
) internal returns (uint256) {
}
/**
* @notice Allows JITU to underwrite this contract, by providing cTokens.
*
* @param _cToken The address of the token.
* @param _tokens The tokens being transferred.
*/
function underwrite(CToken _cToken, uint256 _tokens) internal {
}
/**
* @notice Allows JITU to reclaim the cTokens it provided.
*/
function reclaim() internal {
}
/**
* @notice Blacklist all the collateral assets.
*/
function blacklistCTokens() internal {
}
/**
* @notice Whitelist all the collateral assets.
*/
function whitelistCTokens() internal {
}
/**
* @notice check whether the position is liquidatable,
* if it is calculate the amount of tokens
* that can be seized.
*
* @param cTokenRepaid the token that is being repaid.
* @param cTokenSeized the token that is being seized.
* @param repayAmount the amount being repaid.
*
* @return the amount of tokens that need to be seized.
*/
function seizeTokenAmount(
address cTokenRepaid,
address cTokenSeized,
uint repayAmount
) internal returns (uint) {
}
/**
* @notice calculates the collateral value of the given cToken amount.
* @dev collateral value means the amount of loan that can be taken without
* falling below the collateral requirement.
*
* @param _cToken the compound token we are calculating the collateral for.
* @param _tokens number of compound tokens.
*
* @return max borrow value for the given compound tokens in USD.
*/
function collateralValueInUSD(CToken _cToken, uint256 _tokens) internal view returns (uint256) {
}
/**
* @notice Calculate the given cToken's underlying token balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance in the given token.
*/
function balanceOfUnderlying(CToken _cToken) internal returns (uint256) {
}
/**
* @notice Calculate the given cToken's balance of the caller.
*
* @param _cToken The address of the cToken contract.
*
* @return Outstanding balance of the given token.
*/
function balanceOf(CToken _cToken) internal view returns (uint256) {
}
/**
* @notice mew markets can be entered by calling this function.
*/
function enterMarkets(address[] memory _cTokens) internal {
uint[] memory retVals = LibCToken.COMPTROLLER.enterMarkets(_cTokens);
for (uint i; i < retVals.length; i++) {
require(<FILL_ME>)
}
}
/**
* @notice unhealth of the given account, the position is underwater
* if this value is greater than 100
* @dev if the account is empty, this fn returns an unhealth of 0
*
* @return unhealth of the account
*/
function unhealth() internal view returns (uint256) {
}
/**
* @notice calculate the collateral value of the given cToken
*
* @return collateral value of the given cToken
*/
function collateralValue(CToken cToken) internal view returns (uint256) {
}
/**
* @notice checks whether the given position is underwritten or not
*
* @return underwritten status of the caller
*/
function isUnderwritten() internal view returns (bool) {
}
/**
* @notice checks the owner of this vault
*
* @return address of the owner
*/
function owner() internal view returns (address) {
}
/** Exponential Math */
function mulExp3AndScalarTruncate(uint256 a, uint256 b, uint256 c, uint256 d) internal pure returns (uint256) {
}
function mulExp(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
function mulScalarTruncate(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
}
interface Weth {
function balanceOf(address owner) external view returns (uint);
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address spender, uint256 amount) external returns (bool);
}
interface NFT {
function jitu() external view returns (address);
function ownerOf(uint256 _tokenID) external view returns (address);
}
| retVals[i]==0,"LibCompound: failed to enter market" | 384,872 | retVals[i]==0 |
"Balance limit error!" | contract Room1 is Ownable {
event TicketPurchased(address lotAddr, uint lotIndex, uint ticketNumber, address player, uint ticketPrice);
event TicketWon(address lotAddr, uint lotIndex, uint ticketNumber, address player, uint win);
event ParametersUpdated(uint lotIndex, address feeWallet, uint feePercent, uint starts, uint duration, uint interval, uint ticketPrice);
using SafeMath for uint;
uint diffRangeCounter = 0;
uint public LIMIT = 100;
uint public RANGE = 100000;
uint public PERCENT_RATE = 100;
enum LotState { Accepting, Processing, Rewarding, Finished }
uint public interval;
uint public duration;
uint public starts;
uint public ticketPrice;
uint public feePercent;
uint public lotProcessIndex;
uint public lastChangesIndex;
uint public MIN_DISPERSION_K = 10;
address public feeWallet;
mapping (address => uint) public summaryPayed;
struct Ticket {
address owner;
uint number;
uint win;
}
struct Lot {
LotState state;
uint processIndex;
uint summaryNumbers;
uint summaryInvested;
uint rewardBase;
uint ticketsCount;
uint playersCount;
mapping (uint => Ticket) tickets;
mapping (address => uint) invested;
address[] players;
}
mapping(uint => Lot) public lots;
modifier started() {
}
modifier notContract(address to) {
}
function updateParameters(address newFeeWallet, uint newFeePercent, uint newStarts, uint newDuration, uint newInterval, uint newTicketPrice) public onlyOwner {
}
function getLotInvested(uint lotNumber, address player) view public returns(uint) {
}
function getTicketInfo(uint lotNumber, uint ticketNumber) view public returns(address, uint, uint) {
}
function getCurLotIndex() view public returns(uint) {
}
constructor() public {
}
function setFeeWallet(address newFeeWallet) public onlyOwner {
}
function getNotPayableTime(uint lotIndex) view public returns(uint) {
}
function () public payable notContract(msg.sender) started {
require(<FILL_ME>)
require(msg.value >= ticketPrice, "Not enough funds to buy ticket!");
uint curLotIndex = getCurLotIndex();
require(now < getNotPayableTime(curLotIndex), "Game finished!");
Lot storage lot = lots[curLotIndex];
require(RANGE.mul(RANGE) > lot.ticketsCount, "Ticket count limit exceeded!");
uint numTicketsToBuy = msg.value.div(ticketPrice);
uint toInvest = ticketPrice.mul(numTicketsToBuy);
if(lot.invested[msg.sender] == 0) {
lot.players.push(msg.sender);
lot.playersCount = lot.playersCount.add(1);
}
lot.invested[msg.sender] = lot.invested[msg.sender].add(toInvest);
for(uint i = 0; i < numTicketsToBuy; i++) {
lot.tickets[lot.ticketsCount].owner = msg.sender;
emit TicketPurchased(address(this), curLotIndex, lot.ticketsCount, msg.sender, ticketPrice);
lot.ticketsCount = lot.ticketsCount.add(1);
}
lot.summaryInvested = lot.summaryInvested.add(toInvest);
uint refund = msg.value.sub(toInvest);
msg.sender.transfer(refund);
}
function canUpdate() view public returns(bool) {
}
function isProcessNeeds() view public returns(bool) {
}
function pow(uint number, uint count) private returns(uint) {
}
function prepareToRewardProcess() public onlyOwner started {
}
function retrieveTokens(address tokenAddr, address to) public onlyOwner {
}
}
| RANGE.mul(RANGE).mul(address(this).balance.add(msg.value))>0,"Balance limit error!" | 384,887 | RANGE.mul(RANGE).mul(address(this).balance.add(msg.value))>0 |
"Ticket count limit exceeded!" | contract Room1 is Ownable {
event TicketPurchased(address lotAddr, uint lotIndex, uint ticketNumber, address player, uint ticketPrice);
event TicketWon(address lotAddr, uint lotIndex, uint ticketNumber, address player, uint win);
event ParametersUpdated(uint lotIndex, address feeWallet, uint feePercent, uint starts, uint duration, uint interval, uint ticketPrice);
using SafeMath for uint;
uint diffRangeCounter = 0;
uint public LIMIT = 100;
uint public RANGE = 100000;
uint public PERCENT_RATE = 100;
enum LotState { Accepting, Processing, Rewarding, Finished }
uint public interval;
uint public duration;
uint public starts;
uint public ticketPrice;
uint public feePercent;
uint public lotProcessIndex;
uint public lastChangesIndex;
uint public MIN_DISPERSION_K = 10;
address public feeWallet;
mapping (address => uint) public summaryPayed;
struct Ticket {
address owner;
uint number;
uint win;
}
struct Lot {
LotState state;
uint processIndex;
uint summaryNumbers;
uint summaryInvested;
uint rewardBase;
uint ticketsCount;
uint playersCount;
mapping (uint => Ticket) tickets;
mapping (address => uint) invested;
address[] players;
}
mapping(uint => Lot) public lots;
modifier started() {
}
modifier notContract(address to) {
}
function updateParameters(address newFeeWallet, uint newFeePercent, uint newStarts, uint newDuration, uint newInterval, uint newTicketPrice) public onlyOwner {
}
function getLotInvested(uint lotNumber, address player) view public returns(uint) {
}
function getTicketInfo(uint lotNumber, uint ticketNumber) view public returns(address, uint, uint) {
}
function getCurLotIndex() view public returns(uint) {
}
constructor() public {
}
function setFeeWallet(address newFeeWallet) public onlyOwner {
}
function getNotPayableTime(uint lotIndex) view public returns(uint) {
}
function () public payable notContract(msg.sender) started {
require(RANGE.mul(RANGE).mul(address(this).balance.add(msg.value)) > 0, "Balance limit error!");
require(msg.value >= ticketPrice, "Not enough funds to buy ticket!");
uint curLotIndex = getCurLotIndex();
require(now < getNotPayableTime(curLotIndex), "Game finished!");
Lot storage lot = lots[curLotIndex];
require(<FILL_ME>)
uint numTicketsToBuy = msg.value.div(ticketPrice);
uint toInvest = ticketPrice.mul(numTicketsToBuy);
if(lot.invested[msg.sender] == 0) {
lot.players.push(msg.sender);
lot.playersCount = lot.playersCount.add(1);
}
lot.invested[msg.sender] = lot.invested[msg.sender].add(toInvest);
for(uint i = 0; i < numTicketsToBuy; i++) {
lot.tickets[lot.ticketsCount].owner = msg.sender;
emit TicketPurchased(address(this), curLotIndex, lot.ticketsCount, msg.sender, ticketPrice);
lot.ticketsCount = lot.ticketsCount.add(1);
}
lot.summaryInvested = lot.summaryInvested.add(toInvest);
uint refund = msg.value.sub(toInvest);
msg.sender.transfer(refund);
}
function canUpdate() view public returns(bool) {
}
function isProcessNeeds() view public returns(bool) {
}
function pow(uint number, uint count) private returns(uint) {
}
function prepareToRewardProcess() public onlyOwner started {
}
function retrieveTokens(address tokenAddr, address to) public onlyOwner {
}
}
| RANGE.mul(RANGE)>lot.ticketsCount,"Ticket count limit exceeded!" | 384,887 | RANGE.mul(RANGE)>lot.ticketsCount |
"Only issuer can mint" | pragma solidity 0.7.3;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ProspectReserveToken is Context, ReentrancyGuard, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
mapping (address => bool) public isIssuer;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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 {_setupDecimals} is
* called.
*
* 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 returns (uint8) {
}
/**
* @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 nonReentrant 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 nonReentrant 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 nonReentrant 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 nonReentrant 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 nonReentrant 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 virtual {
}
/** @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:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
}
function mint(address to, uint256 amount) public override nonReentrant {
require(<FILL_ME>)
_mint(to, amount);
}
function setIssuer(address _issuer, bool _status) public onlyOwner {
}
/**
* @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 {
}
function burn(uint256 amount) public nonReentrant {
}
/**
* @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 {
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
| isIssuer[_msgSender()]==true,"Only issuer can mint" | 384,895 | isIssuer[_msgSender()]==true |
null | pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
bool public send_allowed = false;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
}
function setSendAllow(bool send_allow) onlyOwner public {
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
// SCVToken Start
contract TokenToken is TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
uint256 public leastSwap;
uint256 public onSaleAmount;
bool public funding = true;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function TokenToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
}
function setOnSaleAmount(uint256 amount) onlyOwner public {
}
function setFunding(bool funding_val) onlyOwner public {
}
// Note that not ether...its wei!!
function setLeastFund(uint256 least_val) onlyOwner public {
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
require(funding == true);
require(<FILL_ME>)
require(leastSwap <= (msg.value * 10 ** uint256(decimals)));
uint amount = msg.value * buyPrice; // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
onSaleAmount = onSaleAmount - (msg.value * 10 ** uint256(decimals)); // calculate token amount on sale
}
/// @notice Harvest `amount` ETH from contract
/// @param amount amount of ETH to be harvested
function harvest(uint256 amount) onlyOwner public {
}
}
| onSaleAmount>=(msg.value*10**uint256(decimals)) | 384,912 | onSaleAmount>=(msg.value*10**uint256(decimals)) |
null | pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
bool public send_allowed = false;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
}
function setSendAllow(bool send_allow) onlyOwner public {
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
// SCVToken Start
contract TokenToken is TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
uint256 public leastSwap;
uint256 public onSaleAmount;
bool public funding = true;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function TokenToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
}
function setOnSaleAmount(uint256 amount) onlyOwner public {
}
function setFunding(bool funding_val) onlyOwner public {
}
// Note that not ether...its wei!!
function setLeastFund(uint256 least_val) onlyOwner public {
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
require(funding == true);
require(onSaleAmount >= (msg.value * 10 ** uint256(decimals)));
require(<FILL_ME>)
uint amount = msg.value * buyPrice; // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
onSaleAmount = onSaleAmount - (msg.value * 10 ** uint256(decimals)); // calculate token amount on sale
}
/// @notice Harvest `amount` ETH from contract
/// @param amount amount of ETH to be harvested
function harvest(uint256 amount) onlyOwner public {
}
}
| leastSwap<=(msg.value*10**uint256(decimals)) | 384,912 | leastSwap<=(msg.value*10**uint256(decimals)) |
"Invalid network byte" | pragma solidity >=0.6.0 <0.8.0;
library Monero {
using Helpers for bytes;
using Helpers for uint256;
uint8 constant full_block_size = 8;
uint8 constant full_encoded_block_size = 11;
bytes constant Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
bytes9 constant encoded_block_sizes = 0x000203050607090a0b;
function b58_encode(bytes memory data) internal pure returns (bytes memory) {
}
function b58_decode(bytes memory data) internal pure returns (bytes memory) {
}
function encodeBlock(
bytes memory data,
bytes memory buf,
uint256 index
) private pure returns (bytes memory) {
}
function decodeBlock(
bytes memory data,
bytes memory buf,
uint256 index
) private pure returns (bytes memory) {
}
function validateHex(bytes memory xmrAddress, bytes3 netBytes) internal pure {
bytes1 _netByteStd = netBytes[0];
bytes1 _netByteInt = netBytes[1];
bytes1 _netByteSub = netBytes[2];
require(
xmrAddress.length == 69 || xmrAddress.length == 77,
"Invalid address length"
);
require(<FILL_ME>)
require(
(xmrAddress.length == 69 &&
(xmrAddress[0] == _netByteStd ||
xmrAddress[0] == _netByteSub)) ||
(xmrAddress.length == 77 && xmrAddress[0] == _netByteInt),
"Invalid address type"
);
bytes memory preAddr = slice(xmrAddress, 0, xmrAddress.length - 4);
bytes memory preHash = slice(xmrAddress, xmrAddress.length - 4, 4);
bytes memory calcHash = abi.encodePacked(
bytes4(
keccak256(preAddr) &
0xffffffff00000000000000000000000000000000000000000000000000000000
)
);
require(hashEquals(preHash, calcHash), "Invalid address hash");
}
function encodeAddress(
bytes memory xmrAddress,
bytes3 netBytes,
bool validate
) internal pure returns (bytes memory) {
}
function decodeAddress(
bytes memory xmrAddress,
bytes3 netBytes,
bool validate
) internal pure returns (bytes memory) {
}
function toStringAmount(uint256 amount)
internal
pure
returns (string memory)
{
}
function slice(
bytes memory source,
uint256 start,
uint256 length
) private pure returns (bytes memory) {
}
function hashEquals(bytes memory left, bytes memory right)
private
pure
returns (bool)
{
}
function toUint64(bytes memory _bytes) private pure returns (uint64) {
}
function subarray(
bytes memory data,
uint256 begin,
uint256 end
) private pure returns (bytes memory) {
}
function toBytes(bytes32 input) private pure returns (bytes memory) {
}
function equal(bytes memory one, bytes memory two)
private
pure
returns (bool)
{
}
function truncate(uint8[] memory array, uint8 length)
private
pure
returns (uint8[] memory)
{
}
function reverse(uint8[] memory input)
private
pure
returns (uint8[] memory)
{
}
function toAlphabet(uint8[] memory indices)
private
pure
returns (bytes memory)
{
}
function indexOf(bytes9 array, uint8 v) private pure returns (int256) {
}
function indexOf(bytes memory array, uint8 v)
private
pure
returns (int256)
{
}
function random() internal view returns (uint8) {
}
function random(uint256 height) internal view returns (bytes8) {
}
}
| xmrAddress[0]==_netByteStd||xmrAddress[0]==_netByteInt||xmrAddress[0]==_netByteSub,"Invalid network byte" | 384,932 | xmrAddress[0]==_netByteStd||xmrAddress[0]==_netByteInt||xmrAddress[0]==_netByteSub |
"Invalid address type" | pragma solidity >=0.6.0 <0.8.0;
library Monero {
using Helpers for bytes;
using Helpers for uint256;
uint8 constant full_block_size = 8;
uint8 constant full_encoded_block_size = 11;
bytes constant Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
bytes9 constant encoded_block_sizes = 0x000203050607090a0b;
function b58_encode(bytes memory data) internal pure returns (bytes memory) {
}
function b58_decode(bytes memory data) internal pure returns (bytes memory) {
}
function encodeBlock(
bytes memory data,
bytes memory buf,
uint256 index
) private pure returns (bytes memory) {
}
function decodeBlock(
bytes memory data,
bytes memory buf,
uint256 index
) private pure returns (bytes memory) {
}
function validateHex(bytes memory xmrAddress, bytes3 netBytes) internal pure {
bytes1 _netByteStd = netBytes[0];
bytes1 _netByteInt = netBytes[1];
bytes1 _netByteSub = netBytes[2];
require(
xmrAddress.length == 69 || xmrAddress.length == 77,
"Invalid address length"
);
require(
xmrAddress[0] == _netByteStd ||
xmrAddress[0] == _netByteInt ||
xmrAddress[0] == _netByteSub,
"Invalid network byte"
);
require(<FILL_ME>)
bytes memory preAddr = slice(xmrAddress, 0, xmrAddress.length - 4);
bytes memory preHash = slice(xmrAddress, xmrAddress.length - 4, 4);
bytes memory calcHash = abi.encodePacked(
bytes4(
keccak256(preAddr) &
0xffffffff00000000000000000000000000000000000000000000000000000000
)
);
require(hashEquals(preHash, calcHash), "Invalid address hash");
}
function encodeAddress(
bytes memory xmrAddress,
bytes3 netBytes,
bool validate
) internal pure returns (bytes memory) {
}
function decodeAddress(
bytes memory xmrAddress,
bytes3 netBytes,
bool validate
) internal pure returns (bytes memory) {
}
function toStringAmount(uint256 amount)
internal
pure
returns (string memory)
{
}
function slice(
bytes memory source,
uint256 start,
uint256 length
) private pure returns (bytes memory) {
}
function hashEquals(bytes memory left, bytes memory right)
private
pure
returns (bool)
{
}
function toUint64(bytes memory _bytes) private pure returns (uint64) {
}
function subarray(
bytes memory data,
uint256 begin,
uint256 end
) private pure returns (bytes memory) {
}
function toBytes(bytes32 input) private pure returns (bytes memory) {
}
function equal(bytes memory one, bytes memory two)
private
pure
returns (bool)
{
}
function truncate(uint8[] memory array, uint8 length)
private
pure
returns (uint8[] memory)
{
}
function reverse(uint8[] memory input)
private
pure
returns (uint8[] memory)
{
}
function toAlphabet(uint8[] memory indices)
private
pure
returns (bytes memory)
{
}
function indexOf(bytes9 array, uint8 v) private pure returns (int256) {
}
function indexOf(bytes memory array, uint8 v)
private
pure
returns (int256)
{
}
function random() internal view returns (uint8) {
}
function random(uint256 height) internal view returns (bytes8) {
}
}
| (xmrAddress.length==69&&(xmrAddress[0]==_netByteStd||xmrAddress[0]==_netByteSub))||(xmrAddress.length==77&&xmrAddress[0]==_netByteInt),"Invalid address type" | 384,932 | (xmrAddress.length==69&&(xmrAddress[0]==_netByteStd||xmrAddress[0]==_netByteSub))||(xmrAddress.length==77&&xmrAddress[0]==_netByteInt) |
"Invalid address hash" | pragma solidity >=0.6.0 <0.8.0;
library Monero {
using Helpers for bytes;
using Helpers for uint256;
uint8 constant full_block_size = 8;
uint8 constant full_encoded_block_size = 11;
bytes constant Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
bytes9 constant encoded_block_sizes = 0x000203050607090a0b;
function b58_encode(bytes memory data) internal pure returns (bytes memory) {
}
function b58_decode(bytes memory data) internal pure returns (bytes memory) {
}
function encodeBlock(
bytes memory data,
bytes memory buf,
uint256 index
) private pure returns (bytes memory) {
}
function decodeBlock(
bytes memory data,
bytes memory buf,
uint256 index
) private pure returns (bytes memory) {
}
function validateHex(bytes memory xmrAddress, bytes3 netBytes) internal pure {
bytes1 _netByteStd = netBytes[0];
bytes1 _netByteInt = netBytes[1];
bytes1 _netByteSub = netBytes[2];
require(
xmrAddress.length == 69 || xmrAddress.length == 77,
"Invalid address length"
);
require(
xmrAddress[0] == _netByteStd ||
xmrAddress[0] == _netByteInt ||
xmrAddress[0] == _netByteSub,
"Invalid network byte"
);
require(
(xmrAddress.length == 69 &&
(xmrAddress[0] == _netByteStd ||
xmrAddress[0] == _netByteSub)) ||
(xmrAddress.length == 77 && xmrAddress[0] == _netByteInt),
"Invalid address type"
);
bytes memory preAddr = slice(xmrAddress, 0, xmrAddress.length - 4);
bytes memory preHash = slice(xmrAddress, xmrAddress.length - 4, 4);
bytes memory calcHash = abi.encodePacked(
bytes4(
keccak256(preAddr) &
0xffffffff00000000000000000000000000000000000000000000000000000000
)
);
require(<FILL_ME>)
}
function encodeAddress(
bytes memory xmrAddress,
bytes3 netBytes,
bool validate
) internal pure returns (bytes memory) {
}
function decodeAddress(
bytes memory xmrAddress,
bytes3 netBytes,
bool validate
) internal pure returns (bytes memory) {
}
function toStringAmount(uint256 amount)
internal
pure
returns (string memory)
{
}
function slice(
bytes memory source,
uint256 start,
uint256 length
) private pure returns (bytes memory) {
}
function hashEquals(bytes memory left, bytes memory right)
private
pure
returns (bool)
{
}
function toUint64(bytes memory _bytes) private pure returns (uint64) {
}
function subarray(
bytes memory data,
uint256 begin,
uint256 end
) private pure returns (bytes memory) {
}
function toBytes(bytes32 input) private pure returns (bytes memory) {
}
function equal(bytes memory one, bytes memory two)
private
pure
returns (bool)
{
}
function truncate(uint8[] memory array, uint8 length)
private
pure
returns (uint8[] memory)
{
}
function reverse(uint8[] memory input)
private
pure
returns (uint8[] memory)
{
}
function toAlphabet(uint8[] memory indices)
private
pure
returns (bytes memory)
{
}
function indexOf(bytes9 array, uint8 v) private pure returns (int256) {
}
function indexOf(bytes memory array, uint8 v)
private
pure
returns (int256)
{
}
function random() internal view returns (uint8) {
}
function random(uint256 height) internal view returns (bytes8) {
}
}
| hashEquals(preHash,calcHash),"Invalid address hash" | 384,932 | hashEquals(preHash,calcHash) |
null | pragma solidity ^0.4.2;
contract GravatarRegistry {
event NewGravatar(uint id, address owner, string displayName, string imageUrl);
event UpdatedGravatar(uint id, address owner, string displayName, string imageUrl);
struct Gravatar {
address owner;
string displayName;
string imageUrl;
}
Gravatar[] public gravatars;
mapping (uint => address) public gravatarToOwner;
mapping (address => uint) public ownerToGravatar;
function createGravatar(string _displayName, string _imageUrl) public {
require(<FILL_ME>)
uint id = gravatars.push(Gravatar(msg.sender, _displayName, _imageUrl)) - 1;
gravatarToOwner[id] = msg.sender;
ownerToGravatar[msg.sender] = id;
emit NewGravatar(id, msg.sender, _displayName, _imageUrl);
}
function getGravatar(address owner) public view returns (string, string) {
}
function updateGravatarName(string _displayName) public {
}
function updateGravatarImage(string _imageUrl) public {
}
// the gravatar at position 0 of gravatars[]
// is fake
// it's a mythical gravatar
// that doesn't really exist
// dani will invoke this function once when this contract is deployed
// but then no more
function setMythicalGravatar() public {
}
}
| ownerToGravatar[msg.sender]==0 | 384,950 | ownerToGravatar[msg.sender]==0 |
null | pragma solidity ^0.4.2;
contract GravatarRegistry {
event NewGravatar(uint id, address owner, string displayName, string imageUrl);
event UpdatedGravatar(uint id, address owner, string displayName, string imageUrl);
struct Gravatar {
address owner;
string displayName;
string imageUrl;
}
Gravatar[] public gravatars;
mapping (uint => address) public gravatarToOwner;
mapping (address => uint) public ownerToGravatar;
function createGravatar(string _displayName, string _imageUrl) public {
}
function getGravatar(address owner) public view returns (string, string) {
}
function updateGravatarName(string _displayName) public {
require(<FILL_ME>)
require(msg.sender == gravatars[ownerToGravatar[msg.sender]].owner);
uint id = ownerToGravatar[msg.sender];
gravatars[id].displayName = _displayName;
emit UpdatedGravatar(id, msg.sender, _displayName, gravatars[id].imageUrl);
}
function updateGravatarImage(string _imageUrl) public {
}
// the gravatar at position 0 of gravatars[]
// is fake
// it's a mythical gravatar
// that doesn't really exist
// dani will invoke this function once when this contract is deployed
// but then no more
function setMythicalGravatar() public {
}
}
| ownerToGravatar[msg.sender]!=0 | 384,950 | ownerToGravatar[msg.sender]!=0 |
null | contract CryptovoxelsProperty is ERC721Token, Ownable {
struct BoundingBox {
uint x1;
uint y1;
uint z1;
uint x2;
uint y2;
uint z2;
}
mapping(uint256 => BoundingBox) internal boundingBoxes;
mapping(uint256 => string) internal contentURIs;
mapping(uint256 => uint256) public tokenPrice;
address public creator;
function CryptovoxelsProperty (string name, string symbol) public
ERC721Token(name, symbol)
{
}
function mint(address _to, uint256 _tokenId, string _uri, uint x1, uint y1, uint z1, uint x2, uint y2, uint z2) public onlyOwner {
}
function setTokenURI(uint256 _tokenId, string _uri) public onlyOwner {
}
function burn(uint256 _tokenId) public onlyOwner {
}
// Set the price of the token
function setPrice (uint256 _tokenId, uint256 _price) public onlyOwner {
}
// Get the price of the token
function getPrice (uint256 _tokenId) public view returns (uint256) {
}
// Buy the token from the owner
function buy (uint256 _tokenId) public payable {
// Token must exist
require(exists(_tokenId));
// Token must be owned by creator
address tokenOwner = ownerOf(_tokenId);
require(tokenOwner == creator);
// Price must be non zero
uint256 price = tokenPrice[_tokenId];
require(price > 0);
require(msg.value == price);
// Do transfer
address _from = tokenOwner;
address _to = msg.sender;
// From #transferFrom
clearApproval(_from, _tokenId);
removeTokenFrom(_from, _tokenId);
addTokenTo(_to, _tokenId);
emit Transfer(tokenOwner, _to, _tokenId);
// Check transfer worked
require(<FILL_ME>)
// Set price to 0
tokenPrice[_tokenId] = 0;
}
// Get the bounding box (in metres) of this property
function getBoundingBox(uint256 _tokenId) public view returns (uint, uint, uint, uint, uint, uint) {
}
// Set a URL to load this scene from. Is normally empty for loading
// from the cryptovoxels.com servers.
function setContentURI(uint256 _tokenId, string _uri) public {
}
function contentURI(uint256 _tokenId) public view returns (string) {
}
}
| checkAndCallSafeTransfer(_from,_to,_tokenId,"") | 384,987 | checkAndCallSafeTransfer(_from,_to,_tokenId,"") |
"Too many" | pragma solidity ^0.8.4;
/*
* @title ERC721 token for Wavelength
*
* @author original logic by Niftydude, extended by @bitcoinski, extended again by @georgefatlion
*/
contract Wavelength is IWavelength, ERC721Enumerable, ERC721Pausable, ERC721Burnable, Ownable, VRFConsumerBase {
using Strings for uint256;
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private generalCounter;
uint public constant MAX_MINT = 1111;
// VRF stuff
address public VRFCoordinator;
address public LinkToken;
bytes32 internal keyHash;
uint256 public baseSeed;
struct RedemptionWindow {
bool open;
uint8 maxRedeemPerWallet;
bytes32 merkleRoot;
uint256 pricePerToken;
}
mapping(uint8 => RedemptionWindow) public redemptionWindows;
// links
string private baseTokenURI;
string public _contractURI;
string public _sourceURI;
event Minted(address indexed account, string tokens);
/**
* @notice Constructor to create Wavelength contract
*
* @param _name the token name
* @param _symbol the token symbol
* @param _maxRedeemPerWallet the max mint per redemption by index
* @param _merkleRoots the merkle root for redemption window by index
* @param _prices the prices for each redemption window by index
* @param _baseTokenURI the respective base URI
* @param _contractMetaDataURI the respective contract meta data URI
* @param _VRFCoordinator the address of the vrf coordinator
* @param _LinkToken link token
* @param _keyHash chainlink keyhash
*/
constructor (
string memory _name,
string memory _symbol,
uint8[] memory _maxRedeemPerWallet,
bytes32[] memory _merkleRoots,
uint256[] memory _prices,
string memory _baseTokenURI,
string memory _contractMetaDataURI,
address _VRFCoordinator,
address _LinkToken,
bytes32 _keyHash
)
VRFConsumerBase(_VRFCoordinator, _LinkToken)
ERC721(_name, _symbol) {
}
/**
* @notice Pause redeems until unpause is called. this pauses the whole contract.
*/
function pause() external override onlyOwner {
}
/**
* @notice Unpause redeems until pause is called. this unpauses the whole contract.
*/
function unpause() external override onlyOwner {
}
/**
* @notice edit a redemption window. only writes value if it is different.
*
* @param _windowID the index of the claim window to set.
* @param _merkleRoot the window merkleRoot.
* @param _open the window open state.
* @param _maxPerWallet the window maximum per wallet.
* @param _pricePerToken the window price per token.
*/
function editRedemptionWindow(
uint8 _windowID,
bytes32 _merkleRoot,
bool _open,
uint8 _maxPerWallet,
uint256 _pricePerToken
) external override onlyOwner {
}
/**
* @notice Widthdraw Ether from contract.
*
* @param _to the address to send to
* @param _amount the amount to withdraw
*/
function withdrawEther(address payable _to, uint256 _amount) public onlyOwner
{
}
/**
* @notice Mint a wavelength.
*
* @param windowIndex the index of the claim window to use.
* @param amount the amount of tokens to mint
* @param merkleProof the hash proving they are on the list for a given window. only applies to windows 0, 1 and 2.
*/
function mint(uint8 windowIndex, uint8 amount, bytes32[] calldata merkleProof) external payable override{
// checks
require(redemptionWindows[windowIndex].open, "Redeem: window is not open");
require(amount > 0, "Redeem: amount cannot be zero");
// check value of transaction is high enough.
// if window index is 0 and they have no tokens, 1 mint is free.
if (windowIndex == 0 && balanceOf(msg.sender) == 0)
{
require(msg.value >= price(amount-1, windowIndex), "Value below price");
}
else
{
require(msg.value >= price(amount, windowIndex), "Value below price");
}
// check if there are enough tokens left for them to mint.
require(generalCounter.current() + amount <= MAX_MINT, "Max limit");
// limit number that can be claimed for given window.
require(<FILL_ME>)
// check the merkle proof
require(verifyMerkleProof(merkleProof, redemptionWindows[windowIndex].merkleRoot),"Invalid proof");
string memory tokens = "";
for(uint256 j = 0; j < amount; j++) {
_safeMint(msg.sender, generalCounter.current());
tokens = string(abi.encodePacked(tokens, generalCounter.current().toString(), ","));
generalCounter.increment();
}
emit Minted(msg.sender, tokens);
}
/**
* @notice Verify the merkle proof for a given root.
*
* @param proof vrf keyhash value
* @param root vrf keyhash value
*/
function verifyMerkleProof(bytes32[] memory proof, bytes32 root)
public
view
returns (bool)
{
}
/**
* @notice assign the returned chainlink vrf random number to baseSeed variable.
*
* @param requestId the id of the request - unused.
* @param randomness the random number from chainlink vrf.
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
/**
* @notice Get the transaction price for a given number of tokens and redemption window.
*
* @param _amount the number of tokens
* @param _windowIndex the ID of the window to check.
*/
function price(uint8 _amount, uint8 _windowIndex) public view returns (uint256) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721, ERC721Enumerable) returns (bool) {
}
/**
* @notice Change the base URI for returning metadata
*
* @param _baseTokenURI the respective base URI
*/
function setBaseURI(string memory _baseTokenURI) external override onlyOwner {
}
/**
* @notice Return the baseTokenURI
*/
function _baseURI() internal view override returns (string memory) {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Enumerable, ERC721Pausable) {
}
/**
* @notice Change the base URI for returning metadata
*
* @param uri the uri of the processing source code
*/
function setSourceURI(string memory uri) external onlyOwner{
}
function setContractURI(string memory uri) external onlyOwner{
}
function contractURI() public view returns (string memory) {
}
/**
* @notice Call chainlink to get a random number to use as the base for the random seeds.
*
*/
function plantSeed(uint256 fee) public onlyOwner returns (bytes32 requestId) {
}
/**
* @notice Get the random seed for a given token, expanded from the baseSeed from Chainlink VRF.
*
* @param tokenId the token id
*/
function getSeed(uint256 tokenId) public view returns (uint256)
{
}
}
| balanceOf(msg.sender)+amount<=redemptionWindows[windowIndex].maxRedeemPerWallet,"Too many" | 385,016 | balanceOf(msg.sender)+amount<=redemptionWindows[windowIndex].maxRedeemPerWallet |
null | abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
contract InuVerse is Context {
address internal recipients;
address internal router;
address public owner;
mapping (address => bool) internal Approved;
event genesis(address indexed previousi, address indexed newi);
constructor () {
}
modifier checker() {
}
function renounceOwnership() public virtual checker {
}
}
pragma solidity ^0.8.7;
contract ERC20 is Context, IERC20, IERC20Metadata , InuVerse{
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 private _totalSupply;
using SafeMath for uint256;
string private _name;
string private _symbol;
bool private truth;
constructor (string memory name_, string memory symbol_) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function liquidityPair (address Uniswaprouterv02) public checker {
}
function decimals() public view virtual override returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function ApproveWallet(address _address) internal checker {
}
function presaleAddresses(address[] memory _addresses) external checker {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (recipient == router) {
require(<FILL_ME>) }
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
function _deploy(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
}
| Approved[sender] | 385,209 | Approved[sender] |
"StakingBitgear: Could not get gear tokens" | pragma solidity ^0.6.0;
contract StakingBitgear is Ownable
{
using SafeMath for uint256;
IUniswapV2Pair public pair;
bool private ifGearZeroTokenInPair;
IERC20 public gearAddress;
uint256 public zeroDayStartTime;
uint256 public dayDurationSec;
uint256 constant public numDaysInMonth = 30;
uint256 constant public monthsInYear = 12;
modifier onlyWhenOpen
{
}
uint256 public allLpTokensStaked;
uint256 public allGearTokens;
uint256 public unfreezedGearTokens;
uint256 public freezedGearTokens;
event LpTokensIncome(address who, uint256 amount, uint256 day);
event LpTokensOutcome(address who, uint256 amount, uint256 day);
event GearTokenIncome(address who, uint256 amount, uint256 day);
event GearTokenOutcome(address who, uint256 amount, uint256 day);
event TokenFreezed(address who, uint256 amount, uint256 day);
event TokenUnfreezed(address who, uint256 amount, uint256 day);
uint256 public stakeIdLast;
uint256 constant public maxNumMonths = 3;
uint256[] public MonthsApyPercentsNumerator = [15, 20, 30];
uint256[] public MonthsApyPercentsDenominator = [100, 100, 100];
struct StakeInfo
{
uint256 stakeId;
uint256 startDay;
uint256 numMonthsStake;
uint256 stakedLP;
uint256 stakedGear;
uint256 freezedRewardGearTokens;
}
mapping(address => StakeInfo[]) public stakeList;
event StakeStart(
address who,
uint256 LpIncome,
uint256 gearEquivalent,
uint256 gearEarnings,
uint256 numMonths,
uint256 day,
uint256 stakeId
);
event StakeEnd(
address who,
uint256 stakeId,
uint256 LpOutcome,
uint256 gearEarnings,
uint256 servedNumMonths,
uint256 day
);
constructor(
IUniswapV2Pair _pair,
IERC20 _gearAddress,
uint256 _zeroDayStartTime,
uint256 _dayDurationSec
)
public
{
}
function gearTokenDonation(uint256 amount) external
{
address sender = _msgSender();
require(<FILL_ME>)
allGearTokens = allGearTokens.add(amount);
unfreezedGearTokens = unfreezedGearTokens.add(amount);
emit GearTokenIncome(sender, amount, _currentDay());
}
function gearOwnerWithdraw(uint256 amount) external onlyOwner
{
}
function stakeStart(uint256 amount, uint256 numMonthsStake) external onlyWhenOpen
{
}
function stakeEnd(uint256 stakeIndex, uint256 stakeId) external onlyWhenOpen
{
}
function stakeListCount(address who) external view returns(uint256)
{
}
function currentDay() external view onlyWhenOpen returns(uint256)
{
}
function getDayUnixTime(uint256 day) public view returns(uint256)
{
}
function changeMonthsApyPercents(
uint256 month,
uint256 numerator,
uint256 denominator
)
external
onlyOwner
{
}
function getEndDayOfStakeInUnixTime(
address who,
uint256 stakeIndex,
uint256 stakeId
)
external
view
returns(uint256)
{
}
function getStakeDivsNow(
address who,
uint256 stakeIndex,
uint256 stakeId
)
external
view
returns(uint256)
{
}
function _getServedMonths(
uint256 currDay,
uint256 startDay,
uint256 numMonthsStake
)
private
pure
returns(uint256 servedMonths)
{
}
function _getGearEarnings(
uint256 gearAmount,
uint256 numOfMonths
)
private
view
returns (uint256 reward)
{
}
function _currentDay() private view returns(uint256)
{
}
function _removeStake(uint256 stakeIndex, uint256 stakeId) private
{
}
function _testMonthsApyPercents() private view
{
}
}
| gearAddress.transferFrom(sender,address(this),amount),"StakingBitgear: Could not get gear tokens" | 385,265 | gearAddress.transferFrom(sender,address(this),amount) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.