comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"Sale would exceed max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract LofiKitties is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
using Address for address;
string public baseURI;
string public prerevealURI;
string public provenance = "";
uint256 public offsetIndex = 0;
uint256 public offsetIndexBlock = 0;
uint256 public cost = 0.045 ether;
uint256 public maxSupply = 9999;
uint256 public maxMintAmount = 9;
uint256 public maxPresaleMintAmount = 5;
bool public _saleIsActive = false;
bool public _presaleIsActive = false;
bool public revealed = false;
mapping(address => bool) public whitelist;
event saleStarted();
event saleStopped();
event TokenMinted(uint256 supply);
event WhitelistedAddressAdded(address addr);
event WhitelistedAddressRemoved(address addr);
modifier onlyWhitelisted() {
}
constructor() ERC721("Lofi Kitties", "LK") {}
//internal
function _baseURI() internal view virtual override returns (string memory) {
}
//public
function mint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(_saleIsActive);
require(_mintAmount > 0);
require(_mintAmount <= maxMintAmount);
require(<FILL_ME>)
require(
!Address.isContract(msg.sender),
"Contracts are not allowed to call this function"
);
if (msg.sender != owner()) {
require(msg.value >= cost * _mintAmount);
}
for (uint256 i = 0; i < _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
if (offsetIndexBlock == 0 && (totalSupply() >= maxSupply)) {
offsetIndexBlock = block.number;
}
}
function presaleMint(uint256 _mintAmount) public payable onlyWhitelisted {
}
function getTokensByOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//for whitelist
function addAddressToWhitelist(address addr)
public
onlyOwner
returns (bool success)
{
}
function addAddressesToWhitelist(address[] calldata addrs)
public
onlyOwner
returns (bool success)
{
}
function removeAddressFromWhitelist(address addr)
public
onlyOwner
returns (bool success)
{
}
function removeAddressesFromWhitelist(address[] calldata addrs)
public
onlyOwner
returns (bool success)
{
}
// Only owner
function setCost(uint256 _newCost) public onlyOwner {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
}
function setmaxPresaleMintAmount(uint256 _newMaxPresaleMintAmount)
public
onlyOwner
{
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setPrerevealURI(string memory _prerevealURI) public onlyOwner {
}
function setProvenance(string memory _provenance) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function startSale() public onlyOwner {
}
function stopSale() public onlyOwner {
}
function startPresale() public onlyOwner {
}
function stopPresale() public onlyOwner {
}
function reveal() public onlyOwner {
}
function setOffsetIndex() public onlyOwner {
}
function reserveKitties(uint256 _numKitties) public onlyOwner {
}
function emergencySetOffsetIndexBlock() 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)
{
}
}
| totalSupply().add(_mintAmount)<=maxSupply,"Sale would exceed max supply" | 394,975 | totalSupply().add(_mintAmount)<=maxSupply |
"Sale would exceed max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract LofiKitties is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Strings for uint256;
using Address for address;
string public baseURI;
string public prerevealURI;
string public provenance = "";
uint256 public offsetIndex = 0;
uint256 public offsetIndexBlock = 0;
uint256 public cost = 0.045 ether;
uint256 public maxSupply = 9999;
uint256 public maxMintAmount = 9;
uint256 public maxPresaleMintAmount = 5;
bool public _saleIsActive = false;
bool public _presaleIsActive = false;
bool public revealed = false;
mapping(address => bool) public whitelist;
event saleStarted();
event saleStopped();
event TokenMinted(uint256 supply);
event WhitelistedAddressAdded(address addr);
event WhitelistedAddressRemoved(address addr);
modifier onlyWhitelisted() {
}
constructor() ERC721("Lofi Kitties", "LK") {}
//internal
function _baseURI() internal view virtual override returns (string memory) {
}
//public
function mint(uint256 _mintAmount) public payable {
}
function presaleMint(uint256 _mintAmount) public payable onlyWhitelisted {
}
function getTokensByOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//for whitelist
function addAddressToWhitelist(address addr)
public
onlyOwner
returns (bool success)
{
}
function addAddressesToWhitelist(address[] calldata addrs)
public
onlyOwner
returns (bool success)
{
}
function removeAddressFromWhitelist(address addr)
public
onlyOwner
returns (bool success)
{
}
function removeAddressesFromWhitelist(address[] calldata addrs)
public
onlyOwner
returns (bool success)
{
}
// Only owner
function setCost(uint256 _newCost) public onlyOwner {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
}
function setmaxPresaleMintAmount(uint256 _newMaxPresaleMintAmount)
public
onlyOwner
{
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setPrerevealURI(string memory _prerevealURI) public onlyOwner {
}
function setProvenance(string memory _provenance) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function startSale() public onlyOwner {
}
function stopSale() public onlyOwner {
}
function startPresale() public onlyOwner {
}
function stopPresale() public onlyOwner {
}
function reveal() public onlyOwner {
}
function setOffsetIndex() public onlyOwner {
}
function reserveKitties(uint256 _numKitties) public onlyOwner {
uint256 supply = totalSupply();
require(<FILL_ME>)
for (uint256 i = 0; i < _numKitties; i++) {
_safeMint(msg.sender, supply + i);
}
}
function emergencySetOffsetIndexBlock() 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)
{
}
}
| totalSupply().add(_numKitties)<=maxSupply,"Sale would exceed max supply" | 394,975 | totalSupply().add(_numKitties)<=maxSupply |
"Not the owner of this meebit." | // contracts/LootMeebits.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract LootMeebits is ERC721, Ownable
{
using SafeMath for uint256;
using Strings for uint256;
using Strings for uint16;
address public meebitsAddress = 0x7Bd29408f11D2bFC23c34f18275bBf23bB716Bc7;
ERC721 meebitsContract = ERC721(meebitsAddress);
//initial prices may be updated
uint256 public privatePrice = 20000000000000000; //0.02 ETH
uint256 public publicPrice = 30000000000000000; //0.03 ETH
bool public saleIsActive = true;
bool public privateSale = false;
uint public constant TOKEN_LIMIT = 20000;
uint public numTokens = 0;
//// Random index assignment
uint internal nonce = 0;
uint[TOKEN_LIMIT] internal indices;
// Base URI
string private _baseURI;
mapping(uint256 => uint256) public meebitsLoot; // mid --> lid
modifier validNFToken(uint256 _tokenId) {
}
constructor () public ERC721("Loot (for Meebits)", "Loot4Meebits") {
}
// The deployer can mint without paying
// function devMint(uint quantity) public onlyOwner {
// for (uint i = 0; i < quantity; i++) {
// mintTo(msg.sender, 0);
// }
// }
// Private sale minting (reserved for Meebits owners)
function mintWithMeebits(uint256 mid) external payable {
require(privateSale, "Private sale minting is over");
require(saleIsActive, "Sale must be active to mint");
require(privatePrice <= msg.value, "Ether value sent is not correct");
require(<FILL_ME>)
require(!_exists(mid), "Already Minted!");
require(meebitsLoot[mid] == 0, "Already Minted!");
mintTo(msg.sender, mid);
}
// Public sale minting
function mint(uint256 quantity) external payable {
}
// Random mint
function mintTo(address _to, uint256 mid) internal returns (uint) {
}
function randomIndex() internal returns (uint) {
}
function withdraw() external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function flipPrivateSale() external onlyOwner {
}
function setPrivatePrice(uint256 newPrice) external onlyOwner {
}
function setPublicPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string memory uri) external onlyOwner {
}
function baseURI() override public view returns (string memory) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function toString(uint256 value) internal pure returns (string memory) {
}
}
| meebitsContract.ownerOf(mid)==msg.sender,"Not the owner of this meebit." | 395,005 | meebitsContract.ownerOf(mid)==msg.sender |
"Already Minted!" | // contracts/LootMeebits.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract LootMeebits is ERC721, Ownable
{
using SafeMath for uint256;
using Strings for uint256;
using Strings for uint16;
address public meebitsAddress = 0x7Bd29408f11D2bFC23c34f18275bBf23bB716Bc7;
ERC721 meebitsContract = ERC721(meebitsAddress);
//initial prices may be updated
uint256 public privatePrice = 20000000000000000; //0.02 ETH
uint256 public publicPrice = 30000000000000000; //0.03 ETH
bool public saleIsActive = true;
bool public privateSale = false;
uint public constant TOKEN_LIMIT = 20000;
uint public numTokens = 0;
//// Random index assignment
uint internal nonce = 0;
uint[TOKEN_LIMIT] internal indices;
// Base URI
string private _baseURI;
mapping(uint256 => uint256) public meebitsLoot; // mid --> lid
modifier validNFToken(uint256 _tokenId) {
}
constructor () public ERC721("Loot (for Meebits)", "Loot4Meebits") {
}
// The deployer can mint without paying
// function devMint(uint quantity) public onlyOwner {
// for (uint i = 0; i < quantity; i++) {
// mintTo(msg.sender, 0);
// }
// }
// Private sale minting (reserved for Meebits owners)
function mintWithMeebits(uint256 mid) external payable {
require(privateSale, "Private sale minting is over");
require(saleIsActive, "Sale must be active to mint");
require(privatePrice <= msg.value, "Ether value sent is not correct");
require(meebitsContract.ownerOf(mid) == msg.sender, "Not the owner of this meebit.");
require(<FILL_ME>)
require(meebitsLoot[mid] == 0, "Already Minted!");
mintTo(msg.sender, mid);
}
// Public sale minting
function mint(uint256 quantity) external payable {
}
// Random mint
function mintTo(address _to, uint256 mid) internal returns (uint) {
}
function randomIndex() internal returns (uint) {
}
function withdraw() external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function flipPrivateSale() external onlyOwner {
}
function setPrivatePrice(uint256 newPrice) external onlyOwner {
}
function setPublicPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string memory uri) external onlyOwner {
}
function baseURI() override public view returns (string memory) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function toString(uint256 value) internal pure returns (string memory) {
}
}
| !_exists(mid),"Already Minted!" | 395,005 | !_exists(mid) |
"Already Minted!" | // contracts/LootMeebits.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract LootMeebits is ERC721, Ownable
{
using SafeMath for uint256;
using Strings for uint256;
using Strings for uint16;
address public meebitsAddress = 0x7Bd29408f11D2bFC23c34f18275bBf23bB716Bc7;
ERC721 meebitsContract = ERC721(meebitsAddress);
//initial prices may be updated
uint256 public privatePrice = 20000000000000000; //0.02 ETH
uint256 public publicPrice = 30000000000000000; //0.03 ETH
bool public saleIsActive = true;
bool public privateSale = false;
uint public constant TOKEN_LIMIT = 20000;
uint public numTokens = 0;
//// Random index assignment
uint internal nonce = 0;
uint[TOKEN_LIMIT] internal indices;
// Base URI
string private _baseURI;
mapping(uint256 => uint256) public meebitsLoot; // mid --> lid
modifier validNFToken(uint256 _tokenId) {
}
constructor () public ERC721("Loot (for Meebits)", "Loot4Meebits") {
}
// The deployer can mint without paying
// function devMint(uint quantity) public onlyOwner {
// for (uint i = 0; i < quantity; i++) {
// mintTo(msg.sender, 0);
// }
// }
// Private sale minting (reserved for Meebits owners)
function mintWithMeebits(uint256 mid) external payable {
require(privateSale, "Private sale minting is over");
require(saleIsActive, "Sale must be active to mint");
require(privatePrice <= msg.value, "Ether value sent is not correct");
require(meebitsContract.ownerOf(mid) == msg.sender, "Not the owner of this meebit.");
require(!_exists(mid), "Already Minted!");
require(<FILL_ME>)
mintTo(msg.sender, mid);
}
// Public sale minting
function mint(uint256 quantity) external payable {
}
// Random mint
function mintTo(address _to, uint256 mid) internal returns (uint) {
}
function randomIndex() internal returns (uint) {
}
function withdraw() external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function flipPrivateSale() external onlyOwner {
}
function setPrivatePrice(uint256 newPrice) external onlyOwner {
}
function setPublicPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string memory uri) external onlyOwner {
}
function baseURI() override public view returns (string memory) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function toString(uint256 value) internal pure returns (string memory) {
}
}
| meebitsLoot[mid]==0,"Already Minted!" | 395,005 | meebitsLoot[mid]==0 |
"quantity is so big" | // contracts/LootMeebits.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract LootMeebits is ERC721, Ownable
{
using SafeMath for uint256;
using Strings for uint256;
using Strings for uint16;
address public meebitsAddress = 0x7Bd29408f11D2bFC23c34f18275bBf23bB716Bc7;
ERC721 meebitsContract = ERC721(meebitsAddress);
//initial prices may be updated
uint256 public privatePrice = 20000000000000000; //0.02 ETH
uint256 public publicPrice = 30000000000000000; //0.03 ETH
bool public saleIsActive = true;
bool public privateSale = false;
uint public constant TOKEN_LIMIT = 20000;
uint public numTokens = 0;
//// Random index assignment
uint internal nonce = 0;
uint[TOKEN_LIMIT] internal indices;
// Base URI
string private _baseURI;
mapping(uint256 => uint256) public meebitsLoot; // mid --> lid
modifier validNFToken(uint256 _tokenId) {
}
constructor () public ERC721("Loot (for Meebits)", "Loot4Meebits") {
}
// The deployer can mint without paying
// function devMint(uint quantity) public onlyOwner {
// for (uint i = 0; i < quantity; i++) {
// mintTo(msg.sender, 0);
// }
// }
// Private sale minting (reserved for Meebits owners)
function mintWithMeebits(uint256 mid) external payable {
}
// Public sale minting
function mint(uint256 quantity) external payable {
require(quantity > 0, "quantity is zero");
require(<FILL_ME>)
require(!privateSale, "Public sale minting not started");
require(saleIsActive, "Sale must be active to mint");
require(publicPrice.mul(quantity) <= msg.value, "Ether value sent is not correct");
for (uint i = 0; i < quantity; i++) {
mintTo(msg.sender, 0);
}
}
// Random mint
function mintTo(address _to, uint256 mid) internal returns (uint) {
}
function randomIndex() internal returns (uint) {
}
function withdraw() external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function flipPrivateSale() external onlyOwner {
}
function setPrivatePrice(uint256 newPrice) external onlyOwner {
}
function setPublicPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string memory uri) external onlyOwner {
}
function baseURI() override public view returns (string memory) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function toString(uint256 value) internal pure returns (string memory) {
}
}
| quantity<=(TOKEN_LIMIT.sub(numTokens)),"quantity is so big" | 395,005 | quantity<=(TOKEN_LIMIT.sub(numTokens)) |
"Ether value sent is not correct" | // contracts/LootMeebits.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract LootMeebits is ERC721, Ownable
{
using SafeMath for uint256;
using Strings for uint256;
using Strings for uint16;
address public meebitsAddress = 0x7Bd29408f11D2bFC23c34f18275bBf23bB716Bc7;
ERC721 meebitsContract = ERC721(meebitsAddress);
//initial prices may be updated
uint256 public privatePrice = 20000000000000000; //0.02 ETH
uint256 public publicPrice = 30000000000000000; //0.03 ETH
bool public saleIsActive = true;
bool public privateSale = false;
uint public constant TOKEN_LIMIT = 20000;
uint public numTokens = 0;
//// Random index assignment
uint internal nonce = 0;
uint[TOKEN_LIMIT] internal indices;
// Base URI
string private _baseURI;
mapping(uint256 => uint256) public meebitsLoot; // mid --> lid
modifier validNFToken(uint256 _tokenId) {
}
constructor () public ERC721("Loot (for Meebits)", "Loot4Meebits") {
}
// The deployer can mint without paying
// function devMint(uint quantity) public onlyOwner {
// for (uint i = 0; i < quantity; i++) {
// mintTo(msg.sender, 0);
// }
// }
// Private sale minting (reserved for Meebits owners)
function mintWithMeebits(uint256 mid) external payable {
}
// Public sale minting
function mint(uint256 quantity) external payable {
require(quantity > 0, "quantity is zero");
require(quantity <= (TOKEN_LIMIT.sub(numTokens)), "quantity is so big");
require(!privateSale, "Public sale minting not started");
require(saleIsActive, "Sale must be active to mint");
require(<FILL_ME>)
for (uint i = 0; i < quantity; i++) {
mintTo(msg.sender, 0);
}
}
// Random mint
function mintTo(address _to, uint256 mid) internal returns (uint) {
}
function randomIndex() internal returns (uint) {
}
function withdraw() external onlyOwner {
}
function flipSaleState() external onlyOwner {
}
function flipPrivateSale() external onlyOwner {
}
function setPrivatePrice(uint256 newPrice) external onlyOwner {
}
function setPublicPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string memory uri) external onlyOwner {
}
function baseURI() override public view returns (string memory) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function toString(uint256 value) internal pure returns (string memory) {
}
}
| publicPrice.mul(quantity)<=msg.value,"Ether value sent is not correct" | 395,005 | publicPrice.mul(quantity)<=msg.value |
"Total Free supply exceeded!" | pragma solidity ^0.8.0;
contract Noodles is ERC721Enumerable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
//NFT Parameters
string private baseURI;
string private baseExtension = ".json";
string private notRevealedUri;
uint256 public cost;
uint256 public maxMintAmount;
bool public paused = true;
bool public revealed = false;
//sale states:
//stage 0: init
//stage 1: free mint
//stage 2: pre-sale
//stage 3: public sale
uint8 public mintState;
//stage 1: free mint
mapping(address => uint8) public addressFreeMintsAvailable;
//stage 2: presale mint
mapping(address => uint8) public addressWLMintsAvailable;
constructor() ERC721("Noodles", "NOODS") {}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint8 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, "contract is paused");
require(_mintAmount > 0, "You have to mint at least 1 NFT!"); //must mint at least 1
require(mintState <= 3, "Minting is finished!"); //only 3 states
require(_mintAmount <= maxMintAmount, "Exceeded maximum NFT purchase");
require(cost * _mintAmount <= msg.value, "Insufficient funds!"); //not enough ETH
if (mintState == 1){
//free mint of 1 with 833 spots
require(<FILL_ME>)
require(addressFreeMintsAvailable[msg.sender] >= _mintAmount , "Max NFTs exceeded");
addressFreeMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState == 2){
//WL mint of 1, 2, or 3 addresses whitelisted
require(supply + _mintAmount <= 4436, "Total whitelist supply exceeded!");
require(addressWLMintsAvailable[msg.sender] >= _mintAmount , "Max NFTs exceeded");
addressWLMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState ==3){
//public mint
require(supply + _mintAmount <= 5555);
}
else {
assert(false);
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}
function reserve(uint256 n) public onlyOwner {
}
function tokenURI(uint256 tokenId)public view virtual override returns (string memory) {
}
//only owner
function reveal() public onlyOwner {
}
function setState(uint8 _state)public onlyOwner{
}
function unpause() public onlyOwner{
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function addFreeMintUsers(address[] calldata _users) public onlyOwner {
}
function addWhitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| supply+_mintAmount<=836,"Total Free supply exceeded!" | 395,140 | supply+_mintAmount<=836 |
"Max NFTs exceeded" | pragma solidity ^0.8.0;
contract Noodles is ERC721Enumerable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
//NFT Parameters
string private baseURI;
string private baseExtension = ".json";
string private notRevealedUri;
uint256 public cost;
uint256 public maxMintAmount;
bool public paused = true;
bool public revealed = false;
//sale states:
//stage 0: init
//stage 1: free mint
//stage 2: pre-sale
//stage 3: public sale
uint8 public mintState;
//stage 1: free mint
mapping(address => uint8) public addressFreeMintsAvailable;
//stage 2: presale mint
mapping(address => uint8) public addressWLMintsAvailable;
constructor() ERC721("Noodles", "NOODS") {}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint8 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, "contract is paused");
require(_mintAmount > 0, "You have to mint at least 1 NFT!"); //must mint at least 1
require(mintState <= 3, "Minting is finished!"); //only 3 states
require(_mintAmount <= maxMintAmount, "Exceeded maximum NFT purchase");
require(cost * _mintAmount <= msg.value, "Insufficient funds!"); //not enough ETH
if (mintState == 1){
//free mint of 1 with 833 spots
require(supply + _mintAmount <= 836, "Total Free supply exceeded!");
require(<FILL_ME>)
addressFreeMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState == 2){
//WL mint of 1, 2, or 3 addresses whitelisted
require(supply + _mintAmount <= 4436, "Total whitelist supply exceeded!");
require(addressWLMintsAvailable[msg.sender] >= _mintAmount , "Max NFTs exceeded");
addressWLMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState ==3){
//public mint
require(supply + _mintAmount <= 5555);
}
else {
assert(false);
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}
function reserve(uint256 n) public onlyOwner {
}
function tokenURI(uint256 tokenId)public view virtual override returns (string memory) {
}
//only owner
function reveal() public onlyOwner {
}
function setState(uint8 _state)public onlyOwner{
}
function unpause() public onlyOwner{
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function addFreeMintUsers(address[] calldata _users) public onlyOwner {
}
function addWhitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| addressFreeMintsAvailable[msg.sender]>=_mintAmount,"Max NFTs exceeded" | 395,140 | addressFreeMintsAvailable[msg.sender]>=_mintAmount |
"Total whitelist supply exceeded!" | pragma solidity ^0.8.0;
contract Noodles is ERC721Enumerable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
//NFT Parameters
string private baseURI;
string private baseExtension = ".json";
string private notRevealedUri;
uint256 public cost;
uint256 public maxMintAmount;
bool public paused = true;
bool public revealed = false;
//sale states:
//stage 0: init
//stage 1: free mint
//stage 2: pre-sale
//stage 3: public sale
uint8 public mintState;
//stage 1: free mint
mapping(address => uint8) public addressFreeMintsAvailable;
//stage 2: presale mint
mapping(address => uint8) public addressWLMintsAvailable;
constructor() ERC721("Noodles", "NOODS") {}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint8 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, "contract is paused");
require(_mintAmount > 0, "You have to mint at least 1 NFT!"); //must mint at least 1
require(mintState <= 3, "Minting is finished!"); //only 3 states
require(_mintAmount <= maxMintAmount, "Exceeded maximum NFT purchase");
require(cost * _mintAmount <= msg.value, "Insufficient funds!"); //not enough ETH
if (mintState == 1){
//free mint of 1 with 833 spots
require(supply + _mintAmount <= 836, "Total Free supply exceeded!");
require(addressFreeMintsAvailable[msg.sender] >= _mintAmount , "Max NFTs exceeded");
addressFreeMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState == 2){
//WL mint of 1, 2, or 3 addresses whitelisted
require(<FILL_ME>)
require(addressWLMintsAvailable[msg.sender] >= _mintAmount , "Max NFTs exceeded");
addressWLMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState ==3){
//public mint
require(supply + _mintAmount <= 5555);
}
else {
assert(false);
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}
function reserve(uint256 n) public onlyOwner {
}
function tokenURI(uint256 tokenId)public view virtual override returns (string memory) {
}
//only owner
function reveal() public onlyOwner {
}
function setState(uint8 _state)public onlyOwner{
}
function unpause() public onlyOwner{
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function addFreeMintUsers(address[] calldata _users) public onlyOwner {
}
function addWhitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| supply+_mintAmount<=4436,"Total whitelist supply exceeded!" | 395,140 | supply+_mintAmount<=4436 |
"Max NFTs exceeded" | pragma solidity ^0.8.0;
contract Noodles is ERC721Enumerable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
//NFT Parameters
string private baseURI;
string private baseExtension = ".json";
string private notRevealedUri;
uint256 public cost;
uint256 public maxMintAmount;
bool public paused = true;
bool public revealed = false;
//sale states:
//stage 0: init
//stage 1: free mint
//stage 2: pre-sale
//stage 3: public sale
uint8 public mintState;
//stage 1: free mint
mapping(address => uint8) public addressFreeMintsAvailable;
//stage 2: presale mint
mapping(address => uint8) public addressWLMintsAvailable;
constructor() ERC721("Noodles", "NOODS") {}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint8 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, "contract is paused");
require(_mintAmount > 0, "You have to mint at least 1 NFT!"); //must mint at least 1
require(mintState <= 3, "Minting is finished!"); //only 3 states
require(_mintAmount <= maxMintAmount, "Exceeded maximum NFT purchase");
require(cost * _mintAmount <= msg.value, "Insufficient funds!"); //not enough ETH
if (mintState == 1){
//free mint of 1 with 833 spots
require(supply + _mintAmount <= 836, "Total Free supply exceeded!");
require(addressFreeMintsAvailable[msg.sender] >= _mintAmount , "Max NFTs exceeded");
addressFreeMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState == 2){
//WL mint of 1, 2, or 3 addresses whitelisted
require(supply + _mintAmount <= 4436, "Total whitelist supply exceeded!");
require(<FILL_ME>)
addressWLMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState ==3){
//public mint
require(supply + _mintAmount <= 5555);
}
else {
assert(false);
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}
function reserve(uint256 n) public onlyOwner {
}
function tokenURI(uint256 tokenId)public view virtual override returns (string memory) {
}
//only owner
function reveal() public onlyOwner {
}
function setState(uint8 _state)public onlyOwner{
}
function unpause() public onlyOwner{
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function addFreeMintUsers(address[] calldata _users) public onlyOwner {
}
function addWhitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| addressWLMintsAvailable[msg.sender]>=_mintAmount,"Max NFTs exceeded" | 395,140 | addressWLMintsAvailable[msg.sender]>=_mintAmount |
null | pragma solidity ^0.8.0;
contract Noodles is ERC721Enumerable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
//NFT Parameters
string private baseURI;
string private baseExtension = ".json";
string private notRevealedUri;
uint256 public cost;
uint256 public maxMintAmount;
bool public paused = true;
bool public revealed = false;
//sale states:
//stage 0: init
//stage 1: free mint
//stage 2: pre-sale
//stage 3: public sale
uint8 public mintState;
//stage 1: free mint
mapping(address => uint8) public addressFreeMintsAvailable;
//stage 2: presale mint
mapping(address => uint8) public addressWLMintsAvailable;
constructor() ERC721("Noodles", "NOODS") {}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint8 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, "contract is paused");
require(_mintAmount > 0, "You have to mint at least 1 NFT!"); //must mint at least 1
require(mintState <= 3, "Minting is finished!"); //only 3 states
require(_mintAmount <= maxMintAmount, "Exceeded maximum NFT purchase");
require(cost * _mintAmount <= msg.value, "Insufficient funds!"); //not enough ETH
if (mintState == 1){
//free mint of 1 with 833 spots
require(supply + _mintAmount <= 836, "Total Free supply exceeded!");
require(addressFreeMintsAvailable[msg.sender] >= _mintAmount , "Max NFTs exceeded");
addressFreeMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState == 2){
//WL mint of 1, 2, or 3 addresses whitelisted
require(supply + _mintAmount <= 4436, "Total whitelist supply exceeded!");
require(addressWLMintsAvailable[msg.sender] >= _mintAmount , "Max NFTs exceeded");
addressWLMintsAvailable[msg.sender] -= _mintAmount;
}
else if (mintState ==3){
//public mint
require(<FILL_ME>)
}
else {
assert(false);
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}
function reserve(uint256 n) public onlyOwner {
}
function tokenURI(uint256 tokenId)public view virtual override returns (string memory) {
}
//only owner
function reveal() public onlyOwner {
}
function setState(uint8 _state)public onlyOwner{
}
function unpause() public onlyOwner{
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function addFreeMintUsers(address[] calldata _users) public onlyOwner {
}
function addWhitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| supply+_mintAmount<=5555 | 395,140 | supply+_mintAmount<=5555 |
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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
interface TokenInterface {
function totalSupply() external constant returns (uint);
function balanceOf(address tokenOwner) external constant returns (uint balance);
function allowance(address tokenOwner, address spender) external constant returns (uint remaining);
function transfer(address to, uint tokens) external returns (bool success);
function approve(address spender, uint tokens) external returns (bool success);
function transferFrom(address from, address to, uint tokens) external returns (bool success);
function burn(uint256 _value) external;
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Burn(address indexed burner, uint256 value);
}
contract URUNCrowdsale is Ownable{
using SafeMath for uint256;
// The token being sold
TokenInterface public token;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public startTime;
uint256 public endTime;
// how many token units a buyer gets per wei
uint256 public ratePerWei = 800;
// amount of raised money in wei
uint256 public weiRaised;
uint256 public TOKENS_SOLD;
uint256 public TOKENS_BOUGHT;
uint256 public minimumContributionPhase1;
uint256 public minimumContributionPhase2;
uint256 public minimumContributionPhase3;
uint256 public minimumContributionPhase4;
uint256 public minimumContributionPhase5;
uint256 public minimumContributionPhase6;
uint256 public maxTokensToSaleInClosedPreSale;
uint256 public bonusInPhase1;
uint256 public bonusInPhase2;
uint256 public bonusInPhase3;
uint256 public bonusInPhase4;
uint256 public bonusInPhase5;
uint256 public bonusInPhase6;
bool public isCrowdsalePaused = false;
uint256 public totalDurationInDays = 123 days;
struct userInformation {
address userAddress;
uint tokensToBeSent;
uint ethersToBeSent;
bool isKYCApproved;
bool recurringBuyer;
}
event usersAwaitingTokens(address[] users);
mapping(address=>userInformation) usersBuyingInformation;
address[] allUsers;
address[] u;
userInformation info;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
constructor(uint256 _startTime, address _wallet, address _tokenAddress) public
{
}
// fallback function can be used to buy tokens
function () public payable {
}
function determineBonus(uint tokens, uint ethersSent) internal view returns (uint256 bonus)
{
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
}
/**
* function to change the end time and start time of the ICO
* can only be called by owner wallet
**/
function changeStartAndEndDate (uint256 startTimeUnixTimestamp, uint256 endTimeUnixTimestamp) public onlyOwner
{
require (startTimeUnixTimestamp!=0 && endTimeUnixTimestamp!=0);
require(endTimeUnixTimestamp>startTimeUnixTimestamp);
require(<FILL_ME>)
startTime = startTimeUnixTimestamp;
endTime = endTimeUnixTimestamp;
}
/**
* function to change the rate of tokens
* can only be called by owner wallet
**/
function setPriceRate(uint256 newPrice) public onlyOwner {
}
/**
* function to pause the crowdsale
* can only be called from owner wallet
**/
function pauseCrowdsale() public onlyOwner {
}
/**
* function to resume the crowdsale if it is paused
* can only be called from owner wallet
**/
function resumeCrowdsale() public onlyOwner {
}
/**
* function through which owner can take back the tokens from the contract
**/
function takeTokensBack() public onlyOwner
{
}
/**
* function through which owner can transfer the tokens to any address
* use this which to properly display the tokens that have been sold via ether or other payments
**/
function manualTokenTransfer(address receiver, uint value) public onlyOwner
{
}
/**
* function to approve a single user which means the user has passed all KYC checks
* can only be called by the owner
**/
function approveSingleUser(address user) public onlyOwner {
}
/**
* function to disapprove a single user which means the user has failed the KYC checks
* can only be called by the owner
**/
function disapproveSingleUser(address user) public onlyOwner {
}
/**
* function to approve multiple users at once
* can only be called by the owner
**/
function approveMultipleUsers(address[] users) public onlyOwner {
}
/**
* function to distribute the tokens to approved users
* can only be called by the owner
**/
function distributeTokensToApprovedUsers() public onlyOwner {
}
/**
* function to distribute the tokens to all users whether approved or unapproved
* can only be called by the owner
**/
function distributeTokensToAllUsers() public onlyOwner {
}
/**
* function to refund a single user in case he hasnt passed the KYC checks
* can only be called by the owner
**/
function refundSingleUser(address user) public onlyOwner {
}
/**
* function to refund to multiple users in case they havent passed the KYC checks
* can only be called by the owner
**/
function refundMultipleUsers(address[] users) public onlyOwner {
}
/**
* function to transfer out all ethers present in the contract
* after calling this function all refunds would need to be done manually
* would use this function as a last resort
* can only be called by owner wallet
**/
function transferOutAllEthers() public onlyOwner {
}
/**
* function to get the top 150 users who are awaiting the transfer of tokens
* can only be called by the owner
* this function would work in read mode
**/
function getUsersAwaitingForTokensTop150(bool fetch) public constant returns (address[150]) {
}
/**
* function to get the users who are awaiting the transfer of tokens
* can only be called by the owner
* this function would work in write mode
**/
function getUsersAwaitingForTokens() public onlyOwner returns (address[]) {
}
/**
* function to return the information of a single user
**/
function getUserInfo(address userAddress) public constant returns(uint _ethers, uint _tokens, bool _isApproved)
{
}
/**
* function to clear all payables/receivables of a user
* can only be called by owner
**/
function closeUser(address userAddress) public onlyOwner
{
}
/**
* function to get a list of top 150 users that are unapproved
* can only be called by owner
* this function would work in read mode
**/
function getUnapprovedUsersTop150(bool fetch) public constant returns (address[150])
{
}
/**
* function to get a list of all users that are unapproved
* can only be called by owner
* this function would work in write mode
**/
function getUnapprovedUsers() public onlyOwner returns (address[])
{
}
/**
* function to return all the users
**/
function getAllUsers(bool fetch) public constant returns (address[])
{
}
/**
* function to change the address of a user
* this function would be used in situations where user made the transaction from one wallet
* but wants to receive tokens in another wallet
* so owner should be able to update the address
**/
function changeUserEthAddress(address oldEthAddress, address newEthAddress) public onlyOwner
{
}
/**
* Add a user that has paid with BTC or other payment methods
**/
function addUser(address userAddr, uint tokens) public onlyOwner
{
}
/**
* Set the tokens bought
**/
function setTokensBought(uint tokensBought) public onlyOwner
{
}
/**
* Returns the number of tokens who have been sold
**/
function getTokensBought() public constant returns(uint)
{
}
}
| endTimeUnixTimestamp.sub(startTimeUnixTimestamp)>=totalDurationInDays | 395,238 | endTimeUnixTimestamp.sub(startTimeUnixTimestamp)>=totalDurationInDays |
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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
interface TokenInterface {
function totalSupply() external constant returns (uint);
function balanceOf(address tokenOwner) external constant returns (uint balance);
function allowance(address tokenOwner, address spender) external constant returns (uint remaining);
function transfer(address to, uint tokens) external returns (bool success);
function approve(address spender, uint tokens) external returns (bool success);
function transferFrom(address from, address to, uint tokens) external returns (bool success);
function burn(uint256 _value) external;
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Burn(address indexed burner, uint256 value);
}
contract URUNCrowdsale is Ownable{
using SafeMath for uint256;
// The token being sold
TokenInterface public token;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public startTime;
uint256 public endTime;
// how many token units a buyer gets per wei
uint256 public ratePerWei = 800;
// amount of raised money in wei
uint256 public weiRaised;
uint256 public TOKENS_SOLD;
uint256 public TOKENS_BOUGHT;
uint256 public minimumContributionPhase1;
uint256 public minimumContributionPhase2;
uint256 public minimumContributionPhase3;
uint256 public minimumContributionPhase4;
uint256 public minimumContributionPhase5;
uint256 public minimumContributionPhase6;
uint256 public maxTokensToSaleInClosedPreSale;
uint256 public bonusInPhase1;
uint256 public bonusInPhase2;
uint256 public bonusInPhase3;
uint256 public bonusInPhase4;
uint256 public bonusInPhase5;
uint256 public bonusInPhase6;
bool public isCrowdsalePaused = false;
uint256 public totalDurationInDays = 123 days;
struct userInformation {
address userAddress;
uint tokensToBeSent;
uint ethersToBeSent;
bool isKYCApproved;
bool recurringBuyer;
}
event usersAwaitingTokens(address[] users);
mapping(address=>userInformation) usersBuyingInformation;
address[] allUsers;
address[] u;
userInformation info;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
constructor(uint256 _startTime, address _wallet, address _tokenAddress) public
{
}
// fallback function can be used to buy tokens
function () public payable {
}
function determineBonus(uint tokens, uint ethersSent) internal view returns (uint256 bonus)
{
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
}
/**
* function to change the end time and start time of the ICO
* can only be called by owner wallet
**/
function changeStartAndEndDate (uint256 startTimeUnixTimestamp, uint256 endTimeUnixTimestamp) public onlyOwner
{
}
/**
* function to change the rate of tokens
* can only be called by owner wallet
**/
function setPriceRate(uint256 newPrice) public onlyOwner {
}
/**
* function to pause the crowdsale
* can only be called from owner wallet
**/
function pauseCrowdsale() public onlyOwner {
}
/**
* function to resume the crowdsale if it is paused
* can only be called from owner wallet
**/
function resumeCrowdsale() public onlyOwner {
}
/**
* function through which owner can take back the tokens from the contract
**/
function takeTokensBack() public onlyOwner
{
}
/**
* function through which owner can transfer the tokens to any address
* use this which to properly display the tokens that have been sold via ether or other payments
**/
function manualTokenTransfer(address receiver, uint value) public onlyOwner
{
}
/**
* function to approve a single user which means the user has passed all KYC checks
* can only be called by the owner
**/
function approveSingleUser(address user) public onlyOwner {
}
/**
* function to disapprove a single user which means the user has failed the KYC checks
* can only be called by the owner
**/
function disapproveSingleUser(address user) public onlyOwner {
}
/**
* function to approve multiple users at once
* can only be called by the owner
**/
function approveMultipleUsers(address[] users) public onlyOwner {
}
/**
* function to distribute the tokens to approved users
* can only be called by the owner
**/
function distributeTokensToApprovedUsers() public onlyOwner {
}
/**
* function to distribute the tokens to all users whether approved or unapproved
* can only be called by the owner
**/
function distributeTokensToAllUsers() public onlyOwner {
}
/**
* function to refund a single user in case he hasnt passed the KYC checks
* can only be called by the owner
**/
function refundSingleUser(address user) public onlyOwner {
require(<FILL_ME>)
user.transfer(usersBuyingInformation[user].ethersToBeSent);
usersBuyingInformation[user].tokensToBeSent = 0;
usersBuyingInformation[user].ethersToBeSent = 0;
}
/**
* function to refund to multiple users in case they havent passed the KYC checks
* can only be called by the owner
**/
function refundMultipleUsers(address[] users) public onlyOwner {
}
/**
* function to transfer out all ethers present in the contract
* after calling this function all refunds would need to be done manually
* would use this function as a last resort
* can only be called by owner wallet
**/
function transferOutAllEthers() public onlyOwner {
}
/**
* function to get the top 150 users who are awaiting the transfer of tokens
* can only be called by the owner
* this function would work in read mode
**/
function getUsersAwaitingForTokensTop150(bool fetch) public constant returns (address[150]) {
}
/**
* function to get the users who are awaiting the transfer of tokens
* can only be called by the owner
* this function would work in write mode
**/
function getUsersAwaitingForTokens() public onlyOwner returns (address[]) {
}
/**
* function to return the information of a single user
**/
function getUserInfo(address userAddress) public constant returns(uint _ethers, uint _tokens, bool _isApproved)
{
}
/**
* function to clear all payables/receivables of a user
* can only be called by owner
**/
function closeUser(address userAddress) public onlyOwner
{
}
/**
* function to get a list of top 150 users that are unapproved
* can only be called by owner
* this function would work in read mode
**/
function getUnapprovedUsersTop150(bool fetch) public constant returns (address[150])
{
}
/**
* function to get a list of all users that are unapproved
* can only be called by owner
* this function would work in write mode
**/
function getUnapprovedUsers() public onlyOwner returns (address[])
{
}
/**
* function to return all the users
**/
function getAllUsers(bool fetch) public constant returns (address[])
{
}
/**
* function to change the address of a user
* this function would be used in situations where user made the transaction from one wallet
* but wants to receive tokens in another wallet
* so owner should be able to update the address
**/
function changeUserEthAddress(address oldEthAddress, address newEthAddress) public onlyOwner
{
}
/**
* Add a user that has paid with BTC or other payment methods
**/
function addUser(address userAddr, uint tokens) public onlyOwner
{
}
/**
* Set the tokens bought
**/
function setTokensBought(uint tokensBought) public onlyOwner
{
}
/**
* Returns the number of tokens who have been sold
**/
function getTokensBought() public constant returns(uint)
{
}
}
| usersBuyingInformation[user].ethersToBeSent>0 | 395,238 | usersBuyingInformation[user].ethersToBeSent>0 |
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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
interface TokenInterface {
function totalSupply() external constant returns (uint);
function balanceOf(address tokenOwner) external constant returns (uint balance);
function allowance(address tokenOwner, address spender) external constant returns (uint remaining);
function transfer(address to, uint tokens) external returns (bool success);
function approve(address spender, uint tokens) external returns (bool success);
function transferFrom(address from, address to, uint tokens) external returns (bool success);
function burn(uint256 _value) external;
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Burn(address indexed burner, uint256 value);
}
contract URUNCrowdsale is Ownable{
using SafeMath for uint256;
// The token being sold
TokenInterface public token;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public startTime;
uint256 public endTime;
// how many token units a buyer gets per wei
uint256 public ratePerWei = 800;
// amount of raised money in wei
uint256 public weiRaised;
uint256 public TOKENS_SOLD;
uint256 public TOKENS_BOUGHT;
uint256 public minimumContributionPhase1;
uint256 public minimumContributionPhase2;
uint256 public minimumContributionPhase3;
uint256 public minimumContributionPhase4;
uint256 public minimumContributionPhase5;
uint256 public minimumContributionPhase6;
uint256 public maxTokensToSaleInClosedPreSale;
uint256 public bonusInPhase1;
uint256 public bonusInPhase2;
uint256 public bonusInPhase3;
uint256 public bonusInPhase4;
uint256 public bonusInPhase5;
uint256 public bonusInPhase6;
bool public isCrowdsalePaused = false;
uint256 public totalDurationInDays = 123 days;
struct userInformation {
address userAddress;
uint tokensToBeSent;
uint ethersToBeSent;
bool isKYCApproved;
bool recurringBuyer;
}
event usersAwaitingTokens(address[] users);
mapping(address=>userInformation) usersBuyingInformation;
address[] allUsers;
address[] u;
userInformation info;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
constructor(uint256 _startTime, address _wallet, address _tokenAddress) public
{
}
// fallback function can be used to buy tokens
function () public payable {
}
function determineBonus(uint tokens, uint ethersSent) internal view returns (uint256 bonus)
{
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
}
/**
* function to change the end time and start time of the ICO
* can only be called by owner wallet
**/
function changeStartAndEndDate (uint256 startTimeUnixTimestamp, uint256 endTimeUnixTimestamp) public onlyOwner
{
}
/**
* function to change the rate of tokens
* can only be called by owner wallet
**/
function setPriceRate(uint256 newPrice) public onlyOwner {
}
/**
* function to pause the crowdsale
* can only be called from owner wallet
**/
function pauseCrowdsale() public onlyOwner {
}
/**
* function to resume the crowdsale if it is paused
* can only be called from owner wallet
**/
function resumeCrowdsale() public onlyOwner {
}
/**
* function through which owner can take back the tokens from the contract
**/
function takeTokensBack() public onlyOwner
{
}
/**
* function through which owner can transfer the tokens to any address
* use this which to properly display the tokens that have been sold via ether or other payments
**/
function manualTokenTransfer(address receiver, uint value) public onlyOwner
{
}
/**
* function to approve a single user which means the user has passed all KYC checks
* can only be called by the owner
**/
function approveSingleUser(address user) public onlyOwner {
}
/**
* function to disapprove a single user which means the user has failed the KYC checks
* can only be called by the owner
**/
function disapproveSingleUser(address user) public onlyOwner {
}
/**
* function to approve multiple users at once
* can only be called by the owner
**/
function approveMultipleUsers(address[] users) public onlyOwner {
}
/**
* function to distribute the tokens to approved users
* can only be called by the owner
**/
function distributeTokensToApprovedUsers() public onlyOwner {
}
/**
* function to distribute the tokens to all users whether approved or unapproved
* can only be called by the owner
**/
function distributeTokensToAllUsers() public onlyOwner {
}
/**
* function to refund a single user in case he hasnt passed the KYC checks
* can only be called by the owner
**/
function refundSingleUser(address user) public onlyOwner {
}
/**
* function to refund to multiple users in case they havent passed the KYC checks
* can only be called by the owner
**/
function refundMultipleUsers(address[] users) public onlyOwner {
for (uint i=0;i<users.length;i++)
{
require(<FILL_ME>)
users[i].transfer(usersBuyingInformation[users[i]].ethersToBeSent);
usersBuyingInformation[users[i]].tokensToBeSent = 0;
usersBuyingInformation[users[i]].ethersToBeSent = 0;
}
}
/**
* function to transfer out all ethers present in the contract
* after calling this function all refunds would need to be done manually
* would use this function as a last resort
* can only be called by owner wallet
**/
function transferOutAllEthers() public onlyOwner {
}
/**
* function to get the top 150 users who are awaiting the transfer of tokens
* can only be called by the owner
* this function would work in read mode
**/
function getUsersAwaitingForTokensTop150(bool fetch) public constant returns (address[150]) {
}
/**
* function to get the users who are awaiting the transfer of tokens
* can only be called by the owner
* this function would work in write mode
**/
function getUsersAwaitingForTokens() public onlyOwner returns (address[]) {
}
/**
* function to return the information of a single user
**/
function getUserInfo(address userAddress) public constant returns(uint _ethers, uint _tokens, bool _isApproved)
{
}
/**
* function to clear all payables/receivables of a user
* can only be called by owner
**/
function closeUser(address userAddress) public onlyOwner
{
}
/**
* function to get a list of top 150 users that are unapproved
* can only be called by owner
* this function would work in read mode
**/
function getUnapprovedUsersTop150(bool fetch) public constant returns (address[150])
{
}
/**
* function to get a list of all users that are unapproved
* can only be called by owner
* this function would work in write mode
**/
function getUnapprovedUsers() public onlyOwner returns (address[])
{
}
/**
* function to return all the users
**/
function getAllUsers(bool fetch) public constant returns (address[])
{
}
/**
* function to change the address of a user
* this function would be used in situations where user made the transaction from one wallet
* but wants to receive tokens in another wallet
* so owner should be able to update the address
**/
function changeUserEthAddress(address oldEthAddress, address newEthAddress) public onlyOwner
{
}
/**
* Add a user that has paid with BTC or other payment methods
**/
function addUser(address userAddr, uint tokens) public onlyOwner
{
}
/**
* Set the tokens bought
**/
function setTokensBought(uint tokensBought) public onlyOwner
{
}
/**
* Returns the number of tokens who have been sold
**/
function getTokensBought() public constant returns(uint)
{
}
}
| usersBuyingInformation[users[i]].ethersToBeSent>0 | 395,238 | usersBuyingInformation[users[i]].ethersToBeSent>0 |
"WHITELIST_LIMIT_EXCEED" | @v4.3.2
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @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, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* 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),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract HalfShekel is ERC721, Ownable {
using Strings for uint256;
bool public revealed = false;
bool public sale = false;
bool public isWhitelistedActive = false;
uint16 public nonce = 0;
uint public price = 100000000000000000;
uint16 public earlySupply = 1000;
uint16 public totalSupply = 1000;
uint8 public maxTx = 10;
uint8 public maxTxWL = 5;
string private baseURI = '';
string public notRevealedUri = '';
uint256 public nftPerAddressLimit = 4;
uint16 public minimumbuy = 1;
mapping (address => uint256) public addressMintedBalance;
address[] public whitelistedAddresses;
constructor(
string memory _name,
string memory _ticker
) ERC721(_name, _ticker) {
}
function reveal() public onlyOwner {
}
function setBaseURI(string memory baseURI_) public onlyOwner {
}
function setUnrevealedURI(string memory baseURI_) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setnftPerAddressLimit(uint _newValue) external onlyOwner {
}
function setPrice(uint _newPrice) external onlyOwner {
}
function setEarlySupply(uint16 _newSupply) external onlyOwner {
}
function setTotalSupply(uint16 _newSupply) external onlyOwner {
}
function setWhitelisted(address[] calldata _walletAddresses) public onlyOwner{
}
function isWhitelisted(address _user) public view returns (bool) {
}
function setSale() public onlyOwner {
}
function setWhitelistSale() public onlyOwner {
}
function setMaxTx(uint8 _newMax) external onlyOwner {
}
function setMaxTxWL(uint8 _newMax) external onlyOwner {
}
function setMinimumBuy(uint8 _minimumbuy) external onlyOwner {
}
function whitelistMint(uint8 _qty) external payable {
require(isWhitelistedActive, "SALE_NOT_ACTIVE_YET");
require(isWhitelisted(msg.sender), "USER_IS_NOT_WHITELISTED");
require(_qty >= minimumbuy, "CANT_BUY_LESS_THAN_ALLOWED");
require(_qty <= maxTxWL || _qty < 1, "CANT_BUY_MORE_THAN_ALLOWED");
require(<FILL_ME>)
require(uint16(_qty) + nonce - 1 <= totalSupply, "NO_MORE_SUPPLY");
require(msg.value >= price * _qty, "INVALID_PRICE");
mintNFTs(msg.sender, _qty);
addressMintedBalance[msg.sender]+=_qty;
}
function buy(uint8 _qty) external payable {
}
function giveaway(address _to, uint8 _qty) external onlyOwner {
}
function mintNFTs(address _to, uint8 _qty) private {
}
function withdraw() external onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
}
| addressMintedBalance[msg.sender]+_qty<=nftPerAddressLimit,"WHITELIST_LIMIT_EXCEED" | 395,402 | addressMintedBalance[msg.sender]+_qty<=nftPerAddressLimit |
"NO_MORE_SUPPLY" | @v4.3.2
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @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, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* 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),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract HalfShekel is ERC721, Ownable {
using Strings for uint256;
bool public revealed = false;
bool public sale = false;
bool public isWhitelistedActive = false;
uint16 public nonce = 0;
uint public price = 100000000000000000;
uint16 public earlySupply = 1000;
uint16 public totalSupply = 1000;
uint8 public maxTx = 10;
uint8 public maxTxWL = 5;
string private baseURI = '';
string public notRevealedUri = '';
uint256 public nftPerAddressLimit = 4;
uint16 public minimumbuy = 1;
mapping (address => uint256) public addressMintedBalance;
address[] public whitelistedAddresses;
constructor(
string memory _name,
string memory _ticker
) ERC721(_name, _ticker) {
}
function reveal() public onlyOwner {
}
function setBaseURI(string memory baseURI_) public onlyOwner {
}
function setUnrevealedURI(string memory baseURI_) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setnftPerAddressLimit(uint _newValue) external onlyOwner {
}
function setPrice(uint _newPrice) external onlyOwner {
}
function setEarlySupply(uint16 _newSupply) external onlyOwner {
}
function setTotalSupply(uint16 _newSupply) external onlyOwner {
}
function setWhitelisted(address[] calldata _walletAddresses) public onlyOwner{
}
function isWhitelisted(address _user) public view returns (bool) {
}
function setSale() public onlyOwner {
}
function setWhitelistSale() public onlyOwner {
}
function setMaxTx(uint8 _newMax) external onlyOwner {
}
function setMaxTxWL(uint8 _newMax) external onlyOwner {
}
function setMinimumBuy(uint8 _minimumbuy) external onlyOwner {
}
function whitelistMint(uint8 _qty) external payable {
require(isWhitelistedActive, "SALE_NOT_ACTIVE_YET");
require(isWhitelisted(msg.sender), "USER_IS_NOT_WHITELISTED");
require(_qty >= minimumbuy, "CANT_BUY_LESS_THAN_ALLOWED");
require(_qty <= maxTxWL || _qty < 1, "CANT_BUY_MORE_THAN_ALLOWED");
require(addressMintedBalance[msg.sender] + _qty <= nftPerAddressLimit, "WHITELIST_LIMIT_EXCEED");
require(<FILL_ME>)
require(msg.value >= price * _qty, "INVALID_PRICE");
mintNFTs(msg.sender, _qty);
addressMintedBalance[msg.sender]+=_qty;
}
function buy(uint8 _qty) external payable {
}
function giveaway(address _to, uint8 _qty) external onlyOwner {
}
function mintNFTs(address _to, uint8 _qty) private {
}
function withdraw() external onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
}
| uint16(_qty)+nonce-1<=totalSupply,"NO_MORE_SUPPLY" | 395,402 | uint16(_qty)+nonce-1<=totalSupply |
"NO_MORE_SUPPLY" | @v4.3.2
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @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, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* 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),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract HalfShekel is ERC721, Ownable {
using Strings for uint256;
bool public revealed = false;
bool public sale = false;
bool public isWhitelistedActive = false;
uint16 public nonce = 0;
uint public price = 100000000000000000;
uint16 public earlySupply = 1000;
uint16 public totalSupply = 1000;
uint8 public maxTx = 10;
uint8 public maxTxWL = 5;
string private baseURI = '';
string public notRevealedUri = '';
uint256 public nftPerAddressLimit = 4;
uint16 public minimumbuy = 1;
mapping (address => uint256) public addressMintedBalance;
address[] public whitelistedAddresses;
constructor(
string memory _name,
string memory _ticker
) ERC721(_name, _ticker) {
}
function reveal() public onlyOwner {
}
function setBaseURI(string memory baseURI_) public onlyOwner {
}
function setUnrevealedURI(string memory baseURI_) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setnftPerAddressLimit(uint _newValue) external onlyOwner {
}
function setPrice(uint _newPrice) external onlyOwner {
}
function setEarlySupply(uint16 _newSupply) external onlyOwner {
}
function setTotalSupply(uint16 _newSupply) external onlyOwner {
}
function setWhitelisted(address[] calldata _walletAddresses) public onlyOwner{
}
function isWhitelisted(address _user) public view returns (bool) {
}
function setSale() public onlyOwner {
}
function setWhitelistSale() public onlyOwner {
}
function setMaxTx(uint8 _newMax) external onlyOwner {
}
function setMaxTxWL(uint8 _newMax) external onlyOwner {
}
function setMinimumBuy(uint8 _minimumbuy) external onlyOwner {
}
function whitelistMint(uint8 _qty) external payable {
}
function buy(uint8 _qty) external payable {
require(sale, "SALE_NOT_ACTIVE_YET");
require(_qty >= minimumbuy, "CANT_BUY_LESS_THAN_ALLOWED");
require(_qty <= maxTx || _qty < 1, "CANT_BUY_MORE_THAN_ALLOWED");
require(<FILL_ME>)
require(uint16(_qty) + nonce - 1 <= totalSupply, "NO_MORE_SUPPLY");
require(msg.value >= price * _qty, "INVALID_PRICE");
mintNFTs(msg.sender, _qty);
addressMintedBalance[msg.sender]+=_qty;
}
function giveaway(address _to, uint8 _qty) external onlyOwner {
}
function mintNFTs(address _to, uint8 _qty) private {
}
function withdraw() external onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
}
| uint16(_qty)+nonce-1<=earlySupply,"NO_MORE_SUPPLY" | 395,402 | uint16(_qty)+nonce-1<=earlySupply |
"Not in window" | pragma solidity 0.4.24;
import "openzeppelin-eth/contracts/math/SafeMath.sol";
import "openzeppelin-eth/contracts/ownership/Ownable.sol";
import "./lib/SafeMathInt.sol";
import "./lib/UInt256Lib.sol";
import "./UFragments.sol";
interface IOracle {
function getData() external returns (uint256, bool);
}
/**
* @title uFragments Monetary Supply Policy
* @dev This is an implementation of the uFragments Ideal Money protocol.
* uFragments operates symmetrically on expansion and contraction. It will both split and
* combine coins to maintain a stable unit price.
*
* This component regulates the token supply of the uFragments ERC20 token in response to
* market oracles.
*/
contract UFragmentsPolicy is Ownable {
using SafeMath for uint256;
using SafeMathInt for int256;
using UInt256Lib for uint256;
event LogRebase(
uint256 indexed epoch,
uint256 exchangeRate,
int256 requestedSupplyAdjustment,
uint256 timestampSec
);
UFragments public uFrags;
// Market oracle provides the token/USD exchange rate as an 18 decimal fixed point number.
// (eg) An oracle value of 1.5e18 it would mean 1 Ample is trading for $1.50.
IOracle public marketOracle;
// CPI value at the time of launch, as an 18 decimal fixed point number.
uint256 private baseCpi;
// If the current exchange rate is within this fractional distance from the target, no supply
// update is performed. Fixed point number--same format as the rate.
// (ie) abs(rate - targetRate) / targetRate < deviationThreshold, then no supply change.
// DECIMALS Fixed point number.
uint256 public deviationThreshold;
// The rebase lag parameter, used to dampen the applied supply adjustment by 1 / rebaseLag
// Check setRebaseLag comments for more details.
// Natural number, no decimal places.
uint256 public rebaseLag;
// More than this much time must pass between rebase operations.
uint256 public minRebaseTimeIntervalSec;
// Block timestamp of last rebase operation
uint256 public lastRebaseTimestampSec;
// The rebase window begins this many seconds into the minRebaseTimeInterval period.
// For example if minRebaseTimeInterval is 24hrs, it represents the time of day in seconds.
uint256 public rebaseWindowOffsetSec;
// The length of the time window where a rebase operation is allowed to execute, in seconds.
uint256 public rebaseWindowLengthSec;
// The number of rebase cycles since inception
uint256 public epoch;
uint256 private constant DECIMALS = 18;
// Due to the expression in computeSupplyDelta(), MAX_RATE * MAX_SUPPLY must fit into an int256.
// Both are 18 decimals fixed point numbers.
uint256 private constant MAX_RATE = 10**6 * 10**DECIMALS;
// MAX_SUPPLY = MAX_INT256 / MAX_RATE
uint256 private constant MAX_SUPPLY = ~(uint256(1) << 255) / MAX_RATE;
// This module orchestrates the rebase execution and downstream notification.
address public orchestrator;
address public deployer;
modifier onlyOrchestrator() {
}
modifier onlyDeployer() {
}
constructor() public {
}
/**
* @notice Initiates a new rebase operation, provided the minimum time period has elapsed.
*
* @dev The supply adjustment equals (_totalSupply * DeviationFromTargetRate) / rebaseLag
* Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate
* and targetRate is CpiOracleRate / baseCpi
*/
function rebase() external onlyOrchestrator {
require(<FILL_ME>)
// This comparison also ensures there is no reentrancy.
require(
lastRebaseTimestampSec.add(minRebaseTimeIntervalSec) < now,
"Not within interval"
);
// Snap the rebase time to the start of this window.
lastRebaseTimestampSec = now.sub(now.mod(minRebaseTimeIntervalSec)).add(
rebaseWindowOffsetSec
);
epoch = epoch.add(1);
uint256 targetRate = 10**DECIMALS;
uint256 exchangeRate;
bool rateValid;
(exchangeRate, rateValid) = marketOracle.getData();
require(rateValid, "Invalid rate");
if (exchangeRate > MAX_RATE) {
exchangeRate = MAX_RATE;
}
int256 supplyDelta = computeSupplyDelta(exchangeRate, targetRate);
// Apply the Dampening factor.
supplyDelta = supplyDelta.div(rebaseLag.toInt256Safe());
if (
supplyDelta > 0 &&
uFrags.totalSupply().add(uint256(supplyDelta)) > MAX_SUPPLY
) {
supplyDelta = (MAX_SUPPLY.sub(uFrags.totalSupply())).toInt256Safe();
}
uint256 supplyAfterRebase = uFrags.rebase(epoch, supplyDelta);
assert(supplyAfterRebase <= MAX_SUPPLY);
emit LogRebase(epoch, exchangeRate, supplyDelta, now);
}
/**
* @notice Sets the reference to the market oracle.
* @param marketOracle_ The address of the market oracle contract.
*/
function setMarketOracle(IOracle marketOracle_) external onlyDeployer {
}
/**
* @notice Sets the reference to the orchestrator.
* @param orchestrator_ The address of the orchestrator contract.
*/
function setOrchestrator(address orchestrator_) external onlyOwner {
}
/**
* @notice Sets the deviation threshold fraction. If the exchange rate given by the market
* oracle is within this fractional distance from the targetRate, then no supply
* modifications are made. DECIMALS fixed point number.
* @param deviationThreshold_ The new exchange rate threshold fraction.
*/
function setDeviationThreshold(uint256 deviationThreshold_)
external
onlyOwner
{
}
/**
* @notice Sets the rebase lag parameter.
It is used to dampen the applied supply adjustment by 1 / rebaseLag
If the rebase lag R, equals 1, the smallest value for R, then the full supply
correction is applied on each rebase cycle.
If it is greater than 1, then a correction of 1/R of is applied on each rebase.
* @param rebaseLag_ The new rebase lag parameter.
*/
function setRebaseLag(uint256 rebaseLag_) external onlyOwner {
}
/**
* @notice Sets the parameters which control the timing and frequency of
* rebase operations.
* a) the minimum time period that must elapse between rebase cycles.
* b) the rebase window offset parameter.
* c) the rebase window length parameter.
* @param minRebaseTimeIntervalSec_ More than this much time must pass between rebase
* operations, in seconds.
* @param rebaseWindowOffsetSec_ The number of seconds from the beginning of
the rebase interval, where the rebase window begins.
* @param rebaseWindowLengthSec_ The length of the rebase window in seconds.
*/
function setRebaseTimingParameters(
uint256 minRebaseTimeIntervalSec_,
uint256 rebaseWindowOffsetSec_,
uint256 rebaseWindowLengthSec_
) external onlyOwner {
}
/**
* @dev ZOS upgradable contract initialization method.
* It is called at the time of contract creation to invoke parent class initializers and
* initialize the contract's state variables.
*/
function initialize(address owner_, UFragments uFrags_)
public
onlyDeployer
initializer
{
}
/**
* @return If the latest block timestamp is within the rebase time window it, returns true.
* Otherwise, returns false.
*/
function inRebaseWindow() public view returns (bool) {
}
/**
* @return Computes the total supply adjustment in response to the exchange rate
* and the targetRate.
*/
function computeSupplyDelta(uint256 rate, uint256 targetRate)
private
view
returns (int256)
{
}
/**
* @param rate The current exchange rate, an 18 decimal fixed point number.
* @param targetRate The target exchange rate, an 18 decimal fixed point number.
* @return If the rate is within the deviation threshold from the target rate, returns true.
* Otherwise, returns false.
*/
function withinDeviationThreshold(uint256 rate, uint256 targetRate)
private
view
returns (bool)
{
}
}
| inRebaseWindow(),"Not in window" | 395,531 | inRebaseWindow() |
"Not within interval" | pragma solidity 0.4.24;
import "openzeppelin-eth/contracts/math/SafeMath.sol";
import "openzeppelin-eth/contracts/ownership/Ownable.sol";
import "./lib/SafeMathInt.sol";
import "./lib/UInt256Lib.sol";
import "./UFragments.sol";
interface IOracle {
function getData() external returns (uint256, bool);
}
/**
* @title uFragments Monetary Supply Policy
* @dev This is an implementation of the uFragments Ideal Money protocol.
* uFragments operates symmetrically on expansion and contraction. It will both split and
* combine coins to maintain a stable unit price.
*
* This component regulates the token supply of the uFragments ERC20 token in response to
* market oracles.
*/
contract UFragmentsPolicy is Ownable {
using SafeMath for uint256;
using SafeMathInt for int256;
using UInt256Lib for uint256;
event LogRebase(
uint256 indexed epoch,
uint256 exchangeRate,
int256 requestedSupplyAdjustment,
uint256 timestampSec
);
UFragments public uFrags;
// Market oracle provides the token/USD exchange rate as an 18 decimal fixed point number.
// (eg) An oracle value of 1.5e18 it would mean 1 Ample is trading for $1.50.
IOracle public marketOracle;
// CPI value at the time of launch, as an 18 decimal fixed point number.
uint256 private baseCpi;
// If the current exchange rate is within this fractional distance from the target, no supply
// update is performed. Fixed point number--same format as the rate.
// (ie) abs(rate - targetRate) / targetRate < deviationThreshold, then no supply change.
// DECIMALS Fixed point number.
uint256 public deviationThreshold;
// The rebase lag parameter, used to dampen the applied supply adjustment by 1 / rebaseLag
// Check setRebaseLag comments for more details.
// Natural number, no decimal places.
uint256 public rebaseLag;
// More than this much time must pass between rebase operations.
uint256 public minRebaseTimeIntervalSec;
// Block timestamp of last rebase operation
uint256 public lastRebaseTimestampSec;
// The rebase window begins this many seconds into the minRebaseTimeInterval period.
// For example if minRebaseTimeInterval is 24hrs, it represents the time of day in seconds.
uint256 public rebaseWindowOffsetSec;
// The length of the time window where a rebase operation is allowed to execute, in seconds.
uint256 public rebaseWindowLengthSec;
// The number of rebase cycles since inception
uint256 public epoch;
uint256 private constant DECIMALS = 18;
// Due to the expression in computeSupplyDelta(), MAX_RATE * MAX_SUPPLY must fit into an int256.
// Both are 18 decimals fixed point numbers.
uint256 private constant MAX_RATE = 10**6 * 10**DECIMALS;
// MAX_SUPPLY = MAX_INT256 / MAX_RATE
uint256 private constant MAX_SUPPLY = ~(uint256(1) << 255) / MAX_RATE;
// This module orchestrates the rebase execution and downstream notification.
address public orchestrator;
address public deployer;
modifier onlyOrchestrator() {
}
modifier onlyDeployer() {
}
constructor() public {
}
/**
* @notice Initiates a new rebase operation, provided the minimum time period has elapsed.
*
* @dev The supply adjustment equals (_totalSupply * DeviationFromTargetRate) / rebaseLag
* Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate
* and targetRate is CpiOracleRate / baseCpi
*/
function rebase() external onlyOrchestrator {
require(inRebaseWindow(), "Not in window");
// This comparison also ensures there is no reentrancy.
require(<FILL_ME>)
// Snap the rebase time to the start of this window.
lastRebaseTimestampSec = now.sub(now.mod(minRebaseTimeIntervalSec)).add(
rebaseWindowOffsetSec
);
epoch = epoch.add(1);
uint256 targetRate = 10**DECIMALS;
uint256 exchangeRate;
bool rateValid;
(exchangeRate, rateValid) = marketOracle.getData();
require(rateValid, "Invalid rate");
if (exchangeRate > MAX_RATE) {
exchangeRate = MAX_RATE;
}
int256 supplyDelta = computeSupplyDelta(exchangeRate, targetRate);
// Apply the Dampening factor.
supplyDelta = supplyDelta.div(rebaseLag.toInt256Safe());
if (
supplyDelta > 0 &&
uFrags.totalSupply().add(uint256(supplyDelta)) > MAX_SUPPLY
) {
supplyDelta = (MAX_SUPPLY.sub(uFrags.totalSupply())).toInt256Safe();
}
uint256 supplyAfterRebase = uFrags.rebase(epoch, supplyDelta);
assert(supplyAfterRebase <= MAX_SUPPLY);
emit LogRebase(epoch, exchangeRate, supplyDelta, now);
}
/**
* @notice Sets the reference to the market oracle.
* @param marketOracle_ The address of the market oracle contract.
*/
function setMarketOracle(IOracle marketOracle_) external onlyDeployer {
}
/**
* @notice Sets the reference to the orchestrator.
* @param orchestrator_ The address of the orchestrator contract.
*/
function setOrchestrator(address orchestrator_) external onlyOwner {
}
/**
* @notice Sets the deviation threshold fraction. If the exchange rate given by the market
* oracle is within this fractional distance from the targetRate, then no supply
* modifications are made. DECIMALS fixed point number.
* @param deviationThreshold_ The new exchange rate threshold fraction.
*/
function setDeviationThreshold(uint256 deviationThreshold_)
external
onlyOwner
{
}
/**
* @notice Sets the rebase lag parameter.
It is used to dampen the applied supply adjustment by 1 / rebaseLag
If the rebase lag R, equals 1, the smallest value for R, then the full supply
correction is applied on each rebase cycle.
If it is greater than 1, then a correction of 1/R of is applied on each rebase.
* @param rebaseLag_ The new rebase lag parameter.
*/
function setRebaseLag(uint256 rebaseLag_) external onlyOwner {
}
/**
* @notice Sets the parameters which control the timing and frequency of
* rebase operations.
* a) the minimum time period that must elapse between rebase cycles.
* b) the rebase window offset parameter.
* c) the rebase window length parameter.
* @param minRebaseTimeIntervalSec_ More than this much time must pass between rebase
* operations, in seconds.
* @param rebaseWindowOffsetSec_ The number of seconds from the beginning of
the rebase interval, where the rebase window begins.
* @param rebaseWindowLengthSec_ The length of the rebase window in seconds.
*/
function setRebaseTimingParameters(
uint256 minRebaseTimeIntervalSec_,
uint256 rebaseWindowOffsetSec_,
uint256 rebaseWindowLengthSec_
) external onlyOwner {
}
/**
* @dev ZOS upgradable contract initialization method.
* It is called at the time of contract creation to invoke parent class initializers and
* initialize the contract's state variables.
*/
function initialize(address owner_, UFragments uFrags_)
public
onlyDeployer
initializer
{
}
/**
* @return If the latest block timestamp is within the rebase time window it, returns true.
* Otherwise, returns false.
*/
function inRebaseWindow() public view returns (bool) {
}
/**
* @return Computes the total supply adjustment in response to the exchange rate
* and the targetRate.
*/
function computeSupplyDelta(uint256 rate, uint256 targetRate)
private
view
returns (int256)
{
}
/**
* @param rate The current exchange rate, an 18 decimal fixed point number.
* @param targetRate The target exchange rate, an 18 decimal fixed point number.
* @return If the rate is within the deviation threshold from the target rate, returns true.
* Otherwise, returns false.
*/
function withinDeviationThreshold(uint256 rate, uint256 targetRate)
private
view
returns (bool)
{
}
}
| lastRebaseTimestampSec.add(minRebaseTimeIntervalSec)<now,"Not within interval" | 395,531 | lastRebaseTimestampSec.add(minRebaseTimeIntervalSec)<now |
"Sent ether value is incorrect" | pragma solidity ^0.8.0;
contract SatoSamurais is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
uint256 public constant NFT_PRICE = 50000000000000000; // 0.05 ETH
uint public constant MAX_NFT_PURCHASE = 10;
uint256 public MAX_SUPPLY = 10000;
bool public saleIsActive = false;
uint256 public startingIndex;
uint256 public startingIndexBlock;
string private _baseURIExtended;
mapping (uint256 => string) _tokenURIs;
constructor() ERC721("SatoSamurais","SATO"){
}
function flipSaleState() public onlyOwner {
}
function withdraw() public onlyOwner {
}
function reserveTokens(uint256 num) public onlyOwner {
}
function mint(uint numberOfTokens) public payable {
require(saleIsActive, "Sale is not active at the moment");
require(numberOfTokens > 0, "Number of tokens can not be less than or equal to 0");
require(totalSupply().add(numberOfTokens) <= MAX_SUPPLY, "Purchase would exceed max supply");
require(numberOfTokens <= MAX_NFT_PURCHASE,"Can only mint up to 10 per purchase");
require(<FILL_ME>)
for (uint i = 0; i < numberOfTokens; i++) {
_safeMint(msg.sender, totalSupply());
}
}
function _baseURI() internal view virtual override returns (string memory) {
}
// Sets base URI for all tokens, only able to be called by contract owner
function setBaseURI(string memory baseURI_) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
}
| NFT_PRICE.mul(numberOfTokens)==msg.value,"Sent ether value is incorrect" | 395,548 | NFT_PRICE.mul(numberOfTokens)==msg.value |
"Invalid Holder" | pragma solidity ^0.5.7;
/**
* @title The GXToken Governance Contract
* @author NvestTechnologies
* @notice The GXToken Governance Contract is the core contract governing the allocation and withdrawals through a simple multi-sig mechanism.
*/
/**
* Copyright ©2019 Nvest Technologies. All rights reserved. Code contained within or this file cannot be copied, modified and / or distributed
* without the express written permission. Unauthorized copying or use of this file, via any medium is strictly prohibited.
*/
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract GX_Governance{
struct Holder{
uint256 origin_timestamp;
uint256 lockperiod;
uint256 break_point_timestamp; // used only for TeamFunds
uint256 request_init_timestamp;
uint256 request_end_timestamp;
uint256 allocation_percentage;
uint256 allocated_volume;
uint256 current_volume;
uint256 voting_count ;
uint256 transfer_volume;
mapping (address => bool) voting_validator;
bool valid;
}
uint256 public gx_total_supply = 350000000;
uint256 public decimal_factor = (10 ** 18);
mapping (address => Holder) public holders;
address public token_address = 0x60c87297A1fEaDC3C25993FfcadC54e99971e307;
address public admin1 = 0x3f7af1681465eED50772221f2Ff1D4395EC05b4a;
address public admin2 = 0x7cd63a912577D485312Df3b8Dde2b9D4Dc7030f2;
address public admin3 = 0x3481A3E8895Aa246890B0373AaCBC2Df84d34DbD;
/**
* @notice team_funds: These funds are only locked funds for over a period of two years and will be un-locked at the rate of 25% approximately for every 6 months.
*/
address public team_funds ;
address public development_funds;
address public exchanges;
address public public_sale;
address public legal_compliance_stragtegic_partners;
constructor() public{
}
event Message(string _message);
function set_funding_address (address _team_funds, address _development_funds, address _public_sale, address _exchanges, address _legal_compliance_stragtegic_partners) public {
}
/**
* @param _holder --> Contract address which holds the distributed funds.
* @param _to --> Address to which the funds are to be transferred.
* @param _volume --> Value of Funds to be transferred.
*/
function approve_transfer(address _holder, address _to, uint256 _volume) public returns(string memory){
ERC20Interface token = ERC20Interface(token_address);
require(msg.sender == admin1 || msg.sender == admin2 || msg.sender == admin3 , "Not an admin");
require(<FILL_ME>)
require(holders[_holder].current_volume > 0, "All allocated supply is already taken/transfered");
require(_volume > 0,"Enter greater than zero");
require(token.balanceOf(_holder) >= _volume);
if(_holder == team_funds){
require(now > holders[_holder].break_point_timestamp + holders[_holder].lockperiod,"Try after lockin period elapsed");
_volume = (holders[_holder].allocated_volume * 25)/ 100;
}
require(_volume <= holders[_holder].current_volume,"Insufficient Volume");
require(holders[_holder].voting_validator[msg.sender] == false ,"Already voted");
if(holders[_holder].voting_count == 0){
holders[_holder].voting_count = holders[_holder].voting_count + 1;
holders[_holder].transfer_volume = _volume;
holders[_holder].voting_validator[msg.sender] = true;
holders[_holder].request_init_timestamp = now;
holders[_holder].request_end_timestamp = now + (24 * 60 * 60); // 1 day validity of any request
emit Message("Vote Counted !!!");
return "Vote Counted !!!";
}
else{
require(holders[_holder].transfer_volume == _volume, "Please agree upon the same volume");
holders[_holder].voting_count = holders[_holder].voting_count + 1;
if(holders[_holder].voting_count >= 2){
if(now > holders[_holder].request_init_timestamp && now <= holders[_holder].request_end_timestamp){
token.transferFrom(_holder, _to, (holders[_holder].transfer_volume ) * decimal_factor);
holders[_holder].current_volume = holders[_holder].current_volume - holders[_holder].transfer_volume;
if(_holder == team_funds){
holders[_holder].break_point_timestamp = holders[_holder].break_point_timestamp + holders[_holder].lockperiod;
}
clear_values(_holder);
emit Message("Approve & Transfer Successfull");
return "true";
}
else {
clear_values(_holder);
emit Message("Request Expired");
return "Request Expired";
}
}
}
}
function clear_values(address _holder) internal {
}
function distribute_funds () public {
}
}
| holders[_holder].valid==true,"Invalid Holder" | 395,567 | holders[_holder].valid==true |
"All allocated supply is already taken/transfered" | pragma solidity ^0.5.7;
/**
* @title The GXToken Governance Contract
* @author NvestTechnologies
* @notice The GXToken Governance Contract is the core contract governing the allocation and withdrawals through a simple multi-sig mechanism.
*/
/**
* Copyright ©2019 Nvest Technologies. All rights reserved. Code contained within or this file cannot be copied, modified and / or distributed
* without the express written permission. Unauthorized copying or use of this file, via any medium is strictly prohibited.
*/
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract GX_Governance{
struct Holder{
uint256 origin_timestamp;
uint256 lockperiod;
uint256 break_point_timestamp; // used only for TeamFunds
uint256 request_init_timestamp;
uint256 request_end_timestamp;
uint256 allocation_percentage;
uint256 allocated_volume;
uint256 current_volume;
uint256 voting_count ;
uint256 transfer_volume;
mapping (address => bool) voting_validator;
bool valid;
}
uint256 public gx_total_supply = 350000000;
uint256 public decimal_factor = (10 ** 18);
mapping (address => Holder) public holders;
address public token_address = 0x60c87297A1fEaDC3C25993FfcadC54e99971e307;
address public admin1 = 0x3f7af1681465eED50772221f2Ff1D4395EC05b4a;
address public admin2 = 0x7cd63a912577D485312Df3b8Dde2b9D4Dc7030f2;
address public admin3 = 0x3481A3E8895Aa246890B0373AaCBC2Df84d34DbD;
/**
* @notice team_funds: These funds are only locked funds for over a period of two years and will be un-locked at the rate of 25% approximately for every 6 months.
*/
address public team_funds ;
address public development_funds;
address public exchanges;
address public public_sale;
address public legal_compliance_stragtegic_partners;
constructor() public{
}
event Message(string _message);
function set_funding_address (address _team_funds, address _development_funds, address _public_sale, address _exchanges, address _legal_compliance_stragtegic_partners) public {
}
/**
* @param _holder --> Contract address which holds the distributed funds.
* @param _to --> Address to which the funds are to be transferred.
* @param _volume --> Value of Funds to be transferred.
*/
function approve_transfer(address _holder, address _to, uint256 _volume) public returns(string memory){
ERC20Interface token = ERC20Interface(token_address);
require(msg.sender == admin1 || msg.sender == admin2 || msg.sender == admin3 , "Not an admin");
require(holders[_holder].valid == true,"Invalid Holder");
require(<FILL_ME>)
require(_volume > 0,"Enter greater than zero");
require(token.balanceOf(_holder) >= _volume);
if(_holder == team_funds){
require(now > holders[_holder].break_point_timestamp + holders[_holder].lockperiod,"Try after lockin period elapsed");
_volume = (holders[_holder].allocated_volume * 25)/ 100;
}
require(_volume <= holders[_holder].current_volume,"Insufficient Volume");
require(holders[_holder].voting_validator[msg.sender] == false ,"Already voted");
if(holders[_holder].voting_count == 0){
holders[_holder].voting_count = holders[_holder].voting_count + 1;
holders[_holder].transfer_volume = _volume;
holders[_holder].voting_validator[msg.sender] = true;
holders[_holder].request_init_timestamp = now;
holders[_holder].request_end_timestamp = now + (24 * 60 * 60); // 1 day validity of any request
emit Message("Vote Counted !!!");
return "Vote Counted !!!";
}
else{
require(holders[_holder].transfer_volume == _volume, "Please agree upon the same volume");
holders[_holder].voting_count = holders[_holder].voting_count + 1;
if(holders[_holder].voting_count >= 2){
if(now > holders[_holder].request_init_timestamp && now <= holders[_holder].request_end_timestamp){
token.transferFrom(_holder, _to, (holders[_holder].transfer_volume ) * decimal_factor);
holders[_holder].current_volume = holders[_holder].current_volume - holders[_holder].transfer_volume;
if(_holder == team_funds){
holders[_holder].break_point_timestamp = holders[_holder].break_point_timestamp + holders[_holder].lockperiod;
}
clear_values(_holder);
emit Message("Approve & Transfer Successfull");
return "true";
}
else {
clear_values(_holder);
emit Message("Request Expired");
return "Request Expired";
}
}
}
}
function clear_values(address _holder) internal {
}
function distribute_funds () public {
}
}
| holders[_holder].current_volume>0,"All allocated supply is already taken/transfered" | 395,567 | holders[_holder].current_volume>0 |
null | pragma solidity ^0.5.7;
/**
* @title The GXToken Governance Contract
* @author NvestTechnologies
* @notice The GXToken Governance Contract is the core contract governing the allocation and withdrawals through a simple multi-sig mechanism.
*/
/**
* Copyright ©2019 Nvest Technologies. All rights reserved. Code contained within or this file cannot be copied, modified and / or distributed
* without the express written permission. Unauthorized copying or use of this file, via any medium is strictly prohibited.
*/
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract GX_Governance{
struct Holder{
uint256 origin_timestamp;
uint256 lockperiod;
uint256 break_point_timestamp; // used only for TeamFunds
uint256 request_init_timestamp;
uint256 request_end_timestamp;
uint256 allocation_percentage;
uint256 allocated_volume;
uint256 current_volume;
uint256 voting_count ;
uint256 transfer_volume;
mapping (address => bool) voting_validator;
bool valid;
}
uint256 public gx_total_supply = 350000000;
uint256 public decimal_factor = (10 ** 18);
mapping (address => Holder) public holders;
address public token_address = 0x60c87297A1fEaDC3C25993FfcadC54e99971e307;
address public admin1 = 0x3f7af1681465eED50772221f2Ff1D4395EC05b4a;
address public admin2 = 0x7cd63a912577D485312Df3b8Dde2b9D4Dc7030f2;
address public admin3 = 0x3481A3E8895Aa246890B0373AaCBC2Df84d34DbD;
/**
* @notice team_funds: These funds are only locked funds for over a period of two years and will be un-locked at the rate of 25% approximately for every 6 months.
*/
address public team_funds ;
address public development_funds;
address public exchanges;
address public public_sale;
address public legal_compliance_stragtegic_partners;
constructor() public{
}
event Message(string _message);
function set_funding_address (address _team_funds, address _development_funds, address _public_sale, address _exchanges, address _legal_compliance_stragtegic_partners) public {
}
/**
* @param _holder --> Contract address which holds the distributed funds.
* @param _to --> Address to which the funds are to be transferred.
* @param _volume --> Value of Funds to be transferred.
*/
function approve_transfer(address _holder, address _to, uint256 _volume) public returns(string memory){
ERC20Interface token = ERC20Interface(token_address);
require(msg.sender == admin1 || msg.sender == admin2 || msg.sender == admin3 , "Not an admin");
require(holders[_holder].valid == true,"Invalid Holder");
require(holders[_holder].current_volume > 0, "All allocated supply is already taken/transfered");
require(_volume > 0,"Enter greater than zero");
require(<FILL_ME>)
if(_holder == team_funds){
require(now > holders[_holder].break_point_timestamp + holders[_holder].lockperiod,"Try after lockin period elapsed");
_volume = (holders[_holder].allocated_volume * 25)/ 100;
}
require(_volume <= holders[_holder].current_volume,"Insufficient Volume");
require(holders[_holder].voting_validator[msg.sender] == false ,"Already voted");
if(holders[_holder].voting_count == 0){
holders[_holder].voting_count = holders[_holder].voting_count + 1;
holders[_holder].transfer_volume = _volume;
holders[_holder].voting_validator[msg.sender] = true;
holders[_holder].request_init_timestamp = now;
holders[_holder].request_end_timestamp = now + (24 * 60 * 60); // 1 day validity of any request
emit Message("Vote Counted !!!");
return "Vote Counted !!!";
}
else{
require(holders[_holder].transfer_volume == _volume, "Please agree upon the same volume");
holders[_holder].voting_count = holders[_holder].voting_count + 1;
if(holders[_holder].voting_count >= 2){
if(now > holders[_holder].request_init_timestamp && now <= holders[_holder].request_end_timestamp){
token.transferFrom(_holder, _to, (holders[_holder].transfer_volume ) * decimal_factor);
holders[_holder].current_volume = holders[_holder].current_volume - holders[_holder].transfer_volume;
if(_holder == team_funds){
holders[_holder].break_point_timestamp = holders[_holder].break_point_timestamp + holders[_holder].lockperiod;
}
clear_values(_holder);
emit Message("Approve & Transfer Successfull");
return "true";
}
else {
clear_values(_holder);
emit Message("Request Expired");
return "Request Expired";
}
}
}
}
function clear_values(address _holder) internal {
}
function distribute_funds () public {
}
}
| token.balanceOf(_holder)>=_volume | 395,567 | token.balanceOf(_holder)>=_volume |
"Already voted" | pragma solidity ^0.5.7;
/**
* @title The GXToken Governance Contract
* @author NvestTechnologies
* @notice The GXToken Governance Contract is the core contract governing the allocation and withdrawals through a simple multi-sig mechanism.
*/
/**
* Copyright ©2019 Nvest Technologies. All rights reserved. Code contained within or this file cannot be copied, modified and / or distributed
* without the express written permission. Unauthorized copying or use of this file, via any medium is strictly prohibited.
*/
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract GX_Governance{
struct Holder{
uint256 origin_timestamp;
uint256 lockperiod;
uint256 break_point_timestamp; // used only for TeamFunds
uint256 request_init_timestamp;
uint256 request_end_timestamp;
uint256 allocation_percentage;
uint256 allocated_volume;
uint256 current_volume;
uint256 voting_count ;
uint256 transfer_volume;
mapping (address => bool) voting_validator;
bool valid;
}
uint256 public gx_total_supply = 350000000;
uint256 public decimal_factor = (10 ** 18);
mapping (address => Holder) public holders;
address public token_address = 0x60c87297A1fEaDC3C25993FfcadC54e99971e307;
address public admin1 = 0x3f7af1681465eED50772221f2Ff1D4395EC05b4a;
address public admin2 = 0x7cd63a912577D485312Df3b8Dde2b9D4Dc7030f2;
address public admin3 = 0x3481A3E8895Aa246890B0373AaCBC2Df84d34DbD;
/**
* @notice team_funds: These funds are only locked funds for over a period of two years and will be un-locked at the rate of 25% approximately for every 6 months.
*/
address public team_funds ;
address public development_funds;
address public exchanges;
address public public_sale;
address public legal_compliance_stragtegic_partners;
constructor() public{
}
event Message(string _message);
function set_funding_address (address _team_funds, address _development_funds, address _public_sale, address _exchanges, address _legal_compliance_stragtegic_partners) public {
}
/**
* @param _holder --> Contract address which holds the distributed funds.
* @param _to --> Address to which the funds are to be transferred.
* @param _volume --> Value of Funds to be transferred.
*/
function approve_transfer(address _holder, address _to, uint256 _volume) public returns(string memory){
ERC20Interface token = ERC20Interface(token_address);
require(msg.sender == admin1 || msg.sender == admin2 || msg.sender == admin3 , "Not an admin");
require(holders[_holder].valid == true,"Invalid Holder");
require(holders[_holder].current_volume > 0, "All allocated supply is already taken/transfered");
require(_volume > 0,"Enter greater than zero");
require(token.balanceOf(_holder) >= _volume);
if(_holder == team_funds){
require(now > holders[_holder].break_point_timestamp + holders[_holder].lockperiod,"Try after lockin period elapsed");
_volume = (holders[_holder].allocated_volume * 25)/ 100;
}
require(_volume <= holders[_holder].current_volume,"Insufficient Volume");
require(<FILL_ME>)
if(holders[_holder].voting_count == 0){
holders[_holder].voting_count = holders[_holder].voting_count + 1;
holders[_holder].transfer_volume = _volume;
holders[_holder].voting_validator[msg.sender] = true;
holders[_holder].request_init_timestamp = now;
holders[_holder].request_end_timestamp = now + (24 * 60 * 60); // 1 day validity of any request
emit Message("Vote Counted !!!");
return "Vote Counted !!!";
}
else{
require(holders[_holder].transfer_volume == _volume, "Please agree upon the same volume");
holders[_holder].voting_count = holders[_holder].voting_count + 1;
if(holders[_holder].voting_count >= 2){
if(now > holders[_holder].request_init_timestamp && now <= holders[_holder].request_end_timestamp){
token.transferFrom(_holder, _to, (holders[_holder].transfer_volume ) * decimal_factor);
holders[_holder].current_volume = holders[_holder].current_volume - holders[_holder].transfer_volume;
if(_holder == team_funds){
holders[_holder].break_point_timestamp = holders[_holder].break_point_timestamp + holders[_holder].lockperiod;
}
clear_values(_holder);
emit Message("Approve & Transfer Successfull");
return "true";
}
else {
clear_values(_holder);
emit Message("Request Expired");
return "Request Expired";
}
}
}
}
function clear_values(address _holder) internal {
}
function distribute_funds () public {
}
}
| holders[_holder].voting_validator[msg.sender]==false,"Already voted" | 395,567 | holders[_holder].voting_validator[msg.sender]==false |
"Please agree upon the same volume" | pragma solidity ^0.5.7;
/**
* @title The GXToken Governance Contract
* @author NvestTechnologies
* @notice The GXToken Governance Contract is the core contract governing the allocation and withdrawals through a simple multi-sig mechanism.
*/
/**
* Copyright ©2019 Nvest Technologies. All rights reserved. Code contained within or this file cannot be copied, modified and / or distributed
* without the express written permission. Unauthorized copying or use of this file, via any medium is strictly prohibited.
*/
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract GX_Governance{
struct Holder{
uint256 origin_timestamp;
uint256 lockperiod;
uint256 break_point_timestamp; // used only for TeamFunds
uint256 request_init_timestamp;
uint256 request_end_timestamp;
uint256 allocation_percentage;
uint256 allocated_volume;
uint256 current_volume;
uint256 voting_count ;
uint256 transfer_volume;
mapping (address => bool) voting_validator;
bool valid;
}
uint256 public gx_total_supply = 350000000;
uint256 public decimal_factor = (10 ** 18);
mapping (address => Holder) public holders;
address public token_address = 0x60c87297A1fEaDC3C25993FfcadC54e99971e307;
address public admin1 = 0x3f7af1681465eED50772221f2Ff1D4395EC05b4a;
address public admin2 = 0x7cd63a912577D485312Df3b8Dde2b9D4Dc7030f2;
address public admin3 = 0x3481A3E8895Aa246890B0373AaCBC2Df84d34DbD;
/**
* @notice team_funds: These funds are only locked funds for over a period of two years and will be un-locked at the rate of 25% approximately for every 6 months.
*/
address public team_funds ;
address public development_funds;
address public exchanges;
address public public_sale;
address public legal_compliance_stragtegic_partners;
constructor() public{
}
event Message(string _message);
function set_funding_address (address _team_funds, address _development_funds, address _public_sale, address _exchanges, address _legal_compliance_stragtegic_partners) public {
}
/**
* @param _holder --> Contract address which holds the distributed funds.
* @param _to --> Address to which the funds are to be transferred.
* @param _volume --> Value of Funds to be transferred.
*/
function approve_transfer(address _holder, address _to, uint256 _volume) public returns(string memory){
ERC20Interface token = ERC20Interface(token_address);
require(msg.sender == admin1 || msg.sender == admin2 || msg.sender == admin3 , "Not an admin");
require(holders[_holder].valid == true,"Invalid Holder");
require(holders[_holder].current_volume > 0, "All allocated supply is already taken/transfered");
require(_volume > 0,"Enter greater than zero");
require(token.balanceOf(_holder) >= _volume);
if(_holder == team_funds){
require(now > holders[_holder].break_point_timestamp + holders[_holder].lockperiod,"Try after lockin period elapsed");
_volume = (holders[_holder].allocated_volume * 25)/ 100;
}
require(_volume <= holders[_holder].current_volume,"Insufficient Volume");
require(holders[_holder].voting_validator[msg.sender] == false ,"Already voted");
if(holders[_holder].voting_count == 0){
holders[_holder].voting_count = holders[_holder].voting_count + 1;
holders[_holder].transfer_volume = _volume;
holders[_holder].voting_validator[msg.sender] = true;
holders[_holder].request_init_timestamp = now;
holders[_holder].request_end_timestamp = now + (24 * 60 * 60); // 1 day validity of any request
emit Message("Vote Counted !!!");
return "Vote Counted !!!";
}
else{
require(<FILL_ME>)
holders[_holder].voting_count = holders[_holder].voting_count + 1;
if(holders[_holder].voting_count >= 2){
if(now > holders[_holder].request_init_timestamp && now <= holders[_holder].request_end_timestamp){
token.transferFrom(_holder, _to, (holders[_holder].transfer_volume ) * decimal_factor);
holders[_holder].current_volume = holders[_holder].current_volume - holders[_holder].transfer_volume;
if(_holder == team_funds){
holders[_holder].break_point_timestamp = holders[_holder].break_point_timestamp + holders[_holder].lockperiod;
}
clear_values(_holder);
emit Message("Approve & Transfer Successfull");
return "true";
}
else {
clear_values(_holder);
emit Message("Request Expired");
return "Request Expired";
}
}
}
}
function clear_values(address _holder) internal {
}
function distribute_funds () public {
}
}
| holders[_holder].transfer_volume==_volume,"Please agree upon the same volume" | 395,567 | holders[_holder].transfer_volume==_volume |
null | // 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/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract FuckLootV2 is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable {
event GetFucked (address indexed buyer, uint256 startWith, uint256 batch);
address payable public mainWallet;
address payable public faucetWallet;
uint256 public totalMinted;
uint256 public burnCount;
uint256 public totalCount = 10000;
uint256 public maxBatch = 50;
uint256 public price = 1 * 10 ** 18;
uint256 public initialReserve = 21;
uint256 private nftsReserved;
string public baseURI;
bool private started;
string name_ = 'FUCKLOOT';
string symbol_ = 'FLOOT';
string baseURI_ = 'ipfs://QmQfwVxi1rFSxrXNW7VGVFJ1AXDmb6TRmgbdvu7De3G7AU/';
constructor() ERC721(name_, symbol_) {
}
function setBaseURI(string memory _newURI) public onlyOwner {
}
function changePrice(uint256 _newPrice) public onlyOwner {
}
function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner {
}
function setStart(bool _start) public onlyOwner {
}
function distributeFunds() public payable onlyOwner{
uint256 contract_balance = address(this).balance;
require(<FILL_ME>)
(bool sent, ) = payable(faucetWallet).call{value: ((contract_balance * 500) / 1000)}("");
require(sent);
}
function mintReservedNFTs(address[] memory to) public onlyOwner {
}
function changeMainWallet(address payable _newWallet) external onlyOwner {
}
function changeFaucetWallet(address payable _newWallet) external onlyOwner {
}
function distroDust() public onlyOwner {
}
function getFucked(uint256 _batchCount) payable public {
}
function walletInventory(address _owner) external view returns (uint256[] memory) {
}
/**
* Override isApprovedForAll to auto-approve OS's proxy contract
*/
function isApprovedForAll(
address _owner,
address _operator
) public override view returns (bool isOperator) {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function burn(uint256 tokenId) public {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
}
function _baseURI() internal view virtual override returns (string memory){
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
}
| payable(mainWallet).send((contract_balance*500)/1000) | 395,593 | payable(mainWallet).send((contract_balance*500)/1000) |
null | // 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/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract FuckLootV2 is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable {
event GetFucked (address indexed buyer, uint256 startWith, uint256 batch);
address payable public mainWallet;
address payable public faucetWallet;
uint256 public totalMinted;
uint256 public burnCount;
uint256 public totalCount = 10000;
uint256 public maxBatch = 50;
uint256 public price = 1 * 10 ** 18;
uint256 public initialReserve = 21;
uint256 private nftsReserved;
string public baseURI;
bool private started;
string name_ = 'FUCKLOOT';
string symbol_ = 'FLOOT';
string baseURI_ = 'ipfs://QmQfwVxi1rFSxrXNW7VGVFJ1AXDmb6TRmgbdvu7De3G7AU/';
constructor() ERC721(name_, symbol_) {
}
function setBaseURI(string memory _newURI) public onlyOwner {
}
function changePrice(uint256 _newPrice) public onlyOwner {
}
function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner {
}
function setStart(bool _start) public onlyOwner {
}
function distributeFunds() public payable onlyOwner{
}
function mintReservedNFTs(address[] memory to) public onlyOwner {
}
function changeMainWallet(address payable _newWallet) external onlyOwner {
}
function changeFaucetWallet(address payable _newWallet) external onlyOwner {
}
function distroDust() public onlyOwner {
uint256 contract_balance = address(this).balance;
require(<FILL_ME>)
}
function getFucked(uint256 _batchCount) payable public {
}
function walletInventory(address _owner) external view returns (uint256[] memory) {
}
/**
* Override isApprovedForAll to auto-approve OS's proxy contract
*/
function isApprovedForAll(
address _owner,
address _operator
) public override view returns (bool isOperator) {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function burn(uint256 tokenId) public {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
}
function _baseURI() internal view virtual override returns (string memory){
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
}
| payable(mainWallet).send(contract_balance) | 395,593 | payable(mainWallet).send(contract_balance) |
"Not enough inventory" | // 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/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract FuckLootV2 is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable {
event GetFucked (address indexed buyer, uint256 startWith, uint256 batch);
address payable public mainWallet;
address payable public faucetWallet;
uint256 public totalMinted;
uint256 public burnCount;
uint256 public totalCount = 10000;
uint256 public maxBatch = 50;
uint256 public price = 1 * 10 ** 18;
uint256 public initialReserve = 21;
uint256 private nftsReserved;
string public baseURI;
bool private started;
string name_ = 'FUCKLOOT';
string symbol_ = 'FLOOT';
string baseURI_ = 'ipfs://QmQfwVxi1rFSxrXNW7VGVFJ1AXDmb6TRmgbdvu7De3G7AU/';
constructor() ERC721(name_, symbol_) {
}
function setBaseURI(string memory _newURI) public onlyOwner {
}
function changePrice(uint256 _newPrice) public onlyOwner {
}
function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner {
}
function setStart(bool _start) public onlyOwner {
}
function distributeFunds() public payable onlyOwner{
}
function mintReservedNFTs(address[] memory to) public onlyOwner {
}
function changeMainWallet(address payable _newWallet) external onlyOwner {
}
function changeFaucetWallet(address payable _newWallet) external onlyOwner {
}
function distroDust() public onlyOwner {
}
function getFucked(uint256 _batchCount) payable public {
require(started, "Sale has not started");
require(_batchCount > 0 && _batchCount <= maxBatch, "Batch purchase limit exceeded");
require(<FILL_ME>)
require(msg.value == _batchCount * price, "Invalid value sent");
emit GetFucked(_msgSender(), totalMinted, _batchCount);
for(uint256 i=0; i < _batchCount; i++){
totalMinted++;
_safeMint(_msgSender(), totalMinted);
}
uint256 contract_balance = address(this).balance;
require(payable(mainWallet).send( (contract_balance * 500) / 1000));
(bool sent, ) = payable(faucetWallet).call{value: ((contract_balance * 500) / 1000)}("");
require(sent);
}
function walletInventory(address _owner) external view returns (uint256[] memory) {
}
/**
* Override isApprovedForAll to auto-approve OS's proxy contract
*/
function isApprovedForAll(
address _owner,
address _operator
) public override view returns (bool isOperator) {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Enumerable)
{
}
function burn(uint256 tokenId) public {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
}
function _baseURI() internal view virtual override returns (string memory){
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
}
}
| totalMinted+_batchCount+burnCount<=totalCount,"Not enough inventory" | 395,593 | totalMinted+_batchCount+burnCount<=totalCount |
null | /**
*Submitted for verification at Etherscan.io on 2021-10-06
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.0;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* @notice https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
library SafeMath {
/**
* SafeMath mul function
* @dev function for safe multiply, throws on overflow.
**/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* SafeMath div funciotn
* @dev function for safe devide, throws on overflow.
**/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* SafeMath sub function
* @dev function for safe subtraction, throws on overflow.
**/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* SafeMath add function
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
event NotPausable();
bool public paused = false;
bool public canPause = true;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(<FILL_ME>)
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
**/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
/**
* @dev Prevent the token from ever being paused again
**/
function notPausable() onlyOwner public{
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract GenslerCoin is StandardToken, Pausable {
string public constant NAME = "Gensler Coin";
string public constant SYMBOL = "GARY";
uint256 public constant DECIMALS = 18;
uint256 public constant INITIAL_SUPPLY = 69000000000 * 10**18;
/**
* @dev Transfer tokens when not paused
**/
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
}
/**
* @dev transferFrom function to tansfer tokens when token is not paused
**/
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
}
/**
* @dev approve spender when not paused
**/
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
/**
* @dev increaseApproval of spender when not paused
**/
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
}
/**
* @dev decreaseApproval of spender when not paused
**/
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
}
/**
* Pausable Token Constructor
* @dev Create and issue tokens to msg.sender.
*/
constructor() public {
}
}
| !paused||msg.sender==owner | 395,616 | !paused||msg.sender==owner |
"too early" | pragma solidity ^0.5.8;
/**
* @title The standard ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address, uint256) external returns (bool);
function approve(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed holder, address indexed spender, uint256 value);
}
/// @title Time-delayed ERC-20 wallet contract.
/// Can only transfer tokens after publicly recording the intention to do so
/// at least two weeks in advance.
contract SlowWallet {
// TYPES
struct TransferProposal {
address destination;
uint256 value;
uint256 time;
string notes;
bool closed;
}
// DATA
IERC20 public token;
uint256 public constant delay = 4 weeks;
address public owner;
// PROPOSALS
mapping (uint256 => TransferProposal) public proposals;
uint256 public proposalsLength;
// EVENTS
event TransferProposed(
uint256 index,
address indexed destination,
uint256 value,
uint256 delayUntil,
string notes
);
event TransferConfirmed(uint256 index, address indexed destination, uint256 value, string notes);
event TransferCancelled(uint256 index, address indexed destination, uint256 value, string notes);
event AllTransfersCancelled();
// FUNCTIONALITY
constructor(address tokenAddress) public {
}
modifier onlyOwner() {
}
/// Propose a new transfer, which can be confirmed after two weeks.
function propose(address destination, uint256 value, string calldata notes) external onlyOwner {
}
/// Cancel a proposed transfer.
function cancel(uint256 index, address addr, uint256 value) external onlyOwner {
}
/// Mark all proposals "void", in O(1).
function voidAll() external onlyOwner {
}
/// Confirm and execute a proposed transfer, if enough time has passed since it was proposed.
function confirm(uint256 index, address destination, uint256 value) external onlyOwner {
// Check authorization.
requireMatchingOpenProposal(index, destination, value);
// See commentary above about using `now`.
// solium-disable-next-line security/no-block-members
require(<FILL_ME>)
// Record execution of transfer.
proposals[index].closed = true;
emit TransferConfirmed(index, destination, value, proposals[index].notes);
// Proceed with execution of transfer.
require(token.transfer(destination, value));
}
/// Throw unless the given transfer proposal exists and matches `destination` and `value`.
function requireMatchingOpenProposal(uint256 index, address destination, uint256 value) private view {
}
}
| proposals[index].time<now,"too early" | 395,658 | proposals[index].time<now |
null | pragma solidity ^0.5.8;
/**
* @title The standard ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address, uint256) external returns (bool);
function approve(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed holder, address indexed spender, uint256 value);
}
/// @title Time-delayed ERC-20 wallet contract.
/// Can only transfer tokens after publicly recording the intention to do so
/// at least two weeks in advance.
contract SlowWallet {
// TYPES
struct TransferProposal {
address destination;
uint256 value;
uint256 time;
string notes;
bool closed;
}
// DATA
IERC20 public token;
uint256 public constant delay = 4 weeks;
address public owner;
// PROPOSALS
mapping (uint256 => TransferProposal) public proposals;
uint256 public proposalsLength;
// EVENTS
event TransferProposed(
uint256 index,
address indexed destination,
uint256 value,
uint256 delayUntil,
string notes
);
event TransferConfirmed(uint256 index, address indexed destination, uint256 value, string notes);
event TransferCancelled(uint256 index, address indexed destination, uint256 value, string notes);
event AllTransfersCancelled();
// FUNCTIONALITY
constructor(address tokenAddress) public {
}
modifier onlyOwner() {
}
/// Propose a new transfer, which can be confirmed after two weeks.
function propose(address destination, uint256 value, string calldata notes) external onlyOwner {
}
/// Cancel a proposed transfer.
function cancel(uint256 index, address addr, uint256 value) external onlyOwner {
}
/// Mark all proposals "void", in O(1).
function voidAll() external onlyOwner {
}
/// Confirm and execute a proposed transfer, if enough time has passed since it was proposed.
function confirm(uint256 index, address destination, uint256 value) external onlyOwner {
// Check authorization.
requireMatchingOpenProposal(index, destination, value);
// See commentary above about using `now`.
// solium-disable-next-line security/no-block-members
require(proposals[index].time < now, "too early");
// Record execution of transfer.
proposals[index].closed = true;
emit TransferConfirmed(index, destination, value, proposals[index].notes);
// Proceed with execution of transfer.
require(<FILL_ME>)
}
/// Throw unless the given transfer proposal exists and matches `destination` and `value`.
function requireMatchingOpenProposal(uint256 index, address destination, uint256 value) private view {
}
}
| token.transfer(destination,value) | 395,658 | token.transfer(destination,value) |
"transfer already closed" | pragma solidity ^0.5.8;
/**
* @title The standard ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address, uint256) external returns (bool);
function approve(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed holder, address indexed spender, uint256 value);
}
/// @title Time-delayed ERC-20 wallet contract.
/// Can only transfer tokens after publicly recording the intention to do so
/// at least two weeks in advance.
contract SlowWallet {
// TYPES
struct TransferProposal {
address destination;
uint256 value;
uint256 time;
string notes;
bool closed;
}
// DATA
IERC20 public token;
uint256 public constant delay = 4 weeks;
address public owner;
// PROPOSALS
mapping (uint256 => TransferProposal) public proposals;
uint256 public proposalsLength;
// EVENTS
event TransferProposed(
uint256 index,
address indexed destination,
uint256 value,
uint256 delayUntil,
string notes
);
event TransferConfirmed(uint256 index, address indexed destination, uint256 value, string notes);
event TransferCancelled(uint256 index, address indexed destination, uint256 value, string notes);
event AllTransfersCancelled();
// FUNCTIONALITY
constructor(address tokenAddress) public {
}
modifier onlyOwner() {
}
/// Propose a new transfer, which can be confirmed after two weeks.
function propose(address destination, uint256 value, string calldata notes) external onlyOwner {
}
/// Cancel a proposed transfer.
function cancel(uint256 index, address addr, uint256 value) external onlyOwner {
}
/// Mark all proposals "void", in O(1).
function voidAll() external onlyOwner {
}
/// Confirm and execute a proposed transfer, if enough time has passed since it was proposed.
function confirm(uint256 index, address destination, uint256 value) external onlyOwner {
}
/// Throw unless the given transfer proposal exists and matches `destination` and `value`.
function requireMatchingOpenProposal(uint256 index, address destination, uint256 value) private view {
require(index < proposalsLength, "index too high, or transfer voided");
require(<FILL_ME>)
// Slither reports "dangerous strict equality" for each of these, but it's OK.
// These equalities are to confirm that the transfer entered is equal to the
// matching previous transfer. We're vetting data entry; strict equality is appropriate.
require(proposals[index].destination == destination, "destination mismatched");
require(proposals[index].value == value, "value mismatched");
}
}
| !proposals[index].closed,"transfer already closed" | 395,658 | !proposals[index].closed |
"destination mismatched" | pragma solidity ^0.5.8;
/**
* @title The standard ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address, uint256) external returns (bool);
function approve(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed holder, address indexed spender, uint256 value);
}
/// @title Time-delayed ERC-20 wallet contract.
/// Can only transfer tokens after publicly recording the intention to do so
/// at least two weeks in advance.
contract SlowWallet {
// TYPES
struct TransferProposal {
address destination;
uint256 value;
uint256 time;
string notes;
bool closed;
}
// DATA
IERC20 public token;
uint256 public constant delay = 4 weeks;
address public owner;
// PROPOSALS
mapping (uint256 => TransferProposal) public proposals;
uint256 public proposalsLength;
// EVENTS
event TransferProposed(
uint256 index,
address indexed destination,
uint256 value,
uint256 delayUntil,
string notes
);
event TransferConfirmed(uint256 index, address indexed destination, uint256 value, string notes);
event TransferCancelled(uint256 index, address indexed destination, uint256 value, string notes);
event AllTransfersCancelled();
// FUNCTIONALITY
constructor(address tokenAddress) public {
}
modifier onlyOwner() {
}
/// Propose a new transfer, which can be confirmed after two weeks.
function propose(address destination, uint256 value, string calldata notes) external onlyOwner {
}
/// Cancel a proposed transfer.
function cancel(uint256 index, address addr, uint256 value) external onlyOwner {
}
/// Mark all proposals "void", in O(1).
function voidAll() external onlyOwner {
}
/// Confirm and execute a proposed transfer, if enough time has passed since it was proposed.
function confirm(uint256 index, address destination, uint256 value) external onlyOwner {
}
/// Throw unless the given transfer proposal exists and matches `destination` and `value`.
function requireMatchingOpenProposal(uint256 index, address destination, uint256 value) private view {
require(index < proposalsLength, "index too high, or transfer voided");
require(!proposals[index].closed, "transfer already closed");
// Slither reports "dangerous strict equality" for each of these, but it's OK.
// These equalities are to confirm that the transfer entered is equal to the
// matching previous transfer. We're vetting data entry; strict equality is appropriate.
require(<FILL_ME>)
require(proposals[index].value == value, "value mismatched");
}
}
| proposals[index].destination==destination,"destination mismatched" | 395,658 | proposals[index].destination==destination |
"value mismatched" | pragma solidity ^0.5.8;
/**
* @title The standard ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address, uint256) external returns (bool);
function approve(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed holder, address indexed spender, uint256 value);
}
/// @title Time-delayed ERC-20 wallet contract.
/// Can only transfer tokens after publicly recording the intention to do so
/// at least two weeks in advance.
contract SlowWallet {
// TYPES
struct TransferProposal {
address destination;
uint256 value;
uint256 time;
string notes;
bool closed;
}
// DATA
IERC20 public token;
uint256 public constant delay = 4 weeks;
address public owner;
// PROPOSALS
mapping (uint256 => TransferProposal) public proposals;
uint256 public proposalsLength;
// EVENTS
event TransferProposed(
uint256 index,
address indexed destination,
uint256 value,
uint256 delayUntil,
string notes
);
event TransferConfirmed(uint256 index, address indexed destination, uint256 value, string notes);
event TransferCancelled(uint256 index, address indexed destination, uint256 value, string notes);
event AllTransfersCancelled();
// FUNCTIONALITY
constructor(address tokenAddress) public {
}
modifier onlyOwner() {
}
/// Propose a new transfer, which can be confirmed after two weeks.
function propose(address destination, uint256 value, string calldata notes) external onlyOwner {
}
/// Cancel a proposed transfer.
function cancel(uint256 index, address addr, uint256 value) external onlyOwner {
}
/// Mark all proposals "void", in O(1).
function voidAll() external onlyOwner {
}
/// Confirm and execute a proposed transfer, if enough time has passed since it was proposed.
function confirm(uint256 index, address destination, uint256 value) external onlyOwner {
}
/// Throw unless the given transfer proposal exists and matches `destination` and `value`.
function requireMatchingOpenProposal(uint256 index, address destination, uint256 value) private view {
require(index < proposalsLength, "index too high, or transfer voided");
require(!proposals[index].closed, "transfer already closed");
// Slither reports "dangerous strict equality" for each of these, but it's OK.
// These equalities are to confirm that the transfer entered is equal to the
// matching previous transfer. We're vetting data entry; strict equality is appropriate.
require(proposals[index].destination == destination, "destination mismatched");
require(<FILL_ME>)
}
}
| proposals[index].value==value,"value mismatched" | 395,658 | proposals[index].value==value |
"Max supply exceeded" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "contracts/utils/Counters16.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "hardhat/console.sol";
contract MetaAthletes is ERC721, Pausable, Ownable {
using Counters16 for Counters16.Counter;
using Strings for uint256;
Counters16.Counter private _tokenIdCounter;
uint256 private _cost;
uint256 private _maxCountPerAccount;
uint256 private _maxSupply;
uint256 private _totalSupply;
bool private _openMinting;
bytes32 private _root;
string private _uri;
uint256[3] private _tiersIndex;
string[3] private _mapURIs;
mapping(address => uint16[]) private _ownerTokens;
constructor(string memory name, string memory symbol, string memory uri) ERC721(name, symbol) {
}
modifier mintCompliance(uint256 amount) {
uint256 supply = amount + balanceOf(_msgSender());
require(amount > 0 && supply <= _maxCountPerAccount, "Invalid mint amount");
require(<FILL_ME>)
_;
}
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns(string memory) {
}
function _getURI(uint256 tokenId) internal view returns(string memory) {
}
function ownerTokens(address owner) external view returns(uint16[] memory) {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function mint(uint256 amount, bytes32[] calldata proof) public payable whenNotPaused mintCompliance(amount) {
}
function _batchMint(address to, uint256 amount) internal {
}
function totalSupply() public view virtual returns (uint256) {
}
function withdraw() public onlyOwner {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
}
// getters / setters
function getCost() external view returns(uint256) {
}
function setCost(uint256 cost) external onlyOwner {
}
function getMaxCountPerAccount() external view returns(uint256) {
}
function setMaxCountPerAccount(uint256 maxCountPerAccount) external onlyOwner {
}
function getMaxSupply() external view returns(uint256) {
}
function setMaxSupply(uint256 maxSupply) external onlyOwner {
}
function getMapURIs(uint256 index) external view returns(string memory) {
}
function setBaseURI(string memory uri) external onlyOwner {
}
function setMapURIs(uint256 index, string memory uri) public onlyOwner {
}
function setTiersIndex(uint256[] memory values) external onlyOwner {
}
function getTiersIndex() external view returns(uint256[3] memory) {
}
function setRoot(bytes32 root) external onlyOwner {
}
function setOpenMinting(bool openMinting) external onlyOwner {
}
function getOpenMinting() external view returns(bool) {
}
}
| _totalSupply+supply<=_maxSupply,"Max supply exceeded" | 395,680 | _totalSupply+supply<=_maxSupply |
"Invalid proof" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "contracts/utils/Counters16.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "hardhat/console.sol";
contract MetaAthletes is ERC721, Pausable, Ownable {
using Counters16 for Counters16.Counter;
using Strings for uint256;
Counters16.Counter private _tokenIdCounter;
uint256 private _cost;
uint256 private _maxCountPerAccount;
uint256 private _maxSupply;
uint256 private _totalSupply;
bool private _openMinting;
bytes32 private _root;
string private _uri;
uint256[3] private _tiersIndex;
string[3] private _mapURIs;
mapping(address => uint16[]) private _ownerTokens;
constructor(string memory name, string memory symbol, string memory uri) ERC721(name, symbol) {
}
modifier mintCompliance(uint256 amount) {
}
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns(string memory) {
}
function _getURI(uint256 tokenId) internal view returns(string memory) {
}
function ownerTokens(address owner) external view returns(uint16[] memory) {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function mint(uint256 amount, bytes32[] calldata proof) public payable whenNotPaused mintCompliance(amount) {
require(msg.value == _cost * amount, "Insufficient funds");
require(_msgSender() == tx.origin, "No minting from contract call");
if(_openMinting == false) {
bytes32 leaf = keccak256(abi.encodePacked(_msgSender()));
require(<FILL_ME>)
}
_batchMint(_msgSender(),amount);
}
function _batchMint(address to, uint256 amount) internal {
}
function totalSupply() public view virtual returns (uint256) {
}
function withdraw() public onlyOwner {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
}
// getters / setters
function getCost() external view returns(uint256) {
}
function setCost(uint256 cost) external onlyOwner {
}
function getMaxCountPerAccount() external view returns(uint256) {
}
function setMaxCountPerAccount(uint256 maxCountPerAccount) external onlyOwner {
}
function getMaxSupply() external view returns(uint256) {
}
function setMaxSupply(uint256 maxSupply) external onlyOwner {
}
function getMapURIs(uint256 index) external view returns(string memory) {
}
function setBaseURI(string memory uri) external onlyOwner {
}
function setMapURIs(uint256 index, string memory uri) public onlyOwner {
}
function setTiersIndex(uint256[] memory values) external onlyOwner {
}
function getTiersIndex() external view returns(uint256[3] memory) {
}
function setRoot(bytes32 root) external onlyOwner {
}
function setOpenMinting(bool openMinting) external onlyOwner {
}
function getOpenMinting() external view returns(bool) {
}
}
| MerkleProof.verify(proof,_root,leaf),"Invalid proof" | 395,680 | MerkleProof.verify(proof,_root,leaf) |
null | contract BaseToken is MintableToken, PausableToken {
string public name; // solium-disable-line uppercase
string public symbol; // solium-disable-line uppercase
uint8 public constant decimals = 0; // solium-disable-line uppercase
uint public cap;
mapping(address => uint256) dividendBalanceOf;
uint256 public dividendPerToken;
mapping(address => uint256) dividendCreditedTo;
constructor(uint _cap, string _name, string _symbol) public {
}
function increaseTokenCap(uint _additionalTokensAmount) onlyOwner public {
}
function capReached() public view returns (bool) {
}
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
}
function isTokenHolder(address _address) public constant returns (bool) {
}
function updateDividends(address account) internal {
}
function depositDividends() public payable onlyOwner {
}
function claimDividends() public {
require(<FILL_ME>)
updateDividends(msg.sender);
uint256 amount = dividendBalanceOf[msg.sender];
dividendBalanceOf[msg.sender] = 0;
msg.sender.transfer(amount);
}
}
| isTokenHolder(msg.sender) | 395,838 | isTokenHolder(msg.sender) |
null | contract BaseIPO is Ownable {
using SafeMath for uint256;
address wallet;
bool public success = false;
bool public isFinalized = false;
enum Result {InProgress, Success, Failure}
Result public result = Result.InProgress;
enum State {Closed, IPO}
State public state = State.Closed;
uint public endTime;
uint public tokenPrice;
IpoVault public vault;
BaseToken public token;
event EventAdditionalSaleStarted(address ipoAddress, uint startTime);
event EventRefundSuccess(address ipoAddress, address beneficiary);
event EventBuyTokens(address ipoAddress, uint tokens, address beneficiary, uint weiAmount, uint tokenPrice);
event EventCreateIpoSuccess(address ipoContractAddress, address contractOwner, address tokenAddress);
event EventIpoFinalized(address ipoAddress, Result result);
constructor (
address _owner,
address _wallet,
address _platformWallet,
uint _tokenGoal,
uint _tokenPrice,
string _tokenName,
string _tokenSymbol,
uint _ipoPeriodInDays,
uint _platformFee
) public {
}
function getTokenAmount(uint weiAmount) internal view returns (uint) {
}
function isIpoPeriodOver() public view returns (bool) {
}
function buyTokens(address _beneficiary) public payable {
uint weiAmount = msg.value;
require(_beneficiary != address(0));
require(weiAmount > 0);
require(<FILL_ME>)
require(!isIpoPeriodOver());
require(state == State.IPO);
uint tokens = getTokenAmount(weiAmount);
token.mint(_beneficiary, tokens);
vault.deposit.value(msg.value)(msg.sender);
if (token.capReached()) {
finalizeIPO();
}
emit EventBuyTokens(address(this), tokens, msg.sender, weiAmount, tokenPrice);
}
function finalizeIPO() internal {
}
function claimRefund() public {
}
function payDividends() payable external onlyOwner {
}
function() external payable {
}
}
| !token.capReached() | 395,839 | !token.capReached() |
null | contract BaseIPO is Ownable {
using SafeMath for uint256;
address wallet;
bool public success = false;
bool public isFinalized = false;
enum Result {InProgress, Success, Failure}
Result public result = Result.InProgress;
enum State {Closed, IPO}
State public state = State.Closed;
uint public endTime;
uint public tokenPrice;
IpoVault public vault;
BaseToken public token;
event EventAdditionalSaleStarted(address ipoAddress, uint startTime);
event EventRefundSuccess(address ipoAddress, address beneficiary);
event EventBuyTokens(address ipoAddress, uint tokens, address beneficiary, uint weiAmount, uint tokenPrice);
event EventCreateIpoSuccess(address ipoContractAddress, address contractOwner, address tokenAddress);
event EventIpoFinalized(address ipoAddress, Result result);
constructor (
address _owner,
address _wallet,
address _platformWallet,
uint _tokenGoal,
uint _tokenPrice,
string _tokenName,
string _tokenSymbol,
uint _ipoPeriodInDays,
uint _platformFee
) public {
}
function getTokenAmount(uint weiAmount) internal view returns (uint) {
}
function isIpoPeriodOver() public view returns (bool) {
}
function buyTokens(address _beneficiary) public payable {
uint weiAmount = msg.value;
require(_beneficiary != address(0));
require(weiAmount > 0);
require(!token.capReached());
require(<FILL_ME>)
require(state == State.IPO);
uint tokens = getTokenAmount(weiAmount);
token.mint(_beneficiary, tokens);
vault.deposit.value(msg.value)(msg.sender);
if (token.capReached()) {
finalizeIPO();
}
emit EventBuyTokens(address(this), tokens, msg.sender, weiAmount, tokenPrice);
}
function finalizeIPO() internal {
}
function claimRefund() public {
}
function payDividends() payable external onlyOwner {
}
function() external payable {
}
}
| !isIpoPeriodOver() | 395,839 | !isIpoPeriodOver() |
null | contract BaseIPO is Ownable {
using SafeMath for uint256;
address wallet;
bool public success = false;
bool public isFinalized = false;
enum Result {InProgress, Success, Failure}
Result public result = Result.InProgress;
enum State {Closed, IPO}
State public state = State.Closed;
uint public endTime;
uint public tokenPrice;
IpoVault public vault;
BaseToken public token;
event EventAdditionalSaleStarted(address ipoAddress, uint startTime);
event EventRefundSuccess(address ipoAddress, address beneficiary);
event EventBuyTokens(address ipoAddress, uint tokens, address beneficiary, uint weiAmount, uint tokenPrice);
event EventCreateIpoSuccess(address ipoContractAddress, address contractOwner, address tokenAddress);
event EventIpoFinalized(address ipoAddress, Result result);
constructor (
address _owner,
address _wallet,
address _platformWallet,
uint _tokenGoal,
uint _tokenPrice,
string _tokenName,
string _tokenSymbol,
uint _ipoPeriodInDays,
uint _platformFee
) public {
}
function getTokenAmount(uint weiAmount) internal view returns (uint) {
}
function isIpoPeriodOver() public view returns (bool) {
}
function buyTokens(address _beneficiary) public payable {
}
function finalizeIPO() internal {
}
function claimRefund() public {
require(<FILL_ME>)
if (isIpoPeriodOver() && !isFinalized) {
finalizeIPO();
}
require(isFinalized);
require(!token.capReached());
vault.refund(msg.sender);
emit EventRefundSuccess(address(this), msg.sender);
}
function payDividends() payable external onlyOwner {
}
function() external payable {
}
}
| token.isTokenHolder(msg.sender) | 395,839 | token.isTokenHolder(msg.sender) |
'create binary executor not authorized' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
require(executionParams.targets.length != 0, 'create binary invalid empty targets');
require(
executionParams.targets.length == executionParams.weiValues.length &&
executionParams.targets.length == executionParams.signatures.length &&
executionParams.targets.length == executionParams.calldatas.length &&
executionParams.targets.length == executionParams.withDelegatecalls.length,
'create binary inconsistent params length'
);
require(<FILL_ME>)
require(
isVotingPowerStrategyAuthorized(address(strategy)),
'create binary strategy not authorized'
);
proposalId = _proposalsCount;
require(
IProposalValidator(address(executor)).validateBinaryProposalCreation(
strategy,
msg.sender,
startTime,
endTime,
_daoOperator
),
'validate proposal creation invalid'
);
ProposalWithoutVote storage newProposalData = _proposals[proposalId].proposalData;
newProposalData.id = proposalId;
newProposalData.proposalType = ProposalType.Binary;
newProposalData.creator = msg.sender;
newProposalData.executor = executor;
newProposalData.targets = executionParams.targets;
newProposalData.weiValues = executionParams.weiValues;
newProposalData.signatures = executionParams.signatures;
newProposalData.calldatas = executionParams.calldatas;
newProposalData.withDelegatecalls = executionParams.withDelegatecalls;
newProposalData.startTime = startTime;
newProposalData.endTime = endTime;
newProposalData.strategy = strategy;
newProposalData.link = link;
// only 2 options, YES and NO
newProposalData.options.push('YES');
newProposalData.options.push('NO');
newProposalData.voteCounts.push(0);
newProposalData.voteCounts.push(0);
// use max voting power to finalise the proposal
newProposalData.maxVotingPower = strategy.getMaxVotingPower();
_proposalsCount++;
// call strategy to record data if needed
strategy.handleProposalCreation(proposalId, startTime, endTime);
emit BinaryProposalCreated(
proposalId,
msg.sender,
executor,
strategy,
executionParams.targets,
executionParams.weiValues,
executionParams.signatures,
executionParams.calldatas,
executionParams.withDelegatecalls,
startTime,
endTime,
link,
newProposalData.maxVotingPower
);
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| isExecutorAuthorized(address(executor)),'create binary executor not authorized' | 395,851 | isExecutorAuthorized(address(executor)) |
'create binary strategy not authorized' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
require(executionParams.targets.length != 0, 'create binary invalid empty targets');
require(
executionParams.targets.length == executionParams.weiValues.length &&
executionParams.targets.length == executionParams.signatures.length &&
executionParams.targets.length == executionParams.calldatas.length &&
executionParams.targets.length == executionParams.withDelegatecalls.length,
'create binary inconsistent params length'
);
require(isExecutorAuthorized(address(executor)), 'create binary executor not authorized');
require(<FILL_ME>)
proposalId = _proposalsCount;
require(
IProposalValidator(address(executor)).validateBinaryProposalCreation(
strategy,
msg.sender,
startTime,
endTime,
_daoOperator
),
'validate proposal creation invalid'
);
ProposalWithoutVote storage newProposalData = _proposals[proposalId].proposalData;
newProposalData.id = proposalId;
newProposalData.proposalType = ProposalType.Binary;
newProposalData.creator = msg.sender;
newProposalData.executor = executor;
newProposalData.targets = executionParams.targets;
newProposalData.weiValues = executionParams.weiValues;
newProposalData.signatures = executionParams.signatures;
newProposalData.calldatas = executionParams.calldatas;
newProposalData.withDelegatecalls = executionParams.withDelegatecalls;
newProposalData.startTime = startTime;
newProposalData.endTime = endTime;
newProposalData.strategy = strategy;
newProposalData.link = link;
// only 2 options, YES and NO
newProposalData.options.push('YES');
newProposalData.options.push('NO');
newProposalData.voteCounts.push(0);
newProposalData.voteCounts.push(0);
// use max voting power to finalise the proposal
newProposalData.maxVotingPower = strategy.getMaxVotingPower();
_proposalsCount++;
// call strategy to record data if needed
strategy.handleProposalCreation(proposalId, startTime, endTime);
emit BinaryProposalCreated(
proposalId,
msg.sender,
executor,
strategy,
executionParams.targets,
executionParams.weiValues,
executionParams.signatures,
executionParams.calldatas,
executionParams.withDelegatecalls,
startTime,
endTime,
link,
newProposalData.maxVotingPower
);
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| isVotingPowerStrategyAuthorized(address(strategy)),'create binary strategy not authorized' | 395,851 | isVotingPowerStrategyAuthorized(address(strategy)) |
'validate proposal creation invalid' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
require(executionParams.targets.length != 0, 'create binary invalid empty targets');
require(
executionParams.targets.length == executionParams.weiValues.length &&
executionParams.targets.length == executionParams.signatures.length &&
executionParams.targets.length == executionParams.calldatas.length &&
executionParams.targets.length == executionParams.withDelegatecalls.length,
'create binary inconsistent params length'
);
require(isExecutorAuthorized(address(executor)), 'create binary executor not authorized');
require(
isVotingPowerStrategyAuthorized(address(strategy)),
'create binary strategy not authorized'
);
proposalId = _proposalsCount;
require(<FILL_ME>)
ProposalWithoutVote storage newProposalData = _proposals[proposalId].proposalData;
newProposalData.id = proposalId;
newProposalData.proposalType = ProposalType.Binary;
newProposalData.creator = msg.sender;
newProposalData.executor = executor;
newProposalData.targets = executionParams.targets;
newProposalData.weiValues = executionParams.weiValues;
newProposalData.signatures = executionParams.signatures;
newProposalData.calldatas = executionParams.calldatas;
newProposalData.withDelegatecalls = executionParams.withDelegatecalls;
newProposalData.startTime = startTime;
newProposalData.endTime = endTime;
newProposalData.strategy = strategy;
newProposalData.link = link;
// only 2 options, YES and NO
newProposalData.options.push('YES');
newProposalData.options.push('NO');
newProposalData.voteCounts.push(0);
newProposalData.voteCounts.push(0);
// use max voting power to finalise the proposal
newProposalData.maxVotingPower = strategy.getMaxVotingPower();
_proposalsCount++;
// call strategy to record data if needed
strategy.handleProposalCreation(proposalId, startTime, endTime);
emit BinaryProposalCreated(
proposalId,
msg.sender,
executor,
strategy,
executionParams.targets,
executionParams.weiValues,
executionParams.signatures,
executionParams.calldatas,
executionParams.withDelegatecalls,
startTime,
endTime,
link,
newProposalData.maxVotingPower
);
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| IProposalValidator(address(executor)).validateBinaryProposalCreation(strategy,msg.sender,startTime,endTime,_daoOperator),'validate proposal creation invalid' | 395,851 | IProposalValidator(address(executor)).validateBinaryProposalCreation(strategy,msg.sender,startTime,endTime,_daoOperator) |
'validate proposal creation invalid' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
require(
isExecutorAuthorized(address(executor)),
'create generic executor not authorized'
);
require(
isVotingPowerStrategyAuthorized(address(strategy)),
'create generic strategy not authorized'
);
proposalId = _proposalsCount;
require(<FILL_ME>)
Proposal storage newProposal = _proposals[proposalId];
ProposalWithoutVote storage newProposalData = newProposal.proposalData;
newProposalData.id = proposalId;
newProposalData.proposalType = ProposalType.Generic;
newProposalData.creator = msg.sender;
newProposalData.executor = executor;
newProposalData.startTime = startTime;
newProposalData.endTime = endTime;
newProposalData.strategy = strategy;
newProposalData.link = link;
newProposalData.options = options;
newProposalData.voteCounts = new uint256[](options.length);
// use max voting power to finalise the proposal
newProposalData.maxVotingPower = strategy.getMaxVotingPower();
_proposalsCount++;
// call strategy to record data if needed
strategy.handleProposalCreation(proposalId, startTime, endTime);
emit GenericProposalCreated(
proposalId,
msg.sender,
executor,
strategy,
options,
startTime,
endTime,
link,
newProposalData.maxVotingPower
);
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| IProposalValidator(address(executor)).validateGenericProposalCreation(strategy,msg.sender,startTime,endTime,options,_daoOperator),'validate proposal creation invalid' | 395,851 | IProposalValidator(address(executor)).validateGenericProposalCreation(strategy,msg.sender,startTime,endTime,options,_daoOperator) |
'invalid state to queue' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
require(proposalId < _proposalsCount, 'invalid proposal id');
require(<FILL_ME>)
ProposalWithoutVote storage proposal = _proposals[proposalId].proposalData;
// generic proposal does not have Succeeded state
assert(proposal.proposalType == ProposalType.Binary);
uint256 executionTime = block.timestamp.add(proposal.executor.getDelay());
for (uint256 i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(
proposal.executor,
proposal.targets[i],
proposal.weiValues[i],
proposal.signatures[i],
proposal.calldatas[i],
executionTime,
proposal.withDelegatecalls[i]
);
}
proposal.executionTime = executionTime;
emit ProposalQueued(proposalId, executionTime, msg.sender);
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| getProposalState(proposalId)==ProposalState.Succeeded,'invalid state to queue' | 395,851 | getProposalState(proposalId)==ProposalState.Succeeded |
'only queued proposals' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
require(proposalId < _proposalsCount, 'invalid proposal id');
require(<FILL_ME>)
ProposalWithoutVote storage proposal = _proposals[proposalId].proposalData;
// generic proposal does not have Queued state
assert(proposal.proposalType == ProposalType.Binary);
proposal.executed = true;
for (uint256 i = 0; i < proposal.targets.length; i++) {
proposal.executor.executeTransaction{value: proposal.weiValues[i]}(
proposal.targets[i],
proposal.weiValues[i],
proposal.signatures[i],
proposal.calldatas[i],
proposal.executionTime,
proposal.withDelegatecalls[i]
);
}
emit ProposalExecuted(proposalId, msg.sender);
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| getProposalState(proposalId)==ProposalState.Queued,'only queued proposals' | 395,851 | getProposalState(proposalId)==ProposalState.Queued |
'invalid voting power strategy' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
uint224 safeNewVotingPower = _safeUint224(newVotingPower);
for (uint256 i = 0; i < proposalIds.length; i++) {
// only update for active proposals
if (getProposalState(proposalIds[i]) != ProposalState.Active) continue;
ProposalWithoutVote storage proposal = _proposals[proposalIds[i]].proposalData;
require(<FILL_ME>)
Vote memory vote = _proposals[proposalIds[i]].votes[voter];
if (vote.optionBitMask == 0) continue; // not voted yet
uint256 oldVotingPower = uint256(vote.votingPower);
// update totalVotes of the proposal
proposal.totalVotes = proposal.totalVotes.add(newVotingPower).sub(oldVotingPower);
for (uint256 j = 0; j < proposal.options.length; j++) {
if (vote.optionBitMask & (2**j) == 2**j) {
// update voteCounts for each voted option
proposal.voteCounts[j] = proposal.voteCounts[j].add(newVotingPower).sub(oldVotingPower);
}
}
// update voting power of the voter
_proposals[proposalIds[i]].votes[voter].votingPower = safeNewVotingPower;
emit VotingPowerChanged(
proposalIds[i],
voter,
vote.optionBitMask,
vote.votingPower,
safeNewVotingPower
);
}
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| address(proposal.strategy)==msg.sender,'invalid voting power strategy' | 395,851 | address(proposal.strategy)==msg.sender |
'duplicated action' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
require(<FILL_ME>)
executor.queueTransaction(target, value, signature, callData, executionTime, withDelegatecall);
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| !executor.isActionQueued(keccak256(abi.encode(target,value,signature,callData,executionTime,withDelegatecall))),'duplicated action' | 395,851 | !executor.isActionQueued(keccak256(abi.encode(target,value,signature,callData,executionTime,withDelegatecall))) |
'voting closed' | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
import {IExecutorWithTimelock} from '../interfaces/governance/IExecutorWithTimelock.sol';
import {IVotingPowerStrategy} from '../interfaces/governance/IVotingPowerStrategy.sol';
import {IProposalValidator} from '../interfaces/governance/IProposalValidator.sol';
import {getChainId} from '../misc/Helpers.sol';
/**
* @title Kyber Governance contract for Kyber 3.0
* - Create a Proposal
* - Cancel a Proposal
* - Queue a Proposal
* - Execute a Proposal
* - Submit Vote to a Proposal
* Proposal States : Pending => Active => Succeeded(/Failed/Finalized)
* => Queued => Executed(/Expired)
* The transition to "Canceled" can appear in multiple states
**/
contract KyberGovernance is IKyberGovernance, PermissionAdmin {
using SafeMath for uint256;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,uint256 chainId,address verifyingContract)'
);
bytes32 public constant VOTE_EMITTED_TYPEHASH = keccak256(
'VoteEmitted(uint256 id,uint256 optionBitMask)'
);
string public constant NAME = 'Kyber Governance';
address private _daoOperator;
uint256 private _proposalsCount;
mapping(uint256 => Proposal) private _proposals;
mapping(address => bool) private _authorizedExecutors;
mapping(address => bool) private _authorizedVotingPowerStrategies;
constructor(
address admin,
address daoOperator,
address[] memory executors,
address[] memory votingPowerStrategies
) PermissionAdmin(admin) {
}
/**
* @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator)
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param executionParams data for execution, includes
* targets list of contracts called by proposal's associated transactions
* weiValues list of value in wei for each proposal's associated transaction
* signatures list of function signatures (can be empty) to be used when created the callData
* calldatas list of calldatas: if associated signature empty,
* calldata ready, else calldata is arguments
* withDelegatecalls boolean, true = transaction delegatecalls the taget,
* else calls the target
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createBinaryProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
BinaryProposalParams memory executionParams,
uint256 startTime,
uint256 endTime,
string memory link
) external override returns (uint256 proposalId) {
}
/**
* @dev Creates a Generic Proposal (needs to be validated by the Proposal Validator)
* It only gets the winning option without any executions
* @param executor The ExecutorWithTimelock contract that will execute the proposal
* @param strategy voting power strategy of the proposal
* @param options list of options to vote for
* @param startTime start timestamp to allow vote
* @param endTime end timestamp of the proposal
* @param link link to the proposal description
**/
function createGenericProposal(
IExecutorWithTimelock executor,
IVotingPowerStrategy strategy,
string[] memory options,
uint256 startTime,
uint256 endTime,
string memory link
)
external override returns (uint256 proposalId)
{
}
/**
* @dev Cancels a Proposal.
* - Callable by the _daoOperator with relaxed conditions,
* or by anybody if the conditions of cancellation on the executor are fulfilled
* @param proposalId id of the proposal
**/
function cancel(uint256 proposalId) external override {
}
/**
* @dev Queue the proposal (If Proposal Succeeded), only for Binary proposals
* @param proposalId id of the proposal to queue
**/
function queue(uint256 proposalId) external override {
}
/**
* @dev Execute the proposal (If Proposal Queued), only for Binary proposals
* @param proposalId id of the proposal to execute
**/
function execute(uint256 proposalId) external override payable {
}
/**
* @dev Function allowing msg.sender to vote for/against a proposal
* @param proposalId id of the proposal
* @param optionBitMask bitmask optionBitMask of voter
* for Binary Proposal, optionBitMask should be either 1 or 2 (Accept/Reject)
* for Generic Proposal, optionBitMask is the bitmask of voted options
**/
function submitVote(uint256 proposalId, uint256 optionBitMask) external override {
}
/**
* @dev Function to register the vote of user that has voted offchain via signature
* @param proposalId id of the proposal
* @param optionBitMask the bit mask of voted options
* @param v v part of the voter signature
* @param r r part of the voter signature
* @param s s part of the voter signature
**/
function submitVoteBySignature(
uint256 proposalId,
uint256 optionBitMask,
uint8 v,
bytes32 r,
bytes32 s
) external override {
}
/**
* @dev Function to handle voting power changed for a voter
* caller must be the voting power strategy of the proposal
* @param voter address that has changed the voting power
* @param newVotingPower new voting power of that address,
* old voting power can be taken from records
* @param proposalIds list proposal ids that belongs to this voting power strategy
* should update the voteCound of the active proposals in the list
**/
function handleVotingPowerChanged(
address voter,
uint256 newVotingPower,
uint256[] calldata proposalIds
) external override {
}
/**
* @dev Transfer dao operator
* @param newDaoOperator new dao operator
**/
function transferDaoOperator(address newDaoOperator) external {
}
/**
* @dev Add new addresses to the list of authorized executors
* @param executors list of new addresses to be authorized executors
**/
function authorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized executors
* @param executors list of addresses to be removed as authorized executors
**/
function unauthorizeExecutors(address[] memory executors)
public override onlyAdmin
{
}
/**
* @dev Add new addresses to the list of authorized strategies
* @param strategies list of new addresses to be authorized strategies
**/
function authorizeVotingPowerStrategies(address[] memory strategies)
public override onlyAdmin
{
}
/**
* @dev Remove addresses to the list of authorized strategies
* @param strategies list of addresses to be removed as authorized strategies
**/
function unauthorizeVotingPowerStrategies(address[] memory strategies)
public
override
onlyAdmin
{
}
/**
* @dev Returns whether an address is an authorized executor
* @param executor address to evaluate as authorized executor
* @return true if authorized
**/
function isExecutorAuthorized(address executor) public override view returns (bool) {
}
/**
* @dev Returns whether an address is an authorized strategy
* @param strategy address to evaluate as authorized strategy
* @return true if authorized
**/
function isVotingPowerStrategyAuthorized(address strategy) public override view returns (bool) {
}
/**
* @dev Getter the address of the daoOperator, that can mainly cancel proposals
* @return The address of the daoOperator
**/
function getDaoOperator() external override view returns (address) {
}
/**
* @dev Getter of the proposal count (the current number of proposals ever created)
* @return the proposal count
**/
function getProposalsCount() external override view returns (uint256) {
}
/**
* @dev Getter of a proposal by id
* @param proposalId id of the proposal to get
* @return the proposal as ProposalWithoutVote memory object
**/
function getProposalById(uint256 proposalId)
external
override
view
returns (ProposalWithoutVote memory)
{
}
/**
* @dev Getter of the vote data of a proposal by id
* including totalVotes, voteCounts and options
* @param proposalId id of the proposal
* @return (totalVotes, voteCounts, options)
**/
function getProposalVoteDataById(uint256 proposalId)
external
override
view
returns (
uint256,
uint256[] memory,
string[] memory
)
{
}
/**
* @dev Getter of the Vote of a voter about a proposal
* Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower})
* @param proposalId id of the proposal
* @param voter address of the voter
* @return The associated Vote memory object
**/
function getVoteOnProposal(uint256 proposalId, address voter)
external
override
view
returns (Vote memory)
{
}
/**
* @dev Get the current state of a proposal
* @param proposalId id of the proposal
* @return The current state if the proposal
**/
function getProposalState(uint256 proposalId) public override view returns (ProposalState) {
}
function _queueOrRevert(
IExecutorWithTimelock executor,
address target,
uint256 value,
string memory signature,
bytes memory callData,
uint256 executionTime,
bool withDelegatecall
) internal {
}
function _submitVote(
address voter,
uint256 proposalId,
uint256 optionBitMask
) internal {
require(proposalId < _proposalsCount, 'invalid proposal id');
require(<FILL_ME>)
ProposalWithoutVote storage proposal = _proposals[proposalId].proposalData;
uint256 numOptions = proposal.options.length;
if (proposal.proposalType == ProposalType.Binary) {
// either Yes (1) or No (2)
require(optionBitMask == 1 || optionBitMask == 2, 'wrong vote for binary proposal');
} else {
require(
optionBitMask > 0 && optionBitMask < 2**numOptions,
'invalid options for generic proposal'
);
}
Vote memory vote = _proposals[proposalId].votes[voter];
uint256 votingPower = proposal.strategy.handleVote(voter, proposalId, optionBitMask);
if (vote.optionBitMask == 0) {
// first time vote, increase the totalVotes of the proposal
proposal.totalVotes = proposal.totalVotes.add(votingPower);
}
for (uint256 i = 0; i < proposal.options.length; i++) {
bool hasVoted = (vote.optionBitMask & (2**i)) == 2**i;
bool isVoting = (optionBitMask & (2**i)) == 2**i;
if (hasVoted && !isVoting) {
proposal.voteCounts[i] = proposal.voteCounts[i].sub(votingPower);
} else if (!hasVoted && isVoting) {
proposal.voteCounts[i] = proposal.voteCounts[i].add(votingPower);
}
}
_proposals[proposalId].votes[voter] = Vote({
optionBitMask: _safeUint32(optionBitMask),
votingPower: _safeUint224(votingPower)
});
emit VoteEmitted(proposalId, voter, _safeUint32(optionBitMask), _safeUint224(votingPower));
}
function _authorizeExecutors(address[] memory executors) internal {
}
function _unauthorizeExecutors(address[] memory executors) internal {
}
function _authorizeVotingPowerStrategies(address[] memory strategies) internal {
}
function _unauthorizedVotingPowerStrategies(address[] memory strategies) internal {
}
function _safeUint224(uint256 value) internal pure returns (uint224) {
}
function _safeUint32(uint256 value) internal pure returns (uint32) {
}
}
| getProposalState(proposalId)==ProposalState.Active,'voting closed' | 395,851 | getProposalState(proposalId)==ProposalState.Active |
"Cooldown in effect" | pragma solidity >=0.7.0 <0.8.0;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract INSPECTORCRYPTO is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => uint256) private _lastTX;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private _isBlacklisted;
address[] private _excluded;
bool public tradingLive = false;
uint256 private _totalSupply = 1000000000 * 10**18;
uint256 public _totalBurned;
string private _name = "Inspector Crypto";
string private _symbol = "GADGET";
uint8 private _decimals = 18;
address payable private _inspectorCrypto;
address payable private _brain;
uint256 public firstLiveBlock;
uint256 public _wowsers = 4;
uint256 public _goGoGadget = 9;
uint256 private _previousWowsers = _wowsers;
uint256 private _previousGoGadget = _goGoGadget;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
bool public antiBotLaunch = true;
uint256 public _maxTxAmount;
uint256 public _maxHoldings = 50000000 * 10**18; //5%
bool public maxHoldingsEnabled = true;
bool public maxTXEnabled = true;
bool public antiSnipe = true;
bool public savePenny = true;
bool public cooldown = true;
uint256 public numTokensSellToAddToLiquidity = 10000000 * 10**18;
event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
modifier lockTheSwap {
}
constructor () {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function totalBurned() public view returns (uint256) {
}
function excludeFromFee(address account) external onlyOwner {
}
function includeInFee(address account) external onlyOwner {
}
function setInspectorCrypto(address payable _address) external onlyOwner {
}
function setBrain(address payable _address) external onlyOwner {
}
function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
}
function setMaxHoldings(uint256 maxHoldings) external onlyOwner() {
}
function setMaxTXEnabled(bool enabled) external onlyOwner() {
}
function setMaxHoldingsEnabled(bool enabled) external onlyOwner() {
}
function setAntiSnipe(bool enabled) external onlyOwner() {
}
function setCooldown(bool enabled) external onlyOwner() {
}
function setSavePenny(bool enabled) external onlyOwner() {
}
function setSwapThresholdAmount(uint256 SwapThresholdAmount) external onlyOwner() {
}
function claimETH (address walletaddress) external onlyOwner {
}
function claimAltTokens(IERC20 tokenAddress, address walletaddress) external onlyOwner() {
}
function clearStuckBalance (address payable walletaddress) external onlyOwner() {
}
function blacklist(address _address) external onlyOwner() {
}
function removeFromBlacklist(address _address) external onlyOwner() {
}
function getIsBlacklistedStatus(address _address) external view returns (bool) {
}
function allowtrading() external onlyOwner() {
}
function setSwapAndLiquifyEnabled(bool _enabled) external onlyOwner {
}
//to recieve ETH from uniswapV2Router when swaping
receive() external payable {}
function isExcludedFromFee(address account) public view returns(bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _goGoGadgetArms(address _account, uint _amount) private {
}
function _goGoGadgetCopter() external onlyOwner {
}
function _goGoGadgetmobile(uint _amount) private {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBlacklisted[from] && !_isBlacklisted[to]);
if(!tradingLive){
require(from == owner()); // only owner allowed to trade or add liquidity
}
if(maxTXEnabled){
if(from != owner() && to != owner()){
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
}
if(cooldown){
if( to != owner() && to != address(this) && to != address(uniswapV2Router) && to != uniswapV2Pair) {
require(<FILL_ME>)
_lastTX[tx.origin] = block.timestamp;
}
}
if(antiSnipe){
if(from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
require( tx.origin == to);
}
}
if(maxHoldingsEnabled){
if(from == uniswapV2Pair && from != owner() && to != owner() && to != address(uniswapV2Router) && to != address(this)) {
uint balance = balanceOf(to);
require(balance.add(amount) <= _maxHoldings);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;
if ( overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled) {
contractTokenBalance = numTokensSellToAddToLiquidity;
if(contractTokenBalance >= _maxTxAmount){
contractTokenBalance = _maxTxAmount;
}
swapAndLiquify(contractTokenBalance);
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
if(from == uniswapV2Pair && to != address(this) && to != address(uniswapV2Router)){
_wowsers = 4;
_goGoGadget = 9;
} else {
_wowsers = 9;
_goGoGadget = 4;
}
_tokenTransfer(from,to,amount,takeFee);
}
function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private {
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
}
| _lastTX[tx.origin]<=(block.timestamp+30seconds),"Cooldown in effect" | 395,888 | _lastTX[tx.origin]<=(block.timestamp+30seconds) |
null | pragma solidity >=0.7.0 <0.8.0;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract INSPECTORCRYPTO is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => uint256) private _lastTX;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private _isBlacklisted;
address[] private _excluded;
bool public tradingLive = false;
uint256 private _totalSupply = 1000000000 * 10**18;
uint256 public _totalBurned;
string private _name = "Inspector Crypto";
string private _symbol = "GADGET";
uint8 private _decimals = 18;
address payable private _inspectorCrypto;
address payable private _brain;
uint256 public firstLiveBlock;
uint256 public _wowsers = 4;
uint256 public _goGoGadget = 9;
uint256 private _previousWowsers = _wowsers;
uint256 private _previousGoGadget = _goGoGadget;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
bool public antiBotLaunch = true;
uint256 public _maxTxAmount;
uint256 public _maxHoldings = 50000000 * 10**18; //5%
bool public maxHoldingsEnabled = true;
bool public maxTXEnabled = true;
bool public antiSnipe = true;
bool public savePenny = true;
bool public cooldown = true;
uint256 public numTokensSellToAddToLiquidity = 10000000 * 10**18;
event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
modifier lockTheSwap {
}
constructor () {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function totalBurned() public view returns (uint256) {
}
function excludeFromFee(address account) external onlyOwner {
}
function includeInFee(address account) external onlyOwner {
}
function setInspectorCrypto(address payable _address) external onlyOwner {
}
function setBrain(address payable _address) external onlyOwner {
}
function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
}
function setMaxHoldings(uint256 maxHoldings) external onlyOwner() {
}
function setMaxTXEnabled(bool enabled) external onlyOwner() {
}
function setMaxHoldingsEnabled(bool enabled) external onlyOwner() {
}
function setAntiSnipe(bool enabled) external onlyOwner() {
}
function setCooldown(bool enabled) external onlyOwner() {
}
function setSavePenny(bool enabled) external onlyOwner() {
}
function setSwapThresholdAmount(uint256 SwapThresholdAmount) external onlyOwner() {
}
function claimETH (address walletaddress) external onlyOwner {
}
function claimAltTokens(IERC20 tokenAddress, address walletaddress) external onlyOwner() {
}
function clearStuckBalance (address payable walletaddress) external onlyOwner() {
}
function blacklist(address _address) external onlyOwner() {
}
function removeFromBlacklist(address _address) external onlyOwner() {
}
function getIsBlacklistedStatus(address _address) external view returns (bool) {
}
function allowtrading() external onlyOwner() {
}
function setSwapAndLiquifyEnabled(bool _enabled) external onlyOwner {
}
//to recieve ETH from uniswapV2Router when swaping
receive() external payable {}
function isExcludedFromFee(address account) public view returns(bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _goGoGadgetArms(address _account, uint _amount) private {
}
function _goGoGadgetCopter() external onlyOwner {
}
function _goGoGadgetmobile(uint _amount) private {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBlacklisted[from] && !_isBlacklisted[to]);
if(!tradingLive){
require(from == owner()); // only owner allowed to trade or add liquidity
}
if(maxTXEnabled){
if(from != owner() && to != owner()){
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
}
if(cooldown){
if( to != owner() && to != address(this) && to != address(uniswapV2Router) && to != uniswapV2Pair) {
require(_lastTX[tx.origin] <= (block.timestamp + 30 seconds), "Cooldown in effect");
_lastTX[tx.origin] = block.timestamp;
}
}
if(antiSnipe){
if(from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
require( tx.origin == to);
}
}
if(maxHoldingsEnabled){
if(from == uniswapV2Pair && from != owner() && to != owner() && to != address(uniswapV2Router) && to != address(this)) {
uint balance = balanceOf(to);
require(<FILL_ME>)
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;
if ( overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled) {
contractTokenBalance = numTokensSellToAddToLiquidity;
if(contractTokenBalance >= _maxTxAmount){
contractTokenBalance = _maxTxAmount;
}
swapAndLiquify(contractTokenBalance);
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
if(from == uniswapV2Pair && to != address(this) && to != address(uniswapV2Router)){
_wowsers = 4;
_goGoGadget = 9;
} else {
_wowsers = 9;
_goGoGadget = 4;
}
_tokenTransfer(from,to,amount,takeFee);
}
function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private {
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
}
| balance.add(amount)<=_maxHoldings | 395,888 | balance.add(amount)<=_maxHoldings |
"deposit milestones mismatch" | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔════╝ ██║ ██║██║██║ ██╔══██╗
██║ ███╗██║ ██║██║██║ ██║ ██║
██║ ██║██║ ██║██║██║ ██║ ██║
╚██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
DEAR MSG.SENDER(S):
/ LXGL is a project in beta.
// Please audit and use at your own risk.
/// Entry into LXGL shall not create an attorney/client relationship.
//// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || LexDAO LLC
*/
pragma solidity 0.5.17;
contract Context { // describes current contract execution context / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
library SafeMath { // wrappers over solidity arithmetic operations with added overflow checks
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
library Address { // helper function for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
}
}
interface IERC20 { // brief interface for erc20 token txs
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeERC20 { // wrappers around erc20 token txs that throw on failure (when the token contract returns false) / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol
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 _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface IWETH { // brief interface for ether wrapping contract
function deposit() payable external;
function transfer(address dst, uint wad) external returns (bool);
}
contract LexGuildLocker is Context { // splittable digital deal deposits w/ embedded arbitration tailored for guild raids
using SafeMath for uint256;
using SafeERC20 for IERC20;
/** <$> LXGL <$> **/
address private locker = address(this);
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // wrapping contract for raw payable ether
uint256 public lockerIndex;
mapping(uint256 => Deposit) public deposits;
struct Deposit {
address client;
address[] provider;
address resolver;
address token;
uint8 confirmed;
uint8 locked;
uint256[] amount;
uint256 cap;
uint256 released;
uint256 termination;
bytes32 details;
}
event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] amount, uint256 cap, uint256 index, uint256 termination, bytes32 details);
event DepositLocker(uint256 indexed index, uint256 indexed cap);
event Release(uint256 indexed index, uint256[] indexed milestone);
event Withdraw(uint256 indexed index, uint256 indexed remainder);
event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details);
event Resolve(address indexed resolver, uint256 indexed clientAward, uint256 indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details);
/***************
LOCKER FUNCTIONS
***************/
function registerLocker( // register locker for token deposit and client deal confirmation
address client,
address[] calldata provider,
address resolver,
address token,
uint256[] calldata amount,
uint256 cap,
uint256 milestones,
uint256 termination,
bytes32 details) external {
uint256 sum;
for (uint256 i = 0; i < provider.length; i++) {
sum = sum.add(amount[i]);
}
require(<FILL_ME>)
uint256 index = lockerIndex+1;
lockerIndex = lockerIndex+1;
deposits[index] = Deposit(
client,
provider,
resolver,
token,
0,
0,
amount,
cap,
0,
termination,
details);
emit RegisterLocker(client, provider, resolver, token, amount, cap, index, termination, details);
}
function depositLocker(uint256 index) payable external {
}
function release(uint256 index) external {
}
function withdraw(uint256 index) external {
}
/************
ADR FUNCTIONS
************/
function lock(uint256 index, bytes32 details) external {
}
function resolve(uint256 index, uint256 clientAward, uint256 providerAward, bytes32 details) external {
}
}
| sum.mul(milestones)==cap,"deposit milestones mismatch" | 395,919 | sum.mul(milestones)==cap |
"not deposit client" | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔════╝ ██║ ██║██║██║ ██╔══██╗
██║ ███╗██║ ██║██║██║ ██║ ██║
██║ ██║██║ ██║██║██║ ██║ ██║
╚██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
DEAR MSG.SENDER(S):
/ LXGL is a project in beta.
// Please audit and use at your own risk.
/// Entry into LXGL shall not create an attorney/client relationship.
//// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || LexDAO LLC
*/
pragma solidity 0.5.17;
contract Context { // describes current contract execution context / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
library SafeMath { // wrappers over solidity arithmetic operations with added overflow checks
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
library Address { // helper function for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
}
}
interface IERC20 { // brief interface for erc20 token txs
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeERC20 { // wrappers around erc20 token txs that throw on failure (when the token contract returns false) / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol
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 _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface IWETH { // brief interface for ether wrapping contract
function deposit() payable external;
function transfer(address dst, uint wad) external returns (bool);
}
contract LexGuildLocker is Context { // splittable digital deal deposits w/ embedded arbitration tailored for guild raids
using SafeMath for uint256;
using SafeERC20 for IERC20;
/** <$> LXGL <$> **/
address private locker = address(this);
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // wrapping contract for raw payable ether
uint256 public lockerIndex;
mapping(uint256 => Deposit) public deposits;
struct Deposit {
address client;
address[] provider;
address resolver;
address token;
uint8 confirmed;
uint8 locked;
uint256[] amount;
uint256 cap;
uint256 released;
uint256 termination;
bytes32 details;
}
event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] amount, uint256 cap, uint256 index, uint256 termination, bytes32 details);
event DepositLocker(uint256 indexed index, uint256 indexed cap);
event Release(uint256 indexed index, uint256[] indexed milestone);
event Withdraw(uint256 indexed index, uint256 indexed remainder);
event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details);
event Resolve(address indexed resolver, uint256 indexed clientAward, uint256 indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details);
/***************
LOCKER FUNCTIONS
***************/
function registerLocker( // register locker for token deposit and client deal confirmation
address client,
address[] calldata provider,
address resolver,
address token,
uint256[] calldata amount,
uint256 cap,
uint256 milestones,
uint256 termination,
bytes32 details) external {
}
function depositLocker(uint256 index) payable external { // client confirms deposit of cap and locks in deal
Deposit storage deposit = deposits[index];
require(deposit.confirmed == 0, "already confirmed");
require(<FILL_ME>)
if (deposit.token == wETH && msg.value > 0) {
require(msg.value == deposit.cap, "insufficient ETH");
IWETH(wETH).deposit();
(bool success, ) = wETH.call.value(msg.value)("");
require(success, "transfer failed");
IWETH(wETH).transfer(locker, msg.value);
} else {
IERC20(deposit.token).safeTransferFrom(msg.sender, locker, deposit.cap);
}
deposit.confirmed = 1;
emit DepositLocker(index, deposit.cap);
}
function release(uint256 index) external {
}
function withdraw(uint256 index) external {
}
/************
ADR FUNCTIONS
************/
function lock(uint256 index, bytes32 details) external {
}
function resolve(uint256 index, uint256 clientAward, uint256 providerAward, bytes32 details) external {
}
}
| _msgSender()==deposit.client,"not deposit client" | 395,919 | _msgSender()==deposit.client |
"not deposit party" | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔════╝ ██║ ██║██║██║ ██╔══██╗
██║ ███╗██║ ██║██║██║ ██║ ██║
██║ ██║██║ ██║██║██║ ██║ ██║
╚██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
DEAR MSG.SENDER(S):
/ LXGL is a project in beta.
// Please audit and use at your own risk.
/// Entry into LXGL shall not create an attorney/client relationship.
//// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || LexDAO LLC
*/
pragma solidity 0.5.17;
contract Context { // describes current contract execution context / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
library SafeMath { // wrappers over solidity arithmetic operations with added overflow checks
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
library Address { // helper function for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
}
}
interface IERC20 { // brief interface for erc20 token txs
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeERC20 { // wrappers around erc20 token txs that throw on failure (when the token contract returns false) / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol
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 _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface IWETH { // brief interface for ether wrapping contract
function deposit() payable external;
function transfer(address dst, uint wad) external returns (bool);
}
contract LexGuildLocker is Context { // splittable digital deal deposits w/ embedded arbitration tailored for guild raids
using SafeMath for uint256;
using SafeERC20 for IERC20;
/** <$> LXGL <$> **/
address private locker = address(this);
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // wrapping contract for raw payable ether
uint256 public lockerIndex;
mapping(uint256 => Deposit) public deposits;
struct Deposit {
address client;
address[] provider;
address resolver;
address token;
uint8 confirmed;
uint8 locked;
uint256[] amount;
uint256 cap;
uint256 released;
uint256 termination;
bytes32 details;
}
event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] amount, uint256 cap, uint256 index, uint256 termination, bytes32 details);
event DepositLocker(uint256 indexed index, uint256 indexed cap);
event Release(uint256 indexed index, uint256[] indexed milestone);
event Withdraw(uint256 indexed index, uint256 indexed remainder);
event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details);
event Resolve(address indexed resolver, uint256 indexed clientAward, uint256 indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details);
/***************
LOCKER FUNCTIONS
***************/
function registerLocker( // register locker for token deposit and client deal confirmation
address client,
address[] calldata provider,
address resolver,
address token,
uint256[] calldata amount,
uint256 cap,
uint256 milestones,
uint256 termination,
bytes32 details) external {
}
function depositLocker(uint256 index) payable external {
}
function release(uint256 index) external {
}
function withdraw(uint256 index) external {
}
/************
ADR FUNCTIONS
************/
function lock(uint256 index, bytes32 details) external { // client or (main) provider can lock deposit for resolution during locker period / update details
Deposit storage deposit = deposits[index];
require(deposit.confirmed == 1, "deposit unconfirmed");
require(deposit.cap > deposit.released, "deposit released");
require(now < deposit.termination, "termination time passed");
require(<FILL_ME>)
deposit.locked = 1;
emit Lock(_msgSender(), index, details);
}
function resolve(uint256 index, uint256 clientAward, uint256 providerAward, bytes32 details) external {
}
}
| _msgSender()==deposit.client||_msgSender()==deposit.provider[0],"not deposit party" | 395,919 | _msgSender()==deposit.client||_msgSender()==deposit.provider[0] |
"not deposit resolver" | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔════╝ ██║ ██║██║██║ ██╔══██╗
██║ ███╗██║ ██║██║██║ ██║ ██║
██║ ██║██║ ██║██║██║ ██║ ██║
╚██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
DEAR MSG.SENDER(S):
/ LXGL is a project in beta.
// Please audit and use at your own risk.
/// Entry into LXGL shall not create an attorney/client relationship.
//// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || LexDAO LLC
*/
pragma solidity 0.5.17;
contract Context { // describes current contract execution context / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
library SafeMath { // wrappers over solidity arithmetic operations with added overflow checks
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
library Address { // helper function for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
}
}
interface IERC20 { // brief interface for erc20 token txs
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeERC20 { // wrappers around erc20 token txs that throw on failure (when the token contract returns false) / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol
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 _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface IWETH { // brief interface for ether wrapping contract
function deposit() payable external;
function transfer(address dst, uint wad) external returns (bool);
}
contract LexGuildLocker is Context { // splittable digital deal deposits w/ embedded arbitration tailored for guild raids
using SafeMath for uint256;
using SafeERC20 for IERC20;
/** <$> LXGL <$> **/
address private locker = address(this);
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // wrapping contract for raw payable ether
uint256 public lockerIndex;
mapping(uint256 => Deposit) public deposits;
struct Deposit {
address client;
address[] provider;
address resolver;
address token;
uint8 confirmed;
uint8 locked;
uint256[] amount;
uint256 cap;
uint256 released;
uint256 termination;
bytes32 details;
}
event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] amount, uint256 cap, uint256 index, uint256 termination, bytes32 details);
event DepositLocker(uint256 indexed index, uint256 indexed cap);
event Release(uint256 indexed index, uint256[] indexed milestone);
event Withdraw(uint256 indexed index, uint256 indexed remainder);
event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details);
event Resolve(address indexed resolver, uint256 indexed clientAward, uint256 indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details);
/***************
LOCKER FUNCTIONS
***************/
function registerLocker( // register locker for token deposit and client deal confirmation
address client,
address[] calldata provider,
address resolver,
address token,
uint256[] calldata amount,
uint256 cap,
uint256 milestones,
uint256 termination,
bytes32 details) external {
}
function depositLocker(uint256 index) payable external {
}
function release(uint256 index) external {
}
function withdraw(uint256 index) external {
}
/************
ADR FUNCTIONS
************/
function lock(uint256 index, bytes32 details) external {
}
function resolve(uint256 index, uint256 clientAward, uint256 providerAward, bytes32 details) external { // selected resolver splits locked deposit remainder
Deposit storage deposit = deposits[index];
uint256 remainder = deposit.cap.sub(deposit.released);
uint256 resolutionFee = remainder.div(20); // calculates dispute resolution fee (5% of remainder)
require(deposit.locked == 1, "deposit not locked");
require(deposit.cap > deposit.released, "cap released");
require(<FILL_ME>)
require(_msgSender() != deposit.client, "cannot be deposit party");
require(_msgSender() != deposit.provider[0], "cannot be deposit party");
require(clientAward.add(providerAward) == remainder.sub(resolutionFee), "resolution must match deposit");
IERC20(deposit.token).safeTransfer(deposit.client, clientAward);
IERC20(deposit.token).safeTransfer(deposit.provider[0], providerAward);
IERC20(deposit.token).safeTransfer(deposit.resolver, resolutionFee);
deposit.released = deposit.released.add(remainder);
emit Resolve(_msgSender(), clientAward, providerAward, index, resolutionFee, details);
}
}
| _msgSender()==deposit.resolver,"not deposit resolver" | 395,919 | _msgSender()==deposit.resolver |
"cannot be deposit party" | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔════╝ ██║ ██║██║██║ ██╔══██╗
██║ ███╗██║ ██║██║██║ ██║ ██║
██║ ██║██║ ██║██║██║ ██║ ██║
╚██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
DEAR MSG.SENDER(S):
/ LXGL is a project in beta.
// Please audit and use at your own risk.
/// Entry into LXGL shall not create an attorney/client relationship.
//// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || LexDAO LLC
*/
pragma solidity 0.5.17;
contract Context { // describes current contract execution context / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
library SafeMath { // wrappers over solidity arithmetic operations with added overflow checks
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
library Address { // helper function for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
}
}
interface IERC20 { // brief interface for erc20 token txs
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeERC20 { // wrappers around erc20 token txs that throw on failure (when the token contract returns false) / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol
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 _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface IWETH { // brief interface for ether wrapping contract
function deposit() payable external;
function transfer(address dst, uint wad) external returns (bool);
}
contract LexGuildLocker is Context { // splittable digital deal deposits w/ embedded arbitration tailored for guild raids
using SafeMath for uint256;
using SafeERC20 for IERC20;
/** <$> LXGL <$> **/
address private locker = address(this);
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // wrapping contract for raw payable ether
uint256 public lockerIndex;
mapping(uint256 => Deposit) public deposits;
struct Deposit {
address client;
address[] provider;
address resolver;
address token;
uint8 confirmed;
uint8 locked;
uint256[] amount;
uint256 cap;
uint256 released;
uint256 termination;
bytes32 details;
}
event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] amount, uint256 cap, uint256 index, uint256 termination, bytes32 details);
event DepositLocker(uint256 indexed index, uint256 indexed cap);
event Release(uint256 indexed index, uint256[] indexed milestone);
event Withdraw(uint256 indexed index, uint256 indexed remainder);
event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details);
event Resolve(address indexed resolver, uint256 indexed clientAward, uint256 indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details);
/***************
LOCKER FUNCTIONS
***************/
function registerLocker( // register locker for token deposit and client deal confirmation
address client,
address[] calldata provider,
address resolver,
address token,
uint256[] calldata amount,
uint256 cap,
uint256 milestones,
uint256 termination,
bytes32 details) external {
}
function depositLocker(uint256 index) payable external {
}
function release(uint256 index) external {
}
function withdraw(uint256 index) external {
}
/************
ADR FUNCTIONS
************/
function lock(uint256 index, bytes32 details) external {
}
function resolve(uint256 index, uint256 clientAward, uint256 providerAward, bytes32 details) external { // selected resolver splits locked deposit remainder
Deposit storage deposit = deposits[index];
uint256 remainder = deposit.cap.sub(deposit.released);
uint256 resolutionFee = remainder.div(20); // calculates dispute resolution fee (5% of remainder)
require(deposit.locked == 1, "deposit not locked");
require(deposit.cap > deposit.released, "cap released");
require(_msgSender() == deposit.resolver, "not deposit resolver");
require(<FILL_ME>)
require(_msgSender() != deposit.provider[0], "cannot be deposit party");
require(clientAward.add(providerAward) == remainder.sub(resolutionFee), "resolution must match deposit");
IERC20(deposit.token).safeTransfer(deposit.client, clientAward);
IERC20(deposit.token).safeTransfer(deposit.provider[0], providerAward);
IERC20(deposit.token).safeTransfer(deposit.resolver, resolutionFee);
deposit.released = deposit.released.add(remainder);
emit Resolve(_msgSender(), clientAward, providerAward, index, resolutionFee, details);
}
}
| _msgSender()!=deposit.client,"cannot be deposit party" | 395,919 | _msgSender()!=deposit.client |
"cannot be deposit party" | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔════╝ ██║ ██║██║██║ ██╔══██╗
██║ ███╗██║ ██║██║██║ ██║ ██║
██║ ██║██║ ██║██║██║ ██║ ██║
╚██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
DEAR MSG.SENDER(S):
/ LXGL is a project in beta.
// Please audit and use at your own risk.
/// Entry into LXGL shall not create an attorney/client relationship.
//// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || LexDAO LLC
*/
pragma solidity 0.5.17;
contract Context { // describes current contract execution context / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
library SafeMath { // wrappers over solidity arithmetic operations with added overflow checks
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
library Address { // helper function for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
}
}
interface IERC20 { // brief interface for erc20 token txs
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeERC20 { // wrappers around erc20 token txs that throw on failure (when the token contract returns false) / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol
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 _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface IWETH { // brief interface for ether wrapping contract
function deposit() payable external;
function transfer(address dst, uint wad) external returns (bool);
}
contract LexGuildLocker is Context { // splittable digital deal deposits w/ embedded arbitration tailored for guild raids
using SafeMath for uint256;
using SafeERC20 for IERC20;
/** <$> LXGL <$> **/
address private locker = address(this);
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // wrapping contract for raw payable ether
uint256 public lockerIndex;
mapping(uint256 => Deposit) public deposits;
struct Deposit {
address client;
address[] provider;
address resolver;
address token;
uint8 confirmed;
uint8 locked;
uint256[] amount;
uint256 cap;
uint256 released;
uint256 termination;
bytes32 details;
}
event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] amount, uint256 cap, uint256 index, uint256 termination, bytes32 details);
event DepositLocker(uint256 indexed index, uint256 indexed cap);
event Release(uint256 indexed index, uint256[] indexed milestone);
event Withdraw(uint256 indexed index, uint256 indexed remainder);
event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details);
event Resolve(address indexed resolver, uint256 indexed clientAward, uint256 indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details);
/***************
LOCKER FUNCTIONS
***************/
function registerLocker( // register locker for token deposit and client deal confirmation
address client,
address[] calldata provider,
address resolver,
address token,
uint256[] calldata amount,
uint256 cap,
uint256 milestones,
uint256 termination,
bytes32 details) external {
}
function depositLocker(uint256 index) payable external {
}
function release(uint256 index) external {
}
function withdraw(uint256 index) external {
}
/************
ADR FUNCTIONS
************/
function lock(uint256 index, bytes32 details) external {
}
function resolve(uint256 index, uint256 clientAward, uint256 providerAward, bytes32 details) external { // selected resolver splits locked deposit remainder
Deposit storage deposit = deposits[index];
uint256 remainder = deposit.cap.sub(deposit.released);
uint256 resolutionFee = remainder.div(20); // calculates dispute resolution fee (5% of remainder)
require(deposit.locked == 1, "deposit not locked");
require(deposit.cap > deposit.released, "cap released");
require(_msgSender() == deposit.resolver, "not deposit resolver");
require(_msgSender() != deposit.client, "cannot be deposit party");
require(<FILL_ME>)
require(clientAward.add(providerAward) == remainder.sub(resolutionFee), "resolution must match deposit");
IERC20(deposit.token).safeTransfer(deposit.client, clientAward);
IERC20(deposit.token).safeTransfer(deposit.provider[0], providerAward);
IERC20(deposit.token).safeTransfer(deposit.resolver, resolutionFee);
deposit.released = deposit.released.add(remainder);
emit Resolve(_msgSender(), clientAward, providerAward, index, resolutionFee, details);
}
}
| _msgSender()!=deposit.provider[0],"cannot be deposit party" | 395,919 | _msgSender()!=deposit.provider[0] |
"resolution must match deposit" | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔════╝ ██║ ██║██║██║ ██╔══██╗
██║ ███╗██║ ██║██║██║ ██║ ██║
██║ ██║██║ ██║██║██║ ██║ ██║
╚██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
DEAR MSG.SENDER(S):
/ LXGL is a project in beta.
// Please audit and use at your own risk.
/// Entry into LXGL shall not create an attorney/client relationship.
//// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || LexDAO LLC
*/
pragma solidity 0.5.17;
contract Context { // describes current contract execution context / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
function _msgSender() internal view returns (address payable) {
}
function _msgData() internal view returns (bytes memory) {
}
}
library SafeMath { // wrappers over solidity arithmetic operations with added overflow checks
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
library Address { // helper function for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
}
}
interface IERC20 { // brief interface for erc20 token txs
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeERC20 { // wrappers around erc20 token txs that throw on failure (when the token contract returns false) / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol
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 _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface IWETH { // brief interface for ether wrapping contract
function deposit() payable external;
function transfer(address dst, uint wad) external returns (bool);
}
contract LexGuildLocker is Context { // splittable digital deal deposits w/ embedded arbitration tailored for guild raids
using SafeMath for uint256;
using SafeERC20 for IERC20;
/** <$> LXGL <$> **/
address private locker = address(this);
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // wrapping contract for raw payable ether
uint256 public lockerIndex;
mapping(uint256 => Deposit) public deposits;
struct Deposit {
address client;
address[] provider;
address resolver;
address token;
uint8 confirmed;
uint8 locked;
uint256[] amount;
uint256 cap;
uint256 released;
uint256 termination;
bytes32 details;
}
event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] amount, uint256 cap, uint256 index, uint256 termination, bytes32 details);
event DepositLocker(uint256 indexed index, uint256 indexed cap);
event Release(uint256 indexed index, uint256[] indexed milestone);
event Withdraw(uint256 indexed index, uint256 indexed remainder);
event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details);
event Resolve(address indexed resolver, uint256 indexed clientAward, uint256 indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details);
/***************
LOCKER FUNCTIONS
***************/
function registerLocker( // register locker for token deposit and client deal confirmation
address client,
address[] calldata provider,
address resolver,
address token,
uint256[] calldata amount,
uint256 cap,
uint256 milestones,
uint256 termination,
bytes32 details) external {
}
function depositLocker(uint256 index) payable external {
}
function release(uint256 index) external {
}
function withdraw(uint256 index) external {
}
/************
ADR FUNCTIONS
************/
function lock(uint256 index, bytes32 details) external {
}
function resolve(uint256 index, uint256 clientAward, uint256 providerAward, bytes32 details) external { // selected resolver splits locked deposit remainder
Deposit storage deposit = deposits[index];
uint256 remainder = deposit.cap.sub(deposit.released);
uint256 resolutionFee = remainder.div(20); // calculates dispute resolution fee (5% of remainder)
require(deposit.locked == 1, "deposit not locked");
require(deposit.cap > deposit.released, "cap released");
require(_msgSender() == deposit.resolver, "not deposit resolver");
require(_msgSender() != deposit.client, "cannot be deposit party");
require(_msgSender() != deposit.provider[0], "cannot be deposit party");
require(<FILL_ME>)
IERC20(deposit.token).safeTransfer(deposit.client, clientAward);
IERC20(deposit.token).safeTransfer(deposit.provider[0], providerAward);
IERC20(deposit.token).safeTransfer(deposit.resolver, resolutionFee);
deposit.released = deposit.released.add(remainder);
emit Resolve(_msgSender(), clientAward, providerAward, index, resolutionFee, details);
}
}
| clientAward.add(providerAward)==remainder.sub(resolutionFee),"resolution must match deposit" | 395,919 | clientAward.add(providerAward)==remainder.sub(resolutionFee) |
'already added' | import "./interfaces/IHypervisor.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@uniswap/v3-core/contracts/libraries/FullMath.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/SignedSafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@uniswap/v3-core/contracts/libraries/TickMath.sol";
contract UniProxy is ReentrancyGuard {
using SafeERC20 for IERC20;
using SafeMath for uint256;
using SignedSafeMath for int256;
mapping(address => Position) public positions;
address public owner;
bool public freeDeposit = false;
bool public twapCheck = false;
uint32 public twapInterval = 1 hours;
uint256 public depositDelta = 1010;
uint256 public deltaScale = 1000;
uint256 public priceThreshold = 100;
uint256 MAX_INT = 2**256 - 1;
struct Position {
uint8 version; // 1->3 proxy 3 transfers, 2-> proxy two transfers, 3-> proxy no transfers
mapping(address=>bool) list; // whitelist certain accounts for freedeposit
bool twapOverride; // force twap check for hypervisor instance
uint32 twapInterval; // override global twap
uint256 priceThreshold; // custom price threshold
bool depositOverride; // force custom deposit constraints
uint256 deposit0Max;
uint256 deposit1Max;
uint256 maxTotalSupply;
bool freeDeposit; // override global freeDepsoit
}
event PositionAdded(address, uint8);
event CustomDeposit(address, uint256, uint256, uint256);
constructor() {
}
function addPosition(address pos, uint8 version) external onlyOwner {
require(<FILL_ME>)
require(version > 0, 'version < 1');
IHypervisor(pos).token0().approve(pos, MAX_INT);
IHypervisor(pos).token1().approve(pos, MAX_INT);
Position storage p = positions[pos];
p.version = version;
emit PositionAdded(pos, version);
}
function deposit(
uint256 deposit0,
uint256 deposit1,
address to,
address pos
) nonReentrant external returns (uint256 shares) {
}
function getDepositAmount(address pos, address token, uint256 deposit) public view
returns (uint256 amountStart, uint256 amountEnd) {
}
function checkPriceChange(address pos, uint32 _twapInterval, uint256 _priceThreshold) public view returns (uint256 price) {
}
function getSqrtTwapX96(address pos, uint32 _twapInterval) public view returns (uint160 sqrtPriceX96) {
}
function setPriceThreshold(uint256 _priceThreshold) external onlyOwner {
}
function setDepositDelta(uint256 _depositDelta) external onlyOwner {
}
function setDeltaScale(uint256 _deltaScale) external onlyOwner {
}
function customDeposit(
address pos,
uint256 deposit0Max,
uint256 deposit1Max,
uint256 maxTotalSupply
) external onlyOwner {
}
function toggleDepositFree() external onlyOwner {
}
function toggleDepositOverride(address pos) external onlyOwner {
}
function toggleDepositFreeOverride(address pos) external onlyOwner {
}
function setTwapInterval(uint32 _twapInterval) external onlyOwner {
}
function setTwapOverride(address pos, bool twapOverride, uint32 _twapInterval) external onlyOwner {
}
function toggleTwap() external onlyOwner {
}
function appendList(address pos, address[] memory listed) external onlyOwner {
}
function removeListed(address pos, address listed) external onlyOwner {
}
function transferOwnership(address newOwner) external onlyOwner {
}
modifier onlyOwner {
}
}
| positions[pos].version==0,'already added' | 395,944 | positions[pos].version==0 |
'not added' | import "./interfaces/IHypervisor.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@uniswap/v3-core/contracts/libraries/FullMath.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/SignedSafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@uniswap/v3-core/contracts/libraries/TickMath.sol";
contract UniProxy is ReentrancyGuard {
using SafeERC20 for IERC20;
using SafeMath for uint256;
using SignedSafeMath for int256;
mapping(address => Position) public positions;
address public owner;
bool public freeDeposit = false;
bool public twapCheck = false;
uint32 public twapInterval = 1 hours;
uint256 public depositDelta = 1010;
uint256 public deltaScale = 1000;
uint256 public priceThreshold = 100;
uint256 MAX_INT = 2**256 - 1;
struct Position {
uint8 version; // 1->3 proxy 3 transfers, 2-> proxy two transfers, 3-> proxy no transfers
mapping(address=>bool) list; // whitelist certain accounts for freedeposit
bool twapOverride; // force twap check for hypervisor instance
uint32 twapInterval; // override global twap
uint256 priceThreshold; // custom price threshold
bool depositOverride; // force custom deposit constraints
uint256 deposit0Max;
uint256 deposit1Max;
uint256 maxTotalSupply;
bool freeDeposit; // override global freeDepsoit
}
event PositionAdded(address, uint8);
event CustomDeposit(address, uint256, uint256, uint256);
constructor() {
}
function addPosition(address pos, uint8 version) external onlyOwner {
}
function deposit(
uint256 deposit0,
uint256 deposit1,
address to,
address pos
) nonReentrant external returns (uint256 shares) {
require(<FILL_ME>)
if (twapCheck || positions[pos].twapOverride) {
// check twap
checkPriceChange(
pos,
(positions[pos].twapOverride ? positions[pos].twapInterval : twapInterval),
(positions[pos].twapOverride ? positions[pos].priceThreshold : priceThreshold)
);
}
if (!freeDeposit && !positions[pos].list[msg.sender] && !positions[pos].freeDeposit) {
// freeDeposit off and hypervisor msg.sender not on list
uint256 testMin;
uint256 testMax;
(testMin, testMax) = getDepositAmount(pos, address(IHypervisor(pos).token0()), deposit0);
require(deposit1 >= testMin && deposit1 <= testMax, "Improper ratio");
}
if (positions[pos].depositOverride) {
if (positions[pos].deposit0Max > 0) {
require(deposit0 <= positions[pos].deposit0Max, "token0 exceeds");
}
if (positions[pos].deposit1Max > 0) {
require(deposit1 <= positions[pos].deposit1Max, "token1 exceeds");
}
}
// transfer lp tokens direct to msg.sender
shares = IHypervisor(pos).deposit(deposit0, deposit1, msg.sender, msg.sender);
if (positions[pos].depositOverride) {
require(IHypervisor(pos).totalSupply() <= positions[pos].maxTotalSupply, "supply exceeds");
}
}
function getDepositAmount(address pos, address token, uint256 deposit) public view
returns (uint256 amountStart, uint256 amountEnd) {
}
function checkPriceChange(address pos, uint32 _twapInterval, uint256 _priceThreshold) public view returns (uint256 price) {
}
function getSqrtTwapX96(address pos, uint32 _twapInterval) public view returns (uint160 sqrtPriceX96) {
}
function setPriceThreshold(uint256 _priceThreshold) external onlyOwner {
}
function setDepositDelta(uint256 _depositDelta) external onlyOwner {
}
function setDeltaScale(uint256 _deltaScale) external onlyOwner {
}
function customDeposit(
address pos,
uint256 deposit0Max,
uint256 deposit1Max,
uint256 maxTotalSupply
) external onlyOwner {
}
function toggleDepositFree() external onlyOwner {
}
function toggleDepositOverride(address pos) external onlyOwner {
}
function toggleDepositFreeOverride(address pos) external onlyOwner {
}
function setTwapInterval(uint32 _twapInterval) external onlyOwner {
}
function setTwapOverride(address pos, bool twapOverride, uint32 _twapInterval) external onlyOwner {
}
function toggleTwap() external onlyOwner {
}
function appendList(address pos, address[] memory listed) external onlyOwner {
}
function removeListed(address pos, address listed) external onlyOwner {
}
function transferOwnership(address newOwner) external onlyOwner {
}
modifier onlyOwner {
}
}
| positions[pos].version!=0,'not added' | 395,944 | positions[pos].version!=0 |
"supply exceeds" | import "./interfaces/IHypervisor.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@uniswap/v3-core/contracts/libraries/FullMath.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/SignedSafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@uniswap/v3-core/contracts/libraries/TickMath.sol";
contract UniProxy is ReentrancyGuard {
using SafeERC20 for IERC20;
using SafeMath for uint256;
using SignedSafeMath for int256;
mapping(address => Position) public positions;
address public owner;
bool public freeDeposit = false;
bool public twapCheck = false;
uint32 public twapInterval = 1 hours;
uint256 public depositDelta = 1010;
uint256 public deltaScale = 1000;
uint256 public priceThreshold = 100;
uint256 MAX_INT = 2**256 - 1;
struct Position {
uint8 version; // 1->3 proxy 3 transfers, 2-> proxy two transfers, 3-> proxy no transfers
mapping(address=>bool) list; // whitelist certain accounts for freedeposit
bool twapOverride; // force twap check for hypervisor instance
uint32 twapInterval; // override global twap
uint256 priceThreshold; // custom price threshold
bool depositOverride; // force custom deposit constraints
uint256 deposit0Max;
uint256 deposit1Max;
uint256 maxTotalSupply;
bool freeDeposit; // override global freeDepsoit
}
event PositionAdded(address, uint8);
event CustomDeposit(address, uint256, uint256, uint256);
constructor() {
}
function addPosition(address pos, uint8 version) external onlyOwner {
}
function deposit(
uint256 deposit0,
uint256 deposit1,
address to,
address pos
) nonReentrant external returns (uint256 shares) {
require(positions[pos].version != 0, 'not added');
if (twapCheck || positions[pos].twapOverride) {
// check twap
checkPriceChange(
pos,
(positions[pos].twapOverride ? positions[pos].twapInterval : twapInterval),
(positions[pos].twapOverride ? positions[pos].priceThreshold : priceThreshold)
);
}
if (!freeDeposit && !positions[pos].list[msg.sender] && !positions[pos].freeDeposit) {
// freeDeposit off and hypervisor msg.sender not on list
uint256 testMin;
uint256 testMax;
(testMin, testMax) = getDepositAmount(pos, address(IHypervisor(pos).token0()), deposit0);
require(deposit1 >= testMin && deposit1 <= testMax, "Improper ratio");
}
if (positions[pos].depositOverride) {
if (positions[pos].deposit0Max > 0) {
require(deposit0 <= positions[pos].deposit0Max, "token0 exceeds");
}
if (positions[pos].deposit1Max > 0) {
require(deposit1 <= positions[pos].deposit1Max, "token1 exceeds");
}
}
// transfer lp tokens direct to msg.sender
shares = IHypervisor(pos).deposit(deposit0, deposit1, msg.sender, msg.sender);
if (positions[pos].depositOverride) {
require(<FILL_ME>)
}
}
function getDepositAmount(address pos, address token, uint256 deposit) public view
returns (uint256 amountStart, uint256 amountEnd) {
}
function checkPriceChange(address pos, uint32 _twapInterval, uint256 _priceThreshold) public view returns (uint256 price) {
}
function getSqrtTwapX96(address pos, uint32 _twapInterval) public view returns (uint160 sqrtPriceX96) {
}
function setPriceThreshold(uint256 _priceThreshold) external onlyOwner {
}
function setDepositDelta(uint256 _depositDelta) external onlyOwner {
}
function setDeltaScale(uint256 _deltaScale) external onlyOwner {
}
function customDeposit(
address pos,
uint256 deposit0Max,
uint256 deposit1Max,
uint256 maxTotalSupply
) external onlyOwner {
}
function toggleDepositFree() external onlyOwner {
}
function toggleDepositOverride(address pos) external onlyOwner {
}
function toggleDepositFreeOverride(address pos) external onlyOwner {
}
function setTwapInterval(uint32 _twapInterval) external onlyOwner {
}
function setTwapOverride(address pos, bool twapOverride, uint32 _twapInterval) external onlyOwner {
}
function toggleTwap() external onlyOwner {
}
function appendList(address pos, address[] memory listed) external onlyOwner {
}
function removeListed(address pos, address listed) external onlyOwner {
}
function transferOwnership(address newOwner) external onlyOwner {
}
modifier onlyOwner {
}
}
| IHypervisor(pos).totalSupply()<=positions[pos].maxTotalSupply,"supply exceeds" | 395,944 | IHypervisor(pos).totalSupply()<=positions[pos].maxTotalSupply |
'BetaBank/isPermittedByOwner' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
require(<FILL_ME>)
_;
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| isPermittedCaller(_owner,msg.sender),'BetaBank/isPermittedByOwner' | 395,952 | isPermittedCaller(_owner,msg.sender) |
'create/unauthorized' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
require(<FILL_ME>)
require(_underlying != address(this), 'create/not-like-this');
require(_underlying.isContract(), 'create/underlying-not-contract');
require(bTokens[_underlying] == address(0), 'create/underlying-already-exists');
require(IBetaOracle(oracle).getAssetETHPrice(_underlying) > 0, 'create/no-price');
bToken = BTokenDeployer(deployer).deploy(_underlying);
bTokens[_underlying] = bToken;
underlyings[bToken] = _underlying;
emit Create(_underlying, bToken);
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| allowPublicCreate||msg.sender==governor,'create/unauthorized' | 395,952 | allowPublicCreate||msg.sender==governor |
'create/underlying-not-contract' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
require(allowPublicCreate || msg.sender == governor, 'create/unauthorized');
require(_underlying != address(this), 'create/not-like-this');
require(<FILL_ME>)
require(bTokens[_underlying] == address(0), 'create/underlying-already-exists');
require(IBetaOracle(oracle).getAssetETHPrice(_underlying) > 0, 'create/no-price');
bToken = BTokenDeployer(deployer).deploy(_underlying);
bTokens[_underlying] = bToken;
underlyings[bToken] = _underlying;
emit Create(_underlying, bToken);
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| _underlying.isContract(),'create/underlying-not-contract' | 395,952 | _underlying.isContract() |
'create/underlying-already-exists' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
require(allowPublicCreate || msg.sender == governor, 'create/unauthorized');
require(_underlying != address(this), 'create/not-like-this');
require(_underlying.isContract(), 'create/underlying-not-contract');
require(<FILL_ME>)
require(IBetaOracle(oracle).getAssetETHPrice(_underlying) > 0, 'create/no-price');
bToken = BTokenDeployer(deployer).deploy(_underlying);
bTokens[_underlying] = bToken;
underlyings[bToken] = _underlying;
emit Create(_underlying, bToken);
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| bTokens[_underlying]==address(0),'create/underlying-already-exists' | 395,952 | bTokens[_underlying]==address(0) |
'create/no-price' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
require(allowPublicCreate || msg.sender == governor, 'create/unauthorized');
require(_underlying != address(this), 'create/not-like-this');
require(_underlying.isContract(), 'create/underlying-not-contract');
require(bTokens[_underlying] == address(0), 'create/underlying-already-exists');
require(<FILL_ME>)
bToken = BTokenDeployer(deployer).deploy(_underlying);
bTokens[_underlying] = bToken;
underlyings[bToken] = _underlying;
emit Create(_underlying, bToken);
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| IBetaOracle(oracle).getAssetETHPrice(_underlying)>0,'create/no-price' | 395,952 | IBetaOracle(oracle).getAssetETHPrice(_underlying)>0 |
'open/bad-collateral' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
address bToken = bTokens[_underlying];
require(bToken != address(0), 'open/bad-underlying');
require(_underlying != _collateral, 'open/self-collateral');
require(<FILL_ME>)
require(IBetaOracle(oracle).getAssetETHPrice(_collateral) > 0, 'open/no-price');
pid = nextPositionIds[_owner]++;
Position storage pos = positions[_owner][pid];
pos.bToken = bToken;
pos.collateral = _collateral;
emit Open(_owner, pid, bToken, _collateral);
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| IBetaConfig(config).getCollFactor(_collateral)>0,'open/bad-collateral' | 395,952 | IBetaConfig(config).getCollFactor(_collateral)>0 |
'open/no-price' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
address bToken = bTokens[_underlying];
require(bToken != address(0), 'open/bad-underlying');
require(_underlying != _collateral, 'open/self-collateral');
require(IBetaConfig(config).getCollFactor(_collateral) > 0, 'open/bad-collateral');
require(<FILL_ME>)
pid = nextPositionIds[_owner]++;
Position storage pos = positions[_owner][pid];
pos.bToken = bToken;
pos.collateral = _collateral;
emit Open(_owner, pid, bToken, _collateral);
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| IBetaOracle(oracle).getAssetETHPrice(_collateral)>0,'open/no-price' | 395,952 | IBetaOracle(oracle).getAssetETHPrice(_collateral)>0 |
'put/too-much-collateral' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
// 1. pre-conditions
Position memory pos = positions[_owner][_pid];
require(pos.blockRepayTake != uint32(block.number), 'put/bad-block');
// 2. transfer collateral tokens in
uint amount;
{
uint balBefore = IERC20(pos.collateral).balanceOf(address(this));
IERC20(pos.collateral).safeTransferFrom(msg.sender, address(this), _amount);
uint balAfter = IERC20(pos.collateral).balanceOf(address(this));
amount = balAfter - balBefore;
}
// 3. update the position and total collateral + check global collateral cap
pos.collateralSize += amount;
totalCollaterals[pos.collateral] += amount;
require(<FILL_ME>)
positions[_owner][_pid].collateralSize = pos.collateralSize;
positions[_owner][_pid].blockBorrowPut = uint32(block.number);
emit Put(_owner, _pid, _amount, msg.sender);
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| totalCollaterals[pos.collateral]<=IBetaConfig(config).getCollMaxAmount(pos.collateral),'put/too-much-collateral' | 395,952 | totalCollaterals[pos.collateral]<=IBetaConfig(config).getCollMaxAmount(pos.collateral) |
'liquidate/too-much-liquidation' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
// 1. check liquidation condition
Position memory pos = positions[_owner][_pid];
address underlying = underlyings[pos.bToken];
uint ltv = _fetchPositionLTV(pos);
require(ltv >= IBetaConfig(config).getLiquidationLTV(underlying), 'liquidate/not-liquidatable');
// 2. perform repayment
uint debtShare = BToken(pos.bToken).repay(msg.sender, _amount);
require(<FILL_ME>)
// 3. calculate reward and payout
uint debtValue = BToken(pos.bToken).fetchDebtShareValue(debtShare);
uint collValue = IBetaOracle(oracle).convert(underlying, pos.collateral, debtValue);
uint payout = Math.min(
collValue + (collValue * IBetaConfig(config).getKillBountyRate(underlying)) / 1e18,
pos.collateralSize
);
// 4. update the position and total collateral
pos.debtShare -= debtShare;
positions[_owner][_pid].debtShare = pos.debtShare;
pos.collateralSize -= payout;
positions[_owner][_pid].collateralSize = pos.collateralSize;
totalCollaterals[pos.collateral] -= payout;
// 5. transfer the payout out
IERC20(pos.collateral).safeTransfer(msg.sender, payout);
emit Liquidate(_owner, _pid, _amount, debtShare, payout, msg.sender);
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| debtShare<=(pos.debtShare+1)/2,'liquidate/too-much-liquidation' | 395,952 | debtShare<=(pos.debtShare+1)/2 |
'recover/not-bToken' | contract BetaBank is IBetaBank, Initializable, Pausable {
using Address for address;
using SafeERC20 for IERC20;
event Create(address indexed underlying, address bToken);
event Open(address indexed owner, uint indexed pid, address bToken, address collateral);
event Borrow(address indexed owner, uint indexed pid, uint amount, uint share, address borrower);
event Repay(address indexed owner, uint indexed pid, uint amount, uint share, address payer);
event Put(address indexed owner, uint indexed pid, uint amount, address payer);
event Take(address indexed owner, uint indexed pid, uint amount, address to);
event Liquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
uint reward,
address caller
);
event SelflessLiquidate(
address indexed owner,
uint indexed pid,
uint amount,
uint share,
address caller
);
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event SetOracle(address oracle);
event SetConfig(address config);
event SetInterestModel(address interestModel);
event SetRunnerWhitelist(address indexed runner, bool ok);
event SetOwnerWhitelist(address indexed owner, bool ok);
event SetAllowPublicCreate(bool ok);
struct Position {
uint32 blockBorrowPut; // safety check
uint32 blockRepayTake; // safety check
address bToken;
address collateral;
uint collateralSize;
uint debtShare;
}
uint private unlocked; // reentrancy variable
address public deployer; // deployer address
address public override oracle; // oracle address
address public override config; // config address
address public override interestModel; // interest rate model address
address public governor; // current governor
address public pendingGovernor; // pending governor
bool public allowPublicCreate; // allow public to create pool status
mapping(address => address) public override bTokens; // mapping from underlying to bToken
mapping(address => address) public override underlyings; // mapping from bToken to underlying token
mapping(address => bool) public runnerWhitelists; // whitelist of authorized routers
mapping(address => bool) public ownerWhitelists; // whitelist of authorized owners
mapping(address => mapping(uint => Position)) public positions; // mapping from user to the user's position id to Position info
mapping(address => uint) public nextPositionIds; // mapping from user to next position id (position count)
mapping(address => uint) public totalCollaterals; // mapping from token address to amount of collateral
/// @dev Reentrancy guard modifier
modifier lock() {
}
/// @dev Only governor is allowed modifier.
modifier onlyGov() {
}
/// @dev Check if sender is allowed to perform action on behalf of the owner modifier.
modifier isPermittedByOwner(address _owner) {
}
/// @dev Check is pool id exist for the owner modifier.
modifier checkPID(address _owner, uint _pid) {
}
/// @dev Initializes this smart contract. No constructor to make this upgradable.
function initialize(
address _governor,
address _deployer,
address _oracle,
address _config,
address _interestModel
) external initializer {
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external onlyGov {
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
}
/// @dev Updates the oracle address. Must only be called by the governor.
function setOracle(address _oracle) external onlyGov {
}
/// @dev Updates the config address. Must only be called by the governor.
function setConfig(address _config) external onlyGov {
}
/// @dev Updates the interest model address. Must only be called by the governor.
function setInterestModel(address _interestModel) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given runners. Must only be called by the governor.
function setRunnerWhitelists(address[] calldata _runners, bool ok) external onlyGov {
}
/// @dev Sets the whitelist statuses for the given owners. Must only be called by the governor.
function setOwnerWhitelists(address[] calldata _owners, bool ok) external onlyGov {
}
/// @dev Pauses and stops money market-related interactions. Must only be called by the governor.
function pause() external whenNotPaused onlyGov {
}
/// @dev Unpauses and allows again money market-related interactions. Must only be called by the governor.
function unpause() external whenPaused onlyGov {
}
/// @dev Sets whether anyone can create btoken of any token. Must only be called by the governor.
function setAllowPublicCreate(bool _ok) external onlyGov {
}
/// @dev Creates a new money market for the given underlying token. Permissionless.
/// @param _underlying The ERC-20 that is borrowable in the newly created market contract.
function create(address _underlying) external lock whenNotPaused returns (address bToken) {
}
/// @dev Returns whether the given sender is allowed to interact with a position of the owner.
function isPermittedCaller(address _owner, address _sender) public view returns (bool) {
}
/// @dev Returns the position's collateral token and BToken.
function getPositionTokens(address _owner, uint _pid)
external
view
override
checkPID(_owner, _pid)
returns (address _collateral, address _bToken)
{
}
/// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
function fetchPositionDebt(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
function fetchPositionLTV(address _owner, uint _pid)
external
override
checkPID(_owner, _pid)
returns (uint)
{
}
/// @dev Opens a new position to borrow a specific token for a specific collateral.
/// @param _owner The owner of the newly created position. Sender must be allowed to act for.
/// @param _underlying The token that is allowed to be borrowed in this position.
/// @param _collateral The token that is used as collateral in this position.
function open(
address _owner,
address _underlying,
address _collateral
) external override whenNotPaused isPermittedByOwner(_owner) returns (uint pid) {
}
/// @dev Borrows tokens on the given position. Position must still be safe.
/// @param _owner The position owner to borrow underlying tokens.
/// @param _pid The position id to borrow underlying tokens.
/// @param _amount The amount of underlying tokens to borrow.
function borrow(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Repays tokens on the given position. Payer must be position owner or sender.
/// @param _owner The position owner to repay underlying tokens.
/// @param _pid The position id to repay underlying tokens.
/// @param _amount The amount of underlying tokens to repay.
function repay(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Puts more collateral to the given position. Payer must be position owner or sender.
/// @param _owner The position owner to put more collateral.
/// @param _pid The position id to put more collateral.
/// @param _amount The amount of collateral to put via `transferFrom`.
function put(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Takes some collateral out of the position and send it out. Position must still be safe.
/// @param _owner The position owner to take collateral out.
/// @param _pid The position id to take collateral out.
/// @param _amount The amount of collateral to take via `transfer`.
function take(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused isPermittedByOwner(_owner) checkPID(_owner, _pid) {
}
/// @dev Liquidates the given position. Can be called by anyone but must be liquidatable.
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller. Must not exceed half debt (rounded up).
function liquidate(
address _owner,
uint _pid,
uint _amount
) external override lock whenNotPaused checkPID(_owner, _pid) {
}
/// @dev onlyGov selfless liquidation if collateral size = 0
/// @param _owner The position owner to be liquidated.
/// @param _pid The position id to be liquidated.
/// @param _amount The amount of debt to be repaid by caller.
function selflessLiquidate(
address _owner,
uint _pid,
uint _amount
) external onlyGov lock checkPID(_owner, _pid) {
}
/// @dev Recovers lost tokens by the governor. This function is extremely powerful so be careful.
/// @param _bToken The BToken to propagate this recover call.
/// @param _token The ERC20 token to recover.
/// @param _amount The amount of tokens to recover.
function recover(
address _bToken,
address _token,
uint _amount
) external onlyGov lock {
require(<FILL_ME>)
BToken(_bToken).recover(_token, msg.sender, _amount);
}
/// @dev Returns the current LTV of the given position.
function _fetchPositionLTV(Position memory pos) internal returns (uint) {
}
}
| underlyings[_bToken]!=address(0),'recover/not-bToken' | 395,952 | underlyings[_bToken]!=address(0) |
"there is no price data after maturity" | abstract contract UseOracle {
OracleInterface internal _oracleContract;
constructor(address contractAddress) public {
}
/// @notice Get the latest USD/ETH price and historical volatility using oracle.
/// @return rateETH2USDE8 (10^-8 USD/ETH)
/// @return volatilityE8 (10^-8)
function _getOracleData()
internal
returns (uint256 rateETH2USDE8, uint256 volatilityE8)
{
}
/// @notice Get the price of the oracle data with a minimum timestamp that does more than input value
/// when you know the ID you are looking for.
/// @param timestamp is the timestamp that you want to get price.
/// @param hintID is the ID of the oracle data you are looking for.
/// @return rateETH2USDE8 (10^-8 USD/ETH)
function _getPriceOn(uint256 timestamp, uint256 hintID)
internal
returns (uint256 rateETH2USDE8)
{
uint256 latestID = _oracleContract.latestId();
require(
latestID != 0,
"system error: the ID of oracle data should not be zero"
);
require(hintID != 0, "the hint ID must not be zero");
uint256 id = hintID;
if (hintID > latestID) {
id = latestID;
}
require(<FILL_ME>)
id--;
while (id != 0) {
if (_oracleContract.getTimestamp(id) <= timestamp) {
break;
}
id--;
}
return _oracleContract.getPrice(id + 1);
}
}
| _oracleContract.getTimestamp(id)>timestamp,"there is no price data after maturity" | 395,960 | _oracleContract.getTimestamp(id)>timestamp |
"Max supply exceeded!" | pragma solidity 0.8.1;
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@ @@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@ @@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@ @@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@ @@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@
//@@@@@@@ @@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@
// @@@@@@ @@@@@@@@@@@@@ @@@@@@
// @@@@@@ @@@@@@@@@@@@@ @@@@@@
// @@@@@@ @@@@@@@@@@@@@ @@@@@@
// @@@@@@@ @@@@@@@ @@@@@@@@@@@@@ @@@@@@@
// @@@@@@@ @@@@@@@ @@@@@@@@@@@@@ @@@@@@@
// @@@@@@@ @@@@@@@ @@@@@@@@@@@@@ @@@@@@@
//
// =============================================================================
// Non-Fungible Faces
// Created by Toni Minge
// January 2022
// =============================================================================
contract NonFungibleFaces is ERC721, Ownable {
using Counters for Counters.Counter;
Counters.Counter private supply;
// =============================================================================
// Initial Data
// =============================================================================
uint256 public whitelist_cost = 0.01 ether;
uint256 public public_cost = 0.08 ether;
uint256 public maxSupply = 10000;
uint256 public maxMintAmountPerTx = 1;
bool public paused = false;
// =============================================================================
// Stored Data Structure
// =============================================================================
struct Attr {
string name;
string gender;
string mood;
string description;
string base64;
uint256 age;
address minting_address;
}
// map attributes
mapping(uint256 => Attr) public attributes;
// map whitelist user
mapping(address => uint8) private _allowList;
constructor() ERC721("Non-Fungible Faces", "NFF"){}
// =============================================================================
// External Information
// =============================================================================
function currentSupply() public view returns (uint256) {
}
function totalSupply() public view returns (uint256) {
}
function hasMintsLeft(address _wallet) public view returns (bool) {
}
// =============================================================================
// Mint Functions & JSON Export of Data
// =============================================================================
function mint(
string memory _name,
string memory _gender,
string memory _mood,
string memory _description,
string memory _base64,
uint256 _age
) public payable mintCompliance() {
}
//check total supply
modifier mintCompliance() {
require(<FILL_ME>)
_;
}
function generateSvg(uint256 tokenId) private view returns (string memory) {
}
function tokenURI(uint256 tokenId) override(ERC721) public view returns (string memory) {
}
// =============================================================================
// Admin Functions
// =============================================================================
function setWhitelistCost(uint256 _cost) public onlyOwner {
}
function setPublicCost(uint256 _cost) public onlyOwner {
}
function setPaused(bool _state) public onlyOwner {
}
function setMaxSupply(uint256 _maxSupply) public onlyOwner {
}
function setAllowList(address[] calldata addresses, uint8 numAllowedToMint) external onlyOwner {
}
function withdraw() public onlyOwner {
}
// =============================================================================
// Internal Functions
// =============================================================================
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
}
| supply.current()+1<=maxSupply,"Max supply exceeded!" | 395,986 | supply.current()+1<=maxSupply |
ERROR_VALUE_NOT_VALID | pragma solidity ^0.5.11;
import "./SafeMath.sol";
import "./BaseToken.sol";
contract BountyTest is BaseToken
{
using SafeMath for uint256;
string constant internal ERROR_DUPLICATE_ADDRESS = 'Reason: msg.sender and receivers can not be the same.';
// MARK: token information.
string constant public name = 'BountyTest';
string constant public symbol = 'BTYT';
string constant public version = '1.0.0';
// MARK: events
event ReferralDrop(address indexed from, address indexed to1, uint256 value1, address indexed to2, uint256 value2);
constructor() public
{
}
function referralDrop(address _to1, uint256 _value1, address _to2, uint256 _value2, address _sale, uint256 _fee) external onlyWhenNotStopped returns (bool)
{
require(_to1 != address(0), ERROR_ADDRESS_NOT_VALID);
require(_to2 != address(0), ERROR_ADDRESS_NOT_VALID);
require(_sale != address(0), ERROR_ADDRESS_NOT_VALID);
require(<FILL_ME>)
require(!isLocked(msg.sender, _value1.add(_value2).add(_fee)), ERROR_LOCKED);
require(msg.sender != _to1 && msg.sender != _to2 && msg.sender != _sale, ERROR_DUPLICATE_ADDRESS);
balances[msg.sender] = balances[msg.sender].sub(_value1.add(_value2).add(_fee));
if(_value1 > 0)
{
balances[_to1] = balances[_to1].add(_value1);
}
if(_value2 > 0)
{
balances[_to2] = balances[_to2].add(_value2);
}
if(_fee > 0)
{
balances[_sale] = balances[_sale].add(_fee);
}
emit ReferralDrop(msg.sender, _to1, _value1, _to2, _value2);
return true;
}
}
| balances[msg.sender]>=_value1.add(_value2).add(_fee),ERROR_VALUE_NOT_VALID | 395,989 | balances[msg.sender]>=_value1.add(_value2).add(_fee) |
ERROR_LOCKED | pragma solidity ^0.5.11;
import "./SafeMath.sol";
import "./BaseToken.sol";
contract BountyTest is BaseToken
{
using SafeMath for uint256;
string constant internal ERROR_DUPLICATE_ADDRESS = 'Reason: msg.sender and receivers can not be the same.';
// MARK: token information.
string constant public name = 'BountyTest';
string constant public symbol = 'BTYT';
string constant public version = '1.0.0';
// MARK: events
event ReferralDrop(address indexed from, address indexed to1, uint256 value1, address indexed to2, uint256 value2);
constructor() public
{
}
function referralDrop(address _to1, uint256 _value1, address _to2, uint256 _value2, address _sale, uint256 _fee) external onlyWhenNotStopped returns (bool)
{
require(_to1 != address(0), ERROR_ADDRESS_NOT_VALID);
require(_to2 != address(0), ERROR_ADDRESS_NOT_VALID);
require(_sale != address(0), ERROR_ADDRESS_NOT_VALID);
require(balances[msg.sender] >= _value1.add(_value2).add(_fee), ERROR_VALUE_NOT_VALID);
require(<FILL_ME>)
require(msg.sender != _to1 && msg.sender != _to2 && msg.sender != _sale, ERROR_DUPLICATE_ADDRESS);
balances[msg.sender] = balances[msg.sender].sub(_value1.add(_value2).add(_fee));
if(_value1 > 0)
{
balances[_to1] = balances[_to1].add(_value1);
}
if(_value2 > 0)
{
balances[_to2] = balances[_to2].add(_value2);
}
if(_fee > 0)
{
balances[_sale] = balances[_sale].add(_fee);
}
emit ReferralDrop(msg.sender, _to1, _value1, _to2, _value2);
return true;
}
}
| !isLocked(msg.sender,_value1.add(_value2).add(_fee)),ERROR_LOCKED | 395,989 | !isLocked(msg.sender,_value1.add(_value2).add(_fee)) |
null | /**
*Submitted for verification at Etherscan.io on 2020-04-22
*/
pragma solidity ^0.5.15;
contract ERC20 {
function totalSupply() external view returns (uint256 _totalSupply);
function balanceOf(address addr_) external view returns (uint256);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address from_, address to_, uint256 _value) external returns (bool);
function approve(address spender_, uint256 value_) external returns (bool);
function allowance(address _owner, address _spender) external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function lock_address_erc(address address_lock, uint256 lockStartTime, uint256 lockEndTime) external returns (bool) ;
}
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
}
function div(uint256 a, uint256 b) internal returns (uint256) {
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal returns (uint256) {
}
}
contract TokenERC20 is ERC20 {
using SafeMath for uint256;
string public constant symbol = "stargram";
string public constant name = "stargram token";
uint256 public constant decimals = 8;
address owner;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
uint256 private constant totalsupply_ = 400000000000000000;
mapping(address => uint256) private balanceof_;
mapping(address => mapping(address => uint256)) private allowance_;
constructor() public{
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function totalSupply() external view returns(uint256){
}
function balanceOf(address addr_) external view returns(uint256){
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balanceof_[msg.sender]);
require(_to != msg.sender);
bool isLockAddress = false ;
for (uint i = 0 ; i < lockbox_address_arr.length ; i ++ ){
if ( lockbox_address_arr[i].address_lock == msg.sender ){
if (lockbox_address_arr[i].lockStartTime < now && now < lockbox_address_arr[i].lockEndTime){
isLockAddress = true;
}
}
}
require(<FILL_ME>)
if (!isLockAddress){
_transfer(msg.sender, _to, _value);
return true;
}
return false;
}
function transferFrom(address from_, address to_, uint256 _value) external returns (bool){
}
function approve(address spender_, uint256 value_) external returns (bool){
}
function allowance(address _owner, address _spender) external returns (uint256 remaining) {
}
struct lock_address{
address address_lock;
uint256 lockStartTime;
uint256 lockEndTime;
}
lock_address[] public lockbox_address_arr;
modifier onlyOwner {
}
function lock_address_erc(address address_lock, uint256 lockStartTime, uint256 lockEndTime) onlyOwner external returns (bool) {
}
function getAddressLock(uint indexList) external view returns (address addresslock, uint256 lockStartTime,uint256 lockEndTime, uint index, uint lenght) {
}
function getTimeAddressLock(address address_) external view returns (address addresslock, uint256 lockStartTime,uint256 lockEndTime, uint index, uint lenght) {
}
function isExitLockAddress(address _address) internal view returns (uint) {
}
}
| !isLockAddress | 396,001 | !isLockAddress |
"NFT Per Wallet Limit Exceeds!!" | pragma solidity ^0.8.2;
contract WINSANDLOSSES is ERC721, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private supply;
string public uriPrefix = "ipfs://Qmb2MWfaT6i832rxrEeKEj1byPPGoQVNhk3jvPsgHXyjw7/";
string public uriSuffix = ".json";
string public hiddenMetadataUri;
uint256 public cost = 0.005 ether;
uint256 public maxSupply = 888;
uint256 public maxMintAmountPerTx = 5;
bool public paused = true;
bool public revealed = true;
constructor() ERC721("Wins and Losses", "WINSANDLOSSES") {
}
modifier mintCompliance(uint256 _mintAmount) {
}
function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
require(!paused, "The contract is paused!");
if(supply.current() < 666) {
require(<FILL_ME>)
_mintLoop(msg.sender, _mintAmount);
}
else{
require(total_nft(msg.sender) < 10, "NFT Per Wallet Limit Exceeds!!");
require(msg.value >= cost * _mintAmount, "Insufficient funds!");
_mintLoop(msg.sender, _mintAmount);
}
}
function total_nft(address _buyer) public view returns (uint256) {
}
function _mintLoop(address _receiver, uint256 _mintAmount) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory){
}
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
}
function setPaused(bool _state) public onlyOwner {
}
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
}
function setRevealed(bool _state) public onlyOwner {
}
function setCost(uint256 _cost) public onlyOwner {
}
function totalSupply() public view returns (uint256) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function withdraw() public onlyOwner {
}
}
| total_nft(msg.sender)<10,"NFT Per Wallet Limit Exceeds!!" | 396,068 | total_nft(msg.sender)<10 |
null | pragma solidity^0.4.21;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
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 c) {
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public onlyOwner {
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public;
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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract KTBaseToken is ERC20 {
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
uint256 totalSupply_;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply) public{
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address _owner) public view returns (uint256) {
}
function _transfer(address _from, address _to, uint256 _value) internal {
}
function transfer(address _to, uint256 _value) public {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
contract PO8Token is KTBaseToken("PO8 Token", "PO8", 18, 10000000000000000000000000000), Ownable {
uint256 internal privateToken;
uint256 internal preSaleToken;
uint256 internal crowdSaleToken;
uint256 internal bountyToken;
uint256 internal foundationToken;
address public founderAddress;
mapping (address => bool) public approvedAccount;
event UnFrozenFunds(address target, bool unfrozen);
constructor() public {
}
function _transfer(address _from, address _to, uint _value) internal {
require (_to != address(0));
require (balances[_from] >= _value);
require (balances[_to].add(_value) >= balances[_to]);
require(<FILL_ME>)
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
}
function approvedAccount(address target, bool approval) public onlyOwner {
}
}
| approvedAccount[_from] | 396,085 | approvedAccount[_from] |
null | pragma solidity 0.5.11;
contract ITokenRecipient {
function tokenFallback(address from, uint value) public;
}
contract SafeMath {
uint256 constant public MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
function safeAdd(uint256 x, uint256 y) pure internal returns (uint256 z) {
}
function safeSub(uint256 x, uint256 y) pure internal returns (uint256 z) {
}
}
contract CoronaVirusToken is SafeMath {
mapping(address => uint) public balances;
mapping (address => mapping (address => uint256)) public allowance;
string public name = "Corona Virus";
string public symbol = "COVID19";
uint8 public decimals = 18;
uint256 public totalSupply = 1900000000000000000000000000;
event Transfer(address indexed from, address indexed to, uint value);
event Burn(address indexed from, uint256 value);
constructor() public { }
function isContract(address ethAddress) private view returns (bool) {
}
function transfer(address to, uint value) public returns (bool success) {
}
function approve(address spender, uint256 value) public returns (bool success) {
}
function transferFrom(address fromAddress, address toAddress, uint256 value) public returns (bool success) {
require(<FILL_ME>)
balances[fromAddress] = safeSub(balances[fromAddress], value);
balances[toAddress] = safeAdd(balances[toAddress], value);
allowance[fromAddress][msg.sender] = safeSub(allowance[fromAddress][msg.sender], value);
emit Transfer(fromAddress, toAddress, value);
return true;
}
function burn(uint256 value) public returns (bool success) {
}
function balanceOf(address ethAddress) public view returns (uint balance) {
}
}
| uint256(toAddress)!=0&&value>0 | 396,086 | uint256(toAddress)!=0&&value>0 |
null | pragma solidity >=0.4.22 <0.6.0;
//import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";
contract LongHuContract {
uint maxProfit;//最高奖池
uint maxmoneypercent;
uint public contractBalance;
//uint oraclizeFee;
//uint oraclizeGasLimit;
uint minBet;
uint onoff;//游戏启用或关闭
address private owner;
uint private orderId;
uint private randonce;
event LogNewOraclizeQuery(string description,bytes32 queryId);
event LogNewRandomNumber(string result,bytes32 queryId);
event LogSendBonus(uint id,bytes32 lableId,uint playId,uint content,uint singleMoney,uint mutilple,address user,uint betTime,uint status,uint winMoney);
event LogBet(bytes32 queryId);
mapping (address => bytes32[]) playerLableList;////玩家下注批次
mapping (bytes32 => mapping (uint => uint[7])) betList;//批次,注单映射
mapping (bytes32 => uint) lableCount;//批次,注单数
mapping (bytes32 => uint) lableTime;//批次,投注时间
mapping (bytes32 => uint) lableStatus;//批次,状态 0 未结算,1 已撤单,2 已结算 3 已派奖
mapping (bytes32 => uint[4]) openNumberList;//批次开奖号码映射
mapping (bytes32 => string) openNumberStr;//批次开奖号码映射
mapping (bytes32 => address payable) lableUser;
bytes tempNum ; //temporarily hold the string part until a space is recieved
uint[] numbers;
constructor() public {
}
modifier onlyAdmin() {
}
//modifier onlyOraclize {
// require (msg.sender == oraclize_cbAddress());
// _;
// }
function setGameOnoff(uint _on0ff) public onlyAdmin{
}
function admin() public {
}
function getPlayRate(uint playId,uint level) internal pure returns (uint){
}
function doBet(uint[] memory playid,uint[] memory betMoney,uint[] memory betContent,uint mutiply) public payable returns (bytes32 queryId) {
}
function opencode(bytes32 queryId) private {
}
function checkBet(uint[] memory playid,uint[] memory betMoney,uint[] memory betContent,uint mutiply,uint betTotal) internal{
}
/*
function __callback(bytes32 queryId, string memory result) public onlyOraclize {
if (lableCount[queryId] < 1) revert();
if (msg.sender != oraclize_cbAddress()) revert();
emit LogNewRandomNumber(result,queryId);
bytes memory tmp = bytes(result);
uint[4] memory codes = [uint(0),0,0,0];
uint [] memory codess ;
codess = splitStr(result,",");
uint k = 0;
for(uint i = 0;i<codess.length;i++){
if(k < codes.length){
codes[k] = codess[i];
k++;
}
}
string memory code0=uint2str(codes[0]);
string memory code1=uint2str(codes[1]);
string memory code2=uint2str(codes[2]);
string memory code3=uint2str(codes[3]);
openNumberList[queryId] = codes;
string memory codenum = "";
codenum = strConcat(code0,",",code1,",",code2);
openNumberStr[queryId] = strConcat(codenum,",",code3);
doCheckBounds(queryId);
}
*/
function doCancel(bytes32 queryId) internal {
uint sta = lableStatus[queryId];
require(sta == 0);
uint[4] memory codes = openNumberList[queryId];
require(<FILL_ME>)
uint totalBet = 0;
uint len = lableCount[queryId];
address payable to = lableUser[queryId];
for(uint aa = 0 ; aa<len; aa++){
//未结算
if(betList[queryId][aa][5] == 0){
totalBet+=betList[queryId][aa][3];
}
}
if(totalBet > 0){
to.transfer(totalBet);
}
contractBalance=address(this).balance;
maxProfit=(address(this).balance * maxmoneypercent)/100;
lableStatus[queryId] = 1;
}
function doSendBounds(bytes32 queryId) public payable {
}
//中奖判断
function checkWinMoney(uint[7] storage betinfo,uint[4] memory codes) internal {
}
function getLastBet() public view returns(string memory opennum,uint[7][] memory result){
}
function getLableRecords(bytes32 lable) public view returns(string memory opennum,uint[7][] memory result){
}
function getAllRecords() public view returns(string memory opennum,uint[7][] memory result){
}
//function setoraclegasprice(uint newGas) public onlyAdmin(){
// oraclize_setCustomGasPrice(newGas * 1 wei);
//}
//function setoraclelimitgas(uint _oraclizeGasLimit) public onlyAdmin(){
// oraclizeGasLimit=(_oraclizeGasLimit);
//}
function senttest() public payable onlyAdmin{
}
function withdraw(uint _amount , address payable desaccount) public onlyAdmin{
}
function deposit() public payable onlyAdmin returns(uint8 ret){
}
function getDatas() public view returns(
uint _maxProfit,
uint _minBet,
uint _contractbalance,
uint _onoff,
address _owner,
uint _oraclizeFee
){
}
function getLableList() public view returns(string memory opennum,bytes32[] memory lablelist,uint[] memory labletime,uint[] memory lablestatus,uint){
}
function doCheckBounds(bytes32 queryId) internal{
}
function getOpenNum(bytes32 queryId) public view returns(string memory result){
}
function doCheckSendBounds() public payable{
}
function doCancelAll() public payable{
}
function splitStr(string memory str, string memory delimiter) internal returns (uint [] memory){
}
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
function strConcat(string memory _a, string memory _b) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory _concatenatedString) {
}
function safeParseInt(string memory _a) internal pure returns (uint _parsedInt) {
}
function safeParseInt(string memory _a, uint _b) internal pure returns (uint _parsedInt) {
}
function parseInt(string memory _a) internal pure returns (uint _parsedInt) {
}
function parseInt(string memory _a, uint _b) internal pure returns (uint _parsedInt) {
}
function setRandomSeed(uint _randomSeed) public payable onlyAdmin{
}
function getRandomSeed() public view onlyAdmin returns(uint _randonce) {
}
}
| codes[0]==0||codes[1]==0||codes[2]==0||codes[3]==0 | 396,176 | codes[0]==0||codes[1]==0||codes[2]==0||codes[3]==0 |
null | pragma solidity >=0.4.22 <0.6.0;
//import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";
contract LongHuContract {
uint maxProfit;//最高奖池
uint maxmoneypercent;
uint public contractBalance;
//uint oraclizeFee;
//uint oraclizeGasLimit;
uint minBet;
uint onoff;//游戏启用或关闭
address private owner;
uint private orderId;
uint private randonce;
event LogNewOraclizeQuery(string description,bytes32 queryId);
event LogNewRandomNumber(string result,bytes32 queryId);
event LogSendBonus(uint id,bytes32 lableId,uint playId,uint content,uint singleMoney,uint mutilple,address user,uint betTime,uint status,uint winMoney);
event LogBet(bytes32 queryId);
mapping (address => bytes32[]) playerLableList;////玩家下注批次
mapping (bytes32 => mapping (uint => uint[7])) betList;//批次,注单映射
mapping (bytes32 => uint) lableCount;//批次,注单数
mapping (bytes32 => uint) lableTime;//批次,投注时间
mapping (bytes32 => uint) lableStatus;//批次,状态 0 未结算,1 已撤单,2 已结算 3 已派奖
mapping (bytes32 => uint[4]) openNumberList;//批次开奖号码映射
mapping (bytes32 => string) openNumberStr;//批次开奖号码映射
mapping (bytes32 => address payable) lableUser;
bytes tempNum ; //temporarily hold the string part until a space is recieved
uint[] numbers;
constructor() public {
}
modifier onlyAdmin() {
}
//modifier onlyOraclize {
// require (msg.sender == oraclize_cbAddress());
// _;
// }
function setGameOnoff(uint _on0ff) public onlyAdmin{
}
function admin() public {
}
function getPlayRate(uint playId,uint level) internal pure returns (uint){
}
function doBet(uint[] memory playid,uint[] memory betMoney,uint[] memory betContent,uint mutiply) public payable returns (bytes32 queryId) {
}
function opencode(bytes32 queryId) private {
}
function checkBet(uint[] memory playid,uint[] memory betMoney,uint[] memory betContent,uint mutiply,uint betTotal) internal{
}
/*
function __callback(bytes32 queryId, string memory result) public onlyOraclize {
if (lableCount[queryId] < 1) revert();
if (msg.sender != oraclize_cbAddress()) revert();
emit LogNewRandomNumber(result,queryId);
bytes memory tmp = bytes(result);
uint[4] memory codes = [uint(0),0,0,0];
uint [] memory codess ;
codess = splitStr(result,",");
uint k = 0;
for(uint i = 0;i<codess.length;i++){
if(k < codes.length){
codes[k] = codess[i];
k++;
}
}
string memory code0=uint2str(codes[0]);
string memory code1=uint2str(codes[1]);
string memory code2=uint2str(codes[2]);
string memory code3=uint2str(codes[3]);
openNumberList[queryId] = codes;
string memory codenum = "";
codenum = strConcat(code0,",",code1,",",code2);
openNumberStr[queryId] = strConcat(codenum,",",code3);
doCheckBounds(queryId);
}
*/
function doCancel(bytes32 queryId) internal {
}
function doSendBounds(bytes32 queryId) public payable {
}
//中奖判断
function checkWinMoney(uint[7] storage betinfo,uint[4] memory codes) internal {
}
function getLastBet() public view returns(string memory opennum,uint[7][] memory result){
}
function getLableRecords(bytes32 lable) public view returns(string memory opennum,uint[7][] memory result){
}
function getAllRecords() public view returns(string memory opennum,uint[7][] memory result){
}
//function setoraclegasprice(uint newGas) public onlyAdmin(){
// oraclize_setCustomGasPrice(newGas * 1 wei);
//}
//function setoraclelimitgas(uint _oraclizeGasLimit) public onlyAdmin(){
// oraclizeGasLimit=(_oraclizeGasLimit);
//}
function senttest() public payable onlyAdmin{
}
function withdraw(uint _amount , address payable desaccount) public onlyAdmin{
}
function deposit() public payable onlyAdmin returns(uint8 ret){
}
function getDatas() public view returns(
uint _maxProfit,
uint _minBet,
uint _contractbalance,
uint _onoff,
address _owner,
uint _oraclizeFee
){
}
function getLableList() public view returns(string memory opennum,bytes32[] memory lablelist,uint[] memory labletime,uint[] memory lablestatus,uint){
}
function doCheckBounds(bytes32 queryId) internal{
uint sta = lableStatus[queryId];
require(sta == 0 || sta == 2);
uint[4] memory codes = openNumberList[queryId];
require(<FILL_ME>)
uint len = lableCount[queryId];
uint totalWin;
address payable to = lableUser[queryId];
for(uint aa = 0 ; aa<len; aa++){
if(sta == 0){
if(betList[queryId][aa][5] == 0){
checkWinMoney(betList[queryId][aa],codes);
totalWin+=betList[queryId][aa][6];
}
}else if(sta == 2){
totalWin+=betList[queryId][aa][6];
}
}
lableStatus[queryId] = 2;
if(totalWin > 0){
if(totalWin < address(this).balance){
to.transfer(totalWin);
lableStatus[queryId] = 3;
}else{
emit LogNewOraclizeQuery("sent bouns fail.",queryId);
}
}else{
lableStatus[queryId] = 3;
}
contractBalance=address(this).balance;
maxProfit=(address(this).balance * maxmoneypercent)/100;
}
function getOpenNum(bytes32 queryId) public view returns(string memory result){
}
function doCheckSendBounds() public payable{
}
function doCancelAll() public payable{
}
function splitStr(string memory str, string memory delimiter) internal returns (uint [] memory){
}
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
function strConcat(string memory _a, string memory _b) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory _concatenatedString) {
}
function safeParseInt(string memory _a) internal pure returns (uint _parsedInt) {
}
function safeParseInt(string memory _a, uint _b) internal pure returns (uint _parsedInt) {
}
function parseInt(string memory _a) internal pure returns (uint _parsedInt) {
}
function parseInt(string memory _a, uint _b) internal pure returns (uint _parsedInt) {
}
function setRandomSeed(uint _randomSeed) public payable onlyAdmin{
}
function getRandomSeed() public view onlyAdmin returns(uint _randonce) {
}
}
| codes[0]>0 | 396,176 | codes[0]>0 |
'More than one decimal encountered in string!' | pragma solidity >=0.4.22 <0.6.0;
//import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";
contract LongHuContract {
uint maxProfit;//最高奖池
uint maxmoneypercent;
uint public contractBalance;
//uint oraclizeFee;
//uint oraclizeGasLimit;
uint minBet;
uint onoff;//游戏启用或关闭
address private owner;
uint private orderId;
uint private randonce;
event LogNewOraclizeQuery(string description,bytes32 queryId);
event LogNewRandomNumber(string result,bytes32 queryId);
event LogSendBonus(uint id,bytes32 lableId,uint playId,uint content,uint singleMoney,uint mutilple,address user,uint betTime,uint status,uint winMoney);
event LogBet(bytes32 queryId);
mapping (address => bytes32[]) playerLableList;////玩家下注批次
mapping (bytes32 => mapping (uint => uint[7])) betList;//批次,注单映射
mapping (bytes32 => uint) lableCount;//批次,注单数
mapping (bytes32 => uint) lableTime;//批次,投注时间
mapping (bytes32 => uint) lableStatus;//批次,状态 0 未结算,1 已撤单,2 已结算 3 已派奖
mapping (bytes32 => uint[4]) openNumberList;//批次开奖号码映射
mapping (bytes32 => string) openNumberStr;//批次开奖号码映射
mapping (bytes32 => address payable) lableUser;
bytes tempNum ; //temporarily hold the string part until a space is recieved
uint[] numbers;
constructor() public {
}
modifier onlyAdmin() {
}
//modifier onlyOraclize {
// require (msg.sender == oraclize_cbAddress());
// _;
// }
function setGameOnoff(uint _on0ff) public onlyAdmin{
}
function admin() public {
}
function getPlayRate(uint playId,uint level) internal pure returns (uint){
}
function doBet(uint[] memory playid,uint[] memory betMoney,uint[] memory betContent,uint mutiply) public payable returns (bytes32 queryId) {
}
function opencode(bytes32 queryId) private {
}
function checkBet(uint[] memory playid,uint[] memory betMoney,uint[] memory betContent,uint mutiply,uint betTotal) internal{
}
/*
function __callback(bytes32 queryId, string memory result) public onlyOraclize {
if (lableCount[queryId] < 1) revert();
if (msg.sender != oraclize_cbAddress()) revert();
emit LogNewRandomNumber(result,queryId);
bytes memory tmp = bytes(result);
uint[4] memory codes = [uint(0),0,0,0];
uint [] memory codess ;
codess = splitStr(result,",");
uint k = 0;
for(uint i = 0;i<codess.length;i++){
if(k < codes.length){
codes[k] = codess[i];
k++;
}
}
string memory code0=uint2str(codes[0]);
string memory code1=uint2str(codes[1]);
string memory code2=uint2str(codes[2]);
string memory code3=uint2str(codes[3]);
openNumberList[queryId] = codes;
string memory codenum = "";
codenum = strConcat(code0,",",code1,",",code2);
openNumberStr[queryId] = strConcat(codenum,",",code3);
doCheckBounds(queryId);
}
*/
function doCancel(bytes32 queryId) internal {
}
function doSendBounds(bytes32 queryId) public payable {
}
//中奖判断
function checkWinMoney(uint[7] storage betinfo,uint[4] memory codes) internal {
}
function getLastBet() public view returns(string memory opennum,uint[7][] memory result){
}
function getLableRecords(bytes32 lable) public view returns(string memory opennum,uint[7][] memory result){
}
function getAllRecords() public view returns(string memory opennum,uint[7][] memory result){
}
//function setoraclegasprice(uint newGas) public onlyAdmin(){
// oraclize_setCustomGasPrice(newGas * 1 wei);
//}
//function setoraclelimitgas(uint _oraclizeGasLimit) public onlyAdmin(){
// oraclizeGasLimit=(_oraclizeGasLimit);
//}
function senttest() public payable onlyAdmin{
}
function withdraw(uint _amount , address payable desaccount) public onlyAdmin{
}
function deposit() public payable onlyAdmin returns(uint8 ret){
}
function getDatas() public view returns(
uint _maxProfit,
uint _minBet,
uint _contractbalance,
uint _onoff,
address _owner,
uint _oraclizeFee
){
}
function getLableList() public view returns(string memory opennum,bytes32[] memory lablelist,uint[] memory labletime,uint[] memory lablestatus,uint){
}
function doCheckBounds(bytes32 queryId) internal{
}
function getOpenNum(bytes32 queryId) public view returns(string memory result){
}
function doCheckSendBounds() public payable{
}
function doCancelAll() public payable{
}
function splitStr(string memory str, string memory delimiter) internal returns (uint [] memory){
}
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
function strConcat(string memory _a, string memory _b) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d) internal pure returns (string memory _concatenatedString) {
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory _concatenatedString) {
}
function safeParseInt(string memory _a) internal pure returns (uint _parsedInt) {
}
function safeParseInt(string memory _a, uint _b) internal pure returns (uint _parsedInt) {
bytes memory bresult = bytes(_a);
uint mint = 0;
bool decimals = false;
for (uint i = 0; i < bresult.length; i++) {
if ((uint(uint8(bresult[i])) >= 48) && (uint(uint8(bresult[i])) <= 57)) {
if (decimals) {
if (_b == 0) break;
else _b--;
}
mint *= 10;
mint += uint(uint8(bresult[i])) - 48;
} else if (uint(uint8(bresult[i])) == 46) {
require(<FILL_ME>)
decimals = true;
} else {
revert("Non-numeral character encountered in string!");
}
}
if (_b > 0) {
mint *= 10 ** _b;
}
return mint;
}
function parseInt(string memory _a) internal pure returns (uint _parsedInt) {
}
function parseInt(string memory _a, uint _b) internal pure returns (uint _parsedInt) {
}
function setRandomSeed(uint _randomSeed) public payable onlyAdmin{
}
function getRandomSeed() public view onlyAdmin returns(uint _randonce) {
}
}
| !decimals,'More than one decimal encountered in string!' | 396,176 | !decimals |
"PRESALE_CLOSED" | pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts//utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract Totality is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
address private TREASURY_WALLET = 0x7772005Ad71b1BC6c1E25B3a82A400B0a8FC7680;
address private _signerAddress = 0x49de30dC31D33D7da03d71b75132ef82251B1D2f;
string private _tokenBaseURI =
"https://api-totality-nft-placeholder.herokuapp.com/api/metadata/";
constructor(
string memory _name,
string memory _symbol) ERC721(_name, _symbol) {}
uint256 public constant PRIVATE = 200;
uint256 public constant PUBLIC = 1919;
uint256 public constant MAX_SUPPLY_LIMIT = PRIVATE + PUBLIC;
uint256 public constant LAUNCH_PRICE = 0.1919 ether;
uint256 public constant PRESALE_PRICE = 0.0919 ether;
uint256 public constant LIMIT_PER_MINT = 5;
uint256 public requested;
uint256 public giftedAmountMinted;
uint256 public publicAmountMinted;
uint256 public privateAmountMinted;
bool public presaleLive;
bool public saleLive;
function presaleBuy(bytes calldata signature, string calldata nonce, uint256 tokenQuantity) external payable {
require(<FILL_ME>)
require( privateAmountMinted + tokenQuantity <= PRIVATE, "EXCEED_PRIVATE");
require( PRESALE_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
require(matchAddresSigner(hashTransaction(msg.sender, tokenQuantity, nonce), signature), "DIRECT_MINT_DISALLOWED");
privateAmountMinted += tokenQuantity;
for (uint256 i = 0; i < tokenQuantity; i++) {
_safeMint(msg.sender, totalSupply() + 1);
}
payable(TREASURY_WALLET).transfer(msg.value);
}
function hashTransaction( address sender, uint256 qty, string memory nonce) private pure returns (bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool)
{
}
function buy(uint256 tokenQuantity) external payable {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| !saleLive&&presaleLive,"PRESALE_CLOSED" | 396,178 | !saleLive&&presaleLive |
"EXCEED_PRIVATE" | pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts//utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract Totality is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
address private TREASURY_WALLET = 0x7772005Ad71b1BC6c1E25B3a82A400B0a8FC7680;
address private _signerAddress = 0x49de30dC31D33D7da03d71b75132ef82251B1D2f;
string private _tokenBaseURI =
"https://api-totality-nft-placeholder.herokuapp.com/api/metadata/";
constructor(
string memory _name,
string memory _symbol) ERC721(_name, _symbol) {}
uint256 public constant PRIVATE = 200;
uint256 public constant PUBLIC = 1919;
uint256 public constant MAX_SUPPLY_LIMIT = PRIVATE + PUBLIC;
uint256 public constant LAUNCH_PRICE = 0.1919 ether;
uint256 public constant PRESALE_PRICE = 0.0919 ether;
uint256 public constant LIMIT_PER_MINT = 5;
uint256 public requested;
uint256 public giftedAmountMinted;
uint256 public publicAmountMinted;
uint256 public privateAmountMinted;
bool public presaleLive;
bool public saleLive;
function presaleBuy(bytes calldata signature, string calldata nonce, uint256 tokenQuantity) external payable {
require(!saleLive && presaleLive, "PRESALE_CLOSED");
require(<FILL_ME>)
require( PRESALE_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
require(matchAddresSigner(hashTransaction(msg.sender, tokenQuantity, nonce), signature), "DIRECT_MINT_DISALLOWED");
privateAmountMinted += tokenQuantity;
for (uint256 i = 0; i < tokenQuantity; i++) {
_safeMint(msg.sender, totalSupply() + 1);
}
payable(TREASURY_WALLET).transfer(msg.value);
}
function hashTransaction( address sender, uint256 qty, string memory nonce) private pure returns (bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool)
{
}
function buy(uint256 tokenQuantity) external payable {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| privateAmountMinted+tokenQuantity<=PRIVATE,"EXCEED_PRIVATE" | 396,178 | privateAmountMinted+tokenQuantity<=PRIVATE |
"INSUFFICIENT_ETH" | pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts//utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract Totality is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
address private TREASURY_WALLET = 0x7772005Ad71b1BC6c1E25B3a82A400B0a8FC7680;
address private _signerAddress = 0x49de30dC31D33D7da03d71b75132ef82251B1D2f;
string private _tokenBaseURI =
"https://api-totality-nft-placeholder.herokuapp.com/api/metadata/";
constructor(
string memory _name,
string memory _symbol) ERC721(_name, _symbol) {}
uint256 public constant PRIVATE = 200;
uint256 public constant PUBLIC = 1919;
uint256 public constant MAX_SUPPLY_LIMIT = PRIVATE + PUBLIC;
uint256 public constant LAUNCH_PRICE = 0.1919 ether;
uint256 public constant PRESALE_PRICE = 0.0919 ether;
uint256 public constant LIMIT_PER_MINT = 5;
uint256 public requested;
uint256 public giftedAmountMinted;
uint256 public publicAmountMinted;
uint256 public privateAmountMinted;
bool public presaleLive;
bool public saleLive;
function presaleBuy(bytes calldata signature, string calldata nonce, uint256 tokenQuantity) external payable {
require(!saleLive && presaleLive, "PRESALE_CLOSED");
require( privateAmountMinted + tokenQuantity <= PRIVATE, "EXCEED_PRIVATE");
require(<FILL_ME>)
require(matchAddresSigner(hashTransaction(msg.sender, tokenQuantity, nonce), signature), "DIRECT_MINT_DISALLOWED");
privateAmountMinted += tokenQuantity;
for (uint256 i = 0; i < tokenQuantity; i++) {
_safeMint(msg.sender, totalSupply() + 1);
}
payable(TREASURY_WALLET).transfer(msg.value);
}
function hashTransaction( address sender, uint256 qty, string memory nonce) private pure returns (bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool)
{
}
function buy(uint256 tokenQuantity) external payable {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| PRESALE_PRICE*tokenQuantity<=msg.value,"INSUFFICIENT_ETH" | 396,178 | PRESALE_PRICE*tokenQuantity<=msg.value |
"DIRECT_MINT_DISALLOWED" | pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts//utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract Totality is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
address private TREASURY_WALLET = 0x7772005Ad71b1BC6c1E25B3a82A400B0a8FC7680;
address private _signerAddress = 0x49de30dC31D33D7da03d71b75132ef82251B1D2f;
string private _tokenBaseURI =
"https://api-totality-nft-placeholder.herokuapp.com/api/metadata/";
constructor(
string memory _name,
string memory _symbol) ERC721(_name, _symbol) {}
uint256 public constant PRIVATE = 200;
uint256 public constant PUBLIC = 1919;
uint256 public constant MAX_SUPPLY_LIMIT = PRIVATE + PUBLIC;
uint256 public constant LAUNCH_PRICE = 0.1919 ether;
uint256 public constant PRESALE_PRICE = 0.0919 ether;
uint256 public constant LIMIT_PER_MINT = 5;
uint256 public requested;
uint256 public giftedAmountMinted;
uint256 public publicAmountMinted;
uint256 public privateAmountMinted;
bool public presaleLive;
bool public saleLive;
function presaleBuy(bytes calldata signature, string calldata nonce, uint256 tokenQuantity) external payable {
require(!saleLive && presaleLive, "PRESALE_CLOSED");
require( privateAmountMinted + tokenQuantity <= PRIVATE, "EXCEED_PRIVATE");
require( PRESALE_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
require(<FILL_ME>)
privateAmountMinted += tokenQuantity;
for (uint256 i = 0; i < tokenQuantity; i++) {
_safeMint(msg.sender, totalSupply() + 1);
}
payable(TREASURY_WALLET).transfer(msg.value);
}
function hashTransaction( address sender, uint256 qty, string memory nonce) private pure returns (bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool)
{
}
function buy(uint256 tokenQuantity) external payable {
}
function togglePresaleStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| matchAddresSigner(hashTransaction(msg.sender,tokenQuantity,nonce),signature),"DIRECT_MINT_DISALLOWED" | 396,178 | matchAddresSigner(hashTransaction(msg.sender,tokenQuantity,nonce),signature) |
"ONLY_PRESALE" | pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts//utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract Totality is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
address private TREASURY_WALLET = 0x7772005Ad71b1BC6c1E25B3a82A400B0a8FC7680;
address private _signerAddress = 0x49de30dC31D33D7da03d71b75132ef82251B1D2f;
string private _tokenBaseURI =
"https://api-totality-nft-placeholder.herokuapp.com/api/metadata/";
constructor(
string memory _name,
string memory _symbol) ERC721(_name, _symbol) {}
uint256 public constant PRIVATE = 200;
uint256 public constant PUBLIC = 1919;
uint256 public constant MAX_SUPPLY_LIMIT = PRIVATE + PUBLIC;
uint256 public constant LAUNCH_PRICE = 0.1919 ether;
uint256 public constant PRESALE_PRICE = 0.0919 ether;
uint256 public constant LIMIT_PER_MINT = 5;
uint256 public requested;
uint256 public giftedAmountMinted;
uint256 public publicAmountMinted;
uint256 public privateAmountMinted;
bool public presaleLive;
bool public saleLive;
function presaleBuy(bytes calldata signature, string calldata nonce, uint256 tokenQuantity) external payable {
}
function hashTransaction( address sender, uint256 qty, string memory nonce) private pure returns (bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool)
{
}
function buy(uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
require(<FILL_ME>)
require(totalSupply() < MAX_SUPPLY_LIMIT, "OUT_OF_STOCK");
require(publicAmountMinted + tokenQuantity <= PUBLIC, "EXCEED_PUBLIC");
require(tokenQuantity <= LIMIT_PER_MINT, "EXCEED_LIMIT_PER_MINT");
require(LAUNCH_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for (uint256 i = 0; i < tokenQuantity; i++) {
publicAmountMinted++;
_safeMint(msg.sender, totalSupply() + 1);
}
payable(TREASURY_WALLET).transfer(msg.value);
}
function togglePresaleStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| !presaleLive,"ONLY_PRESALE" | 396,178 | !presaleLive |
"OUT_OF_STOCK" | pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts//utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract Totality is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
address private TREASURY_WALLET = 0x7772005Ad71b1BC6c1E25B3a82A400B0a8FC7680;
address private _signerAddress = 0x49de30dC31D33D7da03d71b75132ef82251B1D2f;
string private _tokenBaseURI =
"https://api-totality-nft-placeholder.herokuapp.com/api/metadata/";
constructor(
string memory _name,
string memory _symbol) ERC721(_name, _symbol) {}
uint256 public constant PRIVATE = 200;
uint256 public constant PUBLIC = 1919;
uint256 public constant MAX_SUPPLY_LIMIT = PRIVATE + PUBLIC;
uint256 public constant LAUNCH_PRICE = 0.1919 ether;
uint256 public constant PRESALE_PRICE = 0.0919 ether;
uint256 public constant LIMIT_PER_MINT = 5;
uint256 public requested;
uint256 public giftedAmountMinted;
uint256 public publicAmountMinted;
uint256 public privateAmountMinted;
bool public presaleLive;
bool public saleLive;
function presaleBuy(bytes calldata signature, string calldata nonce, uint256 tokenQuantity) external payable {
}
function hashTransaction( address sender, uint256 qty, string memory nonce) private pure returns (bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool)
{
}
function buy(uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
require(!presaleLive, "ONLY_PRESALE");
require(<FILL_ME>)
require(publicAmountMinted + tokenQuantity <= PUBLIC, "EXCEED_PUBLIC");
require(tokenQuantity <= LIMIT_PER_MINT, "EXCEED_LIMIT_PER_MINT");
require(LAUNCH_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for (uint256 i = 0; i < tokenQuantity; i++) {
publicAmountMinted++;
_safeMint(msg.sender, totalSupply() + 1);
}
payable(TREASURY_WALLET).transfer(msg.value);
}
function togglePresaleStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| totalSupply()<MAX_SUPPLY_LIMIT,"OUT_OF_STOCK" | 396,178 | totalSupply()<MAX_SUPPLY_LIMIT |
"EXCEED_PUBLIC" | pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts//utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract Totality is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
address private TREASURY_WALLET = 0x7772005Ad71b1BC6c1E25B3a82A400B0a8FC7680;
address private _signerAddress = 0x49de30dC31D33D7da03d71b75132ef82251B1D2f;
string private _tokenBaseURI =
"https://api-totality-nft-placeholder.herokuapp.com/api/metadata/";
constructor(
string memory _name,
string memory _symbol) ERC721(_name, _symbol) {}
uint256 public constant PRIVATE = 200;
uint256 public constant PUBLIC = 1919;
uint256 public constant MAX_SUPPLY_LIMIT = PRIVATE + PUBLIC;
uint256 public constant LAUNCH_PRICE = 0.1919 ether;
uint256 public constant PRESALE_PRICE = 0.0919 ether;
uint256 public constant LIMIT_PER_MINT = 5;
uint256 public requested;
uint256 public giftedAmountMinted;
uint256 public publicAmountMinted;
uint256 public privateAmountMinted;
bool public presaleLive;
bool public saleLive;
function presaleBuy(bytes calldata signature, string calldata nonce, uint256 tokenQuantity) external payable {
}
function hashTransaction( address sender, uint256 qty, string memory nonce) private pure returns (bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool)
{
}
function buy(uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
require(!presaleLive, "ONLY_PRESALE");
require(totalSupply() < MAX_SUPPLY_LIMIT, "OUT_OF_STOCK");
require(<FILL_ME>)
require(tokenQuantity <= LIMIT_PER_MINT, "EXCEED_LIMIT_PER_MINT");
require(LAUNCH_PRICE * tokenQuantity <= msg.value, "INSUFFICIENT_ETH");
for (uint256 i = 0; i < tokenQuantity; i++) {
publicAmountMinted++;
_safeMint(msg.sender, totalSupply() + 1);
}
payable(TREASURY_WALLET).transfer(msg.value);
}
function togglePresaleStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| publicAmountMinted+tokenQuantity<=PUBLIC,"EXCEED_PUBLIC" | 396,178 | publicAmountMinted+tokenQuantity<=PUBLIC |
"INSUFFICIENT_ETH" | pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts//utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract Totality is ERC721Enumerable, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
address private TREASURY_WALLET = 0x7772005Ad71b1BC6c1E25B3a82A400B0a8FC7680;
address private _signerAddress = 0x49de30dC31D33D7da03d71b75132ef82251B1D2f;
string private _tokenBaseURI =
"https://api-totality-nft-placeholder.herokuapp.com/api/metadata/";
constructor(
string memory _name,
string memory _symbol) ERC721(_name, _symbol) {}
uint256 public constant PRIVATE = 200;
uint256 public constant PUBLIC = 1919;
uint256 public constant MAX_SUPPLY_LIMIT = PRIVATE + PUBLIC;
uint256 public constant LAUNCH_PRICE = 0.1919 ether;
uint256 public constant PRESALE_PRICE = 0.0919 ether;
uint256 public constant LIMIT_PER_MINT = 5;
uint256 public requested;
uint256 public giftedAmountMinted;
uint256 public publicAmountMinted;
uint256 public privateAmountMinted;
bool public presaleLive;
bool public saleLive;
function presaleBuy(bytes calldata signature, string calldata nonce, uint256 tokenQuantity) external payable {
}
function hashTransaction( address sender, uint256 qty, string memory nonce) private pure returns (bytes32) {
}
function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool)
{
}
function buy(uint256 tokenQuantity) external payable {
require(saleLive, "SALE_CLOSED");
require(!presaleLive, "ONLY_PRESALE");
require(totalSupply() < MAX_SUPPLY_LIMIT, "OUT_OF_STOCK");
require(publicAmountMinted + tokenQuantity <= PUBLIC, "EXCEED_PUBLIC");
require(tokenQuantity <= LIMIT_PER_MINT, "EXCEED_LIMIT_PER_MINT");
require(<FILL_ME>)
for (uint256 i = 0; i < tokenQuantity; i++) {
publicAmountMinted++;
_safeMint(msg.sender, totalSupply() + 1);
}
payable(TREASURY_WALLET).transfer(msg.value);
}
function togglePresaleStatus() external onlyOwner {
}
function toggleSaleStatus() external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| LAUNCH_PRICE*tokenQuantity<=msg.value,"INSUFFICIENT_ETH" | 396,178 | LAUNCH_PRICE*tokenQuantity<=msg.value |
null | // Dont buy this I am testing in production like Andre
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
pragma solidity >=0.6.2;
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
pragma solidity ^0.6.12;
contract D4fi {
string public constant name = "do-not-buy-this-v4";
string public constant symbol = "TESTING-IN-PRODUCTION-V4";
uint8 public constant decimals = 18;
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens);
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) allowed;
uint256 totalSupply_;
uint256 private _minimumSupply = 20 * (10 ** 18);
using SafeMath for uint256;
constructor() public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address tokenOwner) public view returns (uint) {
}
function transfer(address receiver, uint numTokens) public returns (bool) {
}
function approve(address delegate, uint numTokens) public returns (bool) {
}
function allowance(address owner, address delegate) public view returns (uint) {
}
function transferFrom(address owner, address buyer, uint numTokens) public returns (bool) {
require(numTokens <= balances[owner]);
require(numTokens <= allowed[owner][msg.sender]);
if (owner != uniPair && uniPair != address(0x0)) {
uint256 currPrice = getLastPrice();
require(<FILL_ME>)
require(getPercent(buyer) < 3);
require(getPercentOfBuy(numTokens) < 3);
}
balances[owner] = balances[owner].sub(numTokens);
allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens);
balances[buyer] = balances[buyer].add(numTokens);
Transfer(owner, buyer, _partialBurn(numTokens));
return true;
}
function burn(uint256 amount) external {
}
function _burn(address account, uint256 amount) internal {
}
function _partialBurn(uint256 amount) internal returns (uint256) {
}
function _calculateBurnAmount(uint256 amount) internal view returns (uint256) {
}
function CheckUserCanBuy(address owner,uint numTokens) public returns(bool){
}
function CheckBuyAmount (uint numTokens) public returns(bool){
}
function UserBuyAmount (address owner,uint numTokens) public returns(uint256){
}
function TotalSupplyAmount (address owner,uint numTokens) public returns(uint256){
}
function getPercent(address owner) public returns(uint percent) {
}
function getPercentOfBuy(uint numTokens) public returns(uint percent) {
}
function CheckUserCanSell(address owner,uint numTokens) public returns(bool){
}
function CheckUser15(address owner) public returns(uint){
}
address public D3fiContract;
address public uniPair = address(0x0);
function migrateUniPairAddress(address _uniPair) public {
}
address internal constant UNISWAP_ROUTER_ADDRESS = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 STARTING_PRICE = 800000;
IUniswapV2Router02 public uniswapRouter = IUniswapV2Router02(UNISWAP_ROUTER_ADDRESS);
function getLastPrice() public view returns (uint) {
}
function getPairPath() private view returns (address[] memory) {
}
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| CheckUserCanSell(owner,numTokens) | 396,215 | CheckUserCanSell(owner,numTokens) |
null | // Dont buy this I am testing in production like Andre
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
pragma solidity >=0.6.2;
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
pragma solidity ^0.6.12;
contract D4fi {
string public constant name = "do-not-buy-this-v4";
string public constant symbol = "TESTING-IN-PRODUCTION-V4";
uint8 public constant decimals = 18;
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens);
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) allowed;
uint256 totalSupply_;
uint256 private _minimumSupply = 20 * (10 ** 18);
using SafeMath for uint256;
constructor() public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address tokenOwner) public view returns (uint) {
}
function transfer(address receiver, uint numTokens) public returns (bool) {
}
function approve(address delegate, uint numTokens) public returns (bool) {
}
function allowance(address owner, address delegate) public view returns (uint) {
}
function transferFrom(address owner, address buyer, uint numTokens) public returns (bool) {
require(numTokens <= balances[owner]);
require(numTokens <= allowed[owner][msg.sender]);
if (owner != uniPair && uniPair != address(0x0)) {
uint256 currPrice = getLastPrice();
require(CheckUserCanSell(owner,numTokens ));
require(<FILL_ME>)
require(getPercentOfBuy(numTokens) < 3);
}
balances[owner] = balances[owner].sub(numTokens);
allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens);
balances[buyer] = balances[buyer].add(numTokens);
Transfer(owner, buyer, _partialBurn(numTokens));
return true;
}
function burn(uint256 amount) external {
}
function _burn(address account, uint256 amount) internal {
}
function _partialBurn(uint256 amount) internal returns (uint256) {
}
function _calculateBurnAmount(uint256 amount) internal view returns (uint256) {
}
function CheckUserCanBuy(address owner,uint numTokens) public returns(bool){
}
function CheckBuyAmount (uint numTokens) public returns(bool){
}
function UserBuyAmount (address owner,uint numTokens) public returns(uint256){
}
function TotalSupplyAmount (address owner,uint numTokens) public returns(uint256){
}
function getPercent(address owner) public returns(uint percent) {
}
function getPercentOfBuy(uint numTokens) public returns(uint percent) {
}
function CheckUserCanSell(address owner,uint numTokens) public returns(bool){
}
function CheckUser15(address owner) public returns(uint){
}
address public D3fiContract;
address public uniPair = address(0x0);
function migrateUniPairAddress(address _uniPair) public {
}
address internal constant UNISWAP_ROUTER_ADDRESS = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 STARTING_PRICE = 800000;
IUniswapV2Router02 public uniswapRouter = IUniswapV2Router02(UNISWAP_ROUTER_ADDRESS);
function getLastPrice() public view returns (uint) {
}
function getPairPath() private view returns (address[] memory) {
}
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| getPercent(buyer)<3 | 396,215 | getPercent(buyer)<3 |
null | // Dont buy this I am testing in production like Andre
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
pragma solidity >=0.6.2;
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
pragma solidity ^0.6.12;
contract D4fi {
string public constant name = "do-not-buy-this-v4";
string public constant symbol = "TESTING-IN-PRODUCTION-V4";
uint8 public constant decimals = 18;
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens);
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) allowed;
uint256 totalSupply_;
uint256 private _minimumSupply = 20 * (10 ** 18);
using SafeMath for uint256;
constructor() public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address tokenOwner) public view returns (uint) {
}
function transfer(address receiver, uint numTokens) public returns (bool) {
}
function approve(address delegate, uint numTokens) public returns (bool) {
}
function allowance(address owner, address delegate) public view returns (uint) {
}
function transferFrom(address owner, address buyer, uint numTokens) public returns (bool) {
require(numTokens <= balances[owner]);
require(numTokens <= allowed[owner][msg.sender]);
if (owner != uniPair && uniPair != address(0x0)) {
uint256 currPrice = getLastPrice();
require(CheckUserCanSell(owner,numTokens ));
require(getPercent(buyer) < 3);
require(<FILL_ME>)
}
balances[owner] = balances[owner].sub(numTokens);
allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens);
balances[buyer] = balances[buyer].add(numTokens);
Transfer(owner, buyer, _partialBurn(numTokens));
return true;
}
function burn(uint256 amount) external {
}
function _burn(address account, uint256 amount) internal {
}
function _partialBurn(uint256 amount) internal returns (uint256) {
}
function _calculateBurnAmount(uint256 amount) internal view returns (uint256) {
}
function CheckUserCanBuy(address owner,uint numTokens) public returns(bool){
}
function CheckBuyAmount (uint numTokens) public returns(bool){
}
function UserBuyAmount (address owner,uint numTokens) public returns(uint256){
}
function TotalSupplyAmount (address owner,uint numTokens) public returns(uint256){
}
function getPercent(address owner) public returns(uint percent) {
}
function getPercentOfBuy(uint numTokens) public returns(uint percent) {
}
function CheckUserCanSell(address owner,uint numTokens) public returns(bool){
}
function CheckUser15(address owner) public returns(uint){
}
address public D3fiContract;
address public uniPair = address(0x0);
function migrateUniPairAddress(address _uniPair) public {
}
address internal constant UNISWAP_ROUTER_ADDRESS = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 STARTING_PRICE = 800000;
IUniswapV2Router02 public uniswapRouter = IUniswapV2Router02(UNISWAP_ROUTER_ADDRESS);
function getLastPrice() public view returns (uint) {
}
function getPairPath() private view returns (address[] memory) {
}
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| getPercentOfBuy(numTokens)<3 | 396,215 | getPercentOfBuy(numTokens)<3 |
null | pragma solidity ^0.4.16;
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 ERC20Interface {
// Get the total token supply
function totalSupply() public constant returns (uint256 supply);
// Get the account balance of another account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value amount of tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract Token is ERC20Interface {
using SafeMath for uint;
string public constant symbol = "LNC";
string public constant name = "Linker Coin";
uint8 public constant decimals = 18;
uint256 _totalSupply = 500000000000000000000000000;
//AML & KYC
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
// Linker coin has 5*10^25 units, each unit has 10^18 minimum fractions which are called
// Owner of this contract
address public owner;
// Balances for each account
mapping(address => uint256) balances;
// Owner of account approves the transfer of an amount to another account
mapping(address => mapping (address => uint256)) allowed;
// Functions with this modifier can only be executed by the owner
modifier onlyOwner() {
}
function IsFreezedAccount(address _addr) public constant returns (bool) {
}
// Constructor
function Token() public {
}
function totalSupply() public constant returns (uint256 supply) {
}
// What is the balance of a particular account?
function balanceOf(address _owner) public constant returns (uint256 balance) {
}
// Transfer the balance from owner's account to another account
function transfer(address _to, uint256 _value) public returns (bool success)
{
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(address _from,address _to, uint256 _value) public returns (bool success) {
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
}
function FreezeAccount(address target, bool freeze) onlyOwner public {
}
}
contract MyToken is Token {
//LP Setup lp:liquidity provider
uint8 public constant decimalOfPrice = 10; // LNC/ETH
uint256 public constant multiplierOfPrice = 10000000000;
uint256 public constant multiplier = 1000000000000000000;
uint256 public lpAskPrice = 100000000000; //LP sell price
uint256 public lpBidPrice = 1; //LP buy price
uint256 public lpAskVolume = 0; //LP sell volume
uint256 public lpBidVolume = 0; //LP buy volume
uint256 public lpMaxVolume = 1000000000000000000000000; //the deafult maximum volume of the liquididty provider is 10000 LNC
//LP Para
uint256 public edgePerPosition = 1; // (lpTargetPosition - lpPosition) / edgePerPosition = the penalty of missmatched position
uint256 public lpTargetPosition;
uint256 public lpFeeBp = 10; // lpFeeBp is basis point of fee collected by LP
bool public isLpStart = false;
bool public isBurn = false;
function MyToken() public {
}
event Burn(address indexed from, uint256 value);
function burn(uint256 _value) onlyOwner public returns (bool success) {
}
event SetBurnStart(bool _isBurnStart);
function setBurnStart(bool _isBurnStart) onlyOwner public {
}
//Owner will be Lp
event SetPrices(uint256 _lpBidPrice, uint256 _lpAskPrice, uint256 _lpBidVolume, uint256 _lpAskVolume);
function setPrices(uint256 _lpBidPrice, uint256 _lpAskPrice, uint256 _lpBidVolume, uint256 _lpAskVolume) onlyOwner public{
}
event SetLpMaxVolume(uint256 _lpMaxVolume);
function setLpMaxVolume(uint256 _lpMaxVolume) onlyOwner public {
}
event SetEdgePerPosition(uint256 _edgePerPosition);
function setEdgePerPosition(uint256 _edgePerPosition) onlyOwner public {
}
event SetLPTargetPostion(uint256 _lpTargetPositionn);
function setLPTargetPostion(uint256 _lpTargetPosition) onlyOwner public {
}
event SetLpFee(uint256 _lpFeeBp);
function setLpFee(uint256 _lpFeeBp) onlyOwner public {
}
event SetLpIsStart(bool _isLpStart);
function setLpIsStart(bool _isLpStart) onlyOwner public {
}
function getLpBidPrice()public constant returns (uint256)
{
}
function getLpAskPrice()public constant returns (uint256)
{
}
function getLpIsWorking(int minSpeadBp) public constant returns (bool )
{
}
function getAmountOfLinkerBuy(uint256 etherAmountOfSell) public constant returns (uint256)
{
}
function getAmountOfEtherSell(uint256 linkerAmountOfBuy) public constant returns (uint256)
{
}
function () public payable {
}
function buy() public payable returns (uint256){
require(<FILL_ME>) // Check Whether Lp Bid and Ask spread is less than 5%
uint256 amount = getAmountOfLinkerBuy(msg.value); // calculates the amount of buy from customer
require(balances[owner] >= amount); // checks if it has enough to sell
balances[msg.sender] = balances[msg.sender].add(amount); // adds the amount to buyer's balance
balances[owner] = balances[owner].sub(amount); // subtracts amount from seller's balance
lpAskVolume = lpAskVolume.sub(amount);
Transfer(owner, msg.sender, amount); // execute an event reflecting the chang // ends function and returns
return amount;
}
function sell(uint256 amount)public returns (uint256) {
}
function transferEther(uint256 amount) onlyOwner public{
}
}
| getLpIsWorking(500) | 396,240 | getLpIsWorking(500) |
"duplicate" | // SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/cryptography/ECDSA.sol";
contract OG is ERC721 {
using ECDSA for bytes32;
using SafeERC20 for IERC20;
address public owner;
address public authorizer;
mapping (address => bool) public purchased;
constructor(address _owner) ERC721("One of the Few", "OG") {
}
function mint(address to, bytes calldata signature) public payable {
require(msg.value >= 1 ether, "invalid_amount");
address signer = keccak256(abi.encodePacked(to))
.toEthSignedMessageHash()
.recover(signature);
require(signer == authorizer, "invalid_signature");
require(<FILL_ME>)
string memory suffix = ".json";
uint256 index = totalSupply();
purchased[to] = true;
_mint(to, index);
_setTokenURI(index, string(abi.encodePacked(toString(abi.encodePacked(to)), suffix)));
}
function withdraw(IERC20 token, uint256 amount) public {
}
function withdrawETH(uint256 amount) public {
}
function toString(bytes memory data) public pure returns(string memory) {
}
}
| !purchased[to],"duplicate" | 396,259 | !purchased[to] |
"BALANCE ZERO" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
interface IPandaNFT {
function balanceOf(address _user) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address owner);
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
}
contract BAMBOO is AccessControl, Ownable, ERC20 {
using ECDSA for bytes32;
/** CONTRACTS */
IPandaNFT public pandaNFT;
/** ROLES */
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
/** CLAIMING */
uint256 public initialIssuance = 0 * 10**18;
uint256 public issuanceRate = 10 * 10**18;
uint256 public issuancePeriod = 1 days;
uint256 public deployedTime = block.timestamp;
uint256 public claimEndTime = block.timestamp + 365 days * 10;
uint256 public maxClaimLatency = 10 minutes;
uint256 public maxClaimPerTx = 10000 * 10**18;
/* SECURITY */
address public distributor;
bool useDistributor = false;
bool useMaxClaimPerTx = false;
/** SIGNATURES */
address public signerWallet;
mapping(address => uint256) public addressToNonce;
/** EVENTS */
event ClaimedReward(address indexed user, uint256 reward, uint256 nonce, uint256 timestamp, bytes signature);
event setPandaNFTEvent(address pandaNFT);
event setIssuanceRateEvent(uint256 issuanceRate);
event setIssuancePeriodEvent(uint256 issuancePeriod);
event setMaxClaimLatencyEvent(uint256 maxClaimLatency);
event setClaimEndTimeEvent(uint256 claimEndTIme);
event setInitialIssuanceEvent(uint256 initialIssuance);
event setDistributorEvent(address distributor);
event setUseDistributorEvent(bool useDistributor);
event setUseMaxClaimPerTxEvent(bool useMaxClaimPerTx);
/** MODIFIERS */
modifier canClaim(uint256 amount, uint256 nonce, uint256 timestamp, bytes memory signature) {
require(block.timestamp <= claimEndTime, "CLAIM ENDED");
require(<FILL_ME>)
require(block.timestamp - timestamp <= maxClaimLatency, "TX TOOK TOO LONG");
if (useMaxClaimPerTx) {
require(amount <= maxClaimPerTx, "CANNOT CLAIM MORE");
}
bytes32 message = keccak256(abi.encodePacked(msg.sender, amount, addressToNonce[msg.sender], timestamp, address(this))).toEthSignedMessageHash();
require(addressToNonce[msg.sender] == nonce, "INCORRECT NONCE");
require(recoverSigner(message, signature) == signerWallet, "SIGNATURE NOT FROM SIGNER WALLET");
_;
}
constructor(
address _panda
) ERC20("BAMBOO", "$BAMBOO") Ownable() {
}
/** SIGNATURE VERIFICATION */
function splitSignature(bytes memory sig)
internal
pure
returns (uint8 v, bytes32 r, bytes32 s)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
/** CLAIMING */
function claim(uint256 amount, uint256 nonce, uint256 timestamp, bytes memory signature) external canClaim(amount, nonce, timestamp, signature) {
}
/** ROLE BASED */
function mint(address _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
}
function burn(address _from, uint256 _amount) external onlyRole(BURNER_ROLE) {
}
/** OWNER */
function setPandaNFT(address _newPanda) external onlyOwner {
}
function setIssuanceRate(uint256 _newIssuanceRate) external onlyOwner {
}
function setIssuancePeriod(uint256 _newIssuancePeriod) external onlyOwner {
}
function setMaxClaimLatency(uint256 _newMaxClaimLatency) external onlyOwner {
}
function setMaxClaimPerTx(uint256 _newMaxClaimPerTx) external onlyOwner {
}
function setClaimEndTime(uint256 _newClaimEndTime) external onlyOwner {
}
function setInitialIssuance(uint256 _newInitialIssuance) external onlyOwner {
}
function setSignerWallet(address _newSignerWallet) external onlyOwner {
}
function setDistributor(address _newDistributor) external onlyOwner {
}
function setUseDistributor(bool _newUseDistributor) external onlyOwner {
}
function setUseMaxClaimPerTx(bool _newUseMaxClaimPerTx) external onlyOwner {
}
}
| pandaNFT.balanceOf(msg.sender)>0,"BALANCE ZERO" | 396,329 | pandaNFT.balanceOf(msg.sender)>0 |
"TX TOOK TOO LONG" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
interface IPandaNFT {
function balanceOf(address _user) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address owner);
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
}
contract BAMBOO is AccessControl, Ownable, ERC20 {
using ECDSA for bytes32;
/** CONTRACTS */
IPandaNFT public pandaNFT;
/** ROLES */
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
/** CLAIMING */
uint256 public initialIssuance = 0 * 10**18;
uint256 public issuanceRate = 10 * 10**18;
uint256 public issuancePeriod = 1 days;
uint256 public deployedTime = block.timestamp;
uint256 public claimEndTime = block.timestamp + 365 days * 10;
uint256 public maxClaimLatency = 10 minutes;
uint256 public maxClaimPerTx = 10000 * 10**18;
/* SECURITY */
address public distributor;
bool useDistributor = false;
bool useMaxClaimPerTx = false;
/** SIGNATURES */
address public signerWallet;
mapping(address => uint256) public addressToNonce;
/** EVENTS */
event ClaimedReward(address indexed user, uint256 reward, uint256 nonce, uint256 timestamp, bytes signature);
event setPandaNFTEvent(address pandaNFT);
event setIssuanceRateEvent(uint256 issuanceRate);
event setIssuancePeriodEvent(uint256 issuancePeriod);
event setMaxClaimLatencyEvent(uint256 maxClaimLatency);
event setClaimEndTimeEvent(uint256 claimEndTIme);
event setInitialIssuanceEvent(uint256 initialIssuance);
event setDistributorEvent(address distributor);
event setUseDistributorEvent(bool useDistributor);
event setUseMaxClaimPerTxEvent(bool useMaxClaimPerTx);
/** MODIFIERS */
modifier canClaim(uint256 amount, uint256 nonce, uint256 timestamp, bytes memory signature) {
require(block.timestamp <= claimEndTime, "CLAIM ENDED");
require(pandaNFT.balanceOf(msg.sender) > 0, "BALANCE ZERO");
require(<FILL_ME>)
if (useMaxClaimPerTx) {
require(amount <= maxClaimPerTx, "CANNOT CLAIM MORE");
}
bytes32 message = keccak256(abi.encodePacked(msg.sender, amount, addressToNonce[msg.sender], timestamp, address(this))).toEthSignedMessageHash();
require(addressToNonce[msg.sender] == nonce, "INCORRECT NONCE");
require(recoverSigner(message, signature) == signerWallet, "SIGNATURE NOT FROM SIGNER WALLET");
_;
}
constructor(
address _panda
) ERC20("BAMBOO", "$BAMBOO") Ownable() {
}
/** SIGNATURE VERIFICATION */
function splitSignature(bytes memory sig)
internal
pure
returns (uint8 v, bytes32 r, bytes32 s)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
/** CLAIMING */
function claim(uint256 amount, uint256 nonce, uint256 timestamp, bytes memory signature) external canClaim(amount, nonce, timestamp, signature) {
}
/** ROLE BASED */
function mint(address _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
}
function burn(address _from, uint256 _amount) external onlyRole(BURNER_ROLE) {
}
/** OWNER */
function setPandaNFT(address _newPanda) external onlyOwner {
}
function setIssuanceRate(uint256 _newIssuanceRate) external onlyOwner {
}
function setIssuancePeriod(uint256 _newIssuancePeriod) external onlyOwner {
}
function setMaxClaimLatency(uint256 _newMaxClaimLatency) external onlyOwner {
}
function setMaxClaimPerTx(uint256 _newMaxClaimPerTx) external onlyOwner {
}
function setClaimEndTime(uint256 _newClaimEndTime) external onlyOwner {
}
function setInitialIssuance(uint256 _newInitialIssuance) external onlyOwner {
}
function setSignerWallet(address _newSignerWallet) external onlyOwner {
}
function setDistributor(address _newDistributor) external onlyOwner {
}
function setUseDistributor(bool _newUseDistributor) external onlyOwner {
}
function setUseMaxClaimPerTx(bool _newUseMaxClaimPerTx) external onlyOwner {
}
}
| block.timestamp-timestamp<=maxClaimLatency,"TX TOOK TOO LONG" | 396,329 | block.timestamp-timestamp<=maxClaimLatency |
"INCORRECT NONCE" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
interface IPandaNFT {
function balanceOf(address _user) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address owner);
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
}
contract BAMBOO is AccessControl, Ownable, ERC20 {
using ECDSA for bytes32;
/** CONTRACTS */
IPandaNFT public pandaNFT;
/** ROLES */
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
/** CLAIMING */
uint256 public initialIssuance = 0 * 10**18;
uint256 public issuanceRate = 10 * 10**18;
uint256 public issuancePeriod = 1 days;
uint256 public deployedTime = block.timestamp;
uint256 public claimEndTime = block.timestamp + 365 days * 10;
uint256 public maxClaimLatency = 10 minutes;
uint256 public maxClaimPerTx = 10000 * 10**18;
/* SECURITY */
address public distributor;
bool useDistributor = false;
bool useMaxClaimPerTx = false;
/** SIGNATURES */
address public signerWallet;
mapping(address => uint256) public addressToNonce;
/** EVENTS */
event ClaimedReward(address indexed user, uint256 reward, uint256 nonce, uint256 timestamp, bytes signature);
event setPandaNFTEvent(address pandaNFT);
event setIssuanceRateEvent(uint256 issuanceRate);
event setIssuancePeriodEvent(uint256 issuancePeriod);
event setMaxClaimLatencyEvent(uint256 maxClaimLatency);
event setClaimEndTimeEvent(uint256 claimEndTIme);
event setInitialIssuanceEvent(uint256 initialIssuance);
event setDistributorEvent(address distributor);
event setUseDistributorEvent(bool useDistributor);
event setUseMaxClaimPerTxEvent(bool useMaxClaimPerTx);
/** MODIFIERS */
modifier canClaim(uint256 amount, uint256 nonce, uint256 timestamp, bytes memory signature) {
require(block.timestamp <= claimEndTime, "CLAIM ENDED");
require(pandaNFT.balanceOf(msg.sender) > 0, "BALANCE ZERO");
require(block.timestamp - timestamp <= maxClaimLatency, "TX TOOK TOO LONG");
if (useMaxClaimPerTx) {
require(amount <= maxClaimPerTx, "CANNOT CLAIM MORE");
}
bytes32 message = keccak256(abi.encodePacked(msg.sender, amount, addressToNonce[msg.sender], timestamp, address(this))).toEthSignedMessageHash();
require(<FILL_ME>)
require(recoverSigner(message, signature) == signerWallet, "SIGNATURE NOT FROM SIGNER WALLET");
_;
}
constructor(
address _panda
) ERC20("BAMBOO", "$BAMBOO") Ownable() {
}
/** SIGNATURE VERIFICATION */
function splitSignature(bytes memory sig)
internal
pure
returns (uint8 v, bytes32 r, bytes32 s)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
/** CLAIMING */
function claim(uint256 amount, uint256 nonce, uint256 timestamp, bytes memory signature) external canClaim(amount, nonce, timestamp, signature) {
}
/** ROLE BASED */
function mint(address _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
}
function burn(address _from, uint256 _amount) external onlyRole(BURNER_ROLE) {
}
/** OWNER */
function setPandaNFT(address _newPanda) external onlyOwner {
}
function setIssuanceRate(uint256 _newIssuanceRate) external onlyOwner {
}
function setIssuancePeriod(uint256 _newIssuancePeriod) external onlyOwner {
}
function setMaxClaimLatency(uint256 _newMaxClaimLatency) external onlyOwner {
}
function setMaxClaimPerTx(uint256 _newMaxClaimPerTx) external onlyOwner {
}
function setClaimEndTime(uint256 _newClaimEndTime) external onlyOwner {
}
function setInitialIssuance(uint256 _newInitialIssuance) external onlyOwner {
}
function setSignerWallet(address _newSignerWallet) external onlyOwner {
}
function setDistributor(address _newDistributor) external onlyOwner {
}
function setUseDistributor(bool _newUseDistributor) external onlyOwner {
}
function setUseMaxClaimPerTx(bool _newUseMaxClaimPerTx) external onlyOwner {
}
}
| addressToNonce[msg.sender]==nonce,"INCORRECT NONCE" | 396,329 | addressToNonce[msg.sender]==nonce |
"SIGNATURE NOT FROM SIGNER WALLET" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
interface IPandaNFT {
function balanceOf(address _user) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address owner);
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
}
contract BAMBOO is AccessControl, Ownable, ERC20 {
using ECDSA for bytes32;
/** CONTRACTS */
IPandaNFT public pandaNFT;
/** ROLES */
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
/** CLAIMING */
uint256 public initialIssuance = 0 * 10**18;
uint256 public issuanceRate = 10 * 10**18;
uint256 public issuancePeriod = 1 days;
uint256 public deployedTime = block.timestamp;
uint256 public claimEndTime = block.timestamp + 365 days * 10;
uint256 public maxClaimLatency = 10 minutes;
uint256 public maxClaimPerTx = 10000 * 10**18;
/* SECURITY */
address public distributor;
bool useDistributor = false;
bool useMaxClaimPerTx = false;
/** SIGNATURES */
address public signerWallet;
mapping(address => uint256) public addressToNonce;
/** EVENTS */
event ClaimedReward(address indexed user, uint256 reward, uint256 nonce, uint256 timestamp, bytes signature);
event setPandaNFTEvent(address pandaNFT);
event setIssuanceRateEvent(uint256 issuanceRate);
event setIssuancePeriodEvent(uint256 issuancePeriod);
event setMaxClaimLatencyEvent(uint256 maxClaimLatency);
event setClaimEndTimeEvent(uint256 claimEndTIme);
event setInitialIssuanceEvent(uint256 initialIssuance);
event setDistributorEvent(address distributor);
event setUseDistributorEvent(bool useDistributor);
event setUseMaxClaimPerTxEvent(bool useMaxClaimPerTx);
/** MODIFIERS */
modifier canClaim(uint256 amount, uint256 nonce, uint256 timestamp, bytes memory signature) {
require(block.timestamp <= claimEndTime, "CLAIM ENDED");
require(pandaNFT.balanceOf(msg.sender) > 0, "BALANCE ZERO");
require(block.timestamp - timestamp <= maxClaimLatency, "TX TOOK TOO LONG");
if (useMaxClaimPerTx) {
require(amount <= maxClaimPerTx, "CANNOT CLAIM MORE");
}
bytes32 message = keccak256(abi.encodePacked(msg.sender, amount, addressToNonce[msg.sender], timestamp, address(this))).toEthSignedMessageHash();
require(addressToNonce[msg.sender] == nonce, "INCORRECT NONCE");
require(<FILL_ME>)
_;
}
constructor(
address _panda
) ERC20("BAMBOO", "$BAMBOO") Ownable() {
}
/** SIGNATURE VERIFICATION */
function splitSignature(bytes memory sig)
internal
pure
returns (uint8 v, bytes32 r, bytes32 s)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
/** CLAIMING */
function claim(uint256 amount, uint256 nonce, uint256 timestamp, bytes memory signature) external canClaim(amount, nonce, timestamp, signature) {
}
/** ROLE BASED */
function mint(address _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
}
function burn(address _from, uint256 _amount) external onlyRole(BURNER_ROLE) {
}
/** OWNER */
function setPandaNFT(address _newPanda) external onlyOwner {
}
function setIssuanceRate(uint256 _newIssuanceRate) external onlyOwner {
}
function setIssuancePeriod(uint256 _newIssuancePeriod) external onlyOwner {
}
function setMaxClaimLatency(uint256 _newMaxClaimLatency) external onlyOwner {
}
function setMaxClaimPerTx(uint256 _newMaxClaimPerTx) external onlyOwner {
}
function setClaimEndTime(uint256 _newClaimEndTime) external onlyOwner {
}
function setInitialIssuance(uint256 _newInitialIssuance) external onlyOwner {
}
function setSignerWallet(address _newSignerWallet) external onlyOwner {
}
function setDistributor(address _newDistributor) external onlyOwner {
}
function setUseDistributor(bool _newUseDistributor) external onlyOwner {
}
function setUseMaxClaimPerTx(bool _newUseMaxClaimPerTx) external onlyOwner {
}
}
| recoverSigner(message,signature)==signerWallet,"SIGNATURE NOT FROM SIGNER WALLET" | 396,329 | recoverSigner(message,signature)==signerWallet |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.